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
@@ -1,281 +1,279 @@
1
- <workflow>
2
-
3
- <purpose>
4
- Standalone code review for a story's implementation. The session executing this workflow
5
- IS the code reviewer — it follows the instructions from ace-code-reviewer.md directly.
6
-
7
- Loads story context (AC, Technical Solution, coding standards), identifies changed/created
8
- files, performs 3-level artifact verification, anti-pattern detection, coding standards
9
- enforcement, and tech debt discovery.
10
-
11
- This is a read-only workflow — it does NOT modify code, only reports issues.
12
- </purpose>
13
-
14
- <agent>
15
- This workflow uses the `ace-code-reviewer` agent.
16
- The session executing this workflow IS the code reviewer — it follows the agent's
17
- review process, checklist, stub detection patterns, dead code detection rules,
18
- and report format directly. It does NOT spawn a separate agent.
19
- </agent>
20
-
21
- <mandatory-context>
22
- Read all files referenced by the invoking command's execution-context before starting.
23
- Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
24
- </mandatory-context>
25
-
26
- <process>
27
-
28
- <!-- ══════════════════════════════════════════════════════════════════ -->
29
- <!-- STEP 1: INIT & VALIDATE -->
30
- <!-- ══════════════════════════════════════════════════════════════════ -->
31
-
32
- <step name="init-and-validate" order="1">
33
-
34
- <substep order="1.1" name="parse-arguments">
35
- Parse `$ARGUMENTS` to extract:
36
- - `story` (REQUIRED): file path or GitHub URL/issue number
37
- </substep>
38
-
39
- <substep order="1.2" name="run-init">
40
- Execute environment detection:
41
-
42
- ```bash
43
- INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init execute-story {story_param})
44
- ```
45
-
46
- Parse INIT JSON for:
47
- - `has_git`, `has_gh_cli`, `github_project`
48
- - `story_source`, `story_valid`, `story_error`, `story_content`
49
- - `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
50
- - `has_acceptance_criteria`, `acceptance_criteria_count`
51
- - `has_technical_solution`, `has_wiki_refs`, `has_coding_standards`
52
- - `paths.*`
53
- </substep>
54
-
55
- <substep order="1.3" name="display-banner">
56
- ```
57
- ╔══════════════════════════════════════════════════╗
58
- ║ ACE > Review Story ║
59
- ╚══════════════════════════════════════════════════╝
60
- ```
61
- </substep>
62
-
63
- <substep order="1.4" name="validate-story">
64
- <validation-gate condition="INIT.story_valid is false">
65
- Display `INIT.story_error` and STOP:
66
- ```
67
- x {INIT.story_error}
68
- Provide a valid story file path or GitHub issue.
69
- ```
70
- </validation-gate>
71
-
72
- <validation-gate condition="INIT.has_acceptance_criteria is false">
73
- STOP:
74
- ```
75
- x Story has no acceptance criteria.
76
- Run /ace:plan-story first to define AC scenarios.
77
- ```
78
- </validation-gate>
79
-
80
- <validation-gate condition="INIT.has_technical_solution is false">
81
- STOP:
82
- ```
83
- x Story has no technical solution.
84
- Run /ace:plan-story first to generate the technical solution.
85
- ```
86
- </validation-gate>
87
- </substep>
88
-
89
- <substep order="1.5" name="display-context">
90
- ```
91
- i Story: {INIT.story.id} {INIT.story.title}
92
- Feature: {INIT.feature.id} — {INIT.feature.title}
93
- Status: {INIT.story.status} | Size: {INIT.story.size}
94
- AC scenarios: {INIT.acceptance_criteria_count}
95
- Coding standards: {INIT.has_coding_standards ? "available" : "not found"}
96
- ```
97
- </substep>
98
-
99
- </step>
100
-
101
- <!-- ══════════════════════════════════════════════════════════════════ -->
102
- <!-- STEP 2: LOAD REVIEW CONTEXT -->
103
- <!-- ══════════════════════════════════════════════════════════════════ -->
104
-
105
- <step name="load-context" order="2">
106
-
107
- <substep order="2.1" name="read-story-sections">
108
- Read `INIT.paths.story_file` and extract:
109
- - **Acceptance Criteria** — Gherkin scenarios (what MUST be implemented)
110
- - **Technical Solution** — component breakdown (what files SHOULD exist and what they do)
111
- - **Out of Scope** — what should NOT have been built
112
- </substep>
113
-
114
- <substep order="2.2" name="read-coding-standards">
115
- <variant condition="INIT.has_coding_standards is true">
116
- Read `INIT.paths.coding_standards` — key rules for compliance checking.
117
- </variant>
118
- </substep>
119
-
120
- <substep order="2.3" name="identify-changed-files">
121
- Determine which files to review:
122
-
123
- <variant condition="uncommitted changes exist">
124
- ```bash
125
- git diff --name-only HEAD
126
- git diff --cached --name-only
127
- git status --short
128
- ```
129
- Use changed files as the review scope.
130
- </variant>
131
-
132
- <variant condition="no uncommitted changes">
133
- Use the Technical Solution's artifact list to identify expected files
134
- and check their current state in the codebase.
135
- </variant>
136
-
137
- Display:
138
- ```
139
- i Review scope: {count} files identified
140
- ```
141
- </substep>
142
-
143
- </step>
144
-
145
- <!-- ══════════════════════════════════════════════════════════════════ -->
146
- <!-- STEP 3: EXECUTE REVIEW -->
147
- <!-- -->
148
- <!-- The session IS the reviewer. Follow the review process from -->
149
- <!-- ace-code-reviewer.md (the ace-code-reviewer agent). -->
150
- <!-- ══════════════════════════════════════════════════════════════════ -->
151
-
152
- <step name="execute-review" order="3">
153
-
154
- <substep order="3.1" name="display-banner">
155
- ```
156
- ┌──────────────────────────────────────────────────┐
157
- │ ACE > Review Story > Reviewing │
158
- └──────────────────────────────────────────────────┘
159
- ```
160
- </substep>
161
-
162
- <substep order="3.2" name="3-level-artifact-verification">
163
- For EACH artifact mentioned in the Technical Solution, perform the 3-level
164
- verification as defined in ace-code-reviewer.md:
165
-
166
- <level name="1-exists">
167
- Verify the file exists at the expected path.
168
- ```bash
169
- [ -f "path/to/file" ] &amp;&amp; echo "FOUND" || echo "MISSING"
170
- ```
171
- </level>
172
-
173
- <level name="2-substantive">
174
- Read each file. Check for stub patterns defined in ace-code-reviewer.md's
175
- stub detection section. A substantive file has real logic, real data access,
176
- real rendering — not placeholders, empty handlers, or static returns.
177
- </level>
178
-
179
- <level name="3-wired">
180
- Verify each artifact is imported/referenced AND used by consuming code.
181
- Adapt search patterns to the project's language (as documented in
182
- ace-code-reviewer.md's Level 3 patterns).
183
- </level>
184
-
185
- Build the artifact status matrix (VERIFIED / ORPHANED / STUB / MISSING).
186
- </substep>
187
-
188
- <substep order="3.3" name="run-review-checklist">
189
- Execute the full review checklist from ace-code-reviewer.md:
190
-
191
- <blockers>
192
- <check order="1">Dead codeunused imports, unreferenced functions, orphaned files</check>
193
- <check order="2">Backwards-compatible shims re-exports, deprecated wrappers, underscore renames</check>
194
- <check order="3">Stub implementationsempty returns, placeholder content, no-op handlers</check>
195
- <check order="4">TODO/FIXME/HACK/PLACEHOLDER/XXX comments in new/modified code</check>
196
- <check order="5">Hardcoded valuesmagic numbers, hardcoded URLs, embedded credentials</check>
197
- <check order="6">Missing error handlinguncaught exceptions, unchecked responses</check>
198
- <check order="7">AC coverage gaps — verify EACH Gherkin scenario is implemented</check>
199
- <check order="8">Coding standards violations — mandatory check if standards available</check>
200
- </blockers>
201
-
202
- <warnings>
203
- <check order="9">Console/debug logging left behind</check>
204
- <check order="10">Missing tests for new functionality</check>
205
- <check order="11">Out of scope work — code NOT in the AC</check>
206
- </warnings>
207
-
208
- Use grep, file reads, and code analysis as described in ace-code-reviewer.md's
209
- dead code detection and stub detection sections.
210
- </substep>
211
-
212
- <substep order="3.4" name="discover-tech-debt">
213
- While reviewing, note pre-existing tech debt in files TOUCHED by this story.
214
- Follow the tech debt discovery rules from ace-code-reviewer.md:
215
-
216
- <rules>
217
- <rule>Only flag debt in EXISTING code, not new code (new code issues are blockers)</rule>
218
- <rule>Record: file, subsystem, description, severity, discovering story</rule>
219
- <rule>Severity: high (security/data loss), medium (quality/maintainability), low (cosmetic)</rule>
220
- </rules>
221
-
222
- Output tech debt in YAML format as defined in ace-code-reviewer.md.
223
- </substep>
224
-
225
- </step>
226
-
227
- <!-- ══════════════════════════════════════════════════════════════════ -->
228
- <!-- STEP 4: PRESENT RESULTS -->
229
- <!-- ══════════════════════════════════════════════════════════════════ -->
230
-
231
- <step name="present-results" order="4">
232
- Display the structured review report following ace-code-reviewer.md's report format:
233
-
234
- ```
235
- ╔══════════════════════════════════════════════════╗
236
- ║ ACE > Story Reviewed ║
237
- ║ {INIT.story.id} "{INIT.story.title}" ║
238
- ╚══════════════════════════════════════════════════╝
239
-
240
- { or x} Review complete.
241
-
242
- Status: {passed | issues_found}
243
- Blockers: {count}
244
- Warnings: {count}
245
- Files reviewed: {count}
246
- Artifacts verified: {passed}/{total} (3-level)
247
- AC coverage: {covered}/{total} scenarios
248
- Tech debt discovered: {count} items
249
- ```
250
-
251
- Then display the full report sections:
252
- - Blockers list (if any) — file:line, description, severity, suggested fix
253
- - Warnings list (if any) — file:line, description, severity, suggested fix
254
- - Artifact verification matrix
255
- - AC coverage matrix
256
- - Tech debt YAML (if any)
257
- </step>
258
-
259
- </process>
260
-
261
- <success_criteria>
262
- <criterion>Init function executed (environment detected, story validated)</criterion>
263
- <criterion>Acceptance criteria present STOPPED if missing</criterion>
264
- <criterion>Technical solution present — STOPPED if missing</criterion>
265
- <criterion>Story sections extracted (AC, Technical Solution, Out of Scope)</criterion>
266
- <criterion>Coding standards loaded if available</criterion>
267
- <criterion>Review scope identified (changed files or technical solution artifacts)</criterion>
268
- <criterion>3-level artifact verification completed for EVERY artifact in Technical Solution</criterion>
269
- <criterion>Full review checklist executed (8 blocker checks, 3 warning checks)</criterion>
270
- <criterion>Dead code detection run on all changed files</criterion>
271
- <criterion>Stub detection run on all changed files</criterion>
272
- <criterion>Coding standards compliance checked if standards available</criterion>
273
- <criterion>AC coverage verified every Gherkin scenario checked</criterion>
274
- <criterion>Tech debt in existing code discovered and reported in YAML format</criterion>
275
- <criterion>Structured report displayed following ace-code-reviewer report format</criterion>
276
- <criterion>Completion banner with summary stats displayed</criterion>
277
- <criterion>Next steps displayed</criterion>
278
- <criterion>No code modifications made (read-only review)</criterion>
279
- </success_criteria>
280
-
281
- </workflow>
1
+ <workflow>
2
+
3
+ <purpose>
4
+ Standalone code review for a story's implementation. The session executing this workflow
5
+ IS the code reviewer — it follows the instructions from ace-code-reviewer.md directly.
6
+
7
+ Loads story context (AC, Technical Solution, coding standards), identifies changed/created
8
+ files, performs 3-level artifact verification, anti-pattern detection, coding standards
9
+ enforcement, and tech debt discovery.
10
+
11
+ This is a read-only workflow — it does NOT modify code, only reports issues.
12
+ </purpose>
13
+
14
+ <agent>
15
+ This workflow uses the `ace-code-reviewer` agent.
16
+ The session executing this workflow IS the code reviewer — it follows the agent's
17
+ review process, checklist, stub detection patterns, dead code detection rules,
18
+ and report format directly. It does NOT spawn a separate agent.
19
+ </agent>
20
+
21
+ <mandatory-context>
22
+ All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
23
+ Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
24
+ </mandatory-context>
25
+
26
+ <process>
27
+
28
+ <!-- ══════════════════════════════════════════════════════════════════ -->
29
+ <!-- STEP 1: INIT & VALIDATE -->
30
+ <!-- ══════════════════════════════════════════════════════════════════ -->
31
+
32
+ <step name="init-and-validate" order="1">
33
+
34
+ <substep order="1.1" name="parse-arguments">
35
+ Parse `$ARGUMENTS` to extract:
36
+ - `story` (REQUIRED): file path or GitHub URL/issue number
37
+ </substep>
38
+
39
+ <substep order="1.2" name="run-init">
40
+ Execute environment detection:
41
+
42
+ INIT is available from the preprocessed Environment Context above — do NOT re-run init.
43
+
44
+ Parse INIT JSON for:
45
+ - `has_git`, `has_gh_cli`, `github_project`
46
+ - `story_source`, `story_valid`, `story_error`, `story_content`
47
+ - `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
48
+ - `has_acceptance_criteria`, `acceptance_criteria_count`
49
+ - `has_technical_solution`, `has_wiki_refs`, `has_coding_standards`
50
+ - `paths.*`
51
+ </substep>
52
+
53
+ <substep order="1.3" name="display-banner">
54
+ ```
55
+ ╔══════════════════════════════════════════════════╗
56
+ ║ ACE > Review Story ║
57
+ ╚══════════════════════════════════════════════════╝
58
+ ```
59
+ </substep>
60
+
61
+ <substep order="1.4" name="validate-story">
62
+ <validation-gate condition="INIT.story_valid is false">
63
+ Display `INIT.story_error` and STOP:
64
+ ```
65
+ x {INIT.story_error}
66
+ Provide a valid story file path or GitHub issue.
67
+ ```
68
+ </validation-gate>
69
+
70
+ <validation-gate condition="INIT.has_acceptance_criteria is false">
71
+ STOP:
72
+ ```
73
+ x Story has no acceptance criteria.
74
+ Run /ace:plan-story first to define AC scenarios.
75
+ ```
76
+ </validation-gate>
77
+
78
+ <validation-gate condition="INIT.has_technical_solution is false">
79
+ STOP:
80
+ ```
81
+ x Story has no technical solution.
82
+ Run /ace:plan-story first to generate the technical solution.
83
+ ```
84
+ </validation-gate>
85
+ </substep>
86
+
87
+ <substep order="1.5" name="display-context">
88
+ ```
89
+ i Story: {INIT.story.id} — {INIT.story.title}
90
+ Feature: {INIT.feature.id} — {INIT.feature.title}
91
+ Status: {INIT.story.status} | Size: {INIT.story.size}
92
+ AC scenarios: {INIT.acceptance_criteria_count}
93
+ Coding standards: {INIT.has_coding_standards ? "available" : "not found"}
94
+ ```
95
+ </substep>
96
+
97
+ </step>
98
+
99
+ <!-- ══════════════════════════════════════════════════════════════════ -->
100
+ <!-- STEP 2: LOAD REVIEW CONTEXT -->
101
+ <!-- ══════════════════════════════════════════════════════════════════ -->
102
+
103
+ <step name="load-context" order="2">
104
+
105
+ <substep order="2.1" name="read-story-sections">
106
+ Read `INIT.paths.story_file` and extract:
107
+ - **Acceptance Criteria** — Gherkin scenarios (what MUST be implemented)
108
+ - **Technical Solution** — component breakdown (what files SHOULD exist and what they do)
109
+ - **Out of Scope** — what should NOT have been built
110
+ </substep>
111
+
112
+ <substep order="2.2" name="read-coding-standards">
113
+ <variant condition="INIT.has_coding_standards is true">
114
+ Read `INIT.paths.coding_standards` — key rules for compliance checking.
115
+ </variant>
116
+ </substep>
117
+
118
+ <substep order="2.3" name="identify-changed-files">
119
+ Determine which files to review:
120
+
121
+ <variant condition="uncommitted changes exist">
122
+ ```bash
123
+ git diff --name-only HEAD
124
+ git diff --cached --name-only
125
+ git status --short
126
+ ```
127
+ Use changed files as the review scope.
128
+ </variant>
129
+
130
+ <variant condition="no uncommitted changes">
131
+ Use the Technical Solution's artifact list to identify expected files
132
+ and check their current state in the codebase.
133
+ </variant>
134
+
135
+ Display:
136
+ ```
137
+ i Review scope: {count} files identified
138
+ ```
139
+ </substep>
140
+
141
+ </step>
142
+
143
+ <!-- ══════════════════════════════════════════════════════════════════ -->
144
+ <!-- STEP 3: EXECUTE REVIEW -->
145
+ <!-- -->
146
+ <!-- The session IS the reviewer. Follow the review process from -->
147
+ <!-- ace-code-reviewer.md (the ace-code-reviewer agent). -->
148
+ <!-- ══════════════════════════════════════════════════════════════════ -->
149
+
150
+ <step name="execute-review" order="3">
151
+
152
+ <substep order="3.1" name="display-banner">
153
+ ```
154
+ ┌──────────────────────────────────────────────────┐
155
+ │ ACE > Review Story > Reviewing │
156
+ └──────────────────────────────────────────────────┘
157
+ ```
158
+ </substep>
159
+
160
+ <substep order="3.2" name="3-level-artifact-verification">
161
+ For EACH artifact mentioned in the Technical Solution, perform the 3-level
162
+ verification as defined in ace-code-reviewer.md:
163
+
164
+ <level name="1-exists">
165
+ Verify the file exists at the expected path.
166
+ ```bash
167
+ [ -f "path/to/file" ] &amp;&amp; echo "FOUND" || echo "MISSING"
168
+ ```
169
+ </level>
170
+
171
+ <level name="2-substantive">
172
+ Read each file. Check for stub patterns defined in ace-code-reviewer.md's
173
+ stub detection section. A substantive file has real logic, real data access,
174
+ real rendering not placeholders, empty handlers, or static returns.
175
+ </level>
176
+
177
+ <level name="3-wired">
178
+ Verify each artifact is imported/referenced AND used by consuming code.
179
+ Adapt search patterns to the project's language (as documented in
180
+ ace-code-reviewer.md's Level 3 patterns).
181
+ </level>
182
+
183
+ Build the artifact status matrix (VERIFIED / ORPHANED / STUB / MISSING).
184
+ </substep>
185
+
186
+ <substep order="3.3" name="run-review-checklist">
187
+ Execute the full review checklist from ace-code-reviewer.md:
188
+
189
+ <blockers>
190
+ <check order="1">Dead code — unused imports, unreferenced functions, orphaned files</check>
191
+ <check order="2">Backwards-compatible shims — re-exports, deprecated wrappers, underscore renames</check>
192
+ <check order="3">Stub implementationsempty returns, placeholder content, no-op handlers</check>
193
+ <check order="4">TODO/FIXME/HACK/PLACEHOLDER/XXX comments in new/modified code</check>
194
+ <check order="5">Hardcoded valuesmagic numbers, hardcoded URLs, embedded credentials</check>
195
+ <check order="6">Missing error handling uncaught exceptions, unchecked responses</check>
196
+ <check order="7">AC coverage gaps verify EACH Gherkin scenario is implemented</check>
197
+ <check order="8">Coding standards violationsmandatory check if standards available</check>
198
+ </blockers>
199
+
200
+ <warnings>
201
+ <check order="9">Console/debug logging left behind</check>
202
+ <check order="10">Missing tests for new functionality</check>
203
+ <check order="11">Out of scope work — code NOT in the AC</check>
204
+ </warnings>
205
+
206
+ Use grep, file reads, and code analysis as described in ace-code-reviewer.md's
207
+ dead code detection and stub detection sections.
208
+ </substep>
209
+
210
+ <substep order="3.4" name="discover-tech-debt">
211
+ While reviewing, note pre-existing tech debt in files TOUCHED by this story.
212
+ Follow the tech debt discovery rules from ace-code-reviewer.md:
213
+
214
+ <rules>
215
+ <rule>Only flag debt in EXISTING code, not new code (new code issues are blockers)</rule>
216
+ <rule>Record: file, subsystem, description, severity, discovering story</rule>
217
+ <rule>Severity: high (security/data loss), medium (quality/maintainability), low (cosmetic)</rule>
218
+ </rules>
219
+
220
+ Output tech debt in YAML format as defined in ace-code-reviewer.md.
221
+ </substep>
222
+
223
+ </step>
224
+
225
+ <!-- ══════════════════════════════════════════════════════════════════ -->
226
+ <!-- STEP 4: PRESENT RESULTS -->
227
+ <!-- ══════════════════════════════════════════════════════════════════ -->
228
+
229
+ <step name="present-results" order="4">
230
+ Display the structured review report following ace-code-reviewer.md's report format:
231
+
232
+ ```
233
+ ╔══════════════════════════════════════════════════╗
234
+ ║ ACE > Story Reviewed ║
235
+ ║ {INIT.story.id} "{INIT.story.title}" ║
236
+ ╚══════════════════════════════════════════════════╝
237
+
238
+ {✓ or x} Review complete.
239
+
240
+ Status: {passed | issues_found}
241
+ Blockers: {count}
242
+ Warnings: {count}
243
+ Files reviewed: {count}
244
+ Artifacts verified: {passed}/{total} (3-level)
245
+ AC coverage: {covered}/{total} scenarios
246
+ Tech debt discovered: {count} items
247
+ ```
248
+
249
+ Then display the full report sections:
250
+ - Blockers list (if any) — file:line, description, severity, suggested fix
251
+ - Warnings list (if any) — file:line, description, severity, suggested fix
252
+ - Artifact verification matrix
253
+ - AC coverage matrix
254
+ - Tech debt YAML (if any)
255
+ </step>
256
+
257
+ </process>
258
+
259
+ <success_criteria>
260
+ <criterion>Init function executed (environment detected, story validated)</criterion>
261
+ <criterion>Acceptance criteria present — STOPPED if missing</criterion>
262
+ <criterion>Technical solution present STOPPED if missing</criterion>
263
+ <criterion>Story sections extracted (AC, Technical Solution, Out of Scope)</criterion>
264
+ <criterion>Coding standards loaded if available</criterion>
265
+ <criterion>Review scope identified (changed files or technical solution artifacts)</criterion>
266
+ <criterion>3-level artifact verification completed for EVERY artifact in Technical Solution</criterion>
267
+ <criterion>Full review checklist executed (8 blocker checks, 3 warning checks)</criterion>
268
+ <criterion>Dead code detection run on all changed files</criterion>
269
+ <criterion>Stub detection run on all changed files</criterion>
270
+ <criterion>Coding standards compliance checked if standards available</criterion>
271
+ <criterion>AC coverage verified every Gherkin scenario checked</criterion>
272
+ <criterion>Tech debt in existing code discovered and reported in YAML format</criterion>
273
+ <criterion>Structured report displayed following ace-code-reviewer report format</criterion>
274
+ <criterion>Completion banner with summary stats displayed</criterion>
275
+ <criterion>Next steps displayed</criterion>
276
+ <criterion>No code modifications made (read-only review)</criterion>
277
+ </success_criteria>
278
+
279
+ </workflow>