Skip to content

Commit b9615b5

Browse files
committed
Improved XML
1 parent 7939ca9 commit b9615b5

6 files changed

Lines changed: 112 additions & 160 deletions

File tree

.cursor/rules/112-java-maven-documentation.mdc

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,27 @@ alwaysApply: false
55
---
66
# Create README-DEV.md with information about how to use the Maven project
77

8-
## System prompt characterization
8+
## Role
99

10-
Role definition: You are a Senior software engineer with extensive experience in Java software development
10+
You are a Senior software engineer with extensive experience in Java software development
1111

12-
## Description
12+
## Instructions for AI
1313

1414
When creating a README-DEV.md file for a Maven project, include ONLY the following sections with the specified Maven goals. Do NOT add any additional sections, explanations, or content beyond what is explicitly listed below.
1515

16-
## STRICT Structure for README-DEV.md (Template):
16+
Create a markdown file named `README-DEV.md` with the following exact structure: [java-maven-documentation-template.md](mdc:.cursor/rules/templates/java-maven-documentation-template.md)
1717

18-
**IMPORTANT: Include ONLY the content specified below.**
18+
## Restrictions
1919

20-
---
21-
22-
# Essential Maven Goals:
23-
24-
```bash
25-
# Analyze dependencies
26-
./mvnw dependency:tree
27-
./mvnw dependency:analyze
28-
./mvnw dependency:resolve
29-
30-
./mvnw clean validate -U
31-
./mvnw buildplan:list-plugin
32-
./mvnw buildplan:list-phase
33-
./mvnw help:all-profiles
34-
./mvnw help:active-profiles
35-
./mvnw license:third-party-report
36-
37-
# Clean the project
38-
./mvnw clean
39-
40-
# Clean and package in one command
41-
./mvnw clean package
42-
43-
# Run integration tests
44-
./mvnw verify
20+
**MANDATORY REQUIREMENT**: Follow the embedded template EXACTLY - do not add, remove, or modify any steps, sections, or cursor rules that are not explicitly shown in the template. ### What NOT to Include:
4521

46-
# Check for dependency updates
47-
./mvnw versions:display-property-updates
48-
./mvnw versions:display-dependency-updates
49-
./mvnw versions:display-plugin-updates
22+
- **DO NOT** create additional steps beyond what's shown in the template
23+
- **DO NOT** expand or elaborate on sections beyond what the template shows
24+
- **ONLY** use the exact wording and structure from the template
25+
- If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it
5026

51-
# Generate project reports
52-
./mvnw site
53-
jwebserver -p 8005 -d "$(pwd)/target/site/"
54-
```
27+
## Output Requirements
5528

56-
**END OF TEMPLATE - DO NOT ADD ANYTHING BEYOND THIS POINT**
29+
- Generate the complete markdown file following the embedded template exactly
30+
- Use proper markdown formatting with headers, code blocks, tables, and checklists
31+
- **VERIFY**: Final output contains ONLY what appears in the embedded template
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Essential Maven Goals:
2+
3+
```bash
4+
# Analyze dependencies
5+
./mvnw dependency:tree
6+
./mvnw dependency:analyze
7+
./mvnw dependency:resolve
8+
9+
./mvnw clean validate -U
10+
./mvnw buildplan:list-plugin
11+
./mvnw buildplan:list-phase
12+
./mvnw help:all-profiles
13+
./mvnw help:active-profiles
14+
./mvnw license:third-party-report
15+
16+
# Clean the project
17+
./mvnw clean
18+
19+
# Clean and package in one command
20+
./mvnw clean package
21+
22+
# Run integration tests
23+
./mvnw verify
24+
25+
# Check for dependency updates
26+
./mvnw versions:display-property-updates
27+
./mvnw versions:display-dependency-updates
28+
./mvnw versions:display-plugin-updates
29+
30+
# Generate project reports
31+
./mvnw site
32+
jwebserver -p 8005 -d "$(pwd)/target/site/"
33+
```

spml/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
<includes>
232232
<include>100-java-checklist-guide.mdc</include>
233233
<include>110-java-maven-best-practices.mdc</include>
234+
<include>112-java-maven-documentation.mdc</include>
234235
</includes>
235236
</resource>
236237
</resources>
Lines changed: 33 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,46 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<system-prompt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="spml.xsd"
4-
id="112-java-maven-documentation" version="1.0">
2+
<prompt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="spml-1.1.xsd"
4+
id="112-java-maven-documentation" version="1.0">
5+
56
<metadata>
6-
<description>Create README-DEV.md with information about how to use the Maven project</description>
7-
<globs>pom.xml</globs>
8-
<always-apply>false</always-apply>
7+
<cursor-ai>
8+
<description>Create README-DEV.md with information about how to use the Maven project</description>
9+
<globs>pom.xml</globs>
10+
<always-apply>false</always-apply>
11+
</cursor-ai>
912
<tags>
1013
<tag>maven</tag>
1114
<tag>java</tag>
1215
<tag>documentation</tag>
1316
</tags>
1417
<version>0.8.0</version>
15-
</metadata>
16-
17-
<header>
1818
<title>Create README-DEV.md with information about how to use the Maven project</title>
19-
</header>
19+
</metadata>
2020

21-
<system-characterization>
22-
<role-definition>You are a Senior software engineer with extensive experience in Java software development</role-definition>
23-
</system-characterization>
21+
<role>You are a Senior software engineer with extensive experience in Java software development</role>
2422

25-
<description>
23+
<goal>
2624
When creating a README-DEV.md file for a Maven project, include ONLY the following sections with the specified Maven goals. Do NOT add any additional sections, explanations, or content beyond what is explicitly listed below.
27-
</description>
28-
29-
<content-sections>
30-
<template-section type="configuration">
31-
<template-header>
32-
<template-title>STRICT Structure for README-DEV.md (Template)</template-title>
33-
</template-header>
34-
<template-description>
35-
**IMPORTANT: Include ONLY the content specified below.**
36-
</template-description>
37-
<template-content>
38-
<code-block language="markdown">
39-
# Essential Maven Goals:
40-
41-
```bash
42-
# Analyze dependencies
43-
./mvnw dependency:tree
44-
./mvnw dependency:analyze
45-
./mvnw dependency:resolve
46-
47-
./mvnw clean validate -U
48-
./mvnw buildplan:list-plugin
49-
./mvnw buildplan:list-phase
50-
./mvnw help:all-profiles
51-
./mvnw help:active-profiles
52-
./mvnw license:third-party-report
53-
54-
# Clean the project
55-
./mvnw clean
56-
57-
# Clean and package in one command
58-
./mvnw clean package
59-
60-
# Run integration tests
61-
./mvnw verify
62-
63-
# Check for dependency updates
64-
./mvnw versions:display-property-updates
65-
./mvnw versions:display-dependency-updates
66-
./mvnw versions:display-plugin-updates
67-
68-
# Generate project reports
69-
./mvnw site
70-
jwebserver -p 8005 -d "$(pwd)/target/site/"
71-
```
7225

73-
**END OF TEMPLATE - DO NOT ADD ANYTHING BEYOND THIS POINT**
74-
</code-block>
75-
</template-content>
76-
</template-section>
77-
</content-sections>
78-
</system-prompt>
26+
Create a markdown file named `README-DEV.md` with the following exact structure: [java-maven-documentation-template.md](mdc:.cursor/rules/templates/java-maven-documentation-template.md)
27+
</goal>
28+
29+
<restrictions>
30+
<restrictions-description>**MANDATORY REQUIREMENT**: Follow the embedded template EXACTLY - do not add, remove, or modify any steps, sections, or cursor rules that are not explicitly shown in the template. ### What NOT to Include:</restrictions-description>
31+
<restriction-list>
32+
<restriction>**DO NOT** create additional steps beyond what's shown in the template</restriction>
33+
<restriction>**DO NOT** expand or elaborate on sections beyond what the template shows</restriction>
34+
<restriction>**ONLY** use the exact wording and structure from the template</restriction>
35+
<restriction>If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it</restriction>
36+
</restriction-list>
37+
</restrictions>
38+
39+
<output-requirements-section>
40+
<output-requirements-list>
41+
<output-requirements-item>Generate the complete markdown file following the embedded template exactly</output-requirements-item>
42+
<output-requirements-item>Use proper markdown formatting with headers, code blocks, tables, and checklists</output-requirements-item>
43+
<output-requirements-item>**VERIFY**: Final output contains ONLY what appears in the embedded template</output-requirements-item>
44+
</output-requirements-list>
45+
</output-requirements-section>
46+
</prompt>

spml/src/test/java/info/jab/xml/CursorRuleGeneratorTest.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,31 @@ void should_throwException_when_xsltFileDoesNotExist() {
5757
class UnifiedXsltGeneratorTests {
5858

5959
@Test
60-
@DisplayName("Should generate exact content matching original expected Maven best practices document using unified XSLT")
61-
void should_generateExactContentMatchingOriginalExpected_when_transformingMavenBestPracticesWithUnifiedXslt() throws IOException {
60+
@DisplayName("Should generate exact content matching original expected Java checklist guide document using unified XSLT")
61+
void should_generateExactContentMatchingOriginalExpected_when_transformingJavaChecklistGuideWithUnifiedXslt() throws IOException {
6262
// Given
6363
CursorRuleGenerator generator = new CursorRuleGenerator();
64-
String expectedContent = loadExpectedContent("110-java-maven-best-practices.mdc");
64+
String expectedContent = loadExpectedContent("100-java-checklist-guide.mdc");
6565

66-
// When - explicitly specify the schema since this XML uses spml-1.1.xsd
67-
String actualResult = generator.generate("110-java-maven-best-practices.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
66+
// When
67+
String actualResult = generator.generate("100-java-checklist-guide.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
6868

69-
// Then - Unified XSLT should produce identical output to specialized XSLT
69+
// Then - Unified XSLT should produce identical output to expected
7070
assertThat(actualResult)
7171
.isNotNull()
7272
.isNotEmpty()
7373
.isEqualTo(expectedContent);
7474
}
7575

7676
@Test
77-
@DisplayName("Should generate exact content matching original expected Maven documentation document using unified XSLT")
78-
void should_generateExactContentMatchingOriginalExpected_when_transformingMavenDocumentationWithUnifiedXslt() throws IOException {
77+
@DisplayName("Should generate exact content matching original expected Maven best practices document using unified XSLT")
78+
void should_generateExactContentMatchingOriginalExpected_when_transformingMavenBestPracticesWithUnifiedXslt() throws IOException {
7979
// Given
8080
CursorRuleGenerator generator = new CursorRuleGenerator();
81-
String expectedContent = loadExpectedContent("112-java-maven-documentation.mdc");
81+
String expectedContent = loadExpectedContent("110-java-maven-best-practices.mdc");
8282

83-
// When
84-
String actualResult = generator.generate("112-java-maven-documentation.xml", "cursor-rule-generator.xsl");
83+
// When - explicitly specify the schema since this XML uses spml-1.1.xsd
84+
String actualResult = generator.generate("110-java-maven-best-practices.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
8585

8686
// Then - Unified XSLT should produce identical output to specialized XSLT
8787
assertThat(actualResult)
@@ -91,16 +91,16 @@ void should_generateExactContentMatchingOriginalExpected_when_transformingMavenD
9191
}
9292

9393
@Test
94-
@DisplayName("Should generate exact content matching original expected Java checklist guide document using unified XSLT")
95-
void should_generateExactContentMatchingOriginalExpected_when_transformingJavaChecklistGuideWithUnifiedXslt() throws IOException {
94+
@DisplayName("Should generate exact content matching original expected Maven documentation document using unified XSLT")
95+
void should_generateExactContentMatchingOriginalExpected_when_transformingMavenDocumentationWithUnifiedXslt() throws IOException {
9696
// Given
9797
CursorRuleGenerator generator = new CursorRuleGenerator();
98-
String expectedContent = loadExpectedContent("100-java-checklist-guide.mdc");
98+
String expectedContent = loadExpectedContent("112-java-maven-documentation.mdc");
9999

100100
// When
101-
String actualResult = generator.generate("100-java-checklist-guide.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
101+
String actualResult = generator.generate("112-java-maven-documentation.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
102102

103-
// Then - Unified XSLT should produce identical output to expected
103+
// Then - Unified XSLT should produce identical output to specialized XSLT
104104
assertThat(actualResult)
105105
.isNotNull()
106106
.isNotEmpty()
@@ -303,7 +303,7 @@ void should_produceConsistentStructure_when_processingDifferentXmlTypes() throws
303303
// When
304304
String checklistGuideResult = generator.generate("100-java-checklist-guide.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
305305
String bestPracticesResult = generator.generate("110-java-maven-best-practices.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
306-
String documentationResult = generator.generate("112-java-maven-documentation.xml", "cursor-rule-generator.xsl");
306+
String documentationResult = generator.generate("112-java-maven-documentation.xml", "cursor-rule-generator-1.1.xsl", "spml-1.1.xsd");
307307
String objectOrientedDesignResult = generator.generate("121-java-object-oriented-design.xml", "cursor-rule-generator.xsl");
308308
String typeDesignResult = generator.generate("122-java-type-design.xml", "cursor-rule-generator.xsl");
309309
String generalGuidelinesResult = generator.generate("123-java-general-guidelines.xml", "cursor-rule-generator.xsl");

spml/src/test/resources/112-java-maven-documentation.mdc

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,27 @@ alwaysApply: false
55
---
66
# Create README-DEV.md with information about how to use the Maven project
77

8-
## System prompt characterization
8+
## Role
99

10-
Role definition: You are a Senior software engineer with extensive experience in Java software development
10+
You are a Senior software engineer with extensive experience in Java software development
1111

12-
## Description
12+
## Instructions for AI
1313

1414
When creating a README-DEV.md file for a Maven project, include ONLY the following sections with the specified Maven goals. Do NOT add any additional sections, explanations, or content beyond what is explicitly listed below.
1515

16-
## STRICT Structure for README-DEV.md (Template):
16+
Create a markdown file named `README-DEV.md` with the following exact structure: [java-maven-documentation-template.md](mdc:.cursor/rules/templates/java-maven-documentation-template.md)
1717

18-
**IMPORTANT: Include ONLY the content specified below.**
18+
## Restrictions
1919

20-
---
21-
22-
# Essential Maven Goals:
23-
24-
```bash
25-
# Analyze dependencies
26-
./mvnw dependency:tree
27-
./mvnw dependency:analyze
28-
./mvnw dependency:resolve
29-
30-
./mvnw clean validate -U
31-
./mvnw buildplan:list-plugin
32-
./mvnw buildplan:list-phase
33-
./mvnw help:all-profiles
34-
./mvnw help:active-profiles
35-
./mvnw license:third-party-report
36-
37-
# Clean the project
38-
./mvnw clean
39-
40-
# Clean and package in one command
41-
./mvnw clean package
42-
43-
# Run integration tests
44-
./mvnw verify
20+
**MANDATORY REQUIREMENT**: Follow the embedded template EXACTLY - do not add, remove, or modify any steps, sections, or cursor rules that are not explicitly shown in the template. ### What NOT to Include:
4521

46-
# Check for dependency updates
47-
./mvnw versions:display-property-updates
48-
./mvnw versions:display-dependency-updates
49-
./mvnw versions:display-plugin-updates
22+
- **DO NOT** create additional steps beyond what's shown in the template
23+
- **DO NOT** expand or elaborate on sections beyond what the template shows
24+
- **ONLY** use the exact wording and structure from the template
25+
- If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it
5026

51-
# Generate project reports
52-
./mvnw site
53-
jwebserver -p 8005 -d "$(pwd)/target/site/"
54-
```
27+
## Output Requirements
5528

56-
**END OF TEMPLATE - DO NOT ADD ANYTHING BEYOND THIS POINT**
29+
- Generate the complete markdown file following the embedded template exactly
30+
- Use proper markdown formatting with headers, code blocks, tables, and checklists
31+
- **VERIFY**: Final output contains ONLY what appears in the embedded template

0 commit comments

Comments
 (0)