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,713 +1,711 @@
1
- <workflow>
2
-
3
- <purpose>
4
- Perform COMPREHENSIVE, IN-DEPTH System Integration Analysis of how a specific story
5
- should integrate into the existing codebase. Load the story requirements and wiki
6
- references, validate inputs, load wiki documents and optional external analysis,
7
- then execute exhaustive codebase analysis following the template's analysis-process
8
- phases. Write the analysis to integration-analysis.md in the story's artifact directory.
9
-
10
- Produces `.ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/integration-analysis.md`
11
- — a comprehensive integration analysis with architecture compatibility, refactoring needs,
12
- hardcoded values discovery, integration points, and implementation guidelines extracted
13
- from deep analysis of the existing codebase.
14
-
15
- This is pass 4 of the story specification pipeline (see story.xml composition).
16
- All output is written ONLY to the analysis file — no GitHub updates, no modifications
17
- to the story file.
18
-
19
- This workflow is executed by the `ace-code-integration-analyst` agent
20
- (spawned via `subagent_type="ace-code-integration-analyst"`).
21
- </purpose>
22
-
23
- <mandatory-context>
24
- Read all files referenced by the invoking command's execution-context before starting.
25
- Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
26
- </mandatory-context>
27
-
28
- <process>
29
-
30
- <!-- ══════════════════════════════════════════════════════════════════ -->
31
- <!-- STEP 1: SETUP -->
32
- <!-- ══════════════════════════════════════════════════════════════════ -->
33
-
34
- <step name="setup" order="1">
35
- **MANDATORY FIRST STEP — Execute environment detection and story initialization:**
36
-
37
- ```bash
38
- INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init research-story {story_param})
39
- ```
40
-
41
- This single call validates the story parameter, extracts metadata/requirements/wiki
42
- references, computes all paths and slugs, and checks artifact existence.
43
-
44
- Parse INIT JSON for:
45
- - **Environment**: `has_git`, `has_gh_cli`, `github_project`, `analyst_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, integration_analysis_file, external_analysis_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 Integration Solution ║
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
- </step>
69
-
70
- <!-- ══════════════════════════════════════════════════════════════════ -->
71
- <!-- STEP 2: VALIDATE & LOAD STORY -->
72
- <!-- ══════════════════════════════════════════════════════════════════ -->
73
-
74
- <step name="validate-story" order="2">
75
-
76
- **Story validation, parsing, metadata extraction, wiki reference extraction,
77
- and path computation were all completed by `init research-story` in step 1.**
78
- All data is available in the INIT JSON.
79
-
80
- Read the story file content for analysis context:
81
-
82
- **If `INIT.story_source` is `file`:**
83
- Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
84
-
85
- **If `INIT.story_source` is `github-url` or `issue-number`:**
86
- Fetch the issue body using INIT's GitHub project context:
87
- ```bash
88
- GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
89
- ```
90
- Store as STORY_CONTENT.
91
-
92
- The story's User Story, Description, and Acceptance Criteria (from `INIT.user_story`,
93
- `INIT.description`, `INIT.acceptance_criteria_count`) define WHAT functionality to
94
- analyze for integration. The wiki references (from `INIT.wiki_references`) define
95
- WHICH wiki documents to read for codebase context.
96
-
97
- <!-- ── 2b: Load parent feature document ────────────────────────── -->
98
-
99
- **If `INIT.has_feature_file` is true:**
100
- Read the feature document at `INIT.paths.feature_file` and extract:
101
- - Feature description and scope
102
- - List of all stories in the feature (IDs, titles, descriptions)
103
- - Dependencies between stories
104
- - Shared components or services mentioned
105
-
106
- **If `INIT.has_feature_file` is false:**
107
- Proceed without the analysis can still be done 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: coding standards — NO EXCEPTIONS
147
- - `.docs/wiki/system-wide/testing-framework.md` Testing patterns and frameworks
148
-
149
- **For any file in `INIT.wiki_docs_exist.missing`:** Display warning (non-fatal):
150
- ```
151
- ! Wiki document not found: {path}
152
- Continuing without it.
153
- ```
154
-
155
- <!-- ── 3b: Subsystem documents ──────────────────────────────────── -->
156
-
157
- **Subsystem documents load all from `INIT.wiki_references.subsystem_docs`:**
158
-
159
- For EACH entry in `INIT.wiki_references.subsystem_docs`:
160
- 1. Check if the path is in `INIT.wiki_docs_exist.existing` (already verified)
161
- 2. If exists: read the file completely, store its content keyed by file path
162
- 3. If missing: display warning (non-fatal) and continue
163
-
164
- These subsystem documents provide the context that replaces:
165
- - "documentation" parameter — wiki docs cover all relevant documentation
166
- - "related-stories-implementations" — wiki documents capture knowledge from all stories
167
- - "documented-features" wiki documents catalog existing feature implementations
168
-
169
- <!-- ── 3c: Display ───────────────────────────────────────────────── -->
170
-
171
- Display:
172
- ```
173
- i Wiki documents loaded: {INIT.wiki_docs_exist.existing.length}/{INIT.wiki_references.total_count} files
174
- System-wide: {count}/4 | Subsystem: {INIT.wiki_references.subsystem_docs.length} documents
175
- Missing: {INIT.wiki_docs_exist.missing.length} (warnings shown above if any)
176
- ```
177
- </step>
178
-
179
- <!-- ══════════════════════════════════════════════════════════════════ -->
180
- <!-- STEP 4: CHECK FOR EXTERNAL ANALYSIS -->
181
- <!-- ══════════════════════════════════════════════════════════════════ -->
182
-
183
- <step name="check-external-analysis" order="4">
184
-
185
- **External analysis existence was pre-checked by `init research-story`.**
186
-
187
- The external analysis is produced by pass 3 (`/ace:research-external-solution`).
188
- It is NOT a required input, but when present it provides valuable context about
189
- how external/industry-standard systems implement this functionality.
190
-
191
- **If `INIT.has_external_analysis` is true:**
192
- Read the file at `INIT.paths.external_analysis_file`. Store as EXTERNAL_ANALYSIS_CONTENT.
193
- Display:
194
- ```
195
- i External analysis found: {INIT.paths.external_analysis_file}
196
- Will incorporate external system insights into integration analysis.
197
- ```
198
-
199
- **If `INIT.has_external_analysis` is false:**
200
- Set EXTERNAL_ANALYSIS_CONTENT = null.
201
- Display:
202
- ```
203
- i No external analysis found. Integration analysis will rely on
204
- wiki documents and direct codebase exploration.
205
- ```
206
- </step>
207
-
208
- <!-- ══════════════════════════════════════════════════════════════════ -->
209
- <!-- STEP 5: RESOLVE OUTPUT PATH -->
210
- <!-- ══════════════════════════════════════════════════════════════════ -->
211
-
212
- <step name="resolve-output-path" order="5">
213
-
214
- **Paths were pre-computed by `init research-story` in step 1.**
215
-
216
- Set from INIT JSON:
217
- - `STORY_DIR = INIT.paths.story_dir`
218
- - `OUTPUT_FILE = INIT.paths.integration_analysis_file`
219
-
220
- Ensure directory exists:
221
- ```bash
222
- mkdir -p {STORY_DIR}
223
- ```
224
-
225
- Display:
226
- ```
227
- i Output: {OUTPUT_FILE}
228
- ```
229
- </step>
230
-
231
- <!-- ══════════════════════════════════════════════════════════════════ -->
232
- <!-- STEP 6: CHECK EXISTING ANALYSIS -->
233
- <!-- ══════════════════════════════════════════════════════════════════ -->
234
-
235
- <step name="check-existing" order="6">
236
-
237
- **If `INIT.has_integration_analysis` is true:**
238
-
239
- Use AskUserQuestion:
240
- - header: "Existing"
241
- - question: "An integration analysis already exists at `{OUTPUT_FILE}`. What would you like to do?"
242
- - options:
243
- - "Overwrite" — Discard and create a new analysis from scratch
244
- - "Skip" Keep the current analysis as-is
245
-
246
- **If "Overwrite":** Continue to step 7.
247
- **If "Skip":** Display message and exit workflow:
248
- ```
249
- i Keeping existing analysis. No changes made.
250
- ```
251
-
252
- **If not exists:** Continue to step 7.
253
- </step>
254
-
255
- <!-- ══════════════════════════════════════════════════════════════════ -->
256
- <!-- STEP 7: EXECUTE ANALYSIS -->
257
- <!-- ══════════════════════════════════════════════════════════════════ -->
258
-
259
- <step name="execute-analysis" order="7">
260
-
261
- Display:
262
- ```
263
- ┌──────────────────────────────────────────────────┐
264
- │ ACE > Research Integration Solution > Analysis │
265
- └──────────────────────────────────────────────────┘
266
-
267
- i Starting deep codebase integration analysis.
268
- Reading wiki documents, exploring source code,
269
- and tracing integration points. This may take
270
- several minutes.
271
- ```
272
-
273
- **Execute the complete analysis following the template's `<analysis-process>` section.**
274
- The template (`story-integration-solution.xml`) defines 4 mandatory phases.
275
- You ARE the code-integration-analystperform the analysis directly.
276
-
277
- <!-- ── 7a: Phase 1 Context Loading (4 mandatory items) ─────────── -->
278
-
279
- **Phase 1: Context Loading**
280
-
281
- 1. **[MANDATORY] Understand the story requirements:**
282
- - Re-read STORY_CONTENT thoroughly — User Story, Description, all AC scenarios
283
- - These define WHAT functionality needs to integrate into the codebase
284
- - Extract the key behaviors, components, and patterns that will be needed
285
- - If parent feature document was loaded, understand:
286
- - The broader feature context
287
- - What other stories exist and how they relate
288
- - Dependencies and shared components between stories
289
-
290
- 2. **[MANDATORY] Load and study wiki documents:**
291
- - **Coding Standards** (from system-wide): STRONG EMPHASIS NO EXCEPTIONS!
292
- New code MUST strictly follow all coding standards.
293
- - **System Architecture** (from system-wide): Understand the complete system
294
- architecture and how this story fits into Clean Architecture layers.
295
- - **System Structure** (from system-wide): Understand the codebase layout,
296
- where relevant code lives, and the project file organization.
297
- - **Testing Framework** (from system-wide): Understand testing patterns,
298
- frameworks, and conventions.
299
- - **All subsystem documents**: Read EVERY subsystem document referenced in the
300
- story's Relevant Wiki section. These contain:
301
- - System descriptions and boundaries
302
- - Design patterns in use
303
- - Cross-cutting concerns to respect
304
- - Architecture Decision Records (ADRs) that constrain design
305
- - Guides for common implementation tasks
306
- - Walkthroughs of complex multi-class flows
307
-
308
- 3. **[MANDATORY] Load external analysis (if available):**
309
- - If EXTERNAL_ANALYSIS_CONTENT is set, study it for:
310
- - How industry-standard systems implement this functionality
311
- - Algorithms and formulas to reuse
312
- - Design patterns from external implementations
313
- - Best practices that should inform our integration
314
-
315
- 4. **[MANDATORY] Load the parent feature document:**
316
- - Understand the feature planning context
317
- - Identify how this story fits within the broader feature
318
- - Identify dependencies and integration points with other stories
319
-
320
- <!-- ── 7b: Phase 2 Deep Codebase Analysis (8 mandatory items) ──── -->
321
-
322
- **Phase 2: Deep Codebase Analysis — ALL 8 items MANDATORY, skip NONE:**
323
-
324
- 1. **[MANDATORY] Architecture Compatibility Analysis:**
325
- - Map how the new story fits into Clean Architecture layers:
326
- - **Domain Layer**: New entities, value objects, constants needed
327
- - **Application Layer**: Use cases, interfaces to create
328
- - **Infrastructure Layer**: Services and implementations required
329
- - **Presentation Layer**: UI components and API endpoints needed
330
- - Verify Clean Architecture compliance: dependencies point inward
331
- - Identify layer boundary violations that must be avoided
332
-
333
- 2. **[MANDATORY] Pattern Recognition & Existing Patterns:**
334
- - Search for similar features/patterns in the codebase
335
- - Reference them with specific file paths and line numbers
336
- - Document:
337
- - Similar implementations to use as reference
338
- - Established naming conventions
339
- - Design patterns already in use (Strategy, Factory, Observer, etc.)
340
- - Error handling patterns
341
- - Logging approaches
342
-
343
- 3. **[MANDATORY] Integration Point Discovery (Layer-by-Layer):**
344
- Examine each architectural layer for integration opportunities:
345
- - **Domain Layer**: Entity extensions, value objects, business rules
346
- - **Application Layer**: Service interfaces, use cases, DTOs
347
- - **Infrastructure Layer**: Repository patterns, external services
348
- - **Presentation Layer**: UI components, view models, controllers
349
- Find:
350
- - Existing interfaces that can be extended
351
- - Abstract classes available for inheritance
352
- - Event systems for loose coupling
353
- - Middleware or pipeline patterns
354
- - Plugin or extension points
355
- - Configuration-based feature toggles
356
-
357
- 4. **[MANDATORY] File Dependency Analysis:**
358
- - Identify ALL files that will be referenced or modified
359
- - Document supporting files for the new implementation
360
- - Map import chains and dependency graphs
361
- - Identify potential circular dependency risks
362
-
363
- 5. **[MANDATORY] Convention Compliance Analysis:**
364
- - Document existing conventions that MUST be followed
365
- - Verify the new implementation doesn't violate coding standards
366
- - Check naming conventions, file organization, error handling
367
-
368
- 6. **[MANDATORY] Testing Pattern Analysis:**
369
- - Analyze current test patterns to ensure consistent validation approach
370
- - Identify test utilities and helpers available for reuse
371
- - Document testing conventions (unit, integration, e2e)
372
- - Identify tests that need modification due to the new implementation
373
-
374
- 7. **[MANDATORY] CRITICAL: Hardcoded Values & Placeholder Code Discovery:**
375
-
376
- THIS IS THE MOST CRITICAL PART OF THE INTEGRATION ANALYSIS!
377
-
378
- When a new story implements a feature, there are ALWAYS existing hardcoded
379
- values or placeholder implementations that the new feature is MEANT TO REPLACE.
380
-
381
- YOU MUST EXHAUSTIVELY SEARCH FOR:
382
-
383
- a. **Hardcoded Domain/Range Values:**
384
- - Search for hardcoded number ranges, dimensions, colors, sizes, offsets
385
- - Search for values that should come from the new entity/service
386
- - Use grep patterns like: `domain\(\[`, `= 0;`, `= 100`, `MIN_`, `MAX_`, `DEFAULT_`
387
-
388
- b. **Placeholder/Stub Implementations:**
389
- - Search for TODO comments mentioning the feature being implemented
390
- - Search for "temporary", "placeholder", "stub", "mock" in comments
391
- - Search for methods that return hardcoded values instead of computed ones
392
- - Use grep patterns: `TODO`, `TEMPORARY`, `placeholder`, `HARDCODED`
393
-
394
- c. **Disconnected Wiring:**
395
- - Search for classes/services that EXIST but are NOT USED where they should be
396
- - Find where the NEW entity/service SHOULD be injected but currently isn't
397
- - For every new entity/service being created, ask:
398
- - "What existing code currently does this job (probably poorly/hardcoded)?"
399
- - "Where should this entity be INJECTED that it currently ISN'T?"
400
- - "What hardcoded values exist that this entity should REPLACE?"
401
-
402
- d. **Inline Calculations That Should Use New Service:**
403
- - Search for inline calculations done manually instead of using the new entity
404
- - Search for duplicate calculation logic across multiple files
405
- - Use grep patterns: `Math.min`, `Math.max`, inline formulas
406
-
407
- e. **Manager/Service Classes with Hardcoded Defaults:**
408
- - Search manager/service classes that initialize with dummy values
409
- - These MUST be updated to receive values from the new entity
410
- - Find all `*Manager`, `*Service` classes in Infrastructure layer
411
-
412
- f. **Renderer/Handler Classes Not Using New Entity:**
413
- - When implementing a new feature, ALL relevant renderers/handlers must be checked
414
- - Verify they use the new entity instead of hardcoded values or direct calculations
415
-
416
- Output format for EACH discovered item:
417
- ```yaml
418
- FILE: [exact file path]
419
- LINE: [line number(s)]
420
- CURRENT CODE: |
421
- [actual code snippet from the file]
422
- PROBLEM: [why this is wrong]
423
- SHOULD BE: [what it should become after implementation]
424
- FIX REQUIRED: [specific action to take]
425
- ```
426
-
427
- 8. **[MANDATORY] Impact Analysis:**
428
- - Discover ALL code flows that might be impacted by the new implementation
429
- - Include specific file references for each impacted flow
430
- - Identify tests that need modification (include file paths)
431
- - Document all documentation files/flows requiring updates
432
-
433
- <!-- ── 7c: Phase 3 Refactoring & Strategy (4 mandatory items) ──── -->
434
-
435
- **Phase 3: Refactoring & Strategy Analysis — ALL 4 items MANDATORY:**
436
-
437
- 1. **[MANDATORY] Refactoring Requirements:**
438
- Determine if existing code needs refactoring to support the new implementation
439
- in a MAINTAINABLE / EXTENSIBLE way. Check for:
440
-
441
- - **Consolidation**: Duplicate code that should be unified
442
- - **Abstraction**: Concrete implementations that need interfaces
443
- - **Separation**: Mixed concerns that need splitting
444
- - **Generalization**: Specific code that could be made reusable
445
- - **Simplification**: Complex code that could be streamlined
446
- - **Standardization**: Inconsistent patterns needing alignment
447
-
448
- Common refactoring scenarios:
449
- - Pattern implementation violations (e.g., adding a new type when Strategy pattern should be used)
450
- - Constants/configuration scattered across files (centralize in Domain layer)
451
- - Model proliferation (extend existing models instead of creating duplicates)
452
- - Method duplication (reuse existing methods, don't recreate)
453
- - Incorrect layer violations (business logic in wrong layer)
454
- - Service sprawl (extend existing services if cohesive)
455
- - Event handler inconsistencies (follow established event patterns)
456
- - State management violations (follow established state patterns)
457
- - API integration inconsistencies (use existing API client services)
458
- - Type definition duplication (import and reuse existing types)
459
-
460
- **Even if no refactoring is needed, this section MUST be completed
461
- with the conclusion "no refactoring required" and justification.**
462
-
463
- 2. **[MANDATORY] Implementation Guidelines:**
464
- - Step-by-step implementation approach following coding standards
465
- - Optimal architectural placement for new code
466
- - Interface design for maximum flexibility
467
- - Dependency management approach
468
- - State management strategy
469
- - Error handling patterns to follow
470
- - Recommended implementation order
471
-
472
- 3. **[MANDATORY] Testing Strategy:**
473
- - How to test without breaking existing tests
474
- - Test patterns to follow (from testing framework doc)
475
- - Required test types (unit, integration, e2e)
476
- - Mocking strategies based on existing test patterns
477
- - Edge cases to cover
478
-
479
- 4. **[MANDATORY] Risk Mitigation:**
480
- - Backward compatibility considerations
481
- - Migration path for existing functionality
482
- - What existing functionality might be impacted
483
- - Performance implications
484
- - Breaking change risks
485
-
486
- <!-- ── 7d: Phase 4 AI Implementation Context (2 mandatory items) ── -->
487
-
488
- **Phase 4: AI Implementation Context — ALL 2 items MANDATORY:**
489
-
490
- 1. **[MANDATORY] Complete Analysis Findings:**
491
- Include ALL findings from the deep analysis:
492
- - Every discovered pattern with file references
493
- - Every relevant code snippet
494
- - Every architectural decision
495
- - Every potential issue
496
- - Every integration consideration
497
-
498
- 2. **[MANDATORY] Implementation References:**
499
- - **Internal Documentation**: List all relevant internal docs with full paths
500
- - **Code References**: List all files that should be studied before implementation,
501
- including specific functions/classes to use as examples and utility functions to reuse
502
- - **Design Patterns & Best Practices**: Link to specific design pattern documentation
503
- (e.g., https://refactoring.guru/design-patterns/strategy for Strategy pattern)
504
- - **Domain knowledge**: All naming conventions, error handling patterns,
505
- logging standards, performance considerations
506
-
507
- **CRITICAL REQUIREMENTS:**
508
- - **STORY SCOPE ONLY**: Focus exclusively on code relevant to the story
509
- - **COMPLETE COVERAGE**: Every file and method involved must be documented
510
- - **EXACT IMPLEMENTATIONS**: Include actual code snippets with file paths and line numbers
511
- - **CODING STANDARDS FIRST**: Verify ALL analysis against coding standards
512
- - **NO ASSUMPTIONS**: Only document what you actually find in the code
513
- </step>
514
-
515
- <!-- ══════════════════════════════════════════════════════════════════ -->
516
- <!-- STEP 8: WRITE OUTPUT -->
517
- <!-- ══════════════════════════════════════════════════════════════════ -->
518
-
519
- <step name="write-output" order="8">
520
-
521
- Write the complete analysis to `{OUTPUT_FILE}` following the template's
522
- `<output-format>` section exactly. Include ALL sections:
523
-
524
- 1. Header (story, date, metrics)
525
- 2. Use Case Overview
526
- 3. Architecture Compatibility (layer-by-layer analysis)
527
- 4. Existing Patterns to Follow (with file references)
528
- 5. Required Refactoring (even if "none needed")
529
- 6. CRITICAL: Hardcoded Values & Placeholder Code (with actual code snippets)
530
- 7. Integration Points (all touchpoints with existing system)
531
- 8. Impact Analysis (all affected flows and components)
532
- 9. Implementation Guidelines (step-by-step approach)
533
- 10. Testing Strategy (preserving existing tests)
534
- 11. Complete Analysis Findings
535
- 12. Implementation References (internal docs, code refs, patterns)
536
- 13. AI Implementation Context (complete context for executing agent)
537
-
538
- Use the Write tool to create the file. Include all findings from step 7.
539
-
540
- This is NOT a summary — it is a COMPLETE INTEGRATION ANALYSIS. Every section
541
- must contain actual code snippets, file paths with line numbers, and
542
- concrete implementation details.
543
-
544
- Display:
545
- ```
546
- + Analysis written to {OUTPUT_FILE}
547
- ```
548
- </step>
549
-
550
- <!-- ══════════════════════════════════════════════════════════════════ -->
551
- <!-- STEP 9: VALIDATION -->
552
- <!-- ══════════════════════════════════════════════════════════════════ -->
553
-
554
- <step name="validation" order="9">
555
-
556
- Read the output file and verify against the validation checklist
557
- defined in the template (story-integration-solution.xml):
558
-
559
- **File Creation Requirements:**
560
- - [ ] Analysis file created at {OUTPUT_FILE}
561
- - [ ] Story directory exists
562
- - [ ] File contains all required sections from template
563
-
564
- **Content Requirements Core Analysis:**
565
- - [ ] Tree structure showing current codebase structure
566
- - [ ] Tree structure showing proposed changes with new files
567
- - [ ] Architecture compatibility analysis completed (layer-by-layer)
568
- - [ ] All existing patterns identified with file references
569
- - [ ] Integration points clearly documented
570
- - [ ] Impact analysis showing affected components
571
-
572
- **Architecture Analysis Requirements:**
573
- - [ ] Clean Architecture compliance verified
574
- - [ ] Dependency injection strategy documented
575
- - [ ] Design patterns identified and documented
576
- - [ ] Coding standards compliance verified
577
- - [ ] Testing strategy that preserves existing tests
578
-
579
- **Hardcoded Values & Placeholder Discovery (CRITICAL!):**
580
- - [ ] Searched for hardcoded domain/range values
581
- - [ ] Searched for placeholder/TODO comments related to the feature
582
- - [ ] Identified ALL renderers/handlers that should use the new entity but don't
583
- - [ ] Identified ALL manager/service classes with hardcoded defaults
584
- - [ ] Found disconnected wiring (entity exists but not injected where needed)
585
- - [ ] Hardcoded values section filled with ACTUAL CODE SNIPPETS (not placeholders!)
586
- - [ ] Every hardcoded value includes: file path, line number, current code, fix required
587
-
588
- **Refactoring Requirements:**
589
- - [ ] Refactoring analysis completed (even if "no refactoring needed")
590
- - [ ] Implementation guidelines provided
591
- - [ ] Testing strategy documented
592
- - [ ] Risk mitigation considered
593
-
594
- **Total: 22 mandatory checklist items**
595
-
596
- If the output is incomplete or missing sections, go back and fill in
597
- the missing content before proceeding.
598
-
599
- Display:
600
- ```
601
- {check_mark} Analysis validated. {passed}/{total} checks passed.
602
- ```
603
- </step>
604
-
605
- <!-- ══════════════════════════════════════════════════════════════════ -->
606
- <!-- STEP 10: REVIEW AND APPROVE -->
607
- <!-- ══════════════════════════════════════════════════════════════════ -->
608
-
609
- <step name="review" order="10">
610
-
611
- Display a summary of the analysis:
612
- ```
613
- Analysis Summary:
614
- ────────
615
- Sections: {count}/13 | Checklist: {passed}/22
616
- Wiki docs loaded: {N} | Code references: {M}
617
- Hardcoded values found: {H} | Refactoring items: {R}
618
- ```
619
-
620
- Use AskUserQuestion:
621
- - header: "Analysis"
622
- - question: "Integration analysis written to `{OUTPUT_FILE}`. Review the file in your editor does the analysis look comprehensive?"
623
- - options:
624
- - "Approve" — Looks good, commit it
625
- - "Refine" — Some sections need more depth
626
- - "Skip commit" — Keep the file but don't commit yet
627
-
628
- **If "Approve":**
629
- Continue to step 11.
630
-
631
- **If "Refine":**
632
- - Ask what sections need more depth or what's missing
633
- - Go back to the relevant analysis phase, read more code, and update OUTPUT_FILE
634
- - Re-run validation (step 9)
635
- - Present for review again
636
-
637
- **If "Skip commit":**
638
- Display completion without commit:
639
- ```
640
- ╔══════════════════════════════════════════════════╗
641
- ║ ACE > Integration Analysis Complete (uncommitted)║
642
- ║ {Story ID} "{Story Title}" ║
643
- ╚══════════════════════════════════════════════════╝
644
-
645
- i Analysis written to {OUTPUT_FILE}
646
- File not committed — commit manually when ready.
647
- ```
648
- Exit workflow.
649
- </step>
650
-
651
- <!-- ══════════════════════════════════════════════════════════════════ -->
652
- <!-- STEP 11: COMMIT -->
653
- <!-- ══════════════════════════════════════════════════════════════════ -->
654
-
655
- <step name="commit" order="11">
656
-
657
- Stage and commit the analysis file:
658
-
659
- ```bash
660
- git add {OUTPUT_FILE}
661
- ```
662
-
663
- ```bash
664
- git commit -m "docs: integration analysis for {Story ID} — {Story Title}"
665
- ```
666
-
667
- Display completion:
668
-
669
- ```
670
- ╔══════════════════════════════════════════════════╗
671
- ║ ACE > Integration Analysis Complete ║
672
- ║ {Story ID} "{Story Title}" ║
673
- ╚══════════════════════════════════════════════════╝
674
-
675
- + {OUTPUT_FILE} committed.
676
-
677
- Metrics:
678
- ────────
679
- Wiki docs loaded: {N} | Code references: {M}
680
- Hardcoded values found: {H} | Refactoring items: {R}
681
-
682
- i Integration analysis complete. This artifact will be consumed
683
- by the technical solution (pass 5) when running plan-story.
684
-
685
- Next > Continue with story refinement:
686
- - Technical solution (pass 5)
687
- > /ace:research-integration-solution story=...
688
- Analyze another story's codebase integration.
689
- ```
690
- </step>
691
-
692
- </process>
693
-
694
- <success_criteria>
695
- - Story loaded and requirements extracted (User Story, Description, Acceptance Criteria)
696
- - All wiki references extracted from story's Relevant Wiki section
697
- - All wiki documents loaded (system-wide mandatory, subsystem as referenced)
698
- - Parent feature document loaded for broader context (if available)
699
- - External analysis loaded if present in story directory (auto-detected)
700
- - Output path resolved from story context
701
- - All 4 analysis phases executed directly (18 mandatory items completed)
702
- - Analysis file written with ALL template sections populated
703
- - NO assumptions made all findings backed by actual code references
704
- - Hardcoded values section filled with ACTUAL CODE SNIPPETS
705
- - Refactoring analysis completed (even if "no refactoring needed")
706
- - Coding standards compliance verified throughout
707
- - All 22 validation checklist items verified
708
- - User reviewed and approved the analysis
709
- - Document committed with appropriate message
710
- - No modifications made to the story file or GitHub issues
711
- </success_criteria>
712
-
713
- </workflow>
1
+ <workflow>
2
+
3
+ <purpose>
4
+ Perform COMPREHENSIVE, IN-DEPTH System Integration Analysis of how a specific story
5
+ should integrate into the existing codebase. Load the story requirements and wiki
6
+ references, validate inputs, load wiki documents and optional external analysis,
7
+ then execute exhaustive codebase analysis following the template's analysis-process
8
+ phases. Write the analysis to integration-analysis.md in the story's artifact directory.
9
+
10
+ Produces `.ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/integration-analysis.md`
11
+ — a comprehensive integration analysis with architecture compatibility, refactoring needs,
12
+ hardcoded values discovery, integration points, and implementation guidelines extracted
13
+ from deep analysis of the existing codebase.
14
+
15
+ This is pass 4 of the story specification pipeline (see story.xml composition).
16
+ All output is written ONLY to the analysis file — no GitHub updates, no modifications
17
+ to the story file.
18
+
19
+ This workflow is executed by the `ace-code-integration-analyst` agent
20
+ (spawned via `subagent_type="ace-code-integration-analyst"`).
21
+ </purpose>
22
+
23
+ <mandatory-context>
24
+ All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
25
+ Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
26
+ </mandatory-context>
27
+
28
+ <process>
29
+
30
+ <!-- ══════════════════════════════════════════════════════════════════ -->
31
+ <!-- STEP 1: SETUP -->
32
+ <!-- ══════════════════════════════════════════════════════════════════ -->
33
+
34
+ <step name="setup" order="1">
35
+ **MANDATORY FIRST STEP — Execute environment detection and story initialization:**
36
+
37
+ INIT is available from the preprocessed Environment Context above — do NOT re-run init.
38
+
39
+ This preprocessing validated the story parameter, extracted metadata/requirements/wiki
40
+ references, computed all paths and slugs, and checked artifact existence.
41
+
42
+ Parse INIT JSON for:
43
+ - **Environment**: `has_git`, `has_gh_cli`, `github_project`, `analyst_model`
44
+ - **Story validation**: `story_valid`, `story_error`, `story_source`
45
+ - **Story metadata**: `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
46
+ - **Requirements**: `user_story`, `description`, `acceptance_criteria_count`
47
+ - **Paths**: `paths.*` (story_dir, story_file, integration_analysis_file, external_analysis_file, feature_dir, feature_file, etc.)
48
+ - **Wiki**: `wiki_references` (system_wide, subsystem_docs, total_count), `wiki_docs_exist`
49
+ - **Artifacts**: `has_external_analysis`, `has_integration_analysis`, `has_feature_file`
50
+
51
+ Display stage banner:
52
+
53
+ ```
54
+ ╔══════════════════════════════════════════════════╗
55
+ ║ ACE > Research Integration Solution ║
56
+ ╚══════════════════════════════════════════════════╝
57
+ ```
58
+
59
+ **If `has_git` is false:** Initialize git:
60
+ ```bash
61
+ git init
62
+ ```
63
+
64
+ **If `INIT.story_valid` is false:**
65
+ Display error using `INIT.story_error` and exit.
66
+ </step>
67
+
68
+ <!-- ══════════════════════════════════════════════════════════════════ -->
69
+ <!-- STEP 2: VALIDATE & LOAD STORY -->
70
+ <!-- ══════════════════════════════════════════════════════════════════ -->
71
+
72
+ <step name="validate-story" order="2">
73
+
74
+ **Story validation, parsing, metadata extraction, wiki reference extraction,
75
+ and path computation were all completed by `init research-story` in step 1.**
76
+ All data is available in the INIT JSON.
77
+
78
+ Read the story file content for analysis context:
79
+
80
+ **If `INIT.story_source` is `file`:**
81
+ Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
82
+
83
+ **If `INIT.story_source` is `github-url` or `issue-number`:**
84
+ Fetch the issue body using INIT's GitHub project context:
85
+ ```bash
86
+ GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
87
+ ```
88
+ Store as STORY_CONTENT.
89
+
90
+ The story's User Story, Description, and Acceptance Criteria (from `INIT.user_story`,
91
+ `INIT.description`, `INIT.acceptance_criteria_count`) define WHAT functionality to
92
+ analyze for integration. The wiki references (from `INIT.wiki_references`) define
93
+ WHICH wiki documents to read for codebase context.
94
+
95
+ <!-- ── 2b: Load parent feature document ────────────────────────── -->
96
+
97
+ **If `INIT.has_feature_file` is true:**
98
+ Read the feature document at `INIT.paths.feature_file` and extract:
99
+ - Feature description and scope
100
+ - List of all stories in the feature (IDs, titles, descriptions)
101
+ - Dependencies between stories
102
+ - Shared components or services mentioned
103
+
104
+ **If `INIT.has_feature_file` is false:**
105
+ Proceed without — the analysis can still be done 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: coding standards NO EXCEPTIONS
145
+ - `.docs/wiki/system-wide/testing-framework.md` — Testing patterns and frameworks
146
+
147
+ **For any file in `INIT.wiki_docs_exist.missing`:** Display warning (non-fatal):
148
+ ```
149
+ ! Wiki document not found: {path}
150
+ Continuing without it.
151
+ ```
152
+
153
+ <!-- ── 3b: Subsystem documents ──────────────────────────────────── -->
154
+
155
+ **Subsystem documents load all from `INIT.wiki_references.subsystem_docs`:**
156
+
157
+ For EACH entry in `INIT.wiki_references.subsystem_docs`:
158
+ 1. Check if the path is in `INIT.wiki_docs_exist.existing` (already verified)
159
+ 2. If exists: read the file completely, store its content keyed by file path
160
+ 3. If missing: display warning (non-fatal) and continue
161
+
162
+ These subsystem documents provide the context that replaces:
163
+ - "documentation" parameter — wiki docs cover all relevant documentation
164
+ - "related-stories-implementations" — wiki documents capture knowledge from all stories
165
+ - "documented-features" — wiki documents catalog existing feature implementations
166
+
167
+ <!-- ── 3c: Display ───────────────────────────────────────────────── -->
168
+
169
+ Display:
170
+ ```
171
+ i Wiki documents loaded: {INIT.wiki_docs_exist.existing.length}/{INIT.wiki_references.total_count} files
172
+ System-wide: {count}/4 | Subsystem: {INIT.wiki_references.subsystem_docs.length} documents
173
+ Missing: {INIT.wiki_docs_exist.missing.length} (warnings shown above if any)
174
+ ```
175
+ </step>
176
+
177
+ <!-- ══════════════════════════════════════════════════════════════════ -->
178
+ <!-- STEP 4: CHECK FOR EXTERNAL ANALYSIS -->
179
+ <!-- ══════════════════════════════════════════════════════════════════ -->
180
+
181
+ <step name="check-external-analysis" order="4">
182
+
183
+ **External analysis existence was pre-checked by `init research-story`.**
184
+
185
+ The external analysis is produced by pass 3 (`/ace:research-external-solution`).
186
+ It is NOT a required input, but when present it provides valuable context about
187
+ how external/industry-standard systems implement this functionality.
188
+
189
+ **If `INIT.has_external_analysis` is true:**
190
+ Read the file at `INIT.paths.external_analysis_file`. Store as EXTERNAL_ANALYSIS_CONTENT.
191
+ Display:
192
+ ```
193
+ i External analysis found: {INIT.paths.external_analysis_file}
194
+ Will incorporate external system insights into integration analysis.
195
+ ```
196
+
197
+ **If `INIT.has_external_analysis` is false:**
198
+ Set EXTERNAL_ANALYSIS_CONTENT = null.
199
+ Display:
200
+ ```
201
+ i No external analysis found. Integration analysis will rely on
202
+ wiki documents and direct codebase exploration.
203
+ ```
204
+ </step>
205
+
206
+ <!-- ══════════════════════════════════════════════════════════════════ -->
207
+ <!-- STEP 5: RESOLVE OUTPUT PATH -->
208
+ <!-- ══════════════════════════════════════════════════════════════════ -->
209
+
210
+ <step name="resolve-output-path" order="5">
211
+
212
+ **Paths were pre-computed by `init research-story` in step 1.**
213
+
214
+ Set from INIT JSON:
215
+ - `STORY_DIR = INIT.paths.story_dir`
216
+ - `OUTPUT_FILE = INIT.paths.integration_analysis_file`
217
+
218
+ Ensure directory exists:
219
+ ```bash
220
+ mkdir -p {STORY_DIR}
221
+ ```
222
+
223
+ Display:
224
+ ```
225
+ i Output: {OUTPUT_FILE}
226
+ ```
227
+ </step>
228
+
229
+ <!-- ══════════════════════════════════════════════════════════════════ -->
230
+ <!-- STEP 6: CHECK EXISTING ANALYSIS -->
231
+ <!-- ══════════════════════════════════════════════════════════════════ -->
232
+
233
+ <step name="check-existing" order="6">
234
+
235
+ **If `INIT.has_integration_analysis` is true:**
236
+
237
+ Use AskUserQuestion:
238
+ - header: "Existing"
239
+ - question: "An integration analysis already exists at `{OUTPUT_FILE}`. What would you like to do?"
240
+ - options:
241
+ - "Overwrite" Discard and create a new analysis from scratch
242
+ - "Skip" — Keep the current analysis as-is
243
+
244
+ **If "Overwrite":** Continue to step 7.
245
+ **If "Skip":** Display message and exit workflow:
246
+ ```
247
+ i Keeping existing analysis. No changes made.
248
+ ```
249
+
250
+ **If not exists:** Continue to step 7.
251
+ </step>
252
+
253
+ <!-- ══════════════════════════════════════════════════════════════════ -->
254
+ <!-- STEP 7: EXECUTE ANALYSIS -->
255
+ <!-- ══════════════════════════════════════════════════════════════════ -->
256
+
257
+ <step name="execute-analysis" order="7">
258
+
259
+ Display:
260
+ ```
261
+ ┌──────────────────────────────────────────────────┐
262
+ │ ACE > Research Integration Solution > Analysis │
263
+ └──────────────────────────────────────────────────┘
264
+
265
+ i Starting deep codebase integration analysis.
266
+ Reading wiki documents, exploring source code,
267
+ and tracing integration points. This may take
268
+ several minutes.
269
+ ```
270
+
271
+ **Execute the complete analysis following the template's `<analysis-process>` section.**
272
+ The template (`story-integration-solution.xml`) defines 4 mandatory phases.
273
+ You ARE the code-integration-analyst perform the analysis directly.
274
+
275
+ <!-- ── 7a: Phase 1 Context Loading (4 mandatory items) ─────────── -->
276
+
277
+ **Phase 1: Context Loading**
278
+
279
+ 1. **[MANDATORY] Understand the story requirements:**
280
+ - Re-read STORY_CONTENT thoroughly — User Story, Description, all AC scenarios
281
+ - These define WHAT functionality needs to integrate into the codebase
282
+ - Extract the key behaviors, components, and patterns that will be needed
283
+ - If parent feature document was loaded, understand:
284
+ - The broader feature context
285
+ - What other stories exist and how they relate
286
+ - Dependencies and shared components between stories
287
+
288
+ 2. **[MANDATORY] Load and study wiki documents:**
289
+ - **Coding Standards** (from system-wide): STRONG EMPHASIS — NO EXCEPTIONS!
290
+ New code MUST strictly follow all coding standards.
291
+ - **System Architecture** (from system-wide): Understand the complete system
292
+ architecture and how this story fits into Clean Architecture layers.
293
+ - **System Structure** (from system-wide): Understand the codebase layout,
294
+ where relevant code lives, and the project file organization.
295
+ - **Testing Framework** (from system-wide): Understand testing patterns,
296
+ frameworks, and conventions.
297
+ - **All subsystem documents**: Read EVERY subsystem document referenced in the
298
+ story's Relevant Wiki section. These contain:
299
+ - System descriptions and boundaries
300
+ - Design patterns in use
301
+ - Cross-cutting concerns to respect
302
+ - Architecture Decision Records (ADRs) that constrain design
303
+ - Guides for common implementation tasks
304
+ - Walkthroughs of complex multi-class flows
305
+
306
+ 3. **[MANDATORY] Load external analysis (if available):**
307
+ - If EXTERNAL_ANALYSIS_CONTENT is set, study it for:
308
+ - How industry-standard systems implement this functionality
309
+ - Algorithms and formulas to reuse
310
+ - Design patterns from external implementations
311
+ - Best practices that should inform our integration
312
+
313
+ 4. **[MANDATORY] Load the parent feature document:**
314
+ - Understand the feature planning context
315
+ - Identify how this story fits within the broader feature
316
+ - Identify dependencies and integration points with other stories
317
+
318
+ <!-- ── 7b: Phase 2 Deep Codebase Analysis (8 mandatory items) ──── -->
319
+
320
+ **Phase 2: Deep Codebase Analysis — ALL 8 items MANDATORY, skip NONE:**
321
+
322
+ 1. **[MANDATORY] Architecture Compatibility Analysis:**
323
+ - Map how the new story fits into Clean Architecture layers:
324
+ - **Domain Layer**: New entities, value objects, constants needed
325
+ - **Application Layer**: Use cases, interfaces to create
326
+ - **Infrastructure Layer**: Services and implementations required
327
+ - **Presentation Layer**: UI components and API endpoints needed
328
+ - Verify Clean Architecture compliance: dependencies point inward
329
+ - Identify layer boundary violations that must be avoided
330
+
331
+ 2. **[MANDATORY] Pattern Recognition & Existing Patterns:**
332
+ - Search for similar features/patterns in the codebase
333
+ - Reference them with specific file paths and line numbers
334
+ - Document:
335
+ - Similar implementations to use as reference
336
+ - Established naming conventions
337
+ - Design patterns already in use (Strategy, Factory, Observer, etc.)
338
+ - Error handling patterns
339
+ - Logging approaches
340
+
341
+ 3. **[MANDATORY] Integration Point Discovery (Layer-by-Layer):**
342
+ Examine each architectural layer for integration opportunities:
343
+ - **Domain Layer**: Entity extensions, value objects, business rules
344
+ - **Application Layer**: Service interfaces, use cases, DTOs
345
+ - **Infrastructure Layer**: Repository patterns, external services
346
+ - **Presentation Layer**: UI components, view models, controllers
347
+ Find:
348
+ - Existing interfaces that can be extended
349
+ - Abstract classes available for inheritance
350
+ - Event systems for loose coupling
351
+ - Middleware or pipeline patterns
352
+ - Plugin or extension points
353
+ - Configuration-based feature toggles
354
+
355
+ 4. **[MANDATORY] File Dependency Analysis:**
356
+ - Identify ALL files that will be referenced or modified
357
+ - Document supporting files for the new implementation
358
+ - Map import chains and dependency graphs
359
+ - Identify potential circular dependency risks
360
+
361
+ 5. **[MANDATORY] Convention Compliance Analysis:**
362
+ - Document existing conventions that MUST be followed
363
+ - Verify the new implementation doesn't violate coding standards
364
+ - Check naming conventions, file organization, error handling
365
+
366
+ 6. **[MANDATORY] Testing Pattern Analysis:**
367
+ - Analyze current test patterns to ensure consistent validation approach
368
+ - Identify test utilities and helpers available for reuse
369
+ - Document testing conventions (unit, integration, e2e)
370
+ - Identify tests that need modification due to the new implementation
371
+
372
+ 7. **[MANDATORY] CRITICAL: Hardcoded Values & Placeholder Code Discovery:**
373
+
374
+ THIS IS THE MOST CRITICAL PART OF THE INTEGRATION ANALYSIS!
375
+
376
+ When a new story implements a feature, there are ALWAYS existing hardcoded
377
+ values or placeholder implementations that the new feature is MEANT TO REPLACE.
378
+
379
+ YOU MUST EXHAUSTIVELY SEARCH FOR:
380
+
381
+ a. **Hardcoded Domain/Range Values:**
382
+ - Search for hardcoded number ranges, dimensions, colors, sizes, offsets
383
+ - Search for values that should come from the new entity/service
384
+ - Use grep patterns like: `domain\(\[`, `= 0;`, `= 100`, `MIN_`, `MAX_`, `DEFAULT_`
385
+
386
+ b. **Placeholder/Stub Implementations:**
387
+ - Search for TODO comments mentioning the feature being implemented
388
+ - Search for "temporary", "placeholder", "stub", "mock" in comments
389
+ - Search for methods that return hardcoded values instead of computed ones
390
+ - Use grep patterns: `TODO`, `TEMPORARY`, `placeholder`, `HARDCODED`
391
+
392
+ c. **Disconnected Wiring:**
393
+ - Search for classes/services that EXIST but are NOT USED where they should be
394
+ - Find where the NEW entity/service SHOULD be injected but currently isn't
395
+ - For every new entity/service being created, ask:
396
+ - "What existing code currently does this job (probably poorly/hardcoded)?"
397
+ - "Where should this entity be INJECTED that it currently ISN'T?"
398
+ - "What hardcoded values exist that this entity should REPLACE?"
399
+
400
+ d. **Inline Calculations That Should Use New Service:**
401
+ - Search for inline calculations done manually instead of using the new entity
402
+ - Search for duplicate calculation logic across multiple files
403
+ - Use grep patterns: `Math.min`, `Math.max`, inline formulas
404
+
405
+ e. **Manager/Service Classes with Hardcoded Defaults:**
406
+ - Search manager/service classes that initialize with dummy values
407
+ - These MUST be updated to receive values from the new entity
408
+ - Find all `*Manager`, `*Service` classes in Infrastructure layer
409
+
410
+ f. **Renderer/Handler Classes Not Using New Entity:**
411
+ - When implementing a new feature, ALL relevant renderers/handlers must be checked
412
+ - Verify they use the new entity instead of hardcoded values or direct calculations
413
+
414
+ Output format for EACH discovered item:
415
+ ```yaml
416
+ FILE: [exact file path]
417
+ LINE: [line number(s)]
418
+ CURRENT CODE: |
419
+ [actual code snippet from the file]
420
+ PROBLEM: [why this is wrong]
421
+ SHOULD BE: [what it should become after implementation]
422
+ FIX REQUIRED: [specific action to take]
423
+ ```
424
+
425
+ 8. **[MANDATORY] Impact Analysis:**
426
+ - Discover ALL code flows that might be impacted by the new implementation
427
+ - Include specific file references for each impacted flow
428
+ - Identify tests that need modification (include file paths)
429
+ - Document all documentation files/flows requiring updates
430
+
431
+ <!-- ── 7c: Phase 3 Refactoring & Strategy (4 mandatory items) ──── -->
432
+
433
+ **Phase 3: Refactoring & Strategy Analysis — ALL 4 items MANDATORY:**
434
+
435
+ 1. **[MANDATORY] Refactoring Requirements:**
436
+ Determine if existing code needs refactoring to support the new implementation
437
+ in a MAINTAINABLE / EXTENSIBLE way. Check for:
438
+
439
+ - **Consolidation**: Duplicate code that should be unified
440
+ - **Abstraction**: Concrete implementations that need interfaces
441
+ - **Separation**: Mixed concerns that need splitting
442
+ - **Generalization**: Specific code that could be made reusable
443
+ - **Simplification**: Complex code that could be streamlined
444
+ - **Standardization**: Inconsistent patterns needing alignment
445
+
446
+ Common refactoring scenarios:
447
+ - Pattern implementation violations (e.g., adding a new type when Strategy pattern should be used)
448
+ - Constants/configuration scattered across files (centralize in Domain layer)
449
+ - Model proliferation (extend existing models instead of creating duplicates)
450
+ - Method duplication (reuse existing methods, don't recreate)
451
+ - Incorrect layer violations (business logic in wrong layer)
452
+ - Service sprawl (extend existing services if cohesive)
453
+ - Event handler inconsistencies (follow established event patterns)
454
+ - State management violations (follow established state patterns)
455
+ - API integration inconsistencies (use existing API client services)
456
+ - Type definition duplication (import and reuse existing types)
457
+
458
+ **Even if no refactoring is needed, this section MUST be completed
459
+ with the conclusion "no refactoring required" and justification.**
460
+
461
+ 2. **[MANDATORY] Implementation Guidelines:**
462
+ - Step-by-step implementation approach following coding standards
463
+ - Optimal architectural placement for new code
464
+ - Interface design for maximum flexibility
465
+ - Dependency management approach
466
+ - State management strategy
467
+ - Error handling patterns to follow
468
+ - Recommended implementation order
469
+
470
+ 3. **[MANDATORY] Testing Strategy:**
471
+ - How to test without breaking existing tests
472
+ - Test patterns to follow (from testing framework doc)
473
+ - Required test types (unit, integration, e2e)
474
+ - Mocking strategies based on existing test patterns
475
+ - Edge cases to cover
476
+
477
+ 4. **[MANDATORY] Risk Mitigation:**
478
+ - Backward compatibility considerations
479
+ - Migration path for existing functionality
480
+ - What existing functionality might be impacted
481
+ - Performance implications
482
+ - Breaking change risks
483
+
484
+ <!-- ── 7d: Phase 4 — AI Implementation Context (2 mandatory items) ── -->
485
+
486
+ **Phase 4: AI Implementation Context — ALL 2 items MANDATORY:**
487
+
488
+ 1. **[MANDATORY] Complete Analysis Findings:**
489
+ Include ALL findings from the deep analysis:
490
+ - Every discovered pattern with file references
491
+ - Every relevant code snippet
492
+ - Every architectural decision
493
+ - Every potential issue
494
+ - Every integration consideration
495
+
496
+ 2. **[MANDATORY] Implementation References:**
497
+ - **Internal Documentation**: List all relevant internal docs with full paths
498
+ - **Code References**: List all files that should be studied before implementation,
499
+ including specific functions/classes to use as examples and utility functions to reuse
500
+ - **Design Patterns & Best Practices**: Link to specific design pattern documentation
501
+ (e.g., https://refactoring.guru/design-patterns/strategy for Strategy pattern)
502
+ - **Domain knowledge**: All naming conventions, error handling patterns,
503
+ logging standards, performance considerations
504
+
505
+ **CRITICAL REQUIREMENTS:**
506
+ - **STORY SCOPE ONLY**: Focus exclusively on code relevant to the story
507
+ - **COMPLETE COVERAGE**: Every file and method involved must be documented
508
+ - **EXACT IMPLEMENTATIONS**: Include actual code snippets with file paths and line numbers
509
+ - **CODING STANDARDS FIRST**: Verify ALL analysis against coding standards
510
+ - **NO ASSUMPTIONS**: Only document what you actually find in the code
511
+ </step>
512
+
513
+ <!-- ══════════════════════════════════════════════════════════════════ -->
514
+ <!-- STEP 8: WRITE OUTPUT -->
515
+ <!-- ══════════════════════════════════════════════════════════════════ -->
516
+
517
+ <step name="write-output" order="8">
518
+
519
+ Write the complete analysis to `{OUTPUT_FILE}` following the template's
520
+ `<output-format>` section exactly. Include ALL sections:
521
+
522
+ 1. Header (story, date, metrics)
523
+ 2. Use Case Overview
524
+ 3. Architecture Compatibility (layer-by-layer analysis)
525
+ 4. Existing Patterns to Follow (with file references)
526
+ 5. Required Refactoring (even if "none needed")
527
+ 6. CRITICAL: Hardcoded Values & Placeholder Code (with actual code snippets)
528
+ 7. Integration Points (all touchpoints with existing system)
529
+ 8. Impact Analysis (all affected flows and components)
530
+ 9. Implementation Guidelines (step-by-step approach)
531
+ 10. Testing Strategy (preserving existing tests)
532
+ 11. Complete Analysis Findings
533
+ 12. Implementation References (internal docs, code refs, patterns)
534
+ 13. AI Implementation Context (complete context for executing agent)
535
+
536
+ Use the Write tool to create the file. Include all findings from step 7.
537
+
538
+ This is NOT a summary it is a COMPLETE INTEGRATION ANALYSIS. Every section
539
+ must contain actual code snippets, file paths with line numbers, and
540
+ concrete implementation details.
541
+
542
+ Display:
543
+ ```
544
+ + Analysis written to {OUTPUT_FILE}
545
+ ```
546
+ </step>
547
+
548
+ <!-- ══════════════════════════════════════════════════════════════════ -->
549
+ <!-- STEP 9: VALIDATION -->
550
+ <!-- ══════════════════════════════════════════════════════════════════ -->
551
+
552
+ <step name="validation" order="9">
553
+
554
+ Read the output file and verify against the validation checklist
555
+ defined in the template (story-integration-solution.xml):
556
+
557
+ **File Creation Requirements:**
558
+ - [ ] Analysis file created at {OUTPUT_FILE}
559
+ - [ ] Story directory exists
560
+ - [ ] File contains all required sections from template
561
+
562
+ **Content Requirements Core Analysis:**
563
+ - [ ] Tree structure showing current codebase structure
564
+ - [ ] Tree structure showing proposed changes with new files
565
+ - [ ] Architecture compatibility analysis completed (layer-by-layer)
566
+ - [ ] All existing patterns identified with file references
567
+ - [ ] Integration points clearly documented
568
+ - [ ] Impact analysis showing affected components
569
+
570
+ **Architecture Analysis Requirements:**
571
+ - [ ] Clean Architecture compliance verified
572
+ - [ ] Dependency injection strategy documented
573
+ - [ ] Design patterns identified and documented
574
+ - [ ] Coding standards compliance verified
575
+ - [ ] Testing strategy that preserves existing tests
576
+
577
+ **Hardcoded Values & Placeholder Discovery (CRITICAL!):**
578
+ - [ ] Searched for hardcoded domain/range values
579
+ - [ ] Searched for placeholder/TODO comments related to the feature
580
+ - [ ] Identified ALL renderers/handlers that should use the new entity but don't
581
+ - [ ] Identified ALL manager/service classes with hardcoded defaults
582
+ - [ ] Found disconnected wiring (entity exists but not injected where needed)
583
+ - [ ] Hardcoded values section filled with ACTUAL CODE SNIPPETS (not placeholders!)
584
+ - [ ] Every hardcoded value includes: file path, line number, current code, fix required
585
+
586
+ **Refactoring Requirements:**
587
+ - [ ] Refactoring analysis completed (even if "no refactoring needed")
588
+ - [ ] Implementation guidelines provided
589
+ - [ ] Testing strategy documented
590
+ - [ ] Risk mitigation considered
591
+
592
+ **Total: 22 mandatory checklist items**
593
+
594
+ If the output is incomplete or missing sections, go back and fill in
595
+ the missing content before proceeding.
596
+
597
+ Display:
598
+ ```
599
+ {check_mark} Analysis validated. {passed}/{total} checks passed.
600
+ ```
601
+ </step>
602
+
603
+ <!-- ══════════════════════════════════════════════════════════════════ -->
604
+ <!-- STEP 10: REVIEW AND APPROVE -->
605
+ <!-- ══════════════════════════════════════════════════════════════════ -->
606
+
607
+ <step name="review" order="10">
608
+
609
+ Display a summary of the analysis:
610
+ ```
611
+ Analysis Summary:
612
+ ────────
613
+ Sections: {count}/13 | Checklist: {passed}/22
614
+ Wiki docs loaded: {N} | Code references: {M}
615
+ Hardcoded values found: {H} | Refactoring items: {R}
616
+ ```
617
+
618
+ Use AskUserQuestion:
619
+ - header: "Analysis"
620
+ - question: "Integration analysis written to `{OUTPUT_FILE}`. Review the file in your editor — does the analysis look comprehensive?"
621
+ - options:
622
+ - "Approve"Looks good, commit it
623
+ - "Refine" — Some sections need more depth
624
+ - "Skip commit" — Keep the file but don't commit yet
625
+
626
+ **If "Approve":**
627
+ Continue to step 11.
628
+
629
+ **If "Refine":**
630
+ - Ask what sections need more depth or what's missing
631
+ - Go back to the relevant analysis phase, read more code, and update OUTPUT_FILE
632
+ - Re-run validation (step 9)
633
+ - Present for review again
634
+
635
+ **If "Skip commit":**
636
+ Display completion without commit:
637
+ ```
638
+ ╔══════════════════════════════════════════════════╗
639
+ ║ ACE > Integration Analysis Complete (uncommitted)║
640
+ ║ {Story ID} "{Story Title}" ║
641
+ ╚══════════════════════════════════════════════════╝
642
+
643
+ i Analysis written to {OUTPUT_FILE}
644
+ File not committed — commit manually when ready.
645
+ ```
646
+ Exit workflow.
647
+ </step>
648
+
649
+ <!-- ══════════════════════════════════════════════════════════════════ -->
650
+ <!-- STEP 11: COMMIT -->
651
+ <!-- ══════════════════════════════════════════════════════════════════ -->
652
+
653
+ <step name="commit" order="11">
654
+
655
+ Stage and commit the analysis file:
656
+
657
+ ```bash
658
+ git add {OUTPUT_FILE}
659
+ ```
660
+
661
+ ```bash
662
+ git commit -m "docs: integration analysis for {Story ID} — {Story Title}"
663
+ ```
664
+
665
+ Display completion:
666
+
667
+ ```
668
+ ╔══════════════════════════════════════════════════╗
669
+ ║ ACE > Integration Analysis Complete ║
670
+ ║ {Story ID} "{Story Title}" ║
671
+ ╚══════════════════════════════════════════════════╝
672
+
673
+ + {OUTPUT_FILE} committed.
674
+
675
+ Metrics:
676
+ ────────
677
+ Wiki docs loaded: {N} | Code references: {M}
678
+ Hardcoded values found: {H} | Refactoring items: {R}
679
+
680
+ i Integration analysis complete. This artifact will be consumed
681
+ by the technical solution (pass 5) when running plan-story.
682
+
683
+ Next > Continue with story refinement:
684
+ - Technical solution (pass 5)
685
+ > /ace:research-integration-solution story=...
686
+ Analyze another story's codebase integration.
687
+ ```
688
+ </step>
689
+
690
+ </process>
691
+
692
+ <success_criteria>
693
+ - Story loaded and requirements extracted (User Story, Description, Acceptance Criteria)
694
+ - All wiki references extracted from story's Relevant Wiki section
695
+ - All wiki documents loaded (system-wide mandatory, subsystem as referenced)
696
+ - Parent feature document loaded for broader context (if available)
697
+ - External analysis loaded if present in story directory (auto-detected)
698
+ - Output path resolved from story context
699
+ - All 4 analysis phases executed directly (18 mandatory items completed)
700
+ - Analysis file written with ALL template sections populated
701
+ - NO assumptions made all findings backed by actual code references
702
+ - Hardcoded values section filled with ACTUAL CODE SNIPPETS
703
+ - Refactoring analysis completed (even if "no refactoring needed")
704
+ - Coding standards compliance verified throughout
705
+ - All 22 validation checklist items verified
706
+ - User reviewed and approved the analysis
707
+ - Document committed with appropriate message
708
+ - No modifications made to the story file or GitHub issues
709
+ </success_criteria>
710
+
711
+ </workflow>