Skip to content

Commit db4fd3d

Browse files
committed
WIP
1 parent 03012e8 commit db4fd3d

1 file changed

Lines changed: 263 additions & 0 deletions

File tree

docs/xml/system-prompt-dtd.xml

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
<!DOCTYPE system-prompt [
2+
<!-- Root element for a system prompt -->
3+
<!ELEMENT system-prompt (metadata, header, system-characterization, description, principles?, table-of-contents?, content-sections+)>
4+
<!ATTLIST system-prompt
5+
id CDATA #REQUIRED
6+
version CDATA #IMPLIED>
7+
8+
<!-- Metadata section (equivalent to frontmatter) -->
9+
<!ELEMENT metadata (description, globs?, always-apply?, tags?)>
10+
<!ELEMENT description (#PCDATA)>
11+
<!ELEMENT globs (#PCDATA)>
12+
<!ELEMENT always-apply (#PCDATA)>
13+
<!ELEMENT tags (tag*)>
14+
<!ELEMENT tag (#PCDATA)>
15+
16+
<!-- Header section -->
17+
<!ELEMENT header (title, subtitle?)>
18+
<!ELEMENT title (#PCDATA)>
19+
<!ELEMENT subtitle (#PCDATA)>
20+
21+
<!-- System characterization -->
22+
<!ELEMENT system-characterization (role-definition, expertise-area*)>
23+
<!ELEMENT role-definition (#PCDATA)>
24+
<!ELEMENT expertise-area (#PCDATA)>
25+
26+
<!-- Principles section -->
27+
<!ELEMENT principles (principle*)>
28+
<!ELEMENT principle (#PCDATA)>
29+
<!ATTLIST principle number CDATA #IMPLIED>
30+
31+
<!-- Table of contents -->
32+
<!ELEMENT table-of-contents (toc-item*)>
33+
<!ELEMENT toc-item (#PCDATA)>
34+
<!ATTLIST toc-item level CDATA #IMPLIED>
35+
36+
<!-- Content sections (the main body) -->
37+
<!ELEMENT content-sections (rule-section | question-section | template-section | workflow-section | instruction-section | example-section | reference-section)*>
38+
39+
<!-- Rule section with guidelines -->
40+
<!ELEMENT rule-section (rule-header, rule-description, code-examples?)>
41+
<!ATTLIST rule-section
42+
number CDATA #IMPLIED
43+
id CDATA #IMPLIED>
44+
<!ELEMENT rule-header (rule-title, rule-subtitle?)>
45+
<!ELEMENT rule-title (#PCDATA)>
46+
<!ELEMENT rule-subtitle (#PCDATA)>
47+
<!ELEMENT rule-description (#PCDATA | emphasis | code-inline)*>
48+
49+
<!-- Code examples with good and bad patterns -->
50+
<!ELEMENT code-examples (good-example*, bad-example*)>
51+
<!ELEMENT good-example (code-block, explanation?)>
52+
<!ELEMENT bad-example (code-block, explanation?)>
53+
<!ELEMENT code-block (#PCDATA)>
54+
<!ATTLIST code-block language CDATA #IMPLIED>
55+
<!ELEMENT explanation (#PCDATA | emphasis | code-inline)*>
56+
57+
<!-- Interactive question section -->
58+
<!ELEMENT question-section (question-header, question-description?, question-items+)>
59+
<!ATTLIST question-section
60+
type (single | multiple | conditional) #IMPLIED
61+
dependency CDATA #IMPLIED>
62+
<!ELEMENT question-header (question-title, question-subtitle?)>
63+
<!ELEMENT question-title (#PCDATA)>
64+
<!ELEMENT question-subtitle (#PCDATA)>
65+
<!ELEMENT question-description (#PCDATA | emphasis | code-inline)*>
66+
<!ELEMENT question-items (question-item*)>
67+
<!ELEMENT question-item (option-text, option-description?)>
68+
<!ELEMENT option-text (#PCDATA)>
69+
<!ELEMENT option-description (#PCDATA)>
70+
71+
<!-- Template section for code/configuration templates -->
72+
<!ELEMENT template-section (template-header, template-description?, template-content)>
73+
<!ATTLIST template-section
74+
type (code | configuration | script) #IMPLIED
75+
language CDATA #IMPLIED>
76+
<!ELEMENT template-header (template-title, template-subtitle?)>
77+
<!ELEMENT template-title (#PCDATA)>
78+
<!ELEMENT template-subtitle (#PCDATA)>
79+
<!ELEMENT template-description (#PCDATA | emphasis | code-inline)*>
80+
<!ELEMENT template-content (code-block | parameter-list | placeholder*)>
81+
<!ELEMENT parameter-list (parameter*)>
82+
<!ELEMENT parameter (param-name, param-description, param-default?)>
83+
<!ELEMENT param-name (#PCDATA)>
84+
<!ELEMENT param-description (#PCDATA)>
85+
<!ELEMENT param-default (#PCDATA)>
86+
<!ELEMENT placeholder (#PCDATA)>
87+
<!ATTLIST placeholder name CDATA #REQUIRED>
88+
89+
<!-- Workflow section for step-by-step processes -->
90+
<!ELEMENT workflow-section (workflow-header, workflow-description?, workflow-steps)>
91+
<!ELEMENT workflow-header (workflow-title, workflow-subtitle?)>
92+
<!ELEMENT workflow-title (#PCDATA)>
93+
<!ELEMENT workflow-subtitle (#PCDATA)>
94+
<!ELEMENT workflow-description (#PCDATA | emphasis | code-inline)*>
95+
<!ELEMENT workflow-steps (workflow-step*)>
96+
<!ELEMENT workflow-step (step-header, step-description, step-content?, prerequisites?, validation?)>
97+
<!ATTLIST workflow-step
98+
number CDATA #IMPLIED
99+
type (mandatory | optional | conditional) #IMPLIED
100+
dependency CDATA #IMPLIED>
101+
<!ELEMENT step-header (step-title, step-subtitle?)>
102+
<!ELEMENT step-title (#PCDATA)>
103+
<!ELEMENT step-subtitle (#PCDATA)>
104+
<!ELEMENT step-description (#PCDATA | emphasis | code-inline)*>
105+
<!ELEMENT step-content (code-block | command-list | checklist)*>
106+
<!ELEMENT prerequisites (prerequisite*)>
107+
<!ELEMENT prerequisite (#PCDATA)>
108+
<!ELEMENT validation (validation-criteria*)>
109+
<!ELEMENT validation-criteria (#PCDATA)>
110+
111+
<!-- Instruction section for AI behavior -->
112+
<!ELEMENT instruction-section (instruction-header, instruction-description?, instruction-rules)>
113+
<!ELEMENT instruction-header (instruction-title, instruction-subtitle?)>
114+
<!ELEMENT instruction-title (#PCDATA)>
115+
<!ELEMENT instruction-subtitle (#PCDATA)>
116+
<!ELEMENT instruction-description (#PCDATA | emphasis | code-inline)*>
117+
<!ELEMENT instruction-rules (instruction-rule*)>
118+
<!ELEMENT instruction-rule (#PCDATA | emphasis | code-inline)*>
119+
<!ATTLIST instruction-rule
120+
type (mandatory | optional | conditional) #IMPLIED
121+
priority (high | medium | low) #IMPLIED>
122+
123+
<!-- Example section -->
124+
<!ELEMENT example-section (example-header, example-description?, example-content)>
125+
<!ATTLIST example-section type CDATA #IMPLIED>
126+
<!ELEMENT example-header (example-title, example-subtitle?)>
127+
<!ELEMENT example-title (#PCDATA)>
128+
<!ELEMENT example-subtitle (#PCDATA)>
129+
<!ELEMENT example-description (#PCDATA | emphasis | code-inline)*>
130+
<!ELEMENT example-content (code-block | scenario | use-case)*>
131+
<!ELEMENT scenario (scenario-description, scenario-steps)>
132+
<!ELEMENT scenario-description (#PCDATA)>
133+
<!ELEMENT scenario-steps (scenario-step*)>
134+
<!ELEMENT scenario-step (#PCDATA)>
135+
<!ELEMENT use-case (use-case-description, use-case-implementation)>
136+
<!ELEMENT use-case-description (#PCDATA)>
137+
<!ELEMENT use-case-implementation (code-block)>
138+
139+
<!-- Reference section -->
140+
<!ELEMENT reference-section (reference-header, reference-description?, reference-links)>
141+
<!ELEMENT reference-header (reference-title, reference-subtitle?)>
142+
<!ELEMENT reference-title (#PCDATA)>
143+
<!ELEMENT reference-subtitle (#PCDATA)>
144+
<!ELEMENT reference-description (#PCDATA | emphasis | code-inline)*>
145+
<!ELEMENT reference-links (reference-link*)>
146+
<!ELEMENT reference-link (#PCDATA)>
147+
<!ATTLIST reference-link
148+
type (internal | external | template) #IMPLIED
149+
href CDATA #IMPLIED>
150+
151+
<!-- Common utility elements -->
152+
<!ELEMENT command-list (command*)>
153+
<!ELEMENT command (#PCDATA)>
154+
<!ATTLIST command shell CDATA #IMPLIED>
155+
156+
<!ELEMENT checklist (checklist-item*)>
157+
<!ELEMENT checklist-item (#PCDATA)>
158+
<!ATTLIST checklist-item checked (true | false) #IMPLIED>
159+
160+
<!-- Text formatting elements -->
161+
<!ELEMENT emphasis (#PCDATA)>
162+
<!ATTLIST emphasis type (bold | italic | code | warning | critical) #IMPLIED>
163+
164+
<!ELEMENT code-inline (#PCDATA)>
165+
]>
166+
167+
<!-- Example system prompt structure -->
168+
<system-prompt id="java-maven-best-practices" version="1.0">
169+
<metadata>
170+
<description>Maven Best Practices for Java Development</description>
171+
<globs>pom.xml</globs>
172+
<always-apply>false</always-apply>
173+
<tags>
174+
<tag>maven</tag>
175+
<tag>java</tag>
176+
<tag>build-system</tag>
177+
</tags>
178+
</metadata>
179+
180+
<header>
181+
<title>Maven Best Practices</title>
182+
<subtitle>Comprehensive guidelines for effective Maven usage</subtitle>
183+
</header>
184+
185+
<system-characterization>
186+
<role-definition>You are a Senior software engineer with extensive experience in Java software development</role-definition>
187+
<expertise-area>Maven build system</expertise-area>
188+
<expertise-area>Java dependency management</expertise-area>
189+
</system-characterization>
190+
191+
<description>
192+
Effective Maven usage involves robust dependency management via dependencyManagement and BOMs,
193+
adherence to the standard directory layout, and centralized plugin management.
194+
</description>
195+
196+
<principles>
197+
<principle number="1">Effective Dependency Management</principle>
198+
<principle number="2">Standard Directory Layout</principle>
199+
<principle number="3">Plugin Management and Configuration</principle>
200+
</principles>
201+
202+
<table-of-contents>
203+
<toc-item level="1">Rule 1: Effective Dependency Management</toc-item>
204+
<toc-item level="1">Rule 2: Standard Directory Layout</toc-item>
205+
<toc-item level="1">Rule 3: Plugin Management and Configuration</toc-item>
206+
</table-of-contents>
207+
208+
<content-sections>
209+
<rule-section number="1" id="dependency-management">
210+
<rule-header>
211+
<rule-title>Effective Dependency Management</rule-title>
212+
<rule-subtitle>Use dependencyManagement and BOMs</rule-subtitle>
213+
</rule-header>
214+
<rule-description>
215+
Use the <code-inline>dependencyManagement</code-inline> section in parent POMs or import
216+
Bill of Materials (BOMs) to centralize and control dependency versions.
217+
</rule-description>
218+
<code-examples>
219+
<good-example>
220+
<code-block language="xml">
221+
&lt;dependencyManagement&gt;
222+
&lt;dependencies&gt;
223+
&lt;dependency&gt;
224+
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
225+
&lt;artifactId&gt;spring-context&lt;/artifactId&gt;
226+
&lt;version&gt;${spring.version}&lt;/version&gt;
227+
&lt;/dependency&gt;
228+
&lt;/dependencies&gt;
229+
&lt;/dependencyManagement&gt;
230+
</code-block>
231+
<explanation>Centralized version management using properties</explanation>
232+
</good-example>
233+
<bad-example>
234+
<code-block language="xml">
235+
&lt;dependency&gt;
236+
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
237+
&lt;artifactId&gt;spring-context&lt;/artifactId&gt;
238+
&lt;version&gt;5.3.20&lt;/version&gt;
239+
&lt;/dependency&gt;
240+
</code-block>
241+
<explanation>Hardcoded version may differ from parent's intention</explanation>
242+
</bad-example>
243+
</code-examples>
244+
</rule-section>
245+
246+
<instruction-section>
247+
<instruction-header>
248+
<instruction-title>Implementation Guidelines</instruction-title>
249+
</instruction-header>
250+
<instruction-rules>
251+
<instruction-rule type="mandatory" priority="high">
252+
<emphasis type="bold">ALWAYS</emphasis> use dependencyManagement in parent POMs
253+
</instruction-rule>
254+
<instruction-rule type="mandatory" priority="high">
255+
<emphasis type="critical">NEVER</emphasis> hardcode versions in child modules
256+
</instruction-rule>
257+
<instruction-rule type="optional" priority="medium">
258+
Consider using BOMs for complex dependency trees
259+
</instruction-rule>
260+
</instruction-rules>
261+
</instruction-section>
262+
</content-sections>
263+
</system-prompt>

0 commit comments

Comments
 (0)