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.
- package/.claude-plugin/marketplace.json +18 -0
- package/.claude-plugin/plugin.json +10 -0
- package/CHANGELOG.md +7 -1
- package/LICENSE +51 -51
- package/README.md +330 -318
- package/agents/ace-code-discovery-analyst.md +245 -245
- package/agents/ace-code-integration-analyst.md +248 -248
- package/agents/ace-code-reviewer.md +375 -375
- package/agents/ace-product-owner.md +365 -361
- package/agents/ace-project-researcher.md +606 -606
- package/agents/ace-research-synthesizer.md +228 -228
- package/agents/ace-technical-application-architect.md +315 -315
- package/agents/ace-wiki-mapper.md +449 -445
- package/bin/install.js +605 -195
- package/hooks/ace-check-update.js +71 -62
- package/hooks/ace-statusline.js +107 -89
- package/hooks/hooks.json +14 -0
- package/package.json +7 -5
- package/shared/lib/ace-core.js +361 -0
- package/shared/lib/ace-core.test.js +308 -0
- package/shared/lib/ace-github.js +753 -0
- package/shared/lib/ace-story.js +400 -0
- package/shared/lib/ace-story.test.js +250 -0
- package/{agile-context-engineering → shared}/utils/questioning.xml +110 -110
- package/{agile-context-engineering → shared}/utils/ui-formatting.md +299 -299
- package/{commands/ace/execute-story.md → skills/execute-story/SKILL.md} +116 -138
- package/skills/execute-story/script.js +291 -0
- package/skills/execute-story/script.test.js +261 -0
- package/{agile-context-engineering/templates/product/story.xml → skills/execute-story/story-template.xml} +451 -451
- package/skills/execute-story/walkthrough-template.xml +255 -0
- package/{agile-context-engineering/workflows/execute-story.xml → skills/execute-story/workflow.xml} +1221 -1219
- package/skills/help/SKILL.md +71 -0
- package/skills/help/script.js +315 -0
- package/skills/help/script.test.js +183 -0
- package/{agile-context-engineering/workflows/help.xml → skills/help/workflow.xml} +544 -533
- package/{commands/ace/init-coding-standards.md → skills/init-coding-standards/SKILL.md} +91 -83
- package/{agile-context-engineering/templates/wiki/coding-standards.xml → skills/init-coding-standards/coding-standards-template.xml} +531 -531
- package/skills/init-coding-standards/script.js +50 -0
- package/skills/init-coding-standards/script.test.js +70 -0
- package/{agile-context-engineering/workflows/init-coding-standards.xml → skills/init-coding-standards/workflow.xml} +381 -386
- package/skills/map-cross-cutting/SKILL.md +126 -0
- package/{agile-context-engineering/templates/wiki → skills/map-cross-cutting}/system-cross-cutting.xml +197 -197
- package/skills/map-cross-cutting/workflow.xml +330 -0
- package/skills/map-guide/SKILL.md +126 -0
- package/{agile-context-engineering/templates/wiki → skills/map-guide}/guide.xml +137 -137
- package/skills/map-guide/workflow.xml +320 -0
- package/skills/map-pattern/SKILL.md +125 -0
- package/{agile-context-engineering/templates/wiki → skills/map-pattern}/pattern.xml +159 -159
- package/skills/map-pattern/workflow.xml +331 -0
- package/{commands/ace/map-story.md → skills/map-story/SKILL.md} +180 -165
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/decizions.xml +115 -115
- package/skills/map-story/templates/guide.xml +137 -0
- package/skills/map-story/templates/pattern.xml +159 -0
- package/skills/map-story/templates/system-cross-cutting.xml +197 -0
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/system.xml +381 -381
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/tech-debt-index.xml +125 -125
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/walkthrough.xml +255 -255
- package/{agile-context-engineering/workflows/map-story.xml → skills/map-story/workflow.xml} +1046 -1046
- package/{commands/ace/map-subsystem.md → skills/map-subsystem/SKILL.md} +155 -140
- package/skills/map-subsystem/script.js +51 -0
- package/skills/map-subsystem/script.test.js +68 -0
- package/skills/map-subsystem/templates/decizions.xml +115 -0
- package/skills/map-subsystem/templates/guide.xml +137 -0
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/module-discovery.xml +174 -174
- package/skills/map-subsystem/templates/pattern.xml +159 -0
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-architecture.xml +343 -343
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-structure.xml +234 -234
- package/skills/map-subsystem/templates/system-cross-cutting.xml +197 -0
- package/skills/map-subsystem/templates/system.xml +381 -0
- package/skills/map-subsystem/templates/walkthrough.xml +255 -0
- package/{agile-context-engineering/workflows/map-subsystem.xml → skills/map-subsystem/workflow.xml} +1173 -1178
- package/skills/map-sys-doc/SKILL.md +125 -0
- package/skills/map-sys-doc/system.xml +381 -0
- package/skills/map-sys-doc/workflow.xml +336 -0
- package/{commands/ace/map-system.md → skills/map-system/SKILL.md} +103 -92
- package/skills/map-system/script.js +75 -0
- package/skills/map-system/script.test.js +73 -0
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-architecture.xml +254 -254
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-structure.xml +177 -177
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/testing-framework.xml +283 -283
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/wiki-readme.xml +296 -296
- package/{agile-context-engineering/workflows/map-system.xml → skills/map-system/workflow.xml} +667 -672
- package/{commands/ace/map-walkthrough.md → skills/map-walkthrough/SKILL.md} +140 -127
- package/skills/map-walkthrough/walkthrough.xml +255 -0
- package/{agile-context-engineering/workflows/map-walkthrough.xml → skills/map-walkthrough/workflow.xml} +457 -457
- package/{commands/ace/plan-backlog.md → skills/plan-backlog/SKILL.md} +93 -83
- package/{agile-context-engineering/templates/product/product-backlog.xml → skills/plan-backlog/product-backlog-template.xml} +231 -231
- package/skills/plan-backlog/script.js +121 -0
- package/skills/plan-backlog/script.test.js +83 -0
- package/{agile-context-engineering/workflows/plan-backlog.xml → skills/plan-backlog/workflow.xml} +1348 -1356
- package/{commands/ace/plan-feature.md → skills/plan-feature/SKILL.md} +99 -89
- package/{agile-context-engineering/templates/product/feature.xml → skills/plan-feature/feature-template.xml} +361 -361
- package/skills/plan-feature/script.js +131 -0
- package/skills/plan-feature/script.test.js +80 -0
- package/{agile-context-engineering/workflows/plan-feature.xml → skills/plan-feature/workflow.xml} +1487 -1495
- package/{commands/ace/plan-product-vision.md → skills/plan-product-vision/SKILL.md} +91 -81
- package/{agile-context-engineering/templates/product/product-vision.xml → skills/plan-product-vision/product-vision-template.xml} +227 -227
- package/skills/plan-product-vision/script.js +51 -0
- package/skills/plan-product-vision/script.test.js +69 -0
- package/{agile-context-engineering/workflows/plan-product-vision.xml → skills/plan-product-vision/workflow.xml} +337 -342
- package/{commands/ace/plan-story.md → skills/plan-story/SKILL.md} +139 -159
- package/skills/plan-story/script.js +295 -0
- package/skills/plan-story/script.test.js +240 -0
- package/skills/plan-story/story-template.xml +458 -0
- package/{agile-context-engineering/workflows/plan-story.xml → skills/plan-story/workflow.xml} +1301 -944
- package/{commands/ace/research-external-solution.md → skills/research-external-solution/SKILL.md} +120 -138
- package/{agile-context-engineering/templates/product/external-solution.xml → skills/research-external-solution/external-solution-template.xml} +832 -832
- package/skills/research-external-solution/script.js +229 -0
- package/skills/research-external-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-external-solution.xml → skills/research-external-solution/workflow.xml} +657 -659
- package/{commands/ace/research-integration-solution.md → skills/research-integration-solution/SKILL.md} +121 -135
- package/{agile-context-engineering/templates/product/story-integration-solution.xml → skills/research-integration-solution/integration-solution-template.xml} +1015 -1015
- package/skills/research-integration-solution/script.js +223 -0
- package/skills/research-integration-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-integration-solution.xml → skills/research-integration-solution/workflow.xml} +711 -713
- package/{commands/ace/research-story-wiki.md → skills/research-story-wiki/SKILL.md} +101 -116
- package/skills/research-story-wiki/script.js +223 -0
- package/skills/research-story-wiki/script.test.js +138 -0
- package/{agile-context-engineering/templates/product/story-wiki.xml → skills/research-story-wiki/story-wiki-template.xml} +194 -194
- package/{agile-context-engineering/workflows/research-story-wiki.xml → skills/research-story-wiki/workflow.xml} +473 -475
- package/{commands/ace/research-technical-solution.md → skills/research-technical-solution/SKILL.md} +131 -147
- package/skills/research-technical-solution/script.js +223 -0
- package/skills/research-technical-solution/script.test.js +134 -0
- package/{agile-context-engineering/templates/product/story-technical-solution.xml → skills/research-technical-solution/technical-solution-template.xml} +1025 -1025
- package/{agile-context-engineering/workflows/research-technical-solution.xml → skills/research-technical-solution/workflow.xml} +761 -763
- package/{commands/ace/review-story.md → skills/review-story/SKILL.md} +99 -109
- package/skills/review-story/script.js +249 -0
- package/skills/review-story/script.test.js +169 -0
- package/skills/review-story/story-template.xml +451 -0
- package/{agile-context-engineering/workflows/review-story.xml → skills/review-story/workflow.xml} +279 -281
- package/{commands/ace/update.md → skills/update/SKILL.md} +65 -56
- package/{agile-context-engineering/workflows/update.xml → skills/update/workflow.xml} +33 -18
- package/agile-context-engineering/src/ace-tools.js +0 -2881
- package/agile-context-engineering/src/ace-tools.test.js +0 -1089
- package/agile-context-engineering/templates/_command.md +0 -54
- package/agile-context-engineering/templates/_workflow.xml +0 -17
- package/agile-context-engineering/templates/config.json +0 -0
- package/agile-context-engineering/templates/product/integration-solution.xml +0 -0
- package/commands/ace/help.md +0 -93
|
@@ -1,659 +1,657 @@
|
|
|
1
|
-
<workflow>
|
|
2
|
-
|
|
3
|
-
<purpose>
|
|
4
|
-
Perform COMPREHENSIVE, IN-DEPTH, CODE-LEVEL analysis of how a specific story
|
|
5
|
-
is implemented in an external reference system. Load the story requirements, validate
|
|
6
|
-
the external codebase, optionally load external documentation, then execute exhaustive
|
|
7
|
-
code analysis following the template's analysis-process phases. Write the analysis to
|
|
8
|
-
external-analysis.md in the story's artifact directory.
|
|
9
|
-
|
|
10
|
-
Produces `.ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/external-analysis.md`
|
|
11
|
-
— a comprehensive code-level analysis with algorithms, patterns, formulas, and
|
|
12
|
-
implementation details extracted verbatim from the external system's code.
|
|
13
|
-
|
|
14
|
-
This is pass 3 of the story specification pipeline (see story.xml composition).
|
|
15
|
-
All output is written ONLY to the analysis file — no GitHub updates, no modifications
|
|
16
|
-
to the story file.
|
|
17
|
-
|
|
18
|
-
This workflow is executed by the `ace-code-discovery-analyst` agent
|
|
19
|
-
(spawned via `subagent_type="ace-code-discovery-analyst"`).
|
|
20
|
-
</purpose>
|
|
21
|
-
|
|
22
|
-
<mandatory-context>
|
|
23
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
Use
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
**
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
- **
|
|
354
|
-
- **
|
|
355
|
-
- **
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
-
|
|
382
|
-
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
- **
|
|
389
|
-
- **
|
|
390
|
-
- **
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
-
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
-
|
|
404
|
-
-
|
|
405
|
-
-
|
|
406
|
-
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
-
|
|
412
|
-
-
|
|
413
|
-
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
-
|
|
420
|
-
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
**
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
-
|
|
431
|
-
-
|
|
432
|
-
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
-
|
|
438
|
-
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
-
|
|
450
|
-
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
**
|
|
455
|
-
- **
|
|
456
|
-
- **
|
|
457
|
-
- **
|
|
458
|
-
- **
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
- [ ]
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
- [ ]
|
|
515
|
-
- [ ]
|
|
516
|
-
- [ ]
|
|
517
|
-
- [ ]
|
|
518
|
-
- [ ]
|
|
519
|
-
- [ ]
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
- [ ]
|
|
525
|
-
- [ ]
|
|
526
|
-
- [ ]
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
- [ ]
|
|
532
|
-
- [ ]
|
|
533
|
-
- [ ]
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
- [ ] Minimum
|
|
539
|
-
- [ ]
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
- "
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
-
|
|
581
|
-
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
```
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
-
|
|
644
|
-
-
|
|
645
|
-
-
|
|
646
|
-
-
|
|
647
|
-
-
|
|
648
|
-
-
|
|
649
|
-
-
|
|
650
|
-
-
|
|
651
|
-
-
|
|
652
|
-
-
|
|
653
|
-
-
|
|
654
|
-
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
</workflow>
|
|
1
|
+
<workflow>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Perform COMPREHENSIVE, IN-DEPTH, CODE-LEVEL analysis of how a specific story
|
|
5
|
+
is implemented in an external reference system. Load the story requirements, validate
|
|
6
|
+
the external codebase, optionally load external documentation, then execute exhaustive
|
|
7
|
+
code analysis following the template's analysis-process phases. Write the analysis to
|
|
8
|
+
external-analysis.md in the story's artifact directory.
|
|
9
|
+
|
|
10
|
+
Produces `.ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/external-analysis.md`
|
|
11
|
+
— a comprehensive code-level analysis with algorithms, patterns, formulas, and
|
|
12
|
+
implementation details extracted verbatim from the external system's code.
|
|
13
|
+
|
|
14
|
+
This is pass 3 of the story specification pipeline (see story.xml composition).
|
|
15
|
+
All output is written ONLY to the analysis file — no GitHub updates, no modifications
|
|
16
|
+
to the story file.
|
|
17
|
+
|
|
18
|
+
This workflow is executed by the `ace-code-discovery-analyst` agent
|
|
19
|
+
(spawned via `subagent_type="ace-code-discovery-analyst"`).
|
|
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, external_analysis_file, feature_dir, feature_file, etc.)
|
|
47
|
+
- **Artifacts**: `has_external_analysis`, `has_integration_analysis`, `has_feature_file`
|
|
48
|
+
|
|
49
|
+
Display stage banner:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
╔══════════════════════════════════════════════════╗
|
|
53
|
+
║ ACE > Research External Solution ║
|
|
54
|
+
╚══════════════════════════════════════════════════╝
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**If `has_git` is false:** Initialize git:
|
|
58
|
+
```bash
|
|
59
|
+
git init
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**If `INIT.story_valid` is false:**
|
|
63
|
+
Display error using `INIT.story_error` and exit.
|
|
64
|
+
</step>
|
|
65
|
+
|
|
66
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
67
|
+
<!-- STEP 2: VALIDATE & LOAD STORY -->
|
|
68
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
69
|
+
|
|
70
|
+
<step name="validate-story" order="2">
|
|
71
|
+
|
|
72
|
+
**Story validation, parsing, and path computation were completed by
|
|
73
|
+
`init research-story` in step 1.** All metadata, requirements, and
|
|
74
|
+
paths are available in the INIT JSON.
|
|
75
|
+
|
|
76
|
+
Read the story file content for analysis context:
|
|
77
|
+
|
|
78
|
+
**If `INIT.story_source` is `file`:**
|
|
79
|
+
Read the file at `INIT.paths.story_file`. Store as STORY_CONTENT.
|
|
80
|
+
|
|
81
|
+
**If `INIT.story_source` is `github-url` or `issue-number`:**
|
|
82
|
+
Fetch the issue body using INIT's GitHub project context:
|
|
83
|
+
```bash
|
|
84
|
+
GH_STORY=$(gh issue view {issue_number} --repo {INIT.github_project.owner}/{INIT.github_project.repo} --json body -q .body)
|
|
85
|
+
```
|
|
86
|
+
Store as STORY_CONTENT.
|
|
87
|
+
|
|
88
|
+
The story's User Story, Description, and Acceptance Criteria define
|
|
89
|
+
WHAT functionality to analyze in the external codebase. These are the
|
|
90
|
+
requirements — do NOT seek requirements from other sources.
|
|
91
|
+
Wiki references from `INIT.wiki_references` may inform exploration.
|
|
92
|
+
|
|
93
|
+
<!-- ── 2b: Read parent feature document ───────────────────────── -->
|
|
94
|
+
|
|
95
|
+
**If `INIT.has_feature_file` is true:**
|
|
96
|
+
Read the feature document at `INIT.paths.feature_file` and extract:
|
|
97
|
+
- Feature description and scope
|
|
98
|
+
- List of all stories in the feature (IDs, titles, descriptions)
|
|
99
|
+
- Dependencies between stories
|
|
100
|
+
- Shared components or services mentioned
|
|
101
|
+
This informs the "Story Integration Within Feature" section.
|
|
102
|
+
|
|
103
|
+
**If `INIT.has_feature_file` is false:**
|
|
104
|
+
Proceed without — the analysis can still be done without feature context.
|
|
105
|
+
|
|
106
|
+
<!-- ── 2c: Display ───────────────────────────────────────────────── -->
|
|
107
|
+
|
|
108
|
+
Set pre-computed paths from INIT:
|
|
109
|
+
- `STORY_FILE = INIT.paths.story_file`
|
|
110
|
+
- `STORY_DIR = INIT.paths.story_dir`
|
|
111
|
+
|
|
112
|
+
Display:
|
|
113
|
+
```
|
|
114
|
+
i Story loaded: {INIT.story.id} — {INIT.story.title}
|
|
115
|
+
Feature: {INIT.feature.id} — {INIT.feature.title}
|
|
116
|
+
Epic: {INIT.epic.id} — {INIT.epic.title}
|
|
117
|
+
Requirements: {INIT.acceptance_criteria_count} acceptance criteria scenarios
|
|
118
|
+
```
|
|
119
|
+
</step>
|
|
120
|
+
|
|
121
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
122
|
+
<!-- STEP 3: VALIDATE EXTERNAL CODEBASE -->
|
|
123
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
124
|
+
|
|
125
|
+
<step name="validate-external-codebase" order="3">
|
|
126
|
+
|
|
127
|
+
Parse the `external-codebase` parameter from $ARGUMENTS.
|
|
128
|
+
|
|
129
|
+
<!-- ── 3a: Local path ────────────────────────────────────────────── -->
|
|
130
|
+
|
|
131
|
+
**If local path:**
|
|
132
|
+
|
|
133
|
+
Confirm folder exists and contains source code:
|
|
134
|
+
```bash
|
|
135
|
+
ls {external_codebase_path}/
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**If not valid:** Display error and exit:
|
|
139
|
+
```
|
|
140
|
+
x External codebase not found: {external_codebase_path}
|
|
141
|
+
Provide a valid local path to a source code directory
|
|
142
|
+
or a GitHub repository URL.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Set `EXTERNAL_CODEBASE_PATH = {external_codebase_path}`
|
|
146
|
+
|
|
147
|
+
<!-- ── 3b: GitHub URL ────────────────────────────────────────────── -->
|
|
148
|
+
|
|
149
|
+
**If GitHub URL:**
|
|
150
|
+
|
|
151
|
+
Verify repository accessibility:
|
|
152
|
+
```bash
|
|
153
|
+
gh repo view {repo_identifier} --json name,url 2>/dev/null
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**If not accessible:** Display error and exit:
|
|
157
|
+
```
|
|
158
|
+
x External repository not accessible: {repo_url}
|
|
159
|
+
Verify the URL is correct and the repository is public
|
|
160
|
+
or you have access.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Set `EXTERNAL_CODEBASE_PATH = {resolved path or URL}`
|
|
164
|
+
|
|
165
|
+
<!-- ── 3c: Display ───────────────────────────────────────────────── -->
|
|
166
|
+
|
|
167
|
+
Display:
|
|
168
|
+
```
|
|
169
|
+
i External codebase: {EXTERNAL_CODEBASE_PATH}
|
|
170
|
+
```
|
|
171
|
+
</step>
|
|
172
|
+
|
|
173
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
174
|
+
<!-- STEP 4: LOAD EXTERNAL DOCS (OPTIONAL) -->
|
|
175
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
176
|
+
|
|
177
|
+
<step name="load-external-docs" order="4">
|
|
178
|
+
|
|
179
|
+
Parse the `external-docs` parameter from $ARGUMENTS.
|
|
180
|
+
|
|
181
|
+
<!-- ── 4a: Not provided ──────────────────────────────────────────── -->
|
|
182
|
+
|
|
183
|
+
**If not provided:**
|
|
184
|
+
|
|
185
|
+
Check if context7 MCP server is available (check if `mcp__context7__resolve-library-id`
|
|
186
|
+
or similar context7 tools are available in the current tool set).
|
|
187
|
+
|
|
188
|
+
**If context7 available:**
|
|
189
|
+
Set `USE_CONTEXT7 = true`
|
|
190
|
+
Display:
|
|
191
|
+
```
|
|
192
|
+
i No external docs provided.
|
|
193
|
+
context7 MCP server detected — will use it for library documentation.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**If context7 not available:**
|
|
197
|
+
Set `USE_CONTEXT7 = false`
|
|
198
|
+
Display:
|
|
199
|
+
```
|
|
200
|
+
i No external docs provided. Analysis will rely on code exploration.
|
|
201
|
+
TIP: Provide external-docs= for richer analysis,
|
|
202
|
+
or install context7 MCP server for automatic library docs.
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
<!-- ── 4b: Provided as weblink ───────────────────────────────────── -->
|
|
206
|
+
|
|
207
|
+
**If provided as weblink:**
|
|
208
|
+
|
|
209
|
+
Verify URL accessibility (attempt a fetch or HEAD request).
|
|
210
|
+
|
|
211
|
+
**If not accessible:** Display warning (non-fatal):
|
|
212
|
+
```
|
|
213
|
+
! External docs URL not accessible: {url}
|
|
214
|
+
Continuing without external docs.
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**If accessible:**
|
|
218
|
+
Store as `EXTERNAL_DOCS_URL = {url}`
|
|
219
|
+
Display:
|
|
220
|
+
```
|
|
221
|
+
i External docs: {url}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
<!-- ── 4c: Provided as filepath ──────────────────────────────────── -->
|
|
225
|
+
|
|
226
|
+
**If provided as filepath:**
|
|
227
|
+
|
|
228
|
+
Verify file exists:
|
|
229
|
+
```bash
|
|
230
|
+
DOCS_EXISTS=$(node "${CLAUDE_SKILL_DIR}/script.js" verify-path-exists {filepath} --raw)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**If not exists:** Display warning (non-fatal):
|
|
234
|
+
```
|
|
235
|
+
! External docs file not found: {filepath}
|
|
236
|
+
Continuing without external docs.
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**If exists:** Read the file. Store as `EXTERNAL_DOCS_CONTENT`.
|
|
240
|
+
Display:
|
|
241
|
+
```
|
|
242
|
+
i External docs: {filepath}
|
|
243
|
+
```
|
|
244
|
+
</step>
|
|
245
|
+
|
|
246
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
247
|
+
<!-- STEP 5: RESOLVE OUTPUT PATH -->
|
|
248
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
249
|
+
|
|
250
|
+
<step name="resolve-output-path" order="5">
|
|
251
|
+
|
|
252
|
+
**Paths were pre-computed by `init research-story` in step 1.**
|
|
253
|
+
|
|
254
|
+
Set from INIT JSON:
|
|
255
|
+
- `STORY_DIR = INIT.paths.story_dir`
|
|
256
|
+
- `OUTPUT_FILE = INIT.paths.external_analysis_file`
|
|
257
|
+
|
|
258
|
+
Ensure directory exists:
|
|
259
|
+
```bash
|
|
260
|
+
mkdir -p {STORY_DIR}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Display:
|
|
264
|
+
```
|
|
265
|
+
i Output: {OUTPUT_FILE}
|
|
266
|
+
```
|
|
267
|
+
</step>
|
|
268
|
+
|
|
269
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
270
|
+
<!-- STEP 6: CHECK EXISTING ANALYSIS -->
|
|
271
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
272
|
+
|
|
273
|
+
<step name="check-existing" order="6">
|
|
274
|
+
|
|
275
|
+
**If `INIT.has_external_analysis` is true:**
|
|
276
|
+
|
|
277
|
+
Use AskUserQuestion:
|
|
278
|
+
- header: "Existing"
|
|
279
|
+
- question: "An external analysis already exists at `{OUTPUT_FILE}`. What would you like to do?"
|
|
280
|
+
- options:
|
|
281
|
+
- "Overwrite" — Discard and create a new analysis from scratch
|
|
282
|
+
- "Skip" — Keep the current analysis as-is
|
|
283
|
+
|
|
284
|
+
**If "Overwrite":** Continue to step 7.
|
|
285
|
+
**If "Skip":** Display message and exit workflow:
|
|
286
|
+
```
|
|
287
|
+
i Keeping existing analysis. No changes made.
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**If not exists:** Continue to step 7.
|
|
291
|
+
</step>
|
|
292
|
+
|
|
293
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
294
|
+
<!-- STEP 7: EXECUTE ANALYSIS -->
|
|
295
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
296
|
+
|
|
297
|
+
<step name="execute-analysis" order="7">
|
|
298
|
+
|
|
299
|
+
Display:
|
|
300
|
+
```
|
|
301
|
+
┌──────────────────────────────────────────────────┐
|
|
302
|
+
│ ACE > Research External Solution > Analysis │
|
|
303
|
+
└──────────────────────────────────────────────────┘
|
|
304
|
+
|
|
305
|
+
i Starting deep code-level analysis.
|
|
306
|
+
Reading 30+ files and tracing execution paths
|
|
307
|
+
5+ levels deep. This may take several minutes.
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Execute the complete analysis following the template's `<analysis-process>` section.**
|
|
311
|
+
The template (`external-solution.xml`) defines 3 mandatory phases with 16 total items.
|
|
312
|
+
You ARE the code-discovery-analyst — perform the analysis directly.
|
|
313
|
+
|
|
314
|
+
<!-- ── 7a: Phase 1 — Initial Discovery (3 mandatory items) ───────── -->
|
|
315
|
+
|
|
316
|
+
**Phase 1: Initial Discovery**
|
|
317
|
+
|
|
318
|
+
1. **[MANDATORY] Understand the story requirements:**
|
|
319
|
+
- Re-read STORY_CONTENT thoroughly — User Story, Description, all AC scenarios
|
|
320
|
+
- These define WHAT functionality to analyze in the external codebase
|
|
321
|
+
- Extract the key behaviors, algorithms, and patterns to look for
|
|
322
|
+
- If parent feature document was loaded (step 2c), understand:
|
|
323
|
+
- The broader feature context
|
|
324
|
+
- What other stories exist and how they relate
|
|
325
|
+
- Dependencies and shared components between stories
|
|
326
|
+
|
|
327
|
+
2. **[MANDATORY] Explore available documentation:**
|
|
328
|
+
- **external-docs** (if EXTERNAL_DOCS_URL or EXTERNAL_DOCS_CONTENT set):
|
|
329
|
+
Review for implementation context, API documentation, architecture overview.
|
|
330
|
+
If URL: use WebFetch to retrieve content.
|
|
331
|
+
Use documentation to guide code exploration.
|
|
332
|
+
- **context7 MCP server** (if USE_CONTEXT7 is true — PREFERRED):
|
|
333
|
+
Use `mcp__context7__resolve-library-id` to find the library,
|
|
334
|
+
then `mcp__context7__get-library-docs` to fetch relevant docs.
|
|
335
|
+
**ALWAYS prefer context7** when the external system is a known library/framework.
|
|
336
|
+
- If neither available: rely entirely on code exploration.
|
|
337
|
+
|
|
338
|
+
3. **[MANDATORY] Locate the implementation:**
|
|
339
|
+
- Find where the story's functionality is implemented in `EXTERNAL_CODEBASE_PATH`
|
|
340
|
+
- Start with likely entry points: exports, public APIs, event handlers
|
|
341
|
+
- Use Grep/Glob to find relevant files by keywords from the story
|
|
342
|
+
- Read README files and documentation in the external codebase for structural guidance
|
|
343
|
+
- Build an initial map of involved files before deep diving
|
|
344
|
+
|
|
345
|
+
<!-- ── 7b: Phase 2 — Deep Implementation Analysis (9 mandatory items) ── -->
|
|
346
|
+
|
|
347
|
+
**Phase 2: Deep Implementation Analysis — ALL 9 items MANDATORY, skip NONE:**
|
|
348
|
+
|
|
349
|
+
1. **[MANDATORY] Complete Entry Points & Triggers Identification (CRITICAL):**
|
|
350
|
+
Document ALL entry points into the story functionality:
|
|
351
|
+
- **User Action Triggers**: button clicks, form submissions, keyboard shortcuts
|
|
352
|
+
- **API Entry Points**: REST endpoints, GraphQL mutations, RPC calls
|
|
353
|
+
- **Event-Based Triggers**: WebSocket messages, system events, pub/sub messages
|
|
354
|
+
- **Scheduled/Automated Triggers**: cron jobs, timers, intervals
|
|
355
|
+
- **External System Triggers**: webhooks, callbacks, integrations
|
|
356
|
+
For EACH entry point document:
|
|
357
|
+
```typescript
|
|
358
|
+
// Entry Point Type: [User Action/API/Event/etc.]
|
|
359
|
+
// File: src/path/file.ts:45-60
|
|
360
|
+
// Trigger: [Exact trigger description]
|
|
361
|
+
// Parameters: [List all parameters with types]
|
|
362
|
+
// Example usage: [Show actual usage example]
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
2. **[MANDATORY] Complete Code Path Mapping:**
|
|
366
|
+
- Follow EVERY code path from entry to completion
|
|
367
|
+
- Include ALL branches, conditionals, and edge cases
|
|
368
|
+
- Document every file, class, method, and function involved
|
|
369
|
+
- Track all data transformations and state changes
|
|
370
|
+
- Minimum call depth: 5+ levels
|
|
371
|
+
|
|
372
|
+
3. **[MANDATORY] Story-Specific File Tree:**
|
|
373
|
+
- Document ONLY files involved in this story (NOT entire codebase)
|
|
374
|
+
- Categorize as: CORE, SUPPORT, CONFIG, TEST
|
|
375
|
+
- Include line counts and one-line purpose for each file
|
|
376
|
+
- Include total file count and line count at bottom
|
|
377
|
+
|
|
378
|
+
4. **[MANDATORY] Constants & Configuration Extraction:**
|
|
379
|
+
- Extract ALL constants and configuration values used by the story
|
|
380
|
+
- Include ACTUAL values from code, NOT placeholders
|
|
381
|
+
- Group by category: performance limits, business thresholds, magic numbers
|
|
382
|
+
- Always include source file path and line numbers
|
|
383
|
+
|
|
384
|
+
5. **[MANDATORY] Algorithm & Formula Documentation:**
|
|
385
|
+
For each calculation or algorithm found:
|
|
386
|
+
- **Purpose**: What it calculates/achieves
|
|
387
|
+
- **Formula**: Exact mathematical formula or logic
|
|
388
|
+
- **Implementation**: Code snippet showing implementation
|
|
389
|
+
- **Example**: Sample input/output with explanation
|
|
390
|
+
- **Edge Cases**: How they handle special cases
|
|
391
|
+
|
|
392
|
+
6. **[MANDATORY] Comprehensive Flow Diagram:**
|
|
393
|
+
Create a detailed Mermaid sequence diagram showing:
|
|
394
|
+
- Complete execution flow with ALL branches
|
|
395
|
+
- Actual method names and parameters (NOT generic names)
|
|
396
|
+
- Data flow between components
|
|
397
|
+
- State changes and side effects
|
|
398
|
+
- Error handling paths
|
|
399
|
+
|
|
400
|
+
7. **[MANDATORY] Test Patterns Extraction:**
|
|
401
|
+
- Extract actual test cases from the external system
|
|
402
|
+
- Include test code snippets with assertions
|
|
403
|
+
- Document test scenarios covered
|
|
404
|
+
- Note edge cases tested
|
|
405
|
+
- Extract test data patterns
|
|
406
|
+
- Identify mocking strategies used
|
|
407
|
+
|
|
408
|
+
8. **[MANDATORY] Performance Considerations:**
|
|
409
|
+
- Caching strategies used
|
|
410
|
+
- Algorithm optimizations
|
|
411
|
+
- Throttling/debouncing patterns
|
|
412
|
+
- Memory management techniques
|
|
413
|
+
- Batch processing approaches
|
|
414
|
+
Include code references for each optimization.
|
|
415
|
+
|
|
416
|
+
9. **[MANDATORY] Validation & Security:**
|
|
417
|
+
- Input validation rules with actual validation code
|
|
418
|
+
- Data sanitization methods
|
|
419
|
+
- Security checks implemented
|
|
420
|
+
- Error boundaries
|
|
421
|
+
Include actual code snippets showing validation logic.
|
|
422
|
+
|
|
423
|
+
<!-- ── 7c: Phase 3 — Pattern & Architecture Analysis (4 mandatory items) ── -->
|
|
424
|
+
|
|
425
|
+
**Phase 3: Pattern & Architecture Analysis — ALL 4 items MANDATORY:**
|
|
426
|
+
|
|
427
|
+
1. **[MANDATORY] Design Patterns Identified:**
|
|
428
|
+
- Document all design patterns used (Strategy, Observer, Factory, etc.)
|
|
429
|
+
- Explain WHY they chose each pattern
|
|
430
|
+
- Include code examples of pattern implementation
|
|
431
|
+
- Note patterns shared with other parts of the system
|
|
432
|
+
- Identify if patterns enable component integration/communication
|
|
433
|
+
|
|
434
|
+
2. **[MANDATORY] Component Lifecycle:**
|
|
435
|
+
- Initialization sequence
|
|
436
|
+
- State management approach
|
|
437
|
+
- Cleanup/disposal mechanisms
|
|
438
|
+
- Memory management considerations
|
|
439
|
+
|
|
440
|
+
3. **[MANDATORY] Performance Optimizations:**
|
|
441
|
+
- Caching strategies
|
|
442
|
+
- Algorithm optimizations
|
|
443
|
+
- Rendering optimizations (if applicable)
|
|
444
|
+
- Data structure choices for performance
|
|
445
|
+
|
|
446
|
+
4. **[MANDATORY] Error Handling & Edge Cases:**
|
|
447
|
+
- How they handle errors at each architectural level
|
|
448
|
+
- Validation approaches
|
|
449
|
+
- Fallback mechanisms
|
|
450
|
+
- Boundary conditions
|
|
451
|
+
|
|
452
|
+
**CRITICAL REQUIREMENTS:**
|
|
453
|
+
- **NO ASSUMPTIONS**: Only document what you actually find in the code
|
|
454
|
+
- **STORY SCOPE ONLY**: Focus exclusively on code paths related to the story
|
|
455
|
+
- **COMPLETE COVERAGE**: Every file and method involved must be documented
|
|
456
|
+
- **EXACT IMPLEMENTATIONS**: Include actual code snippets, not descriptions
|
|
457
|
+
- **FORMULAS & CALCULATIONS**: Extract and explain ALL mathematical operations
|
|
458
|
+
- **METRICS**: Minimum 30+ files read, 50+ code references, 5+ call depth
|
|
459
|
+
</step>
|
|
460
|
+
|
|
461
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
462
|
+
<!-- STEP 8: WRITE OUTPUT -->
|
|
463
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
464
|
+
|
|
465
|
+
<step name="write-output" order="8">
|
|
466
|
+
|
|
467
|
+
Write the complete analysis to `{OUTPUT_FILE}` following the template's
|
|
468
|
+
`<output-format>` section exactly. Include ALL sections:
|
|
469
|
+
|
|
470
|
+
1. Header (repository, version, story, date, metrics)
|
|
471
|
+
2. Implementation Overview
|
|
472
|
+
3. Entry Points & Triggers (categorized by type)
|
|
473
|
+
4. Story-Specific File Tree
|
|
474
|
+
5. Constants & Configuration
|
|
475
|
+
6. Core Implementation (Algorithms, Data Flow with Mermaid diagram, Key Components)
|
|
476
|
+
7. Code Examples
|
|
477
|
+
8. Test Patterns
|
|
478
|
+
9. Validation & Security
|
|
479
|
+
10. Performance Optimizations
|
|
480
|
+
11. Architecture Decisions (Design Patterns, Lifecycle, Error Handling)
|
|
481
|
+
12. Story Integration Within Feature
|
|
482
|
+
13. Lessons for Our Implementation
|
|
483
|
+
14. Complete File Reference
|
|
484
|
+
|
|
485
|
+
Use the Write tool to create the file. Include all findings from step 7.
|
|
486
|
+
|
|
487
|
+
This is NOT a summary — it is a COMPLETE CODE EXTRACTION. Every section
|
|
488
|
+
must contain actual code snippets, file paths with line numbers, and
|
|
489
|
+
concrete implementation details.
|
|
490
|
+
|
|
491
|
+
Display:
|
|
492
|
+
```
|
|
493
|
+
+ Analysis written to {OUTPUT_FILE}
|
|
494
|
+
```
|
|
495
|
+
</step>
|
|
496
|
+
|
|
497
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
498
|
+
<!-- STEP 9: VALIDATION -->
|
|
499
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
500
|
+
|
|
501
|
+
<step name="validation" order="9">
|
|
502
|
+
|
|
503
|
+
Read the output file and verify against the validation checklist
|
|
504
|
+
defined in the template (external-solution.xml):
|
|
505
|
+
|
|
506
|
+
**File Creation Requirements:**
|
|
507
|
+
- [ ] Analysis file created at {OUTPUT_FILE}
|
|
508
|
+
- [ ] Story directory exists
|
|
509
|
+
- [ ] File contains all required sections from template
|
|
510
|
+
|
|
511
|
+
**Content Requirements — Core Analysis:**
|
|
512
|
+
- [ ] CRITICAL: No assumptions — analysis reflects 100% accurate code, no guessing
|
|
513
|
+
- [ ] Complete Entry Points & Triggers section with ALL trigger types
|
|
514
|
+
- [ ] Story-Specific File Tree showing ONLY files involved in story
|
|
515
|
+
- [ ] Constants & Configuration section with actual values
|
|
516
|
+
- [ ] Mermaid sequence diagram showing complete data flow
|
|
517
|
+
- [ ] All algorithms and formulas extracted with explanations
|
|
518
|
+
- [ ] Code examples included from external implementation
|
|
519
|
+
- [ ] Architecture patterns identified and documented
|
|
520
|
+
|
|
521
|
+
**Content Requirements — Enhanced Sections:**
|
|
522
|
+
- [ ] Test Patterns section with actual test code
|
|
523
|
+
- [ ] Validation & Security section with validation rules
|
|
524
|
+
- [ ] Performance Optimizations documented
|
|
525
|
+
- [ ] Story Integration Within Feature section completed
|
|
526
|
+
- [ ] Complete File Reference with file roles
|
|
527
|
+
|
|
528
|
+
**Analysis Quality Requirements:**
|
|
529
|
+
- [ ] All entry points categorized (User/API/Event/External)
|
|
530
|
+
- [ ] Complete code path mapping documented (5+ levels deep)
|
|
531
|
+
- [ ] Error handling approaches analyzed
|
|
532
|
+
- [ ] No assumptions made — only documented what was found in code
|
|
533
|
+
- [ ] Lessons for our implementation clearly stated
|
|
534
|
+
|
|
535
|
+
**Metrics Requirements:**
|
|
536
|
+
- [ ] Minimum 30+ files read for the story
|
|
537
|
+
- [ ] Minimum 50+ code references documented
|
|
538
|
+
- [ ] Minimum 5+ call depth traced
|
|
539
|
+
- [ ] All metrics reported in output header
|
|
540
|
+
|
|
541
|
+
**Total: 23 mandatory checklist items**
|
|
542
|
+
|
|
543
|
+
If the output is incomplete or missing sections, go back and fill in
|
|
544
|
+
the missing content before proceeding.
|
|
545
|
+
|
|
546
|
+
Display:
|
|
547
|
+
```
|
|
548
|
+
{check_mark} Analysis validated. {passed}/{total} checks passed.
|
|
549
|
+
```
|
|
550
|
+
</step>
|
|
551
|
+
|
|
552
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
553
|
+
<!-- STEP 10: REVIEW AND APPROVE -->
|
|
554
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
555
|
+
|
|
556
|
+
<step name="review" order="10">
|
|
557
|
+
|
|
558
|
+
Display a summary of the analysis:
|
|
559
|
+
```
|
|
560
|
+
Analysis Summary:
|
|
561
|
+
────────
|
|
562
|
+
Files analyzed: {N} | Code references: {M} | Call depth: {D}
|
|
563
|
+
Sections: {count}/14 | Checklist: {passed}/23
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
Use AskUserQuestion:
|
|
567
|
+
- header: "Analysis"
|
|
568
|
+
- question: "External analysis written to `{OUTPUT_FILE}`. Review the file in your editor — does the analysis look comprehensive?"
|
|
569
|
+
- options:
|
|
570
|
+
- "Approve" — Looks good, commit it
|
|
571
|
+
- "Refine" — Some sections need more depth
|
|
572
|
+
- "Skip commit" — Keep the file but don't commit yet
|
|
573
|
+
|
|
574
|
+
**If "Approve":**
|
|
575
|
+
Continue to step 11.
|
|
576
|
+
|
|
577
|
+
**If "Refine":**
|
|
578
|
+
- Ask what sections need more depth or what's missing
|
|
579
|
+
- Go back to the relevant analysis phase, read more code, and update OUTPUT_FILE
|
|
580
|
+
- Re-run validation (step 9)
|
|
581
|
+
- Present for review again
|
|
582
|
+
|
|
583
|
+
**If "Skip commit":**
|
|
584
|
+
Display completion without commit:
|
|
585
|
+
```
|
|
586
|
+
╔══════════════════════════════════════════════════╗
|
|
587
|
+
║ ACE > External Analysis Complete (uncommitted) ║
|
|
588
|
+
║ {Story ID} "{Story Title}" ║
|
|
589
|
+
╚══════════════════════════════════════════════════╝
|
|
590
|
+
|
|
591
|
+
i Analysis written to {OUTPUT_FILE}
|
|
592
|
+
File not committed — commit manually when ready.
|
|
593
|
+
```
|
|
594
|
+
Exit workflow.
|
|
595
|
+
</step>
|
|
596
|
+
|
|
597
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
598
|
+
<!-- STEP 11: COMMIT -->
|
|
599
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
600
|
+
|
|
601
|
+
<step name="commit" order="11">
|
|
602
|
+
|
|
603
|
+
Stage and commit the analysis file:
|
|
604
|
+
|
|
605
|
+
```bash
|
|
606
|
+
git add {OUTPUT_FILE}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
```bash
|
|
610
|
+
git commit -m "docs: external analysis for {Story ID} — {Story Title}"
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
Display completion:
|
|
614
|
+
|
|
615
|
+
```
|
|
616
|
+
╔══════════════════════════════════════════════════╗
|
|
617
|
+
║ ACE > External Analysis Complete ║
|
|
618
|
+
║ {Story ID} "{Story Title}" ║
|
|
619
|
+
╚══════════════════════════════════════════════════╝
|
|
620
|
+
|
|
621
|
+
+ {OUTPUT_FILE} committed.
|
|
622
|
+
|
|
623
|
+
Metrics:
|
|
624
|
+
────────
|
|
625
|
+
Files analyzed: {N} | Code references: {M} | Call depth: {D}
|
|
626
|
+
|
|
627
|
+
i External analysis complete. This artifact will be consumed
|
|
628
|
+
by the technical solution (pass 5) when running plan-story.
|
|
629
|
+
|
|
630
|
+
Next > Continue with story refinement:
|
|
631
|
+
- Integration analysis (pass 4)
|
|
632
|
+
- Technical solution (pass 5)
|
|
633
|
+
> /ace:research-external-solution story=... external-codebase=...
|
|
634
|
+
Analyze another story's external implementation.
|
|
635
|
+
```
|
|
636
|
+
</step>
|
|
637
|
+
|
|
638
|
+
</process>
|
|
639
|
+
|
|
640
|
+
<success_criteria>
|
|
641
|
+
- Story loaded and requirements extracted (User Story, Description, Acceptance Criteria)
|
|
642
|
+
- Parent feature document loaded for broader context (if available)
|
|
643
|
+
- External codebase validated and accessible (local path or GitHub URL)
|
|
644
|
+
- External docs loaded if provided, or context7 used if available
|
|
645
|
+
- Output path resolved from story context
|
|
646
|
+
- All 3 analysis phases executed directly (16 mandatory items completed)
|
|
647
|
+
- Analysis file written with ALL template sections populated
|
|
648
|
+
- NO assumptions made — all findings backed by actual code references
|
|
649
|
+
- Minimum metrics met: 30+ files read, 50+ code references, 5+ call depth
|
|
650
|
+
- Mermaid sequence diagram included in the analysis
|
|
651
|
+
- All 23 validation checklist items verified
|
|
652
|
+
- User reviewed and approved the analysis
|
|
653
|
+
- Document committed with appropriate message
|
|
654
|
+
- No modifications made to the story file or GitHub issues
|
|
655
|
+
</success_criteria>
|
|
656
|
+
|
|
657
|
+
</workflow>
|