agile-context-engineering 0.3.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +10 -0
  3. package/CHANGELOG.md +7 -1
  4. package/LICENSE +51 -51
  5. package/README.md +330 -318
  6. package/agents/ace-code-discovery-analyst.md +245 -245
  7. package/agents/ace-code-integration-analyst.md +248 -248
  8. package/agents/ace-code-reviewer.md +375 -375
  9. package/agents/ace-product-owner.md +365 -361
  10. package/agents/ace-project-researcher.md +606 -606
  11. package/agents/ace-research-synthesizer.md +228 -228
  12. package/agents/ace-technical-application-architect.md +315 -315
  13. package/agents/ace-wiki-mapper.md +449 -445
  14. package/bin/install.js +605 -195
  15. package/hooks/ace-check-update.js +71 -62
  16. package/hooks/ace-statusline.js +107 -89
  17. package/hooks/hooks.json +14 -0
  18. package/package.json +7 -5
  19. package/shared/lib/ace-core.js +361 -0
  20. package/shared/lib/ace-core.test.js +308 -0
  21. package/shared/lib/ace-github.js +753 -0
  22. package/shared/lib/ace-story.js +400 -0
  23. package/shared/lib/ace-story.test.js +250 -0
  24. package/{agile-context-engineering → shared}/utils/questioning.xml +110 -110
  25. package/{agile-context-engineering → shared}/utils/ui-formatting.md +299 -299
  26. package/{commands/ace/execute-story.md → skills/execute-story/SKILL.md} +116 -138
  27. package/skills/execute-story/script.js +291 -0
  28. package/skills/execute-story/script.test.js +261 -0
  29. package/{agile-context-engineering/templates/product/story.xml → skills/execute-story/story-template.xml} +451 -451
  30. package/skills/execute-story/walkthrough-template.xml +255 -0
  31. package/{agile-context-engineering/workflows/execute-story.xml → skills/execute-story/workflow.xml} +1221 -1219
  32. package/skills/help/SKILL.md +71 -0
  33. package/skills/help/script.js +315 -0
  34. package/skills/help/script.test.js +183 -0
  35. package/{agile-context-engineering/workflows/help.xml → skills/help/workflow.xml} +544 -533
  36. package/{commands/ace/init-coding-standards.md → skills/init-coding-standards/SKILL.md} +91 -83
  37. package/{agile-context-engineering/templates/wiki/coding-standards.xml → skills/init-coding-standards/coding-standards-template.xml} +531 -531
  38. package/skills/init-coding-standards/script.js +50 -0
  39. package/skills/init-coding-standards/script.test.js +70 -0
  40. package/{agile-context-engineering/workflows/init-coding-standards.xml → skills/init-coding-standards/workflow.xml} +381 -386
  41. package/skills/map-cross-cutting/SKILL.md +126 -0
  42. package/{agile-context-engineering/templates/wiki → skills/map-cross-cutting}/system-cross-cutting.xml +197 -197
  43. package/skills/map-cross-cutting/workflow.xml +330 -0
  44. package/skills/map-guide/SKILL.md +126 -0
  45. package/{agile-context-engineering/templates/wiki → skills/map-guide}/guide.xml +137 -137
  46. package/skills/map-guide/workflow.xml +320 -0
  47. package/skills/map-pattern/SKILL.md +125 -0
  48. package/{agile-context-engineering/templates/wiki → skills/map-pattern}/pattern.xml +159 -159
  49. package/skills/map-pattern/workflow.xml +331 -0
  50. package/{commands/ace/map-story.md → skills/map-story/SKILL.md} +180 -165
  51. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/decizions.xml +115 -115
  52. package/skills/map-story/templates/guide.xml +137 -0
  53. package/skills/map-story/templates/pattern.xml +159 -0
  54. package/skills/map-story/templates/system-cross-cutting.xml +197 -0
  55. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/system.xml +381 -381
  56. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/tech-debt-index.xml +125 -125
  57. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/walkthrough.xml +255 -255
  58. package/{agile-context-engineering/workflows/map-story.xml → skills/map-story/workflow.xml} +1046 -1046
  59. package/{commands/ace/map-subsystem.md → skills/map-subsystem/SKILL.md} +155 -140
  60. package/skills/map-subsystem/script.js +51 -0
  61. package/skills/map-subsystem/script.test.js +68 -0
  62. package/skills/map-subsystem/templates/decizions.xml +115 -0
  63. package/skills/map-subsystem/templates/guide.xml +137 -0
  64. package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/module-discovery.xml +174 -174
  65. package/skills/map-subsystem/templates/pattern.xml +159 -0
  66. package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-architecture.xml +343 -343
  67. package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-structure.xml +234 -234
  68. package/skills/map-subsystem/templates/system-cross-cutting.xml +197 -0
  69. package/skills/map-subsystem/templates/system.xml +381 -0
  70. package/skills/map-subsystem/templates/walkthrough.xml +255 -0
  71. package/{agile-context-engineering/workflows/map-subsystem.xml → skills/map-subsystem/workflow.xml} +1173 -1178
  72. package/skills/map-sys-doc/SKILL.md +125 -0
  73. package/skills/map-sys-doc/system.xml +381 -0
  74. package/skills/map-sys-doc/workflow.xml +336 -0
  75. package/{commands/ace/map-system.md → skills/map-system/SKILL.md} +103 -92
  76. package/skills/map-system/script.js +75 -0
  77. package/skills/map-system/script.test.js +73 -0
  78. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-architecture.xml +254 -254
  79. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-structure.xml +177 -177
  80. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/testing-framework.xml +283 -283
  81. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/wiki-readme.xml +296 -296
  82. package/{agile-context-engineering/workflows/map-system.xml → skills/map-system/workflow.xml} +667 -672
  83. package/{commands/ace/map-walkthrough.md → skills/map-walkthrough/SKILL.md} +140 -127
  84. package/skills/map-walkthrough/walkthrough.xml +255 -0
  85. package/{agile-context-engineering/workflows/map-walkthrough.xml → skills/map-walkthrough/workflow.xml} +457 -457
  86. package/{commands/ace/plan-backlog.md → skills/plan-backlog/SKILL.md} +93 -83
  87. package/{agile-context-engineering/templates/product/product-backlog.xml → skills/plan-backlog/product-backlog-template.xml} +231 -231
  88. package/skills/plan-backlog/script.js +121 -0
  89. package/skills/plan-backlog/script.test.js +83 -0
  90. package/{agile-context-engineering/workflows/plan-backlog.xml → skills/plan-backlog/workflow.xml} +1348 -1356
  91. package/{commands/ace/plan-feature.md → skills/plan-feature/SKILL.md} +99 -89
  92. package/{agile-context-engineering/templates/product/feature.xml → skills/plan-feature/feature-template.xml} +361 -361
  93. package/skills/plan-feature/script.js +131 -0
  94. package/skills/plan-feature/script.test.js +80 -0
  95. package/{agile-context-engineering/workflows/plan-feature.xml → skills/plan-feature/workflow.xml} +1487 -1495
  96. package/{commands/ace/plan-product-vision.md → skills/plan-product-vision/SKILL.md} +91 -81
  97. package/{agile-context-engineering/templates/product/product-vision.xml → skills/plan-product-vision/product-vision-template.xml} +227 -227
  98. package/skills/plan-product-vision/script.js +51 -0
  99. package/skills/plan-product-vision/script.test.js +69 -0
  100. package/{agile-context-engineering/workflows/plan-product-vision.xml → skills/plan-product-vision/workflow.xml} +337 -342
  101. package/{commands/ace/plan-story.md → skills/plan-story/SKILL.md} +139 -159
  102. package/skills/plan-story/script.js +295 -0
  103. package/skills/plan-story/script.test.js +240 -0
  104. package/skills/plan-story/story-template.xml +458 -0
  105. package/{agile-context-engineering/workflows/plan-story.xml → skills/plan-story/workflow.xml} +1301 -944
  106. package/{commands/ace/research-external-solution.md → skills/research-external-solution/SKILL.md} +120 -138
  107. package/{agile-context-engineering/templates/product/external-solution.xml → skills/research-external-solution/external-solution-template.xml} +832 -832
  108. package/skills/research-external-solution/script.js +229 -0
  109. package/skills/research-external-solution/script.test.js +134 -0
  110. package/{agile-context-engineering/workflows/research-external-solution.xml → skills/research-external-solution/workflow.xml} +657 -659
  111. package/{commands/ace/research-integration-solution.md → skills/research-integration-solution/SKILL.md} +121 -135
  112. package/{agile-context-engineering/templates/product/story-integration-solution.xml → skills/research-integration-solution/integration-solution-template.xml} +1015 -1015
  113. package/skills/research-integration-solution/script.js +223 -0
  114. package/skills/research-integration-solution/script.test.js +134 -0
  115. package/{agile-context-engineering/workflows/research-integration-solution.xml → skills/research-integration-solution/workflow.xml} +711 -713
  116. package/{commands/ace/research-story-wiki.md → skills/research-story-wiki/SKILL.md} +101 -116
  117. package/skills/research-story-wiki/script.js +223 -0
  118. package/skills/research-story-wiki/script.test.js +138 -0
  119. package/{agile-context-engineering/templates/product/story-wiki.xml → skills/research-story-wiki/story-wiki-template.xml} +194 -194
  120. package/{agile-context-engineering/workflows/research-story-wiki.xml → skills/research-story-wiki/workflow.xml} +473 -475
  121. package/{commands/ace/research-technical-solution.md → skills/research-technical-solution/SKILL.md} +131 -147
  122. package/skills/research-technical-solution/script.js +223 -0
  123. package/skills/research-technical-solution/script.test.js +134 -0
  124. package/{agile-context-engineering/templates/product/story-technical-solution.xml → skills/research-technical-solution/technical-solution-template.xml} +1025 -1025
  125. package/{agile-context-engineering/workflows/research-technical-solution.xml → skills/research-technical-solution/workflow.xml} +761 -763
  126. package/{commands/ace/review-story.md → skills/review-story/SKILL.md} +99 -109
  127. package/skills/review-story/script.js +249 -0
  128. package/skills/review-story/script.test.js +169 -0
  129. package/skills/review-story/story-template.xml +451 -0
  130. package/{agile-context-engineering/workflows/review-story.xml → skills/review-story/workflow.xml} +279 -281
  131. package/{commands/ace/update.md → skills/update/SKILL.md} +65 -56
  132. package/{agile-context-engineering/workflows/update.xml → skills/update/workflow.xml} +33 -18
  133. package/agile-context-engineering/src/ace-tools.js +0 -2881
  134. package/agile-context-engineering/src/ace-tools.test.js +0 -1089
  135. package/agile-context-engineering/templates/_command.md +0 -54
  136. package/agile-context-engineering/templates/_workflow.xml +0 -17
  137. package/agile-context-engineering/templates/config.json +0 -0
  138. package/agile-context-engineering/templates/product/integration-solution.xml +0 -0
  139. package/commands/ace/help.md +0 -93
@@ -0,0 +1,458 @@
1
+ <story>
2
+
3
+ <purpose>
4
+ Template for `.ace/artifacts/product/&lt;id-epic_name&gt;/&lt;id-feature_name&gt;/&lt;id-story_name&gt;/&lt;id-story_name&gt;.md` —
5
+ a story specification document that describes a single implementable unit of work,
6
+ its INVEST-compliant user story statement, Gherkin acceptance criteria, definition of done,
7
+ scope boundaries, and relevant wiki references for technical solution design.
8
+ This document defines EXACTLY what will be built — no more, no less.
9
+
10
+ The acceptance criteria are the SINGLE SOURCE OF TRUTH for story scope.
11
+ If a behavior is not captured in a named scenario, it is not in scope.
12
+
13
+ This is the COMPOSITION ROOT for the story specification pipeline.
14
+ The full story document is built incrementally across up to 3 passes
15
+ that write sections into the story file, plus up to 2 external research
16
+ artifacts that feed into the technical solution but live outside the story:
17
+
18
+ Pass 1 — Business Requirements (this template, sections 1-8)
19
+ Pass 2 — Wiki Research (story-wiki.xml) — appended to story
20
+ Pass 3 — External Analysis (external-solution.xml) — OPTIONAL, external artifact
21
+ Pass 4 — Integration Analysis (integration-solution.xml) — external artifact
22
+ Pass 5 — Technical Solution (story-technical-solution.xml) — appended to story
23
+
24
+ Passes 3 and 4 produce separate research artifacts in the story directory.
25
+ They are consumed as inputs by pass 5 but are NOT embedded in the story file.
26
+ The pipeline is sequential — earlier passes are inputs to later passes.
27
+
28
+ This document serves as both a local markdown file and a GitHub issue description.
29
+ All formatting must render cleanly in GitHub issue bodies.
30
+ </purpose>
31
+
32
+ <composition>
33
+ &lt;!-- The story specification pipeline. Passes 1, 2, 5 write into the story file.
34
+ Passes 3, 4 produce external artifacts in the story directory that feed pass 5.
35
+
36
+ Story directory: .ace/artifacts/product/&lt;epic&gt;/&lt;feature&gt;/&lt;story&gt;/
37
+ Story file: &lt;story&gt;.md
38
+ External artifacts: external-analysis.md, integration-analysis.md --&gt;
39
+
40
+ <pass order="1" template="story.xml" output="story-file" required="true">
41
+ Business Requirements — sections 1-8 (header through DoD).
42
+ Input: plain-text story seed from parent feature document.
43
+ </pass>
44
+ <pass order="2" template="story-wiki.xml" output="story-file" required="true">
45
+ Wiki Research — relevant-wiki section.
46
+ Input: User Story + Description + AC from pass 1.
47
+ Agent scans `.docs/wiki/` for documents relevant to technical solution.
48
+ </pass>
49
+ <pass order="3" template="external-solution.xml" output="external-analysis.md" required="false">
50
+ External Analysis — analyze reference implementations or external systems.
51
+ Input: story requirements + wiki refs from passes 1-2 + external code/docs.
52
+ OPTIONAL: only when the story or feature references external systems.
53
+ Output: separate artifact in story directory, NOT appended to story file.
54
+ </pass>
55
+ <pass order="4" template="integration-solution.xml" output="integration-analysis.md" required="true">
56
+ Integration Analysis — analyze our own codebase for integration points.
57
+ Input: story requirements + wiki refs + optional external analysis.
58
+ Agent reads relevant wiki docs and explores codebase to map affected code.
59
+ Output: separate artifact in story directory, NOT appended to story file.
60
+ </pass>
61
+ <pass order="5" template="story-technical-solution.xml" output="story-file" required="true">
62
+ Technical Solution — design the implementation approach.
63
+ Input: ALL prior passes (story file + external artifacts).
64
+ Produces the technical-solution section appended to the story file.
65
+ </pass>
66
+
67
+ &lt;!-- Execution passes (written by /ace:execute-story, not /ace:plan-story) --&gt;
68
+ <pass order="E1" populated-by="execute-story" output="story-file" required="false">
69
+ Summary &amp; State — execution results, commit log, deviations, code review.
70
+ Written after implementation is complete and user approves.
71
+ </pass>
72
+ <pass order="E2" populated-by="execute-story" output="story-file" required="false">
73
+ Wiki Updates — table of wiki documents updated/created during implementation.
74
+ Written after wiki mapper completes post-implementation.
75
+ </pass>
76
+ </composition>
77
+
78
+ <output-format>
79
+
80
+ <section name="header">
81
+ # [ID]: [Story Title]
82
+
83
+ **Feature**: [Feature ID] [Feature Title] | **Epic**: [Epic ID] [Epic Title]
84
+ **Status**: [Status] | **Size**: [Size] | **Sprint**: [Sprint] | **Link**: [Link]
85
+
86
+ &lt;!-- Example:
87
+ # S3: Display OAuth Provider Buttons
88
+ **Feature**: F3 OAuth2 Login Flow | **Epic**: #45 User Authentication
89
+ **Status**: Refined | **Size**: 3 | **Sprint**: Sprint 2 | **Link**: [#95](https://github.com/owner/repo/issues/95)
90
+ --&gt;
91
+ </section>
92
+
93
+ <section name="user-story">
94
+ ## User Story
95
+
96
+ &gt; As a [persona/role],
97
+ &gt; I want [action/capability],
98
+ &gt; so that [benefit/value].
99
+
100
+ &lt;!-- The user story MUST follow the As/I want/So that format exactly.
101
+ - Persona must match a persona defined in the product vision.
102
+ - Action describes observable user behavior, not system internals.
103
+ - Benefit ties to the parent feature's benefit hypothesis.
104
+ Example:
105
+ "As a returning customer, I want to click a Google or GitHub login button,
106
+ so that I can authenticate without remembering a site-specific password."
107
+ --&gt;
108
+ </section>
109
+
110
+ <section name="description">
111
+ ## Description
112
+
113
+ [What this story delivers and why it matters within the parent feature. 2-4 sentences.
114
+ Describe observable user behavior — what the user can do when this story is done.
115
+ How this story relates to adjacent stories in the feature (what it builds on, what it enables).
116
+ Focus on WHAT and WHY, not HOW.]
117
+ </section>
118
+
119
+ <section name="acceptance-criteria">
120
+ ## Acceptance Criteria
121
+
122
+ &lt;!-- Gherkin scenarios are the SINGLE SOURCE OF TRUTH for this story's scope.
123
+ If a behavior is not captured in a named scenario, it is NOT in scope.
124
+ Do not implement or test behaviors not defined here.
125
+
126
+ Minimum coverage: happy path + at least one edge case + at least one error path.
127
+ Each scenario must be independent — no scenario depends on another's state.
128
+ If more than 6-8 scenarios are needed, the story is likely too large — split it.
129
+
130
+ FORMAT: Use ### H3 headers for scenario names and **bold** for Given/When/Then.
131
+ Do NOT wrap scenarios in fenced code blocks (no ```gherkin).
132
+ This format renders cleanly in both markdown files and GitHub issue bodies. --&gt;
133
+
134
+ ### Scenario: [Short descriptive name]
135
+
136
+ **Given** [precondition — the starting state]
137
+ **When** [action — what the user or system does]
138
+ **Then** [expected outcome — observable result]
139
+
140
+ ### Scenario: [Short descriptive name]
141
+
142
+ **Given** [precondition]
143
+ **When** [action]
144
+ **Then** [expected outcome]
145
+
146
+ &lt;!-- Example:
147
+ ### Scenario: Successful Google login
148
+
149
+ **Given** the user is on the login page and has a valid Google account
150
+ **When** they click the "Sign in with Google" button and complete Google's OAuth flow
151
+ **Then** they are redirected to the dashboard and see their Google profile name
152
+
153
+ ### Scenario: Provider unavailable
154
+
155
+ **Given** the user is on the login page and the Google OAuth service is unreachable
156
+ **When** they click the "Sign in with Google" button
157
+ **Then** they see an error message "Login service temporarily unavailable. Please try again."
158
+ --&gt;
159
+ </section>
160
+
161
+ <section name="out-of-scope">
162
+ ## Out of Scope
163
+
164
+ &lt;!-- Explicitly excluded items to prevent scope creep. Only list things that someone
165
+ might reasonably assume are included but are NOT part of this story.
166
+ Do not list everything in the universe — only meaningful exclusions. --&gt;
167
+
168
+ - [Excluded item — brief reason why it is not part of this story]
169
+ - [Excluded item — brief reason why it is not part of this story]
170
+ </section>
171
+
172
+ <section name="dependencies">
173
+ ## Dependencies
174
+
175
+ ### Blocked By
176
+ &lt;!-- Stories, features, or external items that must be completed before this story can start. --&gt;
177
+ - [Story ID or item — brief reason for the dependency]
178
+
179
+ ### Blocks
180
+ &lt;!-- Stories or items that cannot start until this story is complete. --&gt;
181
+ - [Story ID or item — what it needs from this story]
182
+
183
+ ### External
184
+ &lt;!-- Third-party services, APIs, approvals, or infrastructure needed. --&gt;
185
+ - [External dependency — current status]
186
+ </section>
187
+
188
+ <section name="definition-of-done">
189
+ ## Definition of Done
190
+
191
+ - [ ] All acceptance criteria scenarios pass
192
+ - [ ] Code reviewed and approved
193
+ - [ ] Tests written and passing
194
+ - [ ] CI pipeline green
195
+ - [ ] Documentation updated (if applicable)
196
+ - [ ] Product Owner verified
197
+ </section>
198
+
199
+ <section name="relevant-wiki" pass="2" template="story-wiki.xml">
200
+ ## Relevant Wiki
201
+
202
+ &lt;!-- Pass 2. Populated by story-wiki.xml template.
203
+ A research agent reads the User Story, Description, and AC,
204
+ then scans `.docs/wiki/` to select documents relevant to
205
+ designing a good technical solution for this story.
206
+ See story-wiki.xml for full section structure and selection criteria. --&gt;
207
+ </section>
208
+
209
+ <section name="technical-solution" pass="5" template="story-technical-solution.xml">
210
+ ## Technical Solution
211
+
212
+ &lt;!-- Pass 5. Populated by story-technical-solution.xml template.
213
+ Consumes ALL prior passes as input:
214
+ - Story file (sections 1-8 + relevant wiki)
215
+ - external-analysis.md (if it exists in story directory)
216
+ - integration-analysis.md (from story directory)
217
+ See story-technical-solution.xml for full section structure. --&gt;
218
+ </section>
219
+
220
+ <section name="summary-and-state" populated-by="execute-story">
221
+ ## Summary &amp; State
222
+
223
+ &lt;!-- Populated by /ace:execute-story after implementation.
224
+ Contains: status, execution date, duration, commit log,
225
+ implementation summary, deviations, and code review results.
226
+ Do NOT edit manually — this section is written by the execution workflow. --&gt;
227
+ </section>
228
+
229
+ <section name="wiki-updates" populated-by="execute-story">
230
+ ## Wiki Updates
231
+
232
+ &lt;!-- Populated by /ace:execute-story after wiki mapping.
233
+ Contains: table of wiki documents updated/created during implementation.
234
+ Do NOT edit manually — this section is written by the execution workflow. --&gt;
235
+ </section>
236
+
237
+ <section name="metadata">
238
+ ---
239
+ *Created: [date] | Last refined: [date] | Refinements: [count]*
240
+ *Feature: [relative path to parent feature.md]*
241
+ </section>
242
+
243
+ </output-format>
244
+
245
+ <field-definitions>
246
+
247
+ <field name="ID">
248
+ S[number] for local stories, #[issue_number] for GitHub-linked.
249
+ Sequential within the parent feature. IDs are stable — never renumber after assignment.
250
+ When a local story gets a GitHub issue, ID changes from S[N] to #[issue_number]
251
+ and the parent feature's story index table is updated.
252
+ </field>
253
+
254
+ <field name="Status">
255
+ <allowed-values>
256
+ <value name="Todo">Story seed exists in feature doc, not yet formally specified</value>
257
+ <value name="Refined">Formal spec complete — user story, AC, DoD all defined and clear</value>
258
+ <value name="In Progress">Implementation has started</value>
259
+ <value name="Done">All AC scenarios verified, DoD met, story closed</value>
260
+ </allowed-values>
261
+ </field>
262
+
263
+ <field name="Size">
264
+ <allowed-values>
265
+ <value name="1">Trivial — a few hours of work</value>
266
+ <value name="2">Small — about a day</value>
267
+ <value name="3">Medium — 2-3 days</value>
268
+ <value name="5">Large — most of a sprint</value>
269
+ <value name="8">Very large — full sprint (1 dev / 10 days OR 1 AI agent - 1 day)</value>
270
+ </allowed-values>
271
+ Fibonacci relative sizing (NOT x10 like features).
272
+ If a story exceeds 8 points, it MUST be split into smaller stories.
273
+ </field>
274
+
275
+ <field name="Priority">
276
+ <allowed-values>
277
+ <value name="Critical">Blocks other work or has external deadline</value>
278
+ <value name="High">Core functionality, high user impact</value>
279
+ <value name="Medium">Important but not blocking</value>
280
+ <value name="Low">Nice to have, can be deferred</value>
281
+ </allowed-values>
282
+ </field>
283
+
284
+ <field name="Persona">
285
+ Must match a persona defined in the product vision document.
286
+ Do not introduce new personas at story level — update the product vision first.
287
+ </field>
288
+
289
+ </field-definitions>
290
+
291
+ <guidelines>
292
+
293
+ <guideline name="invest-compliance">
294
+ Every story MUST pass the INVEST checklist before it can move to "Refined" status:
295
+ - **Independent**: Can be developed without requiring another in-progress story
296
+ - **Negotiable**: Scope is defined by AC, not hardcoded implementation details
297
+ - **Valuable**: User story statement describes real user benefit
298
+ - **Estimable**: Can be sized in Fibonacci points (1, 2, 3, 5, 8)
299
+ - **Small**: Completable within a single sprint
300
+ - **Testable**: AC scenarios have clear pass/fail conditions
301
+
302
+ If any INVEST criterion fails, the story is not ready to be refined.
303
+ </guideline>
304
+
305
+ <guideline name="acceptance-criteria-as-scope">
306
+ Acceptance criteria define 100% of this story's scope.
307
+ No behavior should be implemented or tested unless it is captured in a named scenario.
308
+
309
+ - If it's not in the AC, it's OUT OF SCOPE
310
+ - If it's implied but not stated, it's OUT OF SCOPE
311
+ - If it would be "nice to have", it's OUT OF SCOPE
312
+ - ONLY build what the AC scenarios explicitly describe
313
+
314
+ This is the primary scope control mechanism. Adding requirements beyond the AC
315
+ causes scope creep. Extra features = extra work = missed deadlines.
316
+ </guideline>
317
+
318
+ <guideline name="gherkin-quality">
319
+ Gherkin scenarios must follow these rules:
320
+ - **Given**: Describes state or precondition — NEVER an action
321
+ - **When**: Describes exactly ONE action — the trigger being tested
322
+ - **Then**: Describes an observable outcome — NEVER internal system state
323
+ (Bad: "Then the database has a new row" — Good: "Then the user sees a confirmation message")
324
+ - Scenarios MUST be independent — no scenario depends on another scenario's state
325
+ - Use **And** for additional conditions within Given/When/Then, not separate steps
326
+
327
+ Bad: "Given the user clicks login" (action, not state)
328
+ Good: "Given the user is on the login page"
329
+
330
+ **Formatting**: Use `### Scenario:` H3 headers and `**Given**`/`**When**`/`**Then**` bold markdown.
331
+ Do NOT use fenced code blocks (no ```gherkin). The markdown format renders in GitHub issues.
332
+ </guideline>
333
+
334
+ <guideline name="story-sizing">
335
+ Stories use Fibonacci sizing: 1, 2, 3, 5, 8 (NOT x10 like features).
336
+ If a story is estimated at more than 8 points, it MUST be split.
337
+ If a story requires more than 6-8 AC scenarios, it is likely too large — split it.
338
+
339
+ AC scenario count is a reliable proxy for complexity:
340
+ - 1-2 scenarios: likely a 1-2 point story
341
+ - 3-4 scenarios: likely a 3 point story
342
+ - 5-6 scenarios: likely a 5 point story
343
+ - 7-8 scenarios: likely an 8 point story; above 8 consider splitting
344
+ </guideline>
345
+
346
+ <guideline name="github-compatibility">
347
+ The entire story document must render cleanly as a GitHub issue body.
348
+ - Mermaid diagrams are supported and encouraged — GitHub renders them natively
349
+ in issue bodies and markdown files via ```mermaid fenced code blocks
350
+ - No HTML tables (use markdown tables only - make sure titles are aligned with columns)
351
+ - No custom CSS or HTML styling
352
+ - Named scenario H3 headers render as distinct sections in GitHub
353
+ - Blockquote (&gt;) for the user story statement renders correctly
354
+ </guideline>
355
+
356
+ <guideline name="github-identity">
357
+ - GitHub-linked stories: ID = #[issue_number], Title = EXACT GitHub issue title
358
+ - Local stories: ID = S[N], sequential within the parent feature
359
+ - IDs are stable — never renumber after assignment
360
+ - When a story gets a GitHub issue, ID changes from S[N] to #[issue_number]
361
+ - The parent feature's story index table must be updated to reflect the new ID
362
+ </guideline>
363
+
364
+ <guideline name="definition-of-done">
365
+ The inline DoD checklist must stay compact: 5-10 items maximum.
366
+ It covers the universal quality bar for any story. Items are:
367
+ - Acceptance criteria verified (functional correctness)
368
+ - Code quality (review, tests, CI)
369
+ - Documentation (only when applicable)
370
+ - Product validation (PO sign-off)
371
+
372
+ Story-specific DoD items may be added when genuinely unique to that story
373
+ (e.g., "PCI compliance reviewed" for a payment story), but the default
374
+ checklist should suffice for most stories.
375
+ </guideline>
376
+
377
+ <guideline name="relevant-wiki-selection">
378
+ The Relevant Wiki section is populated by pass 2 using story-wiki.xml.
379
+ It runs AFTER sections 1-8 are complete.
380
+ See story-wiki.xml for detailed selection/exclusion criteria and section structure.
381
+ </guideline>
382
+
383
+ <guideline name="completeness">
384
+ Every run of plan-story should produce a COMPLETE story specification —
385
+ user story, description, all AC scenarios, out-of-scope, dependencies, DoD.
386
+ Do not defer sections to "later passes."
387
+
388
+ Re-running plan-story on the same story is supported for scope changes
389
+ or AC gaps, but is the exception, not the workflow.
390
+ When re-running, increment the metadata refinement count and update
391
+ the "Last refined" date.
392
+ </guideline>
393
+
394
+ </guidelines>
395
+
396
+ <evolution>
397
+
398
+ **Pass 1 — Business Requirements (story.xml → story file):**
399
+ The plan-story command takes the plain-text story seed from the parent feature
400
+ document and fills sections 1-8 (header through DoD).
401
+ All business requirements sections are complete after this pass.
402
+
403
+ **Pass 2 — Wiki Research (story-wiki.xml → story file):**
404
+ A research agent reads the User Story, Description, and AC from pass 1,
405
+ then scans `.docs/wiki/` to populate the Relevant Wiki section with documents
406
+ that inform the technical solution.
407
+
408
+ **Pass 3 — External Analysis (external-solution.xml → external-analysis.md) — OPTIONAL:**
409
+ When the story or feature references external systems, libraries, or reference
410
+ implementations, an agent analyzes that external code/documentation for insights.
411
+ Output is a separate artifact in the story directory — NOT part of the story file.
412
+ Skipped when no external references exist.
413
+
414
+ **Pass 4 — Integration Analysis (integration-solution.xml → integration-analysis.md):**
415
+ An agent reads the wiki references from pass 2 (and external analysis from pass 3
416
+ if present), then explores our own codebase to map affected files, existing APIs,
417
+ code patterns, and architectural constraints for this story.
418
+ Output is a separate artifact in the story directory — NOT part of the story file.
419
+
420
+ **Pass 5 — Technical Solution (story-technical-solution.xml → story file):**
421
+ Consumes ALL prior outputs: story file (requirements + wiki) plus the external
422
+ artifacts (external-analysis.md and integration-analysis.md from story directory).
423
+ Designs the implementation approach and appends the Technical Solution section
424
+ to the story file.
425
+ Story status moves from "Todo" to "Refined" in the parent feature's story index.
426
+
427
+ **Refinement (re-run any pass — exception, not norm):**
428
+ Only when scope changes, new information surfaces, or gaps are found.
429
+ Re-running an earlier pass may invalidate later passes — downstream passes
430
+ and their artifacts should be re-evaluated.
431
+ Updates metadata refinement count and "Last refined" date.
432
+
433
+ **During implementation (/ace:execute-story):**
434
+ Story status moves from Refined to In Progress.
435
+ Claude Code Plan Mode creates an execution plan from the Technical Solution.
436
+ Implementation proceeds (solo or agent teams mode).
437
+ Code review runs (ace-code-reviewer agent).
438
+ NO intermediary commits — changes accumulate until user approval.
439
+
440
+ **Execution Pass E1 — Summary &amp; State (execute-story → story file):**
441
+ After user approves implementation, the Summary &amp; State section is written
442
+ with: status, execution date, duration, commit log, implementation summary,
443
+ deviations from plan, and code review results.
444
+
445
+ **Execution Pass E2 — Wiki Updates (execute-story → story file):**
446
+ After wiki mapper completes, the Wiki Updates section is written with a table
447
+ of wiki documents updated/created during implementation. Tech debt discovered
448
+ during code review is integrated into wiki subsystem docs.
449
+
450
+ **Completion:**
451
+ All AC scenarios verified. DoD checklist complete. Story status moves to Done.
452
+ Parent feature's story index updated. Product backlog updated.
453
+ If GitHub-linked, the issue body is updated with full story content.
454
+ If all stories in the feature are Done, the feature status also moves to Done.
455
+
456
+ </evolution>
457
+
458
+ </story>