Skip to content

Commit 2a2aeb5

Browse files
authored
Added ADR (#161)
1 parent 649a8e0 commit 2a2aeb5

1 file changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
# These are optional metadata elements. Feel free to remove any of them.
3+
status: "adopted"
4+
date: 2025-07-08
5+
decision-makers: Juan Antônio Breña Moral - Project Lead
6+
consulted: Not necessary - output maintains compatibility with previous versions while improving consistency
7+
informed:
8+
---
9+
10+
# Generate Cursor Rules from XML Files
11+
12+
## Context and Problem Statement
13+
14+
The Java Cursor Rules project was facing significant challenges with manual maintenance of cursor rules across multiple files. The manual approach was becoming difficult to maintain and lacked consistency across rule files. There was a clear need for a unified definition approach that could ensure uniform structure and enable automated generation of markdown files with consistent frontmatter.
15+
16+
The current situation involved scattered rule definitions without standardization, making it difficult to maintain consistency and requiring significant manual effort for updates and modifications.
17+
18+
## Decision Drivers
19+
20+
* **Maintainability**: Reducing manual maintenance overhead of cursor rule files
21+
* **Consistency**: Ensuring uniform structure and formatting across all rule files
22+
* **Standardization**: Using XSD for unified rule definitions with schema validation
23+
* **Automation**: Leveraging XSL transformations for consistent markdown generation with frontmatter
24+
25+
## Considered Options
26+
27+
* **Option 1**: Continue with manual maintenance of cursor rules (status quo)
28+
* **Option 2**: Generate cursor rules from XML files using XSD/XSL transformations
29+
* **Option 3**: PromptML-based approach using Domain Specific Language for prompts
30+
31+
## Decision Outcome
32+
33+
Chosen option: "Generate cursor rules from XML files using XSD/XSL transformations", because it provides the best fit for a Java-oriented project, uses proven and mature technology stack (XML/XSD/XSL), addresses all core maintenance and consistency issues, and enables full automation of the rule generation process.
34+
35+
### Consequences
36+
37+
* Good, because maintenance is now much better and more consistent across all generated files
38+
* Good, because the unified XSD schema ensures standardized rule definitions
39+
* Good, because XSL transformations provide automated and consistent markdown generation
40+
* Good, because it fits naturally into the Java ecosystem and existing toolchain
41+
* Good, because it reduces manual errors and improves development velocity
42+
43+
### Confirmation
44+
45+
The implementation has been successfully adopted and is confirmed to be working as intended through the following indicators:
46+
47+
* **Consistency Validation**: All generated cursor rules now follow a uniform structure and format
48+
* **Maintainability Assessment**: Rule modifications and updates are significantly easier to implement
49+
* **Feature Discovery**: It is now much easier to infer if existing rules require new features or enhancements
50+
* **Quality Assurance**: The XSD validation ensures all rule definitions meet the established schema requirements
51+
52+
## Pros and Cons of the Options
53+
54+
### Option 1: Continue with Manual Maintenance
55+
56+
Manual creation and maintenance of cursor rule files using direct markdown editing.
57+
58+
* Good, because it provides direct control over file content and formatting
59+
* Good, because it requires no additional toolchain or build process dependencies
60+
* Bad, because it leads to inconsistencies across multiple rule files
61+
* Bad, because it requires significant manual effort for updates and maintenance
62+
* Bad, because it is prone to human errors and formatting mistakes
63+
* Bad, because it doesn't scale well as the number of rules grows
64+
65+
### Option 2: Generate cursor rules from XML files using XSD/XSL
66+
67+
XML-based rule definitions with XSD schema validation and XSL transformations for markdown generation.
68+
69+
* Good, because it ensures consistency across all generated rule files
70+
* Good, because it fits well with Java ecosystem and existing project structure
71+
* Good, because it uses mature and proven technology stack (XML/XSD/XSL)
72+
* Good, because it enables automation and reduces manual maintenance overhead
73+
* Good, because XSD provides schema validation and enforces rule structure
74+
* Good, because it supports easy modifications and updates through XML editing
75+
* Neutral, because it requires understanding of XML/XSD/XSL technologies
76+
* Neutral, because it adds a generation step to the build process
77+
78+
### Option 3: PromptML-based approach
79+
80+
Using PromptML Domain Specific Language for defining prompts and rules.
81+
82+
* Good, because it provides a specialized DSL designed for prompt engineering
83+
* Good, because it offers structured approach to prompt definition
84+
* Bad, because it doesn't align well with the Java-oriented project ecosystem
85+
* Bad, because it would require additional Python dependencies and toolchain
86+
* Bad, because it adds complexity without clear benefits over XML approach
87+
* Bad, because it's less mature compared to established XML technologies
88+
89+
## More Information
90+
91+
The implementation includes:
92+
93+
* XML rule definitions following established XSD schema in the `/generator` module
94+
* XSL transformations for generating consistent markdown files with frontmatter
95+
* Integration with the existing Java-based project structure and build process
96+
97+
This decision has been successfully implemented and adopted, demonstrating improved maintainability and consistency in cursor rule management. The approach provides a solid foundation for future rule expansion and modification.

0 commit comments

Comments
 (0)