Skip to content

Commit 86ff442

Browse files
committed
Nice modelling for 100-java-checklist-guide
1 parent d12d817 commit 86ff442

3 files changed

Lines changed: 63 additions & 18 deletions

File tree

spml/src/main/resources/100-java-checklist-guide.xml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828

2929
<content-sections>
3030
<instruction-section>
31-
<instruction-header>
32-
<instruction-title>Instructions for AI</instruction-title>
33-
</instruction-header>
31+
<instruction-title>Instructions for AI</instruction-title>
3432
<instruction-description>Create a markdown file named `JAVA-DEVELOPMENT-GUIDE.md` with the following exact structure: [java-checklist-template.md](mdc:.cursor/rules/templates/java-checklist-template.md)</instruction-description>
3533
<restrictions>
3634
<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>
@@ -45,15 +43,13 @@
4543
</restrictions>
4644
</instruction-section>
4745

48-
<instruction-section>
49-
<instruction-header>
50-
<instruction-title>Output Requirements</instruction-title>
51-
</instruction-header>
52-
<instruction-rules>
53-
<instruction-rule>Generate the complete markdown file following the embedded template exactly</instruction-rule>
54-
<instruction-rule>Use proper markdown formatting with headers, code blocks, tables, and checklists</instruction-rule>
55-
<instruction-rule>**VERIFY**: Final output contains ONLY what appears in the embedded template</instruction-rule>
56-
</instruction-rules>
57-
</instruction-section>
46+
<output-requirements-section>
47+
<output-requirements-title>Output Requirements</output-requirements-title>
48+
<output-requirements-rules>
49+
<output-requirements-rule>Generate the complete markdown file following the embedded template exactly</output-requirements-rule>
50+
<output-requirements-rule>Use proper markdown formatting with headers, code blocks, tables, and checklists</output-requirements-rule>
51+
<output-requirements-rule>**VERIFY**: Final output contains ONLY what appears in the embedded template</output-requirements-rule>
52+
</output-requirements-rules>
53+
</output-requirements-section>
5854
</content-sections>
5955
</system-prompt>

spml/src/main/resources/system-prompt.dtd

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<!ATTLIST toc-item level CDATA #IMPLIED>
3535

3636
<!-- Content sections (the main body) -->
37-
<!ELEMENT content-sections (rule-section | question-section | template-section | workflow-section | instruction-section | example-section | reference-section)*>
37+
<!ELEMENT content-sections (rule-section | question-section | template-section | workflow-section | instruction-section | output-requirements-section | example-section | reference-section)*>
3838

3939
<!-- Rule section with guidelines -->
4040
<!ELEMENT rule-section (rule-header, rule-description, code-examples?)>
@@ -108,8 +108,8 @@
108108
<!ELEMENT validation (validation-criteria*)>
109109
<!ELEMENT validation-criteria (#PCDATA)>
110110

111-
<!-- Instruction section for AI behavior -->
112-
<!ELEMENT instruction-section (instruction-header, instruction-description?, instruction-rules?, restrictions?)>
111+
<!-- Simplified Instruction section for AI behavior - supports both complex and simple structures -->
112+
<!ELEMENT instruction-section ((instruction-header, instruction-description?, instruction-rules?, restrictions?) | (instruction-title, instruction-description?, instruction-rules?, restrictions?))>
113113
<!ELEMENT instruction-header (instruction-title, instruction-subtitle?)>
114114
<!ELEMENT instruction-title (#PCDATA)>
115115
<!ELEMENT instruction-subtitle (#PCDATA)>
@@ -129,6 +129,18 @@
129129
type (mandatory | optional | conditional) #IMPLIED
130130
priority (high | medium | low) #IMPLIED>
131131

132+
<!-- Simplified Output requirements section - supports both complex and simple structures -->
133+
<!ELEMENT output-requirements-section ((output-requirements-header, output-requirements-description?, output-requirements-rules?) | (output-requirements-title, output-requirements-description?, output-requirements-rules?))>
134+
<!ELEMENT output-requirements-header (output-requirements-title, output-requirements-subtitle?)>
135+
<!ELEMENT output-requirements-title (#PCDATA)>
136+
<!ELEMENT output-requirements-subtitle (#PCDATA)>
137+
<!ELEMENT output-requirements-description (#PCDATA | emphasis | code-inline)*>
138+
<!ELEMENT output-requirements-rules (output-requirements-rule*)>
139+
<!ELEMENT output-requirements-rule (#PCDATA | emphasis | code-inline)*>
140+
<!ATTLIST output-requirements-rule
141+
type (mandatory | optional | conditional) #IMPLIED
142+
priority (high | medium | low) #IMPLIED>
143+
132144
<!-- Example section -->
133145
<!ELEMENT example-section (example-header, example-description?, example-content)>
134146
<!ATTLIST example-section type CDATA #IMPLIED>

spml/src/main/resources/unified-generator.xsl

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,19 @@ Description: </xsl:text><xsl:value-of select="normalize-space(rule-description)"
184184
</xsl:for-each>
185185
</xsl:template>
186186

187-
<!-- Instruction section template -->
187+
<!-- Instruction section template - handles both complex and simple structures -->
188188
<xsl:template match="instruction-section">
189189
<xsl:text>
190190

191-
## </xsl:text><xsl:value-of select="normalize-space(instruction-header/instruction-title)"/>
191+
## </xsl:text>
192+
<xsl:choose>
193+
<xsl:when test="instruction-header/instruction-title">
194+
<xsl:value-of select="normalize-space(instruction-header/instruction-title)"/>
195+
</xsl:when>
196+
<xsl:otherwise>
197+
<xsl:value-of select="normalize-space(instruction-title)"/>
198+
</xsl:otherwise>
199+
</xsl:choose>
192200
<xsl:text>
193201

194202
</xsl:text>
@@ -219,6 +227,35 @@ Description: </xsl:text><xsl:value-of select="normalize-space(rule-description)"
219227
</xsl:for-each>
220228
</xsl:template>
221229

230+
<!-- Output requirements section template - handles both complex and simple structures -->
231+
<xsl:template match="output-requirements-section">
232+
<xsl:text>
233+
234+
## </xsl:text>
235+
<xsl:choose>
236+
<xsl:when test="output-requirements-header/output-requirements-title">
237+
<xsl:value-of select="normalize-space(output-requirements-header/output-requirements-title)"/>
238+
</xsl:when>
239+
<xsl:otherwise>
240+
<xsl:value-of select="normalize-space(output-requirements-title)"/>
241+
</xsl:otherwise>
242+
</xsl:choose>
243+
<xsl:text>
244+
245+
</xsl:text>
246+
<xsl:if test="output-requirements-description">
247+
<xsl:value-of select="normalize-space(output-requirements-description)"/>
248+
<xsl:text>
249+
250+
</xsl:text>
251+
</xsl:if>
252+
<xsl:for-each select="output-requirements-rules/output-requirements-rule">
253+
<xsl:text>- </xsl:text><xsl:value-of select="normalize-space(.)"/>
254+
<xsl:text>
255+
</xsl:text>
256+
</xsl:for-each>
257+
</xsl:template>
258+
222259
<!-- Restrictions template -->
223260
<xsl:template match="restrictions">
224261
<xsl:text>### Restrictions

0 commit comments

Comments
 (0)