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,475 +1,473 @@
1
- <workflow>
2
-
3
- <purpose>
4
- Research and curate the Relevant Wiki section for a story specification.
5
- Load the story requirements (User Story, Description, AC), read the parent feature
6
- for broader context, scan `.docs/wiki/` system-wide and subsystem documents,
7
- and compile a curated list of wiki references that directly inform the technical
8
- solution for this story.
9
-
10
- The output is written INTO the story file — populating the `## Relevant Wiki`
11
- section placeholder. If the story has a GitHub issue, the issue body is also updated.
12
-
13
- This is pass 2 of the story specification pipeline (see story.xml composition).
14
- Input: story file with sections 1-8 complete (from pass 1).
15
- Output: `## Relevant Wiki` section appended/replaced in the story file.
16
-
17
- This workflow is executed by the orchestrator directly. It spawns `ace-wiki-mapper`
18
- subagents (via `subagent_type="ace-wiki-mapper"`) for parallel subsystem research.
19
- </purpose>
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
-
25
- Key context files:
26
- - **story-wiki.xml template**: defines the output-format, selection-criteria, and guidelines
27
- for the `## Relevant Wiki` section. The compiled output MUST follow this template exactly.
28
- </mandatory-context>
29
-
30
- <process>
31
-
32
- <!-- ══════════════════════════════════════════════════════════════════ -->
33
- <!-- STEP 1: SETUP -->
34
- <!-- ══════════════════════════════════════════════════════════════════ -->
35
-
36
- <step name="setup" order="1">
37
- **MANDATORY FIRST STEP — Execute environment detection and story initialization:**
38
-
39
- ```bash
40
- INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init research-story {story_param})
41
- ```
42
-
43
- This single call validates the story parameter, extracts metadata/requirements/wiki
44
- references, computes all paths and slugs, and checks artifact existence.
45
-
46
- Parse INIT JSON for:
47
- - **Environment**: `has_git`, `has_gh_cli`, `github_project`, `mapper_model`
48
- - **Story validation**: `story_valid`, `story_error`, `story_source`
49
- - **Story metadata**: `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
50
- - **Requirements**: `user_story`, `description`, `acceptance_criteria_count`
51
- - **Paths**: `paths.*` (story_dir, story_file, feature_dir, feature_file, etc.)
52
- - **Wiki**: `wiki_references` (system_wide, subsystem_docs, total_count), `wiki_docs_exist`
53
- - **Artifacts**: `has_external_analysis`, `has_integration_analysis`, `has_feature_file`
54
-
55
- Display stage banner:
56
-
57
- ```
58
- ╔══════════════════════════════════════════════════╗
59
- ║ ACE > Research Story Wiki ║
60
- ╚══════════════════════════════════════════════════╝
61
- ```
62
-
63
- **If `has_git` is false:** Initialize git:
64
- ```bash
65
- git init
66
- ```
67
-
68
- **If `INIT.story_valid` is false:**
69
- Display error using `INIT.story_error` and exit.
70
-
71
- **Verify wiki exists** — check that `.docs/wiki/` directory exists.
72
- **If wiki not found:**
73
- Display error and exit:
74
- ```
75
- x No wiki found at .docs/wiki/
76
- The wiki must exist before researching story wiki references.
77
- Run /ace:init-wiki or /ace:map-system first.
78
- ```
79
- </step>
80
-
81
- <!-- ══════════════════════════════════════════════════════════════════ -->
82
- <!-- STEP 2: VALIDATE & LOAD STORY -->
83
- <!-- ══════════════════════════════════════════════════════════════════ -->
84
-
85
- <step name="validate-story" order="2">
86
-
87
- **Story validation, parsing, and path computation were completed by
88
- `init research-story` in step 1.** All metadata, requirements, and
89
- paths are available in the INIT JSON.
90
-
91
- Read the story file content for use in wiki research:
92
-
93
- **If `INIT.story_source` is `file`:**
94
- Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
95
-
96
- **If `INIT.story_source` is `github-url` or `issue-number`:**
97
- Fetch the issue body using INIT's GitHub project context:
98
- ```bash
99
- GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
100
- ```
101
- Store as STORY_CONTENT.
102
-
103
- Set pre-computed paths from INIT:
104
- - `STORY_FILE = INIT.paths.story_file`
105
- - `STORY_DIR = INIT.paths.story_dir`
106
-
107
- Display:
108
- ```
109
- i Story loaded: {INIT.story.id} — {INIT.story.title}
110
- Feature: {INIT.feature.id} {INIT.feature.title}
111
- Epic: {INIT.epic.id} — {INIT.epic.title}
112
- Requirements: {INIT.acceptance_criteria_count} acceptance criteria scenarios
113
- ```
114
- </step>
115
-
116
- <!-- ══════════════════════════════════════════════════════════════════ -->
117
- <!-- STEP 3: LOAD FEATURE CONTEXT -->
118
- <!-- ══════════════════════════════════════════════════════════════════ -->
119
-
120
- <step name="load-feature-context" order="3">
121
-
122
- <!-- ── 3a: Read parent feature document ──────────────────────── -->
123
-
124
- **If `INIT.has_feature_file` is true:**
125
- Read the feature document at `INIT.paths.feature_file` and extract:
126
- - Feature scope and description
127
- - Other stories in the feature and their relationships
128
- - Subsystems or components mentioned in the feature
129
- Store as FEATURE_CONTEXT.
130
-
131
- **If `INIT.has_feature_file` is false:**
132
- Proceed without log a note but do not fail.
133
-
134
- <!-- ── 3b: Check for feature-level relevant-wiki hint ─────────── -->
135
-
136
- Check if a feature-level relevant-wiki file exists at:
137
- `{INIT.paths.feature_dir}/relevant-wiki.md`
138
-
139
- **If exists:** Read it. This file provides a HINT for which subsystems and
140
- wiki documents are likely relevant. Use it as a starting point for subsystem
141
- identification — but still verify each document's relevance to THIS story.
142
- Store as FEATURE_WIKI_HINTS.
143
-
144
- **If not exists:** Proceed without. This is optional.
145
-
146
- Display:
147
- ```
148
- i Feature context: {loaded | not found}
149
- Feature wiki hints: {loaded | not found}
150
- ```
151
- </step>
152
-
153
- <!-- ══════════════════════════════════════════════════════════════════ -->
154
- <!-- STEP 4: CURATE SYSTEM-WIDE WIKI DOCS -->
155
- <!-- ══════════════════════════════════════════════════════════════════ -->
156
-
157
- <step name="include-system-wide" order="4">
158
-
159
- The four system-wide wiki documents are ALWAYS included — no reading or
160
- assessment needed. They are mandatory context for every story implementation.
161
-
162
- Set SYSTEM_WIDE_REFS to the fixed list:
163
- - `.docs/wiki/system-wide/system-structure.md` — Mandatory system-wide context
164
- - `.docs/wiki/system-wide/system-architecture.md` — Mandatory system-wide context
165
- - `.docs/wiki/system-wide/coding-standards.md` — Mandatory system-wide context
166
- - `.docs/wiki/system-wide/testing-framework.md` Mandatory system-wide context
167
-
168
- **Do NOT read these files.** The implementing agent (pass 5) will read them.
169
- This step only ensures they appear in the output.
170
- </step>
171
-
172
- <!-- ══════════════════════════════════════════════════════════════════ -->
173
- <!-- STEP 5: IDENTIFY AFFECTED SUBSYSTEMS -->
174
- <!-- ══════════════════════════════════════════════════════════════════ -->
175
-
176
- <step name="identify-subsystems" order="5">
177
-
178
- Read `.docs/wiki/system-wide/system-architecture.md` to understand subsystem
179
- boundaries, responsibilities, and how they interact. This is the ONE system-wide
180
- doc worth reading during wiki research it maps the subsystem landscape.
181
-
182
- Then analyze the story requirements (User Story, Description, AC) and feature context
183
- against the architecture doc to determine which subsystems are affected by this story.
184
-
185
- Sources for subsystem identification:
186
- 1. **System architecture doc**: subsystem boundaries, responsibilities, integration points
187
- 2. **Story content**: keywords, component names, service names in the AC
188
- 3. **Feature context**: subsystems mentioned in the parent feature document
189
- 4. **Feature wiki hints**: subsystems listed in the feature-level relevant-wiki.md
190
- 5. **Wiki subsystem list**: compare against `wiki_subsystem_names` from INIT
191
-
192
- For each identified subsystem, verify it exists in `.docs/wiki/subsystems/`:
193
- ```bash
194
- ls .docs/wiki/subsystems/
195
- ```
196
-
197
- Store the list of affected subsystem names as AFFECTED_SUBSYSTEMS.
198
-
199
- **If no subsystems identified:**
200
- Display:
201
- ```
202
- i No specific subsystems identified. Wiki research limited to system-wide docs.
203
- ```
204
- Skip to step 7.
205
-
206
- **If subsystems identified:**
207
- Display:
208
- ```
209
- i Affected subsystems: {subsystem1}, {subsystem2}, ...
210
- Spawning wiki research agents...
211
- ```
212
- </step>
213
-
214
- <!-- ══════════════════════════════════════════════════════════════════ -->
215
- <!-- STEP 6: PARALLEL SUBSYSTEM WIKI RESEARCH -->
216
- <!-- ══════════════════════════════════════════════════════════════════ -->
217
-
218
- <step name="subsystem-research" order="6">
219
-
220
- For each subsystem in AFFECTED_SUBSYSTEMS, spawn an ace-wiki-mapper agent
221
- to read and assess the subsystem's wiki documents for relevance to THIS story.
222
-
223
- **IMPORTANT**: Spawn agents IN PARALLEL when there are multiple subsystems.
224
- Each agent reads the subsystem's wiki docs and returns ONLY a list of relevant
225
- files with reasons — it does NOT write any files.
226
-
227
- For each subsystem, spawn:
228
-
229
- ```
230
- Task(
231
- prompt="Focus: wiki-curation-for-story
232
-
233
- You are assessing wiki documents in a single subsystem for relevance to a story.
234
- DO NOT write or modify any files. ONLY read and assess.
235
-
236
- Story context:
237
- - Story: {Story ID} — {Story Title}
238
- - User Story: {user_story_statement}
239
- - Description: {description}
240
- - Acceptance Criteria: {all_AC_scenarios}
241
- - Feature: {Feature ID} — {Feature Title}
242
-
243
- Subsystem to investigate: {subsystem_name}
244
- Subsystem wiki path: .docs/wiki/subsystems/{subsystem_name}/
245
-
246
- Instructions:
247
- 1. List all files in .docs/wiki/subsystems/{subsystem_name}/ recursively
248
- 2. Read each document (structure.md, architecture.md, and any docs in
249
- systems/, patterns/, cross-cutting/, guides/, walkthroughs/, decisions/ subdirectories)
250
- 3. For each document, assess: does it directly inform the technical solution
251
- for THIS story? Apply these criteria:
252
- - INCLUDE if: describes a system this story modifies/extends, documents a
253
- pattern this story must follow, covers a cross-cutting concern this story
254
- must respect, contains a guide for a task this story requires, records an
255
- ADR that constrains design choices
256
- - EXCLUDE if: only tangentially related, describes something the story reads
257
- but doesn't modify, would be nice-to-know but doesn't change implementation
258
-
259
- 4. Return your findings in this EXACT format:
260
-
261
- RELEVANT_FILES:
262
- - `.docs/wiki/subsystems/{subsystem_name}/{path}` — {one-line reason}
263
- - `.docs/wiki/subsystems/{subsystem_name}/{path}` — {one-line reason}
264
-
265
- NOT_RELEVANT:
266
- - `.docs/wiki/subsystems/{subsystem_name}/{path}` {one-line reason for exclusion}
267
-
268
- If NO documents are relevant, return RELEVANT_FILES with no entries.
269
- Do NOT write any files. Return text only.",
270
- subagent_type="ace-wiki-mapper",
271
- model="{MAPPER_MODEL}",
272
- run_in_background=true,
273
- description="Wiki research: {subsystem_name}"
274
- )
275
- ```
276
-
277
- Wait for ALL agents to complete. Collect their RELEVANT_FILES lists.
278
- Merge into a single list: SUBSYSTEM_REFS.
279
-
280
- Display:
281
- ```
282
- i Subsystem research complete.
283
- {N} relevant docs found across {M} subsystems.
284
- ```
285
- </step>
286
-
287
- <!-- ══════════════════════════════════════════════════════════════════ -->
288
- <!-- STEP 7: COMPILE RELEVANT WIKI SECTION -->
289
- <!-- ══════════════════════════════════════════════════════════════════ -->
290
-
291
- <step name="compile-output" order="7">
292
-
293
- Compile the final `## Relevant Wiki` section by combining:
294
- 1. SYSTEM_WIDE_REFS (always present — the four mandatory system-wide docs)
295
- 2. SUBSYSTEM_REFS (from parallel agent research — may be empty)
296
-
297
- Group subsystem references by wiki document type:
298
- - **Systems**: files under `subsystems/*/systems/`
299
- - **Patterns**: files under `subsystems/*/patterns/`
300
- - **Cross-Cutting Concerns**: files under `subsystems/*/cross-cutting/`
301
- - **Guides**: files under `subsystems/*/guides/`
302
- - **Walkthroughs**: files under `subsystems/*/walkthroughs/`
303
- - **Decisions**: files under `subsystems/*/decisions/`
304
- - **Architecture**: `subsystems/*/architecture.md` files
305
- - **Structure**: `subsystems/*/structure.md` files (include under Systems category)
306
-
307
- Omit any category header that has zero entries.
308
- The `### System-Wide` header is NEVER omitted.
309
-
310
- Follow the output-format defined in story-wiki.xml template exactly.
311
-
312
- Store the compiled markdown as WIKI_SECTION.
313
- </step>
314
-
315
- <!-- ══════════════════════════════════════════════════════════════════ -->
316
- <!-- STEP 8: WRITE TO STORY FILE -->
317
- <!-- ══════════════════════════════════════════════════════════════════ -->
318
-
319
- <step name="write-output" order="8">
320
-
321
- <!-- ── 8a: Write to local story file ──────────────────────────── -->
322
-
323
- Read the current STORY_FILE content.
324
-
325
- **If the story file contains a `## Relevant Wiki` section placeholder:**
326
- Replace the placeholder section (from `## Relevant Wiki` up to the next `## `
327
- heading or end of file) with WIKI_SECTION.
328
-
329
- **If the story file does NOT contain a `## Relevant Wiki` section:**
330
- Append WIKI_SECTION after the `## Definition of Done` section
331
- (before `## Technical Solution` if it exists, otherwise before the metadata section).
332
-
333
- Write the updated content back to STORY_FILE.
334
-
335
- Display:
336
- ```
337
- + Relevant Wiki section written to {STORY_FILE}
338
- ```
339
-
340
- <!-- ── 8b: Update GitHub issue (if applicable) ───────────────── -->
341
-
342
- **If the story was loaded from GitHub OR the story file header contains a GitHub link:**
343
-
344
- Extract the issue number from the story.
345
-
346
- **If `has_gh_cli` is true AND issue number is available:**
347
-
348
- Read the current GitHub issue body:
349
- ```bash
350
- GH_BODY=$(gh issue view {issue_number} --repo {REPO} --json body -q .body)
351
- ```
352
-
353
- Replace or append the `## Relevant Wiki` section in the issue body
354
- (same logic as local file — find and replace existing section, or append).
355
-
356
- Update the issue:
357
- ```bash
358
- gh issue edit {issue_number} --repo {REPO} --body "{updated_body}"
359
- ```
360
-
361
- Display:
362
- ```
363
- + GitHub issue #{issue_number} updated with Relevant Wiki section.
364
- ```
365
-
366
- **If GitHub CLI not available or no issue number:**
367
- Display:
368
- ```
369
- i No GitHub issue to update. Local file only.
370
- ```
371
- </step>
372
-
373
- <!-- ══════════════════════════════════════════════════════════════════ -->
374
- <!-- STEP 9: VALIDATION -->
375
- <!-- ══════════════════════════════════════════════════════════════════ -->
376
-
377
- <step name="validation" order="9">
378
-
379
- Re-read STORY_FILE and verify:
380
-
381
- **Content Requirements:**
382
- - [ ] `## Relevant Wiki` section exists in the story file
383
- - [ ] `### System-Wide` subsection is present with all four docs listed
384
- - [ ] Subsystem references (if any) are grouped by wiki document type
385
- - [ ] Each subsystem reference has a one-line reason
386
- - [ ] No empty category headers (omit categories with zero entries)
387
- - [ ] No placeholder text left unfilled
388
- - [ ] File paths use backtick formatting
389
-
390
- **Quality Requirements:**
391
- - [ ] Subsystem reasons are story-specific, not generic ("related to auth" = FAIL)
392
- - [ ] Only directly relevant subsystem docs included (no tangential references)
393
- - [ ] Markdown renders cleanly (no broken formatting)
394
-
395
- **Total: 10 mandatory checklist items**
396
-
397
- If any check fails, fix the issue before proceeding.
398
-
399
- Display:
400
- ```
401
- {check_mark} Relevant Wiki validated. {passed}/{total} checks passed.
402
- ```
403
- </step>
404
-
405
- <!-- ══════════════════════════════════════════════════════════════════ -->
406
- <!-- STEP 10: REVIEW -->
407
- <!-- ══════════════════════════════════════════════════════════════════ -->
408
-
409
- <step name="review" order="10">
410
-
411
- Display a summary:
412
- ```
413
- Wiki Research Summary:
414
- ────────
415
- System-wide docs: 4
416
- Subsystem docs: {N}
417
- Subsystems scanned: {M}
418
- Total references: {4 + N}
419
- ```
420
-
421
- Use AskUserQuestion:
422
- - header: "Wiki"
423
- - question: "Relevant Wiki section written to `{STORY_FILE}`. Does it look comprehensive?"
424
- - options:
425
- - "Approve" — Looks good
426
- - "Refine" — Some references are missing or incorrect
427
-
428
- **If "Approve":**
429
-
430
- Display completion:
431
- ```
432
- ╔══════════════════════════════════════════════════╗
433
- ║ ACE > Story Wiki Research Complete ║
434
- ║ {Story ID} "{Story Title}" ║
435
- ╚══════════════════════════════════════════════════╝
436
-
437
- + {STORY_FILE} updated.
438
-
439
- References:
440
- ────────
441
- System-wide: 4 | Subsystem: {N} | Total: {4 + N}
442
-
443
- i Wiki research complete. The Relevant Wiki section is now
444
- part of the story file and will be used by pass 5
445
- (technical solution) to load implementation context.
446
-
447
- Next > Continue with story refinement:
448
- - /ace:research-external-solution — analyze external reference systems
449
- - /ace:plan-story — continue the story pipeline
450
- ```
451
-
452
- **If "Refine":**
453
- - Ask what references are missing or incorrect
454
- - Go back to the relevant step (re-read wiki docs, adjust references)
455
- - Re-validate (step 9) and present for review again
456
- </step>
457
-
458
- </process>
459
-
460
- <success_criteria>
461
- - Story loaded and requirements extracted (User Story, Description, AC)
462
- - Parent feature document loaded for broader context (if available)
463
- - Feature-level relevant-wiki.md checked for subsystem hints (if exists)
464
- - All four system-wide wiki docs included (fixed list, not read)
465
- - Affected subsystems identified from story content and feature context
466
- - Parallel ace-wiki-mapper agents spawned for each affected subsystem
467
- - Agent results collected and merged into categorized references
468
- - Relevant Wiki section compiled following story-wiki.xml template
469
- - Story file updated with the Relevant Wiki section
470
- - GitHub issue updated (if applicable)
471
- - All 10 validation checklist items verified
472
- - User reviewed and approved the output
473
- </success_criteria>
474
-
475
- </workflow>
1
+ <workflow>
2
+
3
+ <purpose>
4
+ Research and curate the Relevant Wiki section for a story specification.
5
+ Load the story requirements (User Story, Description, AC), read the parent feature
6
+ for broader context, scan `.docs/wiki/` system-wide and subsystem documents,
7
+ and compile a curated list of wiki references that directly inform the technical
8
+ solution for this story.
9
+
10
+ The output is written INTO the story file — populating the `## Relevant Wiki`
11
+ section placeholder. If the story has a GitHub issue, the issue body is also updated.
12
+
13
+ This is pass 2 of the story specification pipeline (see story.xml composition).
14
+ Input: story file with sections 1-8 complete (from pass 1).
15
+ Output: `## Relevant Wiki` section appended/replaced in the story file.
16
+
17
+ This workflow is executed by the orchestrator directly. It spawns `ace-wiki-mapper`
18
+ subagents (via `subagent_type="ace-wiki-mapper"`) for parallel subsystem research.
19
+ </purpose>
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
+
25
+ Key context files:
26
+ - **story-wiki.xml template**: defines the output-format, selection-criteria, and guidelines
27
+ for the `## Relevant Wiki` section. The compiled output MUST follow this template exactly.
28
+ </mandatory-context>
29
+
30
+ <process>
31
+
32
+ <!-- ══════════════════════════════════════════════════════════════════ -->
33
+ <!-- STEP 1: SETUP -->
34
+ <!-- ══════════════════════════════════════════════════════════════════ -->
35
+
36
+ <step name="setup" order="1">
37
+ **MANDATORY FIRST STEP — Execute environment detection and story initialization:**
38
+
39
+ INIT is available from the preprocessed Environment Context above — do NOT re-run init.
40
+
41
+ This preprocessing validated the story parameter, extracted metadata/requirements/wiki
42
+ references, computed all paths and slugs, and checked artifact existence.
43
+
44
+ Parse INIT JSON for:
45
+ - **Environment**: `has_git`, `has_gh_cli`, `github_project`, `mapper_model`
46
+ - **Story validation**: `story_valid`, `story_error`, `story_source`
47
+ - **Story metadata**: `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
48
+ - **Requirements**: `user_story`, `description`, `acceptance_criteria_count`
49
+ - **Paths**: `paths.*` (story_dir, story_file, feature_dir, feature_file, etc.)
50
+ - **Wiki**: `wiki_references` (system_wide, subsystem_docs, total_count), `wiki_docs_exist`
51
+ - **Artifacts**: `has_external_analysis`, `has_integration_analysis`, `has_feature_file`
52
+
53
+ Display stage banner:
54
+
55
+ ```
56
+ ╔══════════════════════════════════════════════════╗
57
+ ║ ACE > Research Story Wiki ║
58
+ ╚══════════════════════════════════════════════════╝
59
+ ```
60
+
61
+ **If `has_git` is false:** Initialize git:
62
+ ```bash
63
+ git init
64
+ ```
65
+
66
+ **If `INIT.story_valid` is false:**
67
+ Display error using `INIT.story_error` and exit.
68
+
69
+ **Verify wiki exists** check that `.docs/wiki/` directory exists.
70
+ **If wiki not found:**
71
+ Display error and exit:
72
+ ```
73
+ x No wiki found at .docs/wiki/
74
+ The wiki must exist before researching story wiki references.
75
+ Run /ace:init-wiki or /ace:map-system first.
76
+ ```
77
+ </step>
78
+
79
+ <!-- ══════════════════════════════════════════════════════════════════ -->
80
+ <!-- STEP 2: VALIDATE & LOAD STORY -->
81
+ <!-- ══════════════════════════════════════════════════════════════════ -->
82
+
83
+ <step name="validate-story" order="2">
84
+
85
+ **Story validation, parsing, and path computation were completed by
86
+ `init research-story` in step 1.** All metadata, requirements, and
87
+ paths are available in the INIT JSON.
88
+
89
+ Read the story file content for use in wiki research:
90
+
91
+ **If `INIT.story_source` is `file`:**
92
+ Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
93
+
94
+ **If `INIT.story_source` is `github-url` or `issue-number`:**
95
+ Fetch the issue body using INIT's GitHub project context:
96
+ ```bash
97
+ GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
98
+ ```
99
+ Store as STORY_CONTENT.
100
+
101
+ Set pre-computed paths from INIT:
102
+ - `STORY_FILE = INIT.paths.story_file`
103
+ - `STORY_DIR = INIT.paths.story_dir`
104
+
105
+ Display:
106
+ ```
107
+ i Story loaded: {INIT.story.id} — {INIT.story.title}
108
+ Feature: {INIT.feature.id} — {INIT.feature.title}
109
+ Epic: {INIT.epic.id} — {INIT.epic.title}
110
+ Requirements: {INIT.acceptance_criteria_count} acceptance criteria scenarios
111
+ ```
112
+ </step>
113
+
114
+ <!-- ══════════════════════════════════════════════════════════════════ -->
115
+ <!-- STEP 3: LOAD FEATURE CONTEXT -->
116
+ <!-- ══════════════════════════════════════════════════════════════════ -->
117
+
118
+ <step name="load-feature-context" order="3">
119
+
120
+ <!-- ── 3a: Read parent feature document ──────────────────────── -->
121
+
122
+ **If `INIT.has_feature_file` is true:**
123
+ Read the feature document at `INIT.paths.feature_file` and extract:
124
+ - Feature scope and description
125
+ - Other stories in the feature and their relationships
126
+ - Subsystems or components mentioned in the feature
127
+ Store as FEATURE_CONTEXT.
128
+
129
+ **If `INIT.has_feature_file` is false:**
130
+ Proceed without — log a note but do not fail.
131
+
132
+ <!-- ── 3b: Check for feature-level relevant-wiki hint ─────────── -->
133
+
134
+ Check if a feature-level relevant-wiki file exists at:
135
+ `{INIT.paths.feature_dir}/relevant-wiki.md`
136
+
137
+ **If exists:** Read it. This file provides a HINT for which subsystems and
138
+ wiki documents are likely relevant. Use it as a starting point for subsystem
139
+ identification but still verify each document's relevance to THIS story.
140
+ Store as FEATURE_WIKI_HINTS.
141
+
142
+ **If not exists:** Proceed without. This is optional.
143
+
144
+ Display:
145
+ ```
146
+ i Feature context: {loaded | not found}
147
+ Feature wiki hints: {loaded | not found}
148
+ ```
149
+ </step>
150
+
151
+ <!-- ══════════════════════════════════════════════════════════════════ -->
152
+ <!-- STEP 4: CURATE SYSTEM-WIDE WIKI DOCS -->
153
+ <!-- ══════════════════════════════════════════════════════════════════ -->
154
+
155
+ <step name="include-system-wide" order="4">
156
+
157
+ The four system-wide wiki documents are ALWAYS included — no reading or
158
+ assessment needed. They are mandatory context for every story implementation.
159
+
160
+ Set SYSTEM_WIDE_REFS to the fixed list:
161
+ - `.docs/wiki/system-wide/system-structure.md` — Mandatory system-wide context
162
+ - `.docs/wiki/system-wide/system-architecture.md` Mandatory system-wide context
163
+ - `.docs/wiki/system-wide/coding-standards.md` — Mandatory system-wide context
164
+ - `.docs/wiki/system-wide/testing-framework.md` — Mandatory system-wide context
165
+
166
+ **Do NOT read these files.** The implementing agent (pass 5) will read them.
167
+ This step only ensures they appear in the output.
168
+ </step>
169
+
170
+ <!-- ══════════════════════════════════════════════════════════════════ -->
171
+ <!-- STEP 5: IDENTIFY AFFECTED SUBSYSTEMS -->
172
+ <!-- ══════════════════════════════════════════════════════════════════ -->
173
+
174
+ <step name="identify-subsystems" order="5">
175
+
176
+ Read `.docs/wiki/system-wide/system-architecture.md` to understand subsystem
177
+ boundaries, responsibilities, and how they interact. This is the ONE system-wide
178
+ doc worth reading during wiki research it maps the subsystem landscape.
179
+
180
+ Then analyze the story requirements (User Story, Description, AC) and feature context
181
+ against the architecture doc to determine which subsystems are affected by this story.
182
+
183
+ Sources for subsystem identification:
184
+ 1. **System architecture doc**: subsystem boundaries, responsibilities, integration points
185
+ 2. **Story content**: keywords, component names, service names in the AC
186
+ 3. **Feature context**: subsystems mentioned in the parent feature document
187
+ 4. **Feature wiki hints**: subsystems listed in the feature-level relevant-wiki.md
188
+ 5. **Wiki subsystem list**: compare against `wiki_subsystem_names` from INIT
189
+
190
+ For each identified subsystem, verify it exists in `.docs/wiki/subsystems/`:
191
+ ```bash
192
+ ls .docs/wiki/subsystems/
193
+ ```
194
+
195
+ Store the list of affected subsystem names as AFFECTED_SUBSYSTEMS.
196
+
197
+ **If no subsystems identified:**
198
+ Display:
199
+ ```
200
+ i No specific subsystems identified. Wiki research limited to system-wide docs.
201
+ ```
202
+ Skip to step 7.
203
+
204
+ **If subsystems identified:**
205
+ Display:
206
+ ```
207
+ i Affected subsystems: {subsystem1}, {subsystem2}, ...
208
+ Spawning wiki research agents...
209
+ ```
210
+ </step>
211
+
212
+ <!-- ══════════════════════════════════════════════════════════════════ -->
213
+ <!-- STEP 6: PARALLEL SUBSYSTEM WIKI RESEARCH -->
214
+ <!-- ══════════════════════════════════════════════════════════════════ -->
215
+
216
+ <step name="subsystem-research" order="6">
217
+
218
+ For each subsystem in AFFECTED_SUBSYSTEMS, spawn an ace-wiki-mapper agent
219
+ to read and assess the subsystem's wiki documents for relevance to THIS story.
220
+
221
+ **IMPORTANT**: Spawn agents IN PARALLEL when there are multiple subsystems.
222
+ Each agent reads the subsystem's wiki docs and returns ONLY a list of relevant
223
+ files with reasons it does NOT write any files.
224
+
225
+ For each subsystem, spawn:
226
+
227
+ ```
228
+ Task(
229
+ prompt="Focus: wiki-curation-for-story
230
+
231
+ You are assessing wiki documents in a single subsystem for relevance to a story.
232
+ DO NOT write or modify any files. ONLY read and assess.
233
+
234
+ Story context:
235
+ - Story: {Story ID} — {Story Title}
236
+ - User Story: {user_story_statement}
237
+ - Description: {description}
238
+ - Acceptance Criteria: {all_AC_scenarios}
239
+ - Feature: {Feature ID} — {Feature Title}
240
+
241
+ Subsystem to investigate: {subsystem_name}
242
+ Subsystem wiki path: .docs/wiki/subsystems/{subsystem_name}/
243
+
244
+ Instructions:
245
+ 1. List all files in .docs/wiki/subsystems/{subsystem_name}/ recursively
246
+ 2. Read each document (structure.md, architecture.md, and any docs in
247
+ systems/, patterns/, cross-cutting/, guides/, walkthroughs/, decisions/ subdirectories)
248
+ 3. For each document, assess: does it directly inform the technical solution
249
+ for THIS story? Apply these criteria:
250
+ - INCLUDE if: describes a system this story modifies/extends, documents a
251
+ pattern this story must follow, covers a cross-cutting concern this story
252
+ must respect, contains a guide for a task this story requires, records an
253
+ ADR that constrains design choices
254
+ - EXCLUDE if: only tangentially related, describes something the story reads
255
+ but doesn't modify, would be nice-to-know but doesn't change implementation
256
+
257
+ 4. Return your findings in this EXACT format:
258
+
259
+ RELEVANT_FILES:
260
+ - `.docs/wiki/subsystems/{subsystem_name}/{path}` — {one-line reason}
261
+ - `.docs/wiki/subsystems/{subsystem_name}/{path}` — {one-line reason}
262
+
263
+ NOT_RELEVANT:
264
+ - `.docs/wiki/subsystems/{subsystem_name}/{path}` — {one-line reason for exclusion}
265
+
266
+ If NO documents are relevant, return RELEVANT_FILES with no entries.
267
+ Do NOT write any files. Return text only.",
268
+ subagent_type="ace-wiki-mapper",
269
+ model="{MAPPER_MODEL}",
270
+ run_in_background=true,
271
+ description="Wiki research: {subsystem_name}"
272
+ )
273
+ ```
274
+
275
+ Wait for ALL agents to complete. Collect their RELEVANT_FILES lists.
276
+ Merge into a single list: SUBSYSTEM_REFS.
277
+
278
+ Display:
279
+ ```
280
+ i Subsystem research complete.
281
+ {N} relevant docs found across {M} subsystems.
282
+ ```
283
+ </step>
284
+
285
+ <!-- ══════════════════════════════════════════════════════════════════ -->
286
+ <!-- STEP 7: COMPILE RELEVANT WIKI SECTION -->
287
+ <!-- ══════════════════════════════════════════════════════════════════ -->
288
+
289
+ <step name="compile-output" order="7">
290
+
291
+ Compile the final `## Relevant Wiki` section by combining:
292
+ 1. SYSTEM_WIDE_REFS (always present — the four mandatory system-wide docs)
293
+ 2. SUBSYSTEM_REFS (from parallel agent research may be empty)
294
+
295
+ Group subsystem references by wiki document type:
296
+ - **Systems**: files under `subsystems/*/systems/`
297
+ - **Patterns**: files under `subsystems/*/patterns/`
298
+ - **Cross-Cutting Concerns**: files under `subsystems/*/cross-cutting/`
299
+ - **Guides**: files under `subsystems/*/guides/`
300
+ - **Walkthroughs**: files under `subsystems/*/walkthroughs/`
301
+ - **Decisions**: files under `subsystems/*/decisions/`
302
+ - **Architecture**: `subsystems/*/architecture.md` files
303
+ - **Structure**: `subsystems/*/structure.md` files (include under Systems category)
304
+
305
+ Omit any category header that has zero entries.
306
+ The `### System-Wide` header is NEVER omitted.
307
+
308
+ Follow the output-format defined in story-wiki.xml template exactly.
309
+
310
+ Store the compiled markdown as WIKI_SECTION.
311
+ </step>
312
+
313
+ <!-- ══════════════════════════════════════════════════════════════════ -->
314
+ <!-- STEP 8: WRITE TO STORY FILE -->
315
+ <!-- ══════════════════════════════════════════════════════════════════ -->
316
+
317
+ <step name="write-output" order="8">
318
+
319
+ <!-- ── 8a: Write to local story file ──────────────────────────── -->
320
+
321
+ Read the current STORY_FILE content.
322
+
323
+ **If the story file contains a `## Relevant Wiki` section placeholder:**
324
+ Replace the placeholder section (from `## Relevant Wiki` up to the next `## `
325
+ heading or end of file) with WIKI_SECTION.
326
+
327
+ **If the story file does NOT contain a `## Relevant Wiki` section:**
328
+ Append WIKI_SECTION after the `## Definition of Done` section
329
+ (before `## Technical Solution` if it exists, otherwise before the metadata section).
330
+
331
+ Write the updated content back to STORY_FILE.
332
+
333
+ Display:
334
+ ```
335
+ + Relevant Wiki section written to {STORY_FILE}
336
+ ```
337
+
338
+ <!-- ── 8b: Update GitHub issue (if applicable) ───────────────── -->
339
+
340
+ **If the story was loaded from GitHub OR the story file header contains a GitHub link:**
341
+
342
+ Extract the issue number from the story.
343
+
344
+ **If `has_gh_cli` is true AND issue number is available:**
345
+
346
+ Read the current GitHub issue body:
347
+ ```bash
348
+ GH_BODY=$(gh issue view {issue_number} --repo {REPO} --json body -q .body)
349
+ ```
350
+
351
+ Replace or append the `## Relevant Wiki` section in the issue body
352
+ (same logic as local file — find and replace existing section, or append).
353
+
354
+ Update the issue:
355
+ ```bash
356
+ gh issue edit {issue_number} --repo {REPO} --body "{updated_body}"
357
+ ```
358
+
359
+ Display:
360
+ ```
361
+ + GitHub issue #{issue_number} updated with Relevant Wiki section.
362
+ ```
363
+
364
+ **If GitHub CLI not available or no issue number:**
365
+ Display:
366
+ ```
367
+ i No GitHub issue to update. Local file only.
368
+ ```
369
+ </step>
370
+
371
+ <!-- ══════════════════════════════════════════════════════════════════ -->
372
+ <!-- STEP 9: VALIDATION -->
373
+ <!-- ══════════════════════════════════════════════════════════════════ -->
374
+
375
+ <step name="validation" order="9">
376
+
377
+ Re-read STORY_FILE and verify:
378
+
379
+ **Content Requirements:**
380
+ - [ ] `## Relevant Wiki` section exists in the story file
381
+ - [ ] `### System-Wide` subsection is present with all four docs listed
382
+ - [ ] Subsystem references (if any) are grouped by wiki document type
383
+ - [ ] Each subsystem reference has a one-line reason
384
+ - [ ] No empty category headers (omit categories with zero entries)
385
+ - [ ] No placeholder text left unfilled
386
+ - [ ] File paths use backtick formatting
387
+
388
+ **Quality Requirements:**
389
+ - [ ] Subsystem reasons are story-specific, not generic ("related to auth" = FAIL)
390
+ - [ ] Only directly relevant subsystem docs included (no tangential references)
391
+ - [ ] Markdown renders cleanly (no broken formatting)
392
+
393
+ **Total: 10 mandatory checklist items**
394
+
395
+ If any check fails, fix the issue before proceeding.
396
+
397
+ Display:
398
+ ```
399
+ {check_mark} Relevant Wiki validated. {passed}/{total} checks passed.
400
+ ```
401
+ </step>
402
+
403
+ <!-- ══════════════════════════════════════════════════════════════════ -->
404
+ <!-- STEP 10: REVIEW -->
405
+ <!-- ══════════════════════════════════════════════════════════════════ -->
406
+
407
+ <step name="review" order="10">
408
+
409
+ Display a summary:
410
+ ```
411
+ Wiki Research Summary:
412
+ ────────
413
+ System-wide docs: 4
414
+ Subsystem docs: {N}
415
+ Subsystems scanned: {M}
416
+ Total references: {4 + N}
417
+ ```
418
+
419
+ Use AskUserQuestion:
420
+ - header: "Wiki"
421
+ - question: "Relevant Wiki section written to `{STORY_FILE}`. Does it look comprehensive?"
422
+ - options:
423
+ - "Approve" Looks good
424
+ - "Refine" — Some references are missing or incorrect
425
+
426
+ **If "Approve":**
427
+
428
+ Display completion:
429
+ ```
430
+ ╔══════════════════════════════════════════════════╗
431
+ ║ ACE > Story Wiki Research Complete ║
432
+ ║ {Story ID} "{Story Title}" ║
433
+ ╚══════════════════════════════════════════════════╝
434
+
435
+ + {STORY_FILE} updated.
436
+
437
+ References:
438
+ ────────
439
+ System-wide: 4 | Subsystem: {N} | Total: {4 + N}
440
+
441
+ i Wiki research complete. The Relevant Wiki section is now
442
+ part of the story file and will be used by pass 5
443
+ (technical solution) to load implementation context.
444
+
445
+ Next > Continue with story refinement:
446
+ - /ace:research-external-solution — analyze external reference systems
447
+ - /ace:plan-story continue the story pipeline
448
+ ```
449
+
450
+ **If "Refine":**
451
+ - Ask what references are missing or incorrect
452
+ - Go back to the relevant step (re-read wiki docs, adjust references)
453
+ - Re-validate (step 9) and present for review again
454
+ </step>
455
+
456
+ </process>
457
+
458
+ <success_criteria>
459
+ - Story loaded and requirements extracted (User Story, Description, AC)
460
+ - Parent feature document loaded for broader context (if available)
461
+ - Feature-level relevant-wiki.md checked for subsystem hints (if exists)
462
+ - All four system-wide wiki docs included (fixed list, not read)
463
+ - Affected subsystems identified from story content and feature context
464
+ - Parallel ace-wiki-mapper agents spawned for each affected subsystem
465
+ - Agent results collected and merged into categorized references
466
+ - Relevant Wiki section compiled following story-wiki.xml template
467
+ - Story file updated with the Relevant Wiki section
468
+ - GitHub issue updated (if applicable)
469
+ - All 10 validation checklist items verified
470
+ - User reviewed and approved the output
471
+ </success_criteria>
472
+
473
+ </workflow>