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,763 +1,761 @@
1
- <workflow>
2
-
3
- <purpose>
4
- Design a COMPREHENSIVE TECHNICAL SOLUTION for a specific story. Load the story
5
- requirements and wiki references, validate inputs, load wiki documents, integration
6
- analysis (MANDATORY), and optional external analysis, then execute exhaustive
7
- solution design following the template's analysis-process phases. Write the
8
- technical solution directly INTO the story file and update the GitHub issue.
9
-
10
- This is pass 5 of the story specification pipeline (see story.xml composition).
11
- The technical solution is APPENDED to the story file as the `## Technical Solution`
12
- section. No separate artifact file is produced.
13
-
14
- Output is written to:
15
- - The story file (appended/replaced `## Technical Solution` section)
16
- - The GitHub issue body (if applicable)
17
-
18
- This workflow is executed by the `ace-technical-application-architect` agent
19
- (spawned via `subagent_type="ace-technical-application-architect"`).
20
- </purpose>
21
-
22
- <mandatory-context>
23
- Read all files referenced by the invoking command's execution-context before starting.
24
- Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
25
- </mandatory-context>
26
-
27
- <process>
28
-
29
- <!-- ══════════════════════════════════════════════════════════════════ -->
30
- <!-- STEP 1: SETUP -->
31
- <!-- ══════════════════════════════════════════════════════════════════ -->
32
-
33
- <step name="setup" order="1">
34
- **MANDATORY FIRST STEP — Execute environment detection and story initialization:**
35
-
36
- ```bash
37
- INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init research-story {story_param})
38
- ```
39
-
40
- This single call validates the story parameter, extracts metadata/requirements/wiki
41
- references, computes all paths and slugs, and checks artifact existence.
42
-
43
- Parse INIT JSON for:
44
- - **Environment**: `has_git`, `has_gh_cli`, `github_project`, `analyst_model`
45
- - **Story validation**: `story_valid`, `story_error`, `story_source`
46
- - **Story metadata**: `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
47
- - **Requirements**: `user_story`, `description`, `acceptance_criteria_count`
48
- - **Paths**: `paths.*` (story_dir, story_file, integration_analysis_file, external_analysis_file, feature_dir, feature_file, etc.)
49
- - **Wiki**: `wiki_references` (system_wide, subsystem_docs, total_count), `wiki_docs_exist`
50
- - **Artifacts**: `has_external_analysis`, `has_integration_analysis`, `has_feature_file`
51
-
52
- Display stage banner:
53
-
54
- ```
55
- ╔══════════════════════════════════════════════════════════════╗
56
- ║ ACE > Research Technical Solution ║
57
- ╚══════════════════════════════════════════════════════════════╝
58
- ```
59
-
60
- **If `has_git` is false:** Initialize git:
61
- ```bash
62
- git init
63
- ```
64
-
65
- **If `INIT.story_valid` is false:**
66
- Display error using `INIT.story_error` and exit.
67
- </step>
68
-
69
- <!-- ══════════════════════════════════════════════════════════════════ -->
70
- <!-- STEP 2: VALIDATE & LOAD STORY -->
71
- <!-- ══════════════════════════════════════════════════════════════════ -->
72
-
73
- <step name="validate-story" order="2">
74
-
75
- **Story validation, parsing, metadata extraction, wiki reference extraction,
76
- and path computation were all completed by `init research-story` in step 1.**
77
- All data is available in the INIT JSON.
78
-
79
- Read the story file content for analysis context:
80
-
81
- **If `INIT.story_source` is `file`:**
82
- Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
83
-
84
- **If `INIT.story_source` is `github-url` or `issue-number`:**
85
- Fetch the issue body using INIT's GitHub project context:
86
- ```bash
87
- GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
88
- ```
89
- Store as STORY_CONTENT.
90
-
91
- The story's User Story, Description, and Acceptance Criteria (from `INIT.user_story`,
92
- `INIT.description`, `INIT.acceptance_criteria_count`) define WHAT functionality to
93
- design a technical solution for. The wiki references (from `INIT.wiki_references`)
94
- define WHICH wiki documents to read for codebase context.
95
-
96
- <!-- ── 2b: Load parent feature document ────────────────────────── -->
97
-
98
- **If `INIT.has_feature_file` is true:**
99
- Read the feature document at `INIT.paths.feature_file` and extract:
100
- - Feature description, scope, and the COMPLETE feature vision
101
- - List of all stories in the feature (IDs, titles, descriptions)
102
- - Dependencies between stories
103
- - Shared components or services mentioned
104
- Store as FEATURE_CONTENT.
105
-
106
- **If `INIT.has_feature_file` is false:**
107
- Proceed without the solution can still be designed without feature context.
108
-
109
- <!-- ── 2c: Display ───────────────────────────────────────────────── -->
110
-
111
- Set pre-computed paths from INIT:
112
- - `STORY_FILE = INIT.paths.story_file`
113
- - `STORY_DIR = INIT.paths.story_dir`
114
-
115
- Display:
116
- ```
117
- i Story loaded: {INIT.story.id} — {INIT.story.title}
118
- Feature: {INIT.feature.id} {INIT.feature.title}
119
- Epic: {INIT.epic.id} {INIT.epic.title}
120
- Requirements: {INIT.acceptance_criteria_count} acceptance criteria scenarios
121
- Wiki references: {INIT.wiki_references.total_count} documents to load
122
- ```
123
- </step>
124
-
125
- <!-- ══════════════════════════════════════════════════════════════════ -->
126
- <!-- STEP 3: LOAD WIKI DOCUMENTS -->
127
- <!-- ══════════════════════════════════════════════════════════════════ -->
128
-
129
- <step name="load-wiki-documents" order="3">
130
-
131
- **[MANDATORY] Read ALL wiki documents referenced in the story's Relevant Wiki section.**
132
-
133
- Wiki references were pre-extracted by `init research-story` and are available in
134
- `INIT.wiki_references` (system_wide list + subsystem_docs list). File existence
135
- was also pre-checked see `INIT.wiki_docs_exist` (existing[] and missing[]).
136
-
137
- The wiki IS the single source of codebase knowledge.
138
-
139
- <!-- ── 3a: System-Wide documents (mandatory) ────────────────────── -->
140
-
141
- **System-Wide documents ALWAYS load these (from `INIT.wiki_references.system_wide`):**
142
-
143
- Read each file and store its content:
144
- - `.docs/wiki/system-wide/system-structure.md` — High-level tree showing where code is
145
- - `.docs/wiki/system-wide/system-architecture.md` — Complete architectural overview
146
- - `.docs/wiki/system-wide/coding-standards.md` — **CRITICAL: Read BEFORE generating any solution code — NO EXCEPTIONS**
147
- - `.docs/wiki/system-wide/testing-framework.md` Testing patterns and frameworks
148
-
149
- **STRONG EMPHASIS on coding-standards.md**: This file MUST be read and internalized
150
- BEFORE any class diagrams, interfaces, code snippets, or implementation patterns
151
- are produced. Every piece of code in the solution MUST comply with coding standards.
152
-
153
- **For any file in `INIT.wiki_docs_exist.missing`:** Display warning (non-fatal):
154
- ```
155
- ! Wiki document not found: {path}
156
- Continuing without it.
157
- ```
158
-
159
- <!-- ── 3b: Subsystem documents ──────────────────────────────────── -->
160
-
161
- **Subsystem documents load all from `INIT.wiki_references.subsystem_docs`:**
162
-
163
- For EACH entry in `INIT.wiki_references.subsystem_docs`:
164
- 1. Check if the path is in `INIT.wiki_docs_exist.existing` (already verified)
165
- 2. If exists: read the file completely, store its content keyed by file path
166
- 3. If missing: display warning (non-fatal) and continue
167
-
168
- These subsystem documents provide the context that replaces:
169
- - "documentation" parameter — wiki docs cover all relevant documentation
170
- - "high-level-architecture" — system-architecture.md provides this
171
- - "sourcecode" parameter system-structure.md has a high-level tree
172
- - "related-stories-implementations" — wiki documents capture knowledge from all stories
173
- - "documented-features" — wiki documents catalog existing feature implementations
174
- - "feature-planning" the feature file provides this context
175
-
176
- <!-- ── 3c: Display ───────────────────────────────────────────────── -->
177
-
178
- Display:
179
- ```
180
- i Wiki documents loaded: {INIT.wiki_docs_exist.existing.length}/{INIT.wiki_references.total_count} files
181
- System-wide: {count}/4 | Subsystem: {INIT.wiki_references.subsystem_docs.length} documents
182
- Missing: {INIT.wiki_docs_exist.missing.length} (warnings shown above if any)
183
- ```
184
- </step>
185
-
186
- <!-- ══════════════════════════════════════════════════════════════════ -->
187
- <!-- STEP 4: LOAD INTEGRATION ANALYSIS (MANDATORY) -->
188
- <!-- ══════════════════════════════════════════════════════════════════ -->
189
-
190
- <step name="load-integration-analysis" order="4">
191
-
192
- **Integration analysis existence was pre-checked by `init research-story`.**
193
-
194
- The integration analysis is produced by pass 4 (`/ace:research-integration-solution`).
195
- It is a MANDATORY input — the technical solution CANNOT be designed without it.
196
-
197
- **If `INIT.has_integration_analysis` is true:**
198
- Read the file at `INIT.paths.integration_analysis_file`. Store as INTEGRATION_ANALYSIS_CONTENT.
199
- Display:
200
- ```
201
- i Integration analysis found: {INIT.paths.integration_analysis_file}
202
- Will use integration points, refactoring needs, and codebase patterns
203
- to design a seamless technical solution.
204
- ```
205
-
206
- **If `INIT.has_integration_analysis` is false:**
207
- Display error and EXIT:
208
- ```
209
- x Integration analysis NOT FOUND at {INIT.paths.integration_analysis_file}
210
- The integration analysis (pass 4) is MANDATORY for technical solution design.
211
- Run /ace:research-integration-solution first.
212
- ```
213
- **STOP — do not proceed without integration analysis.**
214
- </step>
215
-
216
- <!-- ══════════════════════════════════════════════════════════════════ -->
217
- <!-- STEP 5: CHECK FOR EXTERNAL ANALYSIS (OPTIONAL) -->
218
- <!-- ══════════════════════════════════════════════════════════════════ -->
219
-
220
- <step name="check-external-analysis" order="5">
221
-
222
- **External analysis existence was pre-checked by `init research-story`.**
223
-
224
- The external analysis is produced by pass 3 (`/ace:research-external-solution`).
225
- It is NOT a required input, but when present it provides valuable context about
226
- how external/industry-standard systems implement this functionality.
227
-
228
- **If `INIT.has_external_analysis` is true:**
229
- Read the file at `INIT.paths.external_analysis_file`. Store as EXTERNAL_ANALYSIS_CONTENT.
230
- Display:
231
- ```
232
- i External analysis found: {INIT.paths.external_analysis_file}
233
- Will consider external system algorithms and patterns where they are
234
- the MOST EFFICIENT AND PERFORMANT approach.
235
- ```
236
-
237
- **If `INIT.has_external_analysis` is false:**
238
- Set EXTERNAL_ANALYSIS_CONTENT = null.
239
- Display:
240
- ```
241
- i No external analysis found. Technical solution will rely on
242
- wiki documents, integration analysis, and Clean Architecture principles.
243
- ```
244
- </step>
245
-
246
- <!-- ══════════════════════════════════════════════════════════════════ -->
247
- <!-- STEP 6: CHECK EXISTING SOLUTION -->
248
- <!-- ══════════════════════════════════════════════════════════════════ -->
249
-
250
- <step name="check-existing" order="6">
251
-
252
- Check if the story file already contains a `## Technical Solution` section.
253
-
254
- **If the story file contains `## Technical Solution` with substantive content
255
- (more than just the placeholder comment):**
256
-
257
- Use AskUserQuestion:
258
- - header: "Existing"
259
- - question: "The story already contains a Technical Solution section. What would you like to do?"
260
- - options:
261
- - "Overwrite" — Discard and create a new solution from scratch
262
- - "Skip" Keep the current solution as-is
263
-
264
- **If "Overwrite":** Continue to step 7.
265
- **If "Skip":** Display message and exit workflow:
266
- ```
267
- i Keeping existing technical solution. No changes made.
268
- ```
269
-
270
- **If no existing solution:** Continue to step 7.
271
- </step>
272
-
273
- <!-- ══════════════════════════════════════════════════════════════════ -->
274
- <!-- STEP 7: EXECUTE SOLUTION DESIGN -->
275
- <!-- ══════════════════════════════════════════════════════════════════ -->
276
-
277
- <step name="execute-solution-design" order="7">
278
-
279
- Display:
280
- ```
281
- ┌──────────────────────────────────────────────────────────────┐
282
- │ ACE > Research Technical Solution > Design │
283
- └──────────────────────────────────────────────────────────────┘
284
-
285
- i Starting comprehensive technical solution design.
286
- Reading wiki documents, integration analysis, coding standards,
287
- and designing architecture. This may take several minutes.
288
- ```
289
-
290
- **Execute the complete solution design following the template's `&lt;analysis-process&gt;` section.**
291
- The template (`story-technical-solution.xml`) defines the mandatory phases.
292
- You ARE the technical-application-architect — perform the design directly.
293
-
294
- <!-- ═══════════════════════════════════════════════════════════ -->
295
- <!-- Phase 1: INITIAL DISCOVERY -->
296
- <!-- ═══════════════════════════════════════════════════════════ -->
297
-
298
- <phase name="initial-discovery" order="1">
299
-
300
- <item name="understand-story" mandatory="true">
301
- **[MANDATORY] Understand the Story:**
302
-
303
- - If story is a file path: Read the markdown file directly
304
- - If story is GitHub URL/number: Use GitHub CLI (`gh issue view`)
305
- - Fully understand what functionality needs to be implemented
306
- - Identify ALL acceptance criteria scenarios (each will need a sequence diagram)
307
- </item>
308
-
309
- <item name="extract-business-requirements" mandatory="true">
310
- **[MANDATORY] Extract Business Requirements from Story:**
311
-
312
- - Thoroughly analyze the story's User Story, Description, and Acceptance Criteria
313
- - Extract business requirements and constraints
314
- - **CRITICAL**: Identify ALL scenarios from Acceptance Criteria each will need a sequence diagram
315
- - Understand the business context and value
316
- - The story IS the source of truth for business requirements
317
- </item>
318
-
319
- <item name="study-external-analysis" mandatory="false">
320
- **[CONDITIONAL] Study External/Industry-Standard Analysis:**
321
-
322
- **WHEN TO RUN**: Only if EXTERNAL_ANALYSIS_CONTENT is available.
323
-
324
- The external analysis provides insights from industry-standard implementations.
325
- **USE WITH JUDGMENT** extract and use:
326
-
327
- - **Algorithms**: Use the same algorithms IF they are the MOST EFFICIENT AND PERFORMANT.
328
- If you can identify a better approach, use the better approach.
329
- - **Formulas**: Use the same mathematical formulas and calculations IF they are optimal.
330
- If you know a more efficient formula, use it.
331
- - **Constants**: Consider the same constant values and thresholds as starting points.
332
- - **Business Logic**: Adopt proven business rules and validations.
333
- - **Design Patterns**: Follow their patterns where they align with Clean Architecture.
334
- - **Data Structures**: Use similar data models where appropriate.
335
- - **Event Flows**: Consider their event handling approaches.
336
- - **Error Handling**: Adopt their error handling strategies where they fit.
337
-
338
- **CRITICAL PHILOSOPHY**: The external analysis is a REFERENCE, not a blueprint.
339
- Use external patterns when they are the most efficient and performant approach.
340
- Improve upon them when you can identify a better way.
341
- </item>
342
-
343
- <item name="feature-planning-context" mandatory="true">
344
- **[MANDATORY] Feature Planning Context (from feature file):**
345
-
346
- If FEATURE_CONTENT is available, analyze it for:
347
-
348
- - **Feature Scope**: What is the COMPLETE feature trying to achieve?
349
- - **Story Dependencies**: Which stories must be completed before/after this one?
350
- - **Shared Components**: What components are used by MULTIPLE stories?
351
- - **Data Flow Between Stories**: How does data flow from one story to another?
352
- - **Integration Points**: Where do stories connect and interact?
353
- - **Feature-Level Patterns**: What patterns span across all stories?
354
-
355
- Use this to:
356
- - Ensure this story aligns with the overall feature architecture
357
- - Design components that can be reused by other stories
358
- - Create interfaces that support future stories
359
- - Avoid creating silosthink feature-wide!
360
-
361
- **NEVER DESIGN IN ISOLATION** Consider the complete feature!
362
-
363
- If no feature file available, proceed but note this in the solution.
364
- </item>
365
-
366
- </phase>
367
-
368
- <!-- ═══════════════════════════════════════════════════════════ -->
369
- <!-- Phase 2: OUR SYSTEM ARCHITECTURE UNDERSTANDING -->
370
- <!-- ═══════════════════════════════════════════════════════════ -->
371
-
372
- <phase name="system-architecture-understanding" order="2">
373
-
374
- <item name="comprehensive-architecture" mandatory="true">
375
- **[MANDATORY] Comprehensive System Architecture (from wiki):**
376
-
377
- Using the wiki documents loaded in step 3:
378
-
379
- - **system-architecture.md**: FULLY review for COMPREHENSIVE architectural overview
380
- - Understand the complete system architecture (not just the story)
381
- - Identify architectural layers and their responsibilities
382
- - Map where this story's components will fit in the overall architecture
383
- - Understand existing patterns and conventions
384
-
385
- - **system-structure.md**: Understand the codebase layout,
386
- where relevant code lives, and the project file organization
387
- </item>
388
-
389
- <item name="wiki-subsystem-knowledge" mandatory="true">
390
- **[MANDATORY] Subsystem Knowledge (from wiki documents):**
391
-
392
- Using the subsystem wiki documents loaded in step 3, study ALL:
393
-
394
- - **Systems**: Understand system descriptions, boundaries, and APIs
395
- that relate to this story
396
- - **Patterns**: Catalog design patterns in use (Strategy, Factory, Observer, etc.)
397
- that MUST be followed for consistency
398
- - **Decisions (ADRs)**: Architecture Decision Records that constrain design choices
399
- - **Cross-Cutting Concerns**: Shared concerns to respect (auth, logging, errors, etc.)
400
- - **Guides**: Implementation guides for common tasks relevant to this story
401
- - **Walkthroughs**: Deep tutorial-style flow explanations with actual code snippets
402
-
403
- These wiki documents replace the obsolete command's parameters:
404
- - "related-stories-implementations" — wiki captures this knowledge
405
- - "documented-features" — wiki catalogs existing implementations
406
- - "documentation" wiki IS the documentation
407
-
408
- **Extract from wiki documents:**
409
-
410
- ```yaml
411
- INTERFACES TO EXTEND (not recreate):
412
- - [Interface name and location from wiki]
413
-
414
- CLASSES TO COMPOSE (not duplicate):
415
- - [Class name and location from wiki]
416
-
417
- PATTERNS PROVEN SUCCESSFUL:
418
- - [Pattern and where documented in wiki]
419
-
420
- CONSTANTS TO REUSE (not duplicate):
421
- - [Constant file and values from wiki]
422
- ```
423
- </item>
424
-
425
- <item name="integration-analysis-study" mandatory="true">
426
- **[MANDATORY] Deep Study of Integration Analysis:**
427
-
428
- **THOROUGHLY ANALYZE** the INTEGRATION_ANALYSIS_CONTENT (from step 4).
429
- **CRITICAL**: This document tells you EXACTLY how to integrate without breaking the codebase.
430
-
431
- **Extract ALL:**
432
- - **Integration Points**: Where the new code connects to existing code
433
- - **Required Refactoring**: What existing code MUST be refactored for proper integration
434
- - **Patterns to Follow**: Existing patterns that MUST be followed
435
- - **Files to Modify**: Which existing files need changes
436
- - **Dependencies**: What the new code depends on and what depends on it
437
- - **Hardcoded Values**: All hardcoded values and placeholder code that MUST be replaced
438
- - **Architecture Compatibility**: How the story fits into Clean Architecture layers
439
- - **Testing Strategy**: How to test without breaking existing tests
440
-
441
- **USE THIS TO:**
442
- - Design refactoring strategies that maintain extensibility
443
- - Ensure seamless integration without breaking existing functionality
444
- - Keep the codebase maintainable and follow SOLID principles
445
-
446
- **NEVER SKIP REFACTORING** if the integration analysis identifies it's needed!
447
- </item>
448
-
449
- </phase>
450
-
451
- <!-- ═══════════════════════════════════════════════════════════ -->
452
- <!-- Phase 3: CODEBASE ANALYSIS -->
453
- <!-- ═══════════════════════════════════════════════════════════ -->
454
-
455
- <phase name="codebase-analysis" order="3">
456
-
457
- <item name="coding-standards-review" mandatory="true">
458
- **[MANDATORY] Coding Standards Review:**
459
-
460
- **CRITICAL** — Read and internalize `.docs/wiki/system-wide/coding-standards.md`
461
- BEFORE generating ANY solution code, class diagrams, or interfaces.
462
-
463
- Verify you understand and will enforce:
464
- - Zero hardcoding rules
465
- - Single responsibility (one class/interface/type per file!)
466
- - Interface-first design (code against interfaces)
467
- - No assumptions — verify by reading actual code
468
- - No dead code policy
469
- - File size limits
470
- - Naming conventions
471
- - Layer placement rules
472
-
473
- **EVERY piece of code in the technical solution MUST comply with coding standards.**
474
- </item>
475
-
476
- <item name="source-code-analysis" mandatory="true">
477
- **[MANDATORY] Source Code Analysis (guided by wiki and integration analysis):**
478
-
479
- Using system-structure.md as guide, and integration analysis for specific files:
480
- - Identify existing patterns and structures
481
- - Find reusable components and services
482
- - Map current layer structures
483
- - Document naming conventions
484
- - Identify external dependencies and APIs
485
-
486
- **Focus on files identified by the integration analysis** — don't search blindly.
487
- </item>
488
-
489
- </phase>
490
-
491
- <!-- ═══════════════════════════════════════════════════════════ -->
492
- <!-- Phase 4: SOLUTION DESIGN -->
493
- <!-- ═══════════════════════════════════════════════════════════ -->
494
-
495
- <phase name="solution-design" order="4">
496
-
497
- After loading all context from phases 1-3, you should have:
498
- - Complete understanding of the story and business requirements
499
- - Knowledge of industry standard approaches (if external analysis available)
500
- - Full system architecture understanding from wiki
501
- - Feature context and story dependencies
502
- - Codebase patterns and conventions from wiki
503
- - Integration requirements and constraints from integration analysis
504
- - Coding standards internalized
505
-
506
- Use ALL this information to design a viable technical solution that:
507
- - Respects Clean Architecture principles
508
- - Follows established patterns from wiki
509
- - Integrates seamlessly per integration analysis
510
- - Maintains extensibility
511
- - Enables testability
512
- - Strictly follows coding standards
513
-
514
- **Generate the complete technical solution following the template's `&lt;output-format&gt;`
515
- section in story-technical-solution.xml. This includes ALL of the following sections.**
516
-
517
- </phase>
518
-
519
- </step>
520
-
521
- <!-- ══════════════════════════════════════════════════════════════════ -->
522
- <!-- STEP 8: WRITE OUTPUT TO STORY FILE -->
523
- <!-- ══════════════════════════════════════════════════════════════════ -->
524
-
525
- <step name="write-output" order="8">
526
-
527
- **Write the complete technical solution INTO the story file.**
528
-
529
- The output follows the template's `&lt;output-format&gt;` section exactly.
530
- It includes ALL sections from the design phases above.
531
-
532
- <!-- ── 8a: Write to local story file ──────────────────────────── -->
533
-
534
- Read the current STORY_FILE content.
535
-
536
- **If the story file contains a `## Technical Solution` section placeholder:**
537
- Replace the placeholder section (from `## Technical Solution` up to the next `## `
538
- heading or end-of-file metadata section `---`) with the full technical solution.
539
-
540
- **If the story file does NOT contain a `## Technical Solution` section:**
541
- Append the technical solution after the `## Relevant Wiki` section
542
- (before the metadata section `---` at the end if it exists).
543
-
544
- Write the updated content back to STORY_FILE using the Write or Edit tool.
545
-
546
- Display:
547
- ```
548
- + Technical solution written to {STORY_FILE}
549
- ```
550
-
551
- <!-- ── 8b: Update GitHub issue (if applicable) ───────────────── -->
552
-
553
- **If the story was loaded from GitHub OR the story file header contains a GitHub link:**
554
-
555
- Extract the issue number from the story.
556
-
557
- **If `has_gh_cli` is true AND issue number is available:**
558
-
559
- Read the current GitHub issue body:
560
- ```bash
561
- GH_BODY=$(gh issue view {issue_number} --repo {REPO} --json body -q .body)
562
- ```
563
-
564
- Replace or append the `## Technical Solution` section in the issue body
565
- (same logic as local file — find and replace existing section, or append).
566
-
567
- Update the issue:
568
- ```bash
569
- gh issue edit {issue_number} --repo {REPO} --body "{updated_body}"
570
- ```
571
-
572
- Display:
573
- ```
574
- + GitHub issue #{issue_number} updated with Technical Solution section.
575
- ```
576
-
577
- **If GitHub CLI not available or no issue number:**
578
- Display:
579
- ```
580
- i No GitHub issue to update. Local file only.
581
- ```
582
- </step>
583
-
584
- <!-- ══════════════════════════════════════════════════════════════════ -->
585
- <!-- STEP 9: VALIDATION -->
586
- <!-- ══════════════════════════════════════════════════════════════════ -->
587
-
588
- <step name="validation" order="9">
589
-
590
- Read the story file and verify the technical solution against the validation
591
- checklist defined in the template (story-technical-solution.xml):
592
-
593
- **Story File Requirements:**
594
- - [ ] Technical solution section exists in the story file
595
- - [ ] Section contains all required subsections from template
596
-
597
- **Architecture Requirements:**
598
- - [ ] Component and Boundary Architecture with Mermaid diagram
599
- - [ ] Layer Architecture Analysis (Domain, Application, Infrastructure, Presentation)
600
- - [ ] Clean Architecture compliance verified (dependencies point inward)
601
- - [ ] Dependency injection strategy documented
602
-
603
- **Design Requirements:**
604
- - [ ] Design patterns documented with purpose and implementation
605
- - [ ] Technical decisions documented with rationale and trade-offs
606
- - [ ] Class diagrams with complete interface definitions
607
- - [ ] EVERY interface/class/type in its OWN SEPARATE FILE (coding standards!)
608
- - [ ] Data models and structures defined with TypeScript types
609
-
610
- **Algorithm Requirements:**
611
- - [ ] Algorithms documented with mathematical formulas
612
- - [ ] Constants and configuration values defined (NO hardcoding!)
613
- - [ ] Business rules documented with implementations
614
- - [ ] Example calculations provided
615
-
616
- **Sequence Diagram Requirements (CRITICAL!):**
617
- - [ ] Sequence diagram for EVERY AC scenario
618
- - [ ] Full flow from entry point to exit through ALL layers
619
- - [ ] Real method names used (not generic placeholders)
620
- - [ ] Error handling paths included (alt blocks)
621
- - [ ] Data structures shown at each step
622
-
623
- **Implementation Requirements:**
624
- - [ ] Complete file structure tree (new + modified files)
625
- - [ ] DI container configuration specified
626
- - [ ] Refactoring plan from integration analysis incorporated
627
- - [ ] Testing strategy (unit, integration, e2e)
628
- - [ ] Implementation order with dependencies
629
- - [ ] Implementation checklist
630
-
631
- **Compliance Requirements:**
632
- - [ ] Coding standards compliance verified throughout
633
- - [ ] Integration analysis findings incorporated
634
- - [ ] No hardcoded values in any code snippets
635
- - [ ] All code follows Clean Architecture layers
636
-
637
- **Total: 25 mandatory checklist items**
638
-
639
- If the output is incomplete or missing sections, go back and fill in
640
- the missing content before proceeding.
641
-
642
- Display:
643
- ```
644
- {check_mark} Solution validated. {passed}/{total} checks passed.
645
- ```
646
- </step>
647
-
648
- <!-- ══════════════════════════════════════════════════════════════════ -->
649
- <!-- STEP 10: REVIEW AND APPROVE -->
650
- <!-- ══════════════════════════════════════════════════════════════════ -->
651
-
652
- <step name="review" order="10">
653
-
654
- Display a summary of the solution:
655
- ```
656
- Solution Summary:
657
- ────────
658
- Sections: {count}/13 | Checklist: {passed}/25
659
- Wiki docs loaded: {N} | Integration analysis: loaded
660
- External analysis: {loaded/not found}
661
- AC scenarios: {M} | Sequence diagrams: {M}
662
- New files: {F} | Modified files: {G}
663
- Design patterns: {P} | Refactoring items: {R}
664
- ```
665
-
666
- Use AskUserQuestion:
667
- - header: "Solution"
668
- - question: "Technical solution written to `{STORY_FILE}`. Review the file in your editor does the solution look comprehensive?"
669
- - options:
670
- - "Approve" — Looks good, commit it
671
- - "Refine" — Some sections need more depth
672
- - "Skip commit" — Keep the file but don't commit yet
673
-
674
- **If "Approve":**
675
- Continue to step 11.
676
-
677
- **If "Refine":**
678
- - Ask what sections need more depth or what's missing
679
- - Go back to the relevant design phase, read more code, and update the story file
680
- - Re-run validation (step 9)
681
- - Present for review again
682
-
683
- **If "Skip commit":**
684
- Display completion without commit:
685
- ```
686
- ╔══════════════════════════════════════════════════════════════╗
687
- ║ ACE > Technical Solution Complete (uncommitted) ║
688
- ║ {Story ID} "{Story Title}" ║
689
- ╚══════════════════════════════════════════════════════════════╝
690
-
691
- i Technical solution written to {STORY_FILE}
692
- File not committed — commit manually when ready.
693
- ```
694
- Exit workflow.
695
- </step>
696
-
697
- <!-- ══════════════════════════════════════════════════════════════════ -->
698
- <!-- STEP 11: COMMIT -->
699
- <!-- ══════════════════════════════════════════════════════════════════ -->
700
-
701
- <step name="commit" order="11">
702
-
703
- Stage and commit the story file:
704
-
705
- ```bash
706
- git add {STORY_FILE}
707
- ```
708
-
709
- ```bash
710
- git commit -m "docs: technical solution for {Story ID} — {Story Title}"
711
- ```
712
-
713
- Display completion:
714
-
715
- ```
716
- ╔══════════════════════════════════════════════════════════════╗
717
- ║ ACE > Technical Solution Complete ║
718
- ║ {Story ID} "{Story Title}" ║
719
- ╚══════════════════════════════════════════════════════════════╝
720
-
721
- + {STORY_FILE} committed.
722
-
723
- Metrics:
724
- ────────
725
- Wiki docs loaded: {N} | Integration analysis: incorporated
726
- External analysis: {incorporated/not available}
727
- AC scenarios covered: {M} sequence diagrams
728
- New files designed: {F} | Modified files: {G}
729
-
730
- i Technical solution complete. The story is now fully refined
731
- (pass 5) and ready for implementation.
732
-
733
- Next > Continue with story execution:
734
- - /ace:execute-story story=... Implement the story
735
- - /ace:research-technical-solution story=... — Design another story
736
- - /ace:help — Check project initialization status
737
- ```
738
- </step>
739
-
740
- </process>
741
-
742
- <success_criteria>
743
- - Story loaded and requirements extracted (User Story, Description, Acceptance Criteria)
744
- - All wiki references extracted from story's Relevant Wiki section
745
- - All wiki documents loaded (system-wide mandatory, subsystem as referenced)
746
- - Coding standards read and internalized BEFORE generating solution code
747
- - Parent feature document loaded for broader context (if available)
748
- - Integration analysis loaded and studied (MANDATORY exit if missing)
749
- - External analysis loaded if present in story directory (auto-detected, OPTIONAL)
750
- - All 4 design phases executed (Initial Discovery, System Architecture, Codebase Analysis, Solution Design)
751
- - Technical solution written to story file with ALL template sections populated
752
- - Sequence diagrams created for EVERY acceptance criteria scenario
753
- - Every interface/class/type designed as its own separate file
754
- - NO hardcoded values in any code snippets
755
- - All code follows Clean Architecture layers and coding standards
756
- - Integration analysis findings fully incorporated (refactoring, patterns, hardcoded values)
757
- - All 25 validation checklist items verified
758
- - GitHub issue updated with technical solution (if applicable)
759
- - User reviewed and approved the solution
760
- - Document committed with appropriate message
761
- </success_criteria>
762
-
763
- </workflow>
1
+ <workflow>
2
+
3
+ <purpose>
4
+ Design a COMPREHENSIVE TECHNICAL SOLUTION for a specific story. Load the story
5
+ requirements and wiki references, validate inputs, load wiki documents, integration
6
+ analysis (MANDATORY), and optional external analysis, then execute exhaustive
7
+ solution design following the template's analysis-process phases. Write the
8
+ technical solution directly INTO the story file and update the GitHub issue.
9
+
10
+ This is pass 5 of the story specification pipeline (see story.xml composition).
11
+ The technical solution is APPENDED to the story file as the `## Technical Solution`
12
+ section. No separate artifact file is produced.
13
+
14
+ Output is written to:
15
+ - The story file (appended/replaced `## Technical Solution` section)
16
+ - The GitHub issue body (if applicable)
17
+
18
+ This workflow is executed by the `ace-technical-application-architect` agent
19
+ (spawned via `subagent_type="ace-technical-application-architect"`).
20
+ </purpose>
21
+
22
+ <mandatory-context>
23
+ All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
24
+ Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
25
+ </mandatory-context>
26
+
27
+ <process>
28
+
29
+ <!-- ══════════════════════════════════════════════════════════════════ -->
30
+ <!-- STEP 1: SETUP -->
31
+ <!-- ══════════════════════════════════════════════════════════════════ -->
32
+
33
+ <step name="setup" order="1">
34
+ **MANDATORY FIRST STEP — Execute environment detection and story initialization:**
35
+
36
+ INIT is available from the preprocessed Environment Context above — do NOT re-run init.
37
+
38
+ This preprocessing validated the story parameter, extracted metadata/requirements/wiki
39
+ references, computed all paths and slugs, and checked artifact existence.
40
+
41
+ Parse INIT JSON for:
42
+ - **Environment**: `has_git`, `has_gh_cli`, `github_project`, `analyst_model`
43
+ - **Story validation**: `story_valid`, `story_error`, `story_source`
44
+ - **Story metadata**: `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
45
+ - **Requirements**: `user_story`, `description`, `acceptance_criteria_count`
46
+ - **Paths**: `paths.*` (story_dir, story_file, integration_analysis_file, external_analysis_file, feature_dir, feature_file, etc.)
47
+ - **Wiki**: `wiki_references` (system_wide, subsystem_docs, total_count), `wiki_docs_exist`
48
+ - **Artifacts**: `has_external_analysis`, `has_integration_analysis`, `has_feature_file`
49
+
50
+ Display stage banner:
51
+
52
+ ```
53
+ ╔══════════════════════════════════════════════════════════════╗
54
+ ║ ACE > Research Technical Solution ║
55
+ ╚══════════════════════════════════════════════════════════════╝
56
+ ```
57
+
58
+ **If `has_git` is false:** Initialize git:
59
+ ```bash
60
+ git init
61
+ ```
62
+
63
+ **If `INIT.story_valid` is false:**
64
+ Display error using `INIT.story_error` and exit.
65
+ </step>
66
+
67
+ <!-- ══════════════════════════════════════════════════════════════════ -->
68
+ <!-- STEP 2: VALIDATE & LOAD STORY -->
69
+ <!-- ══════════════════════════════════════════════════════════════════ -->
70
+
71
+ <step name="validate-story" order="2">
72
+
73
+ **Story validation, parsing, metadata extraction, wiki reference extraction,
74
+ and path computation were all completed by `init research-story` in step 1.**
75
+ All data is available in the INIT JSON.
76
+
77
+ Read the story file content for analysis context:
78
+
79
+ **If `INIT.story_source` is `file`:**
80
+ Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
81
+
82
+ **If `INIT.story_source` is `github-url` or `issue-number`:**
83
+ Fetch the issue body using INIT's GitHub project context:
84
+ ```bash
85
+ GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
86
+ ```
87
+ Store as STORY_CONTENT.
88
+
89
+ The story's User Story, Description, and Acceptance Criteria (from `INIT.user_story`,
90
+ `INIT.description`, `INIT.acceptance_criteria_count`) define WHAT functionality to
91
+ design a technical solution for. The wiki references (from `INIT.wiki_references`)
92
+ define WHICH wiki documents to read for codebase context.
93
+
94
+ <!-- ── 2b: Load parent feature document ────────────────────────── -->
95
+
96
+ **If `INIT.has_feature_file` is true:**
97
+ Read the feature document at `INIT.paths.feature_file` and extract:
98
+ - Feature description, scope, and the COMPLETE feature vision
99
+ - List of all stories in the feature (IDs, titles, descriptions)
100
+ - Dependencies between stories
101
+ - Shared components or services mentioned
102
+ Store as FEATURE_CONTENT.
103
+
104
+ **If `INIT.has_feature_file` is false:**
105
+ Proceed without — the solution can still be designed without feature context.
106
+
107
+ <!-- ── 2c: Display ───────────────────────────────────────────────── -->
108
+
109
+ Set pre-computed paths from INIT:
110
+ - `STORY_FILE = INIT.paths.story_file`
111
+ - `STORY_DIR = INIT.paths.story_dir`
112
+
113
+ Display:
114
+ ```
115
+ i Story loaded: {INIT.story.id} — {INIT.story.title}
116
+ Feature: {INIT.feature.id} — {INIT.feature.title}
117
+ Epic: {INIT.epic.id} — {INIT.epic.title}
118
+ Requirements: {INIT.acceptance_criteria_count} acceptance criteria scenarios
119
+ Wiki references: {INIT.wiki_references.total_count} documents to load
120
+ ```
121
+ </step>
122
+
123
+ <!-- ══════════════════════════════════════════════════════════════════ -->
124
+ <!-- STEP 3: LOAD WIKI DOCUMENTS -->
125
+ <!-- ══════════════════════════════════════════════════════════════════ -->
126
+
127
+ <step name="load-wiki-documents" order="3">
128
+
129
+ **[MANDATORY] Read ALL wiki documents referenced in the story's Relevant Wiki section.**
130
+
131
+ Wiki references were pre-extracted by `init research-story` and are available in
132
+ `INIT.wiki_references` (system_wide list + subsystem_docs list). File existence
133
+ was also pre-checked see `INIT.wiki_docs_exist` (existing[] and missing[]).
134
+
135
+ The wiki IS the single source of codebase knowledge.
136
+
137
+ <!-- ── 3a: System-Wide documents (mandatory) ────────────────────── -->
138
+
139
+ **System-Wide documents — ALWAYS load these (from `INIT.wiki_references.system_wide`):**
140
+
141
+ Read each file and store its content:
142
+ - `.docs/wiki/system-wide/system-structure.md` — High-level tree showing where code is
143
+ - `.docs/wiki/system-wide/system-architecture.md` Complete architectural overview
144
+ - `.docs/wiki/system-wide/coding-standards.md` — **CRITICAL: Read BEFORE generating any solution code — NO EXCEPTIONS**
145
+ - `.docs/wiki/system-wide/testing-framework.md` — Testing patterns and frameworks
146
+
147
+ **STRONG EMPHASIS on coding-standards.md**: This file MUST be read and internalized
148
+ BEFORE any class diagrams, interfaces, code snippets, or implementation patterns
149
+ are produced. Every piece of code in the solution MUST comply with coding standards.
150
+
151
+ **For any file in `INIT.wiki_docs_exist.missing`:** Display warning (non-fatal):
152
+ ```
153
+ ! Wiki document not found: {path}
154
+ Continuing without it.
155
+ ```
156
+
157
+ <!-- ── 3b: Subsystem documents ──────────────────────────────────── -->
158
+
159
+ **Subsystem documents load all from `INIT.wiki_references.subsystem_docs`:**
160
+
161
+ For EACH entry in `INIT.wiki_references.subsystem_docs`:
162
+ 1. Check if the path is in `INIT.wiki_docs_exist.existing` (already verified)
163
+ 2. If exists: read the file completely, store its content keyed by file path
164
+ 3. If missing: display warning (non-fatal) and continue
165
+
166
+ These subsystem documents provide the context that replaces:
167
+ - "documentation" parameter — wiki docs cover all relevant documentation
168
+ - "high-level-architecture" system-architecture.md provides this
169
+ - "sourcecode" parameter — system-structure.md has a high-level tree
170
+ - "related-stories-implementations" — wiki documents capture knowledge from all stories
171
+ - "documented-features" — wiki documents catalog existing feature implementations
172
+ - "feature-planning" — the feature file provides this context
173
+
174
+ <!-- ── 3c: Display ───────────────────────────────────────────────── -->
175
+
176
+ Display:
177
+ ```
178
+ i Wiki documents loaded: {INIT.wiki_docs_exist.existing.length}/{INIT.wiki_references.total_count} files
179
+ System-wide: {count}/4 | Subsystem: {INIT.wiki_references.subsystem_docs.length} documents
180
+ Missing: {INIT.wiki_docs_exist.missing.length} (warnings shown above if any)
181
+ ```
182
+ </step>
183
+
184
+ <!-- ══════════════════════════════════════════════════════════════════ -->
185
+ <!-- STEP 4: LOAD INTEGRATION ANALYSIS (MANDATORY) -->
186
+ <!-- ══════════════════════════════════════════════════════════════════ -->
187
+
188
+ <step name="load-integration-analysis" order="4">
189
+
190
+ **Integration analysis existence was pre-checked by `init research-story`.**
191
+
192
+ The integration analysis is produced by pass 4 (`/ace:research-integration-solution`).
193
+ It is a MANDATORY input — the technical solution CANNOT be designed without it.
194
+
195
+ **If `INIT.has_integration_analysis` is true:**
196
+ Read the file at `INIT.paths.integration_analysis_file`. Store as INTEGRATION_ANALYSIS_CONTENT.
197
+ Display:
198
+ ```
199
+ i Integration analysis found: {INIT.paths.integration_analysis_file}
200
+ Will use integration points, refactoring needs, and codebase patterns
201
+ to design a seamless technical solution.
202
+ ```
203
+
204
+ **If `INIT.has_integration_analysis` is false:**
205
+ Display error and EXIT:
206
+ ```
207
+ x Integration analysis NOT FOUND at {INIT.paths.integration_analysis_file}
208
+ The integration analysis (pass 4) is MANDATORY for technical solution design.
209
+ Run /ace:research-integration-solution first.
210
+ ```
211
+ **STOP — do not proceed without integration analysis.**
212
+ </step>
213
+
214
+ <!-- ══════════════════════════════════════════════════════════════════ -->
215
+ <!-- STEP 5: CHECK FOR EXTERNAL ANALYSIS (OPTIONAL) -->
216
+ <!-- ══════════════════════════════════════════════════════════════════ -->
217
+
218
+ <step name="check-external-analysis" order="5">
219
+
220
+ **External analysis existence was pre-checked by `init research-story`.**
221
+
222
+ The external analysis is produced by pass 3 (`/ace:research-external-solution`).
223
+ It is NOT a required input, but when present it provides valuable context about
224
+ how external/industry-standard systems implement this functionality.
225
+
226
+ **If `INIT.has_external_analysis` is true:**
227
+ Read the file at `INIT.paths.external_analysis_file`. Store as EXTERNAL_ANALYSIS_CONTENT.
228
+ Display:
229
+ ```
230
+ i External analysis found: {INIT.paths.external_analysis_file}
231
+ Will consider external system algorithms and patterns where they are
232
+ the MOST EFFICIENT AND PERFORMANT approach.
233
+ ```
234
+
235
+ **If `INIT.has_external_analysis` is false:**
236
+ Set EXTERNAL_ANALYSIS_CONTENT = null.
237
+ Display:
238
+ ```
239
+ i No external analysis found. Technical solution will rely on
240
+ wiki documents, integration analysis, and Clean Architecture principles.
241
+ ```
242
+ </step>
243
+
244
+ <!-- ══════════════════════════════════════════════════════════════════ -->
245
+ <!-- STEP 6: CHECK EXISTING SOLUTION -->
246
+ <!-- ══════════════════════════════════════════════════════════════════ -->
247
+
248
+ <step name="check-existing" order="6">
249
+
250
+ Check if the story file already contains a `## Technical Solution` section.
251
+
252
+ **If the story file contains `## Technical Solution` with substantive content
253
+ (more than just the placeholder comment):**
254
+
255
+ Use AskUserQuestion:
256
+ - header: "Existing"
257
+ - question: "The story already contains a Technical Solution section. What would you like to do?"
258
+ - options:
259
+ - "Overwrite" Discard and create a new solution from scratch
260
+ - "Skip" — Keep the current solution as-is
261
+
262
+ **If "Overwrite":** Continue to step 7.
263
+ **If "Skip":** Display message and exit workflow:
264
+ ```
265
+ i Keeping existing technical solution. No changes made.
266
+ ```
267
+
268
+ **If no existing solution:** Continue to step 7.
269
+ </step>
270
+
271
+ <!-- ══════════════════════════════════════════════════════════════════ -->
272
+ <!-- STEP 7: EXECUTE SOLUTION DESIGN -->
273
+ <!-- ══════════════════════════════════════════════════════════════════ -->
274
+
275
+ <step name="execute-solution-design" order="7">
276
+
277
+ Display:
278
+ ```
279
+ ┌──────────────────────────────────────────────────────────────┐
280
+ │ ACE > Research Technical Solution > Design │
281
+ └──────────────────────────────────────────────────────────────┘
282
+
283
+ i Starting comprehensive technical solution design.
284
+ Reading wiki documents, integration analysis, coding standards,
285
+ and designing architecture. This may take several minutes.
286
+ ```
287
+
288
+ **Execute the complete solution design following the template's `&lt;analysis-process&gt;` section.**
289
+ The template (`story-technical-solution.xml`) defines the mandatory phases.
290
+ You ARE the technical-application-architect perform the design directly.
291
+
292
+ <!-- ═══════════════════════════════════════════════════════════ -->
293
+ <!-- Phase 1: INITIAL DISCOVERY -->
294
+ <!-- ═══════════════════════════════════════════════════════════ -->
295
+
296
+ <phase name="initial-discovery" order="1">
297
+
298
+ <item name="understand-story" mandatory="true">
299
+ **[MANDATORY] Understand the Story:**
300
+
301
+ - If story is a file path: Read the markdown file directly
302
+ - If story is GitHub URL/number: Use GitHub CLI (`gh issue view`)
303
+ - Fully understand what functionality needs to be implemented
304
+ - Identify ALL acceptance criteria scenarios (each will need a sequence diagram)
305
+ </item>
306
+
307
+ <item name="extract-business-requirements" mandatory="true">
308
+ **[MANDATORY] Extract Business Requirements from Story:**
309
+
310
+ - Thoroughly analyze the story's User Story, Description, and Acceptance Criteria
311
+ - Extract business requirements and constraints
312
+ - **CRITICAL**: Identify ALL scenarios from Acceptance Criteria each will need a sequence diagram
313
+ - Understand the business context and value
314
+ - The story IS the source of truth for business requirements
315
+ </item>
316
+
317
+ <item name="study-external-analysis" mandatory="false">
318
+ **[CONDITIONAL] Study External/Industry-Standard Analysis:**
319
+
320
+ **WHEN TO RUN**: Only if EXTERNAL_ANALYSIS_CONTENT is available.
321
+
322
+ The external analysis provides insights from industry-standard implementations.
323
+ **USE WITH JUDGMENT** — extract and use:
324
+
325
+ - **Algorithms**: Use the same algorithms IF they are the MOST EFFICIENT AND PERFORMANT.
326
+ If you can identify a better approach, use the better approach.
327
+ - **Formulas**: Use the same mathematical formulas and calculations IF they are optimal.
328
+ If you know a more efficient formula, use it.
329
+ - **Constants**: Consider the same constant values and thresholds as starting points.
330
+ - **Business Logic**: Adopt proven business rules and validations.
331
+ - **Design Patterns**: Follow their patterns where they align with Clean Architecture.
332
+ - **Data Structures**: Use similar data models where appropriate.
333
+ - **Event Flows**: Consider their event handling approaches.
334
+ - **Error Handling**: Adopt their error handling strategies where they fit.
335
+
336
+ **CRITICAL PHILOSOPHY**: The external analysis is a REFERENCE, not a blueprint.
337
+ Use external patterns when they are the most efficient and performant approach.
338
+ Improve upon them when you can identify a better way.
339
+ </item>
340
+
341
+ <item name="feature-planning-context" mandatory="true">
342
+ **[MANDATORY] Feature Planning Context (from feature file):**
343
+
344
+ If FEATURE_CONTENT is available, analyze it for:
345
+
346
+ - **Feature Scope**: What is the COMPLETE feature trying to achieve?
347
+ - **Story Dependencies**: Which stories must be completed before/after this one?
348
+ - **Shared Components**: What components are used by MULTIPLE stories?
349
+ - **Data Flow Between Stories**: How does data flow from one story to another?
350
+ - **Integration Points**: Where do stories connect and interact?
351
+ - **Feature-Level Patterns**: What patterns span across all stories?
352
+
353
+ Use this to:
354
+ - Ensure this story aligns with the overall feature architecture
355
+ - Design components that can be reused by other stories
356
+ - Create interfaces that support future stories
357
+ - Avoid creating silos think feature-wide!
358
+
359
+ **NEVER DESIGN IN ISOLATION**Consider the complete feature!
360
+
361
+ If no feature file available, proceed but note this in the solution.
362
+ </item>
363
+
364
+ </phase>
365
+
366
+ <!-- ═══════════════════════════════════════════════════════════ -->
367
+ <!-- Phase 2: OUR SYSTEM ARCHITECTURE UNDERSTANDING -->
368
+ <!-- ═══════════════════════════════════════════════════════════ -->
369
+
370
+ <phase name="system-architecture-understanding" order="2">
371
+
372
+ <item name="comprehensive-architecture" mandatory="true">
373
+ **[MANDATORY] Comprehensive System Architecture (from wiki):**
374
+
375
+ Using the wiki documents loaded in step 3:
376
+
377
+ - **system-architecture.md**: FULLY review for COMPREHENSIVE architectural overview
378
+ - Understand the complete system architecture (not just the story)
379
+ - Identify architectural layers and their responsibilities
380
+ - Map where this story's components will fit in the overall architecture
381
+ - Understand existing patterns and conventions
382
+
383
+ - **system-structure.md**: Understand the codebase layout,
384
+ where relevant code lives, and the project file organization
385
+ </item>
386
+
387
+ <item name="wiki-subsystem-knowledge" mandatory="true">
388
+ **[MANDATORY] Subsystem Knowledge (from wiki documents):**
389
+
390
+ Using the subsystem wiki documents loaded in step 3, study ALL:
391
+
392
+ - **Systems**: Understand system descriptions, boundaries, and APIs
393
+ that relate to this story
394
+ - **Patterns**: Catalog design patterns in use (Strategy, Factory, Observer, etc.)
395
+ that MUST be followed for consistency
396
+ - **Decisions (ADRs)**: Architecture Decision Records that constrain design choices
397
+ - **Cross-Cutting Concerns**: Shared concerns to respect (auth, logging, errors, etc.)
398
+ - **Guides**: Implementation guides for common tasks relevant to this story
399
+ - **Walkthroughs**: Deep tutorial-style flow explanations with actual code snippets
400
+
401
+ These wiki documents replace the obsolete command's parameters:
402
+ - "related-stories-implementations" — wiki captures this knowledge
403
+ - "documented-features" wiki catalogs existing implementations
404
+ - "documentation" — wiki IS the documentation
405
+
406
+ **Extract from wiki documents:**
407
+
408
+ ```yaml
409
+ INTERFACES TO EXTEND (not recreate):
410
+ - [Interface name and location from wiki]
411
+
412
+ CLASSES TO COMPOSE (not duplicate):
413
+ - [Class name and location from wiki]
414
+
415
+ PATTERNS PROVEN SUCCESSFUL:
416
+ - [Pattern and where documented in wiki]
417
+
418
+ CONSTANTS TO REUSE (not duplicate):
419
+ - [Constant file and values from wiki]
420
+ ```
421
+ </item>
422
+
423
+ <item name="integration-analysis-study" mandatory="true">
424
+ **[MANDATORY] Deep Study of Integration Analysis:**
425
+
426
+ **THOROUGHLY ANALYZE** the INTEGRATION_ANALYSIS_CONTENT (from step 4).
427
+ **CRITICAL**: This document tells you EXACTLY how to integrate without breaking the codebase.
428
+
429
+ **Extract ALL:**
430
+ - **Integration Points**: Where the new code connects to existing code
431
+ - **Required Refactoring**: What existing code MUST be refactored for proper integration
432
+ - **Patterns to Follow**: Existing patterns that MUST be followed
433
+ - **Files to Modify**: Which existing files need changes
434
+ - **Dependencies**: What the new code depends on and what depends on it
435
+ - **Hardcoded Values**: All hardcoded values and placeholder code that MUST be replaced
436
+ - **Architecture Compatibility**: How the story fits into Clean Architecture layers
437
+ - **Testing Strategy**: How to test without breaking existing tests
438
+
439
+ **USE THIS TO:**
440
+ - Design refactoring strategies that maintain extensibility
441
+ - Ensure seamless integration without breaking existing functionality
442
+ - Keep the codebase maintainable and follow SOLID principles
443
+
444
+ **NEVER SKIP REFACTORING** if the integration analysis identifies it's needed!
445
+ </item>
446
+
447
+ </phase>
448
+
449
+ <!-- ═══════════════════════════════════════════════════════════ -->
450
+ <!-- Phase 3: CODEBASE ANALYSIS -->
451
+ <!-- ═══════════════════════════════════════════════════════════ -->
452
+
453
+ <phase name="codebase-analysis" order="3">
454
+
455
+ <item name="coding-standards-review" mandatory="true">
456
+ **[MANDATORY] Coding Standards Review:**
457
+
458
+ **CRITICAL** Read and internalize `.docs/wiki/system-wide/coding-standards.md`
459
+ BEFORE generating ANY solution code, class diagrams, or interfaces.
460
+
461
+ Verify you understand and will enforce:
462
+ - Zero hardcoding rules
463
+ - Single responsibility (one class/interface/type per file!)
464
+ - Interface-first design (code against interfaces)
465
+ - No assumptions verify by reading actual code
466
+ - No dead code policy
467
+ - File size limits
468
+ - Naming conventions
469
+ - Layer placement rules
470
+
471
+ **EVERY piece of code in the technical solution MUST comply with coding standards.**
472
+ </item>
473
+
474
+ <item name="source-code-analysis" mandatory="true">
475
+ **[MANDATORY] Source Code Analysis (guided by wiki and integration analysis):**
476
+
477
+ Using system-structure.md as guide, and integration analysis for specific files:
478
+ - Identify existing patterns and structures
479
+ - Find reusable components and services
480
+ - Map current layer structures
481
+ - Document naming conventions
482
+ - Identify external dependencies and APIs
483
+
484
+ **Focus on files identified by the integration analysis** — don't search blindly.
485
+ </item>
486
+
487
+ </phase>
488
+
489
+ <!-- ═══════════════════════════════════════════════════════════ -->
490
+ <!-- Phase 4: SOLUTION DESIGN -->
491
+ <!-- ═══════════════════════════════════════════════════════════ -->
492
+
493
+ <phase name="solution-design" order="4">
494
+
495
+ After loading all context from phases 1-3, you should have:
496
+ - Complete understanding of the story and business requirements
497
+ - Knowledge of industry standard approaches (if external analysis available)
498
+ - Full system architecture understanding from wiki
499
+ - Feature context and story dependencies
500
+ - Codebase patterns and conventions from wiki
501
+ - Integration requirements and constraints from integration analysis
502
+ - Coding standards internalized
503
+
504
+ Use ALL this information to design a viable technical solution that:
505
+ - Respects Clean Architecture principles
506
+ - Follows established patterns from wiki
507
+ - Integrates seamlessly per integration analysis
508
+ - Maintains extensibility
509
+ - Enables testability
510
+ - Strictly follows coding standards
511
+
512
+ **Generate the complete technical solution following the template's `&lt;output-format&gt;`
513
+ section in story-technical-solution.xml. This includes ALL of the following sections.**
514
+
515
+ </phase>
516
+
517
+ </step>
518
+
519
+ <!-- ══════════════════════════════════════════════════════════════════ -->
520
+ <!-- STEP 8: WRITE OUTPUT TO STORY FILE -->
521
+ <!-- ══════════════════════════════════════════════════════════════════ -->
522
+
523
+ <step name="write-output" order="8">
524
+
525
+ **Write the complete technical solution INTO the story file.**
526
+
527
+ The output follows the template's `&lt;output-format&gt;` section exactly.
528
+ It includes ALL sections from the design phases above.
529
+
530
+ <!-- ── 8a: Write to local story file ──────────────────────────── -->
531
+
532
+ Read the current STORY_FILE content.
533
+
534
+ **If the story file contains a `## Technical Solution` section placeholder:**
535
+ Replace the placeholder section (from `## Technical Solution` up to the next `## `
536
+ heading or end-of-file metadata section `---`) with the full technical solution.
537
+
538
+ **If the story file does NOT contain a `## Technical Solution` section:**
539
+ Append the technical solution after the `## Relevant Wiki` section
540
+ (before the metadata section `---` at the end if it exists).
541
+
542
+ Write the updated content back to STORY_FILE using the Write or Edit tool.
543
+
544
+ Display:
545
+ ```
546
+ + Technical solution written to {STORY_FILE}
547
+ ```
548
+
549
+ <!-- ── 8b: Update GitHub issue (if applicable) ───────────────── -->
550
+
551
+ **If the story was loaded from GitHub OR the story file header contains a GitHub link:**
552
+
553
+ Extract the issue number from the story.
554
+
555
+ **If `has_gh_cli` is true AND issue number is available:**
556
+
557
+ Read the current GitHub issue body:
558
+ ```bash
559
+ GH_BODY=$(gh issue view {issue_number} --repo {REPO} --json body -q .body)
560
+ ```
561
+
562
+ Replace or append the `## Technical Solution` section in the issue body
563
+ (same logic as local file — find and replace existing section, or append).
564
+
565
+ Update the issue:
566
+ ```bash
567
+ gh issue edit {issue_number} --repo {REPO} --body "{updated_body}"
568
+ ```
569
+
570
+ Display:
571
+ ```
572
+ + GitHub issue #{issue_number} updated with Technical Solution section.
573
+ ```
574
+
575
+ **If GitHub CLI not available or no issue number:**
576
+ Display:
577
+ ```
578
+ i No GitHub issue to update. Local file only.
579
+ ```
580
+ </step>
581
+
582
+ <!-- ══════════════════════════════════════════════════════════════════ -->
583
+ <!-- STEP 9: VALIDATION -->
584
+ <!-- ══════════════════════════════════════════════════════════════════ -->
585
+
586
+ <step name="validation" order="9">
587
+
588
+ Read the story file and verify the technical solution against the validation
589
+ checklist defined in the template (story-technical-solution.xml):
590
+
591
+ **Story File Requirements:**
592
+ - [ ] Technical solution section exists in the story file
593
+ - [ ] Section contains all required subsections from template
594
+
595
+ **Architecture Requirements:**
596
+ - [ ] Component and Boundary Architecture with Mermaid diagram
597
+ - [ ] Layer Architecture Analysis (Domain, Application, Infrastructure, Presentation)
598
+ - [ ] Clean Architecture compliance verified (dependencies point inward)
599
+ - [ ] Dependency injection strategy documented
600
+
601
+ **Design Requirements:**
602
+ - [ ] Design patterns documented with purpose and implementation
603
+ - [ ] Technical decisions documented with rationale and trade-offs
604
+ - [ ] Class diagrams with complete interface definitions
605
+ - [ ] EVERY interface/class/type in its OWN SEPARATE FILE (coding standards!)
606
+ - [ ] Data models and structures defined with TypeScript types
607
+
608
+ **Algorithm Requirements:**
609
+ - [ ] Algorithms documented with mathematical formulas
610
+ - [ ] Constants and configuration values defined (NO hardcoding!)
611
+ - [ ] Business rules documented with implementations
612
+ - [ ] Example calculations provided
613
+
614
+ **Sequence Diagram Requirements (CRITICAL!):**
615
+ - [ ] Sequence diagram for EVERY AC scenario
616
+ - [ ] Full flow from entry point to exit through ALL layers
617
+ - [ ] Real method names used (not generic placeholders)
618
+ - [ ] Error handling paths included (alt blocks)
619
+ - [ ] Data structures shown at each step
620
+
621
+ **Implementation Requirements:**
622
+ - [ ] Complete file structure tree (new + modified files)
623
+ - [ ] DI container configuration specified
624
+ - [ ] Refactoring plan from integration analysis incorporated
625
+ - [ ] Testing strategy (unit, integration, e2e)
626
+ - [ ] Implementation order with dependencies
627
+ - [ ] Implementation checklist
628
+
629
+ **Compliance Requirements:**
630
+ - [ ] Coding standards compliance verified throughout
631
+ - [ ] Integration analysis findings incorporated
632
+ - [ ] No hardcoded values in any code snippets
633
+ - [ ] All code follows Clean Architecture layers
634
+
635
+ **Total: 25 mandatory checklist items**
636
+
637
+ If the output is incomplete or missing sections, go back and fill in
638
+ the missing content before proceeding.
639
+
640
+ Display:
641
+ ```
642
+ {check_mark} Solution validated. {passed}/{total} checks passed.
643
+ ```
644
+ </step>
645
+
646
+ <!-- ══════════════════════════════════════════════════════════════════ -->
647
+ <!-- STEP 10: REVIEW AND APPROVE -->
648
+ <!-- ══════════════════════════════════════════════════════════════════ -->
649
+
650
+ <step name="review" order="10">
651
+
652
+ Display a summary of the solution:
653
+ ```
654
+ Solution Summary:
655
+ ────────
656
+ Sections: {count}/13 | Checklist: {passed}/25
657
+ Wiki docs loaded: {N} | Integration analysis: loaded
658
+ External analysis: {loaded/not found}
659
+ AC scenarios: {M} | Sequence diagrams: {M}
660
+ New files: {F} | Modified files: {G}
661
+ Design patterns: {P} | Refactoring items: {R}
662
+ ```
663
+
664
+ Use AskUserQuestion:
665
+ - header: "Solution"
666
+ - question: "Technical solution written to `{STORY_FILE}`. Review the file in your editor — does the solution look comprehensive?"
667
+ - options:
668
+ - "Approve"Looks good, commit it
669
+ - "Refine" — Some sections need more depth
670
+ - "Skip commit" — Keep the file but don't commit yet
671
+
672
+ **If "Approve":**
673
+ Continue to step 11.
674
+
675
+ **If "Refine":**
676
+ - Ask what sections need more depth or what's missing
677
+ - Go back to the relevant design phase, read more code, and update the story file
678
+ - Re-run validation (step 9)
679
+ - Present for review again
680
+
681
+ **If "Skip commit":**
682
+ Display completion without commit:
683
+ ```
684
+ ╔══════════════════════════════════════════════════════════════╗
685
+ ║ ACE > Technical Solution Complete (uncommitted) ║
686
+ ║ {Story ID} "{Story Title}" ║
687
+ ╚══════════════════════════════════════════════════════════════╝
688
+
689
+ i Technical solution written to {STORY_FILE}
690
+ File not committed — commit manually when ready.
691
+ ```
692
+ Exit workflow.
693
+ </step>
694
+
695
+ <!-- ══════════════════════════════════════════════════════════════════ -->
696
+ <!-- STEP 11: COMMIT -->
697
+ <!-- ══════════════════════════════════════════════════════════════════ -->
698
+
699
+ <step name="commit" order="11">
700
+
701
+ Stage and commit the story file:
702
+
703
+ ```bash
704
+ git add {STORY_FILE}
705
+ ```
706
+
707
+ ```bash
708
+ git commit -m "docs: technical solution for {Story ID} — {Story Title}"
709
+ ```
710
+
711
+ Display completion:
712
+
713
+ ```
714
+ ╔══════════════════════════════════════════════════════════════╗
715
+ ║ ACE > Technical Solution Complete ║
716
+ ║ {Story ID} "{Story Title}" ║
717
+ ╚══════════════════════════════════════════════════════════════╝
718
+
719
+ + {STORY_FILE} committed.
720
+
721
+ Metrics:
722
+ ────────
723
+ Wiki docs loaded: {N} | Integration analysis: incorporated
724
+ External analysis: {incorporated/not available}
725
+ AC scenarios covered: {M} sequence diagrams
726
+ New files designed: {F} | Modified files: {G}
727
+
728
+ i Technical solution complete. The story is now fully refined
729
+ (pass 5) and ready for implementation.
730
+
731
+ Next > Continue with story execution:
732
+ - /ace:execute-story story=... — Implement the story
733
+ - /ace:research-technical-solution story=... Design another story
734
+ - /ace:helpCheck project initialization status
735
+ ```
736
+ </step>
737
+
738
+ </process>
739
+
740
+ <success_criteria>
741
+ - Story loaded and requirements extracted (User Story, Description, Acceptance Criteria)
742
+ - All wiki references extracted from story's Relevant Wiki section
743
+ - All wiki documents loaded (system-wide mandatory, subsystem as referenced)
744
+ - Coding standards read and internalized BEFORE generating solution code
745
+ - Parent feature document loaded for broader context (if available)
746
+ - Integration analysis loaded and studied (MANDATORY exit if missing)
747
+ - External analysis loaded if present in story directory (auto-detected, OPTIONAL)
748
+ - All 4 design phases executed (Initial Discovery, System Architecture, Codebase Analysis, Solution Design)
749
+ - Technical solution written to story file with ALL template sections populated
750
+ - Sequence diagrams created for EVERY acceptance criteria scenario
751
+ - Every interface/class/type designed as its own separate file
752
+ - NO hardcoded values in any code snippets
753
+ - All code follows Clean Architecture layers and coding standards
754
+ - Integration analysis findings fully incorporated (refactoring, patterns, hardcoded values)
755
+ - All 25 validation checklist items verified
756
+ - GitHub issue updated with technical solution (if applicable)
757
+ - User reviewed and approved the solution
758
+ - Document committed with appropriate message
759
+ </success_criteria>
760
+
761
+ </workflow>