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
package/{agile-context-engineering/workflows/map-subsystem.xml → skills/map-subsystem/workflow.xml}
RENAMED
|
@@ -1,1178 +1,1173 @@
|
|
|
1
|
-
<workflow>
|
|
2
|
-
|
|
3
|
-
<purpose>
|
|
4
|
-
Orchestrate subsystem wiki mapping: resolve the target subsystem, load system-wide context,
|
|
5
|
-
determine which documents need creation or updates, spawn ace-wiki-mapper agents to produce
|
|
6
|
-
them, run module discovery, and generate knowledge documentation via map-story.
|
|
7
|
-
|
|
8
|
-
Produces documents in `.docs/wiki/subsystems/[subsystem-name]/`:
|
|
9
|
-
- structure.md — physical file layout within the subsystem
|
|
10
|
-
- architecture.md — L3 component view, flows, dependencies, data ownership
|
|
11
|
-
- systems/*.md — domain system documentation (via map-story)
|
|
12
|
-
- patterns/*.md — reusable implementation patterns (via map-story)
|
|
13
|
-
- cross-cutting/*.md — concerns spanning multiple systems (via map-story)
|
|
14
|
-
- guides/*.md — step-by-step recipes for common tasks (via map-story)
|
|
15
|
-
- walkthroughs/*.md — deep tutorial-style flow explanations (via map-story)
|
|
16
|
-
- decisions/*.md — architecture decision records (via map-story)
|
|
17
|
-
|
|
18
|
-
Also produces `.ace/artifacts/subsystems/[subsystem-name]/module-discovery/module-discovery.md`.
|
|
19
|
-
|
|
20
|
-
May also update `.docs/wiki/system-wide/system-structure.md` if this subsystem
|
|
21
|
-
is not yet listed there, and `.docs/wiki/system-wide/system-architecture.md` if
|
|
22
|
-
the subsystem is missing from the Subsystem Responsibility Matrix.
|
|
23
|
-
</purpose>
|
|
24
|
-
|
|
25
|
-
<mandatory-context>
|
|
26
|
-
|
|
27
|
-
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
28
|
-
</mandatory-context>
|
|
29
|
-
|
|
30
|
-
<process>
|
|
31
|
-
|
|
32
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
33
|
-
<!-- STEP 1: SETUP -->
|
|
34
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
35
|
-
|
|
36
|
-
<step name="setup" order="1">
|
|
37
|
-
|
|
38
|
-
<substep order="1.1" name="environment-detection">
|
|
39
|
-
MANDATORY FIRST STEP — Execute environment detection before any user interaction:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
INIT
|
|
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
|
-
</substep>
|
|
94
|
-
|
|
95
|
-
<substep order="2.
|
|
96
|
-
While reading `system-
|
|
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
|
-
<item>
|
|
289
|
-
<item>
|
|
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
|
-
|
|
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
|
-
<item>
|
|
380
|
-
<item>
|
|
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
|
-
<substep order="8.
|
|
450
|
-
If
|
|
451
|
-
|
|
452
|
-
</substep>
|
|
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
|
-
|
|
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
|
-
<substep order="10.
|
|
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
|
-
<item>
|
|
605
|
-
<item>
|
|
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
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
<pattern>
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
<item>
|
|
723
|
-
<item>
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
<instruction order="
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
**
|
|
857
|
-
**
|
|
858
|
-
|
|
859
|
-
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
<item>
|
|
872
|
-
<item>
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
**
|
|
972
|
-
**
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
**
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
<instruction order="
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
</instruction>
|
|
1012
|
-
|
|
1013
|
-
<instruction order="
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
</instruction>
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
[
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
</
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
<criterion>
|
|
1161
|
-
<criterion>
|
|
1162
|
-
<criterion>
|
|
1163
|
-
<criterion>
|
|
1164
|
-
<criterion>
|
|
1165
|
-
<criterion>
|
|
1166
|
-
<criterion>
|
|
1167
|
-
<criterion>
|
|
1168
|
-
<criterion>
|
|
1169
|
-
<criterion>
|
|
1170
|
-
<criterion>
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
<criterion>module-discovery.md staged and committed</criterion>
|
|
1175
|
-
<criterion>User sees clear completion summary with next steps</criterion>
|
|
1176
|
-
</success_criteria>
|
|
1177
|
-
|
|
1178
|
-
</workflow>
|
|
1
|
+
<workflow>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Orchestrate subsystem wiki mapping: resolve the target subsystem, load system-wide context,
|
|
5
|
+
determine which documents need creation or updates, spawn ace-wiki-mapper agents to produce
|
|
6
|
+
them, run module discovery, and generate knowledge documentation via map-story.
|
|
7
|
+
|
|
8
|
+
Produces documents in `.docs/wiki/subsystems/[subsystem-name]/`:
|
|
9
|
+
- structure.md — physical file layout within the subsystem
|
|
10
|
+
- architecture.md — L3 component view, flows, dependencies, data ownership
|
|
11
|
+
- systems/*.md — domain system documentation (via map-story)
|
|
12
|
+
- patterns/*.md — reusable implementation patterns (via map-story)
|
|
13
|
+
- cross-cutting/*.md — concerns spanning multiple systems (via map-story)
|
|
14
|
+
- guides/*.md — step-by-step recipes for common tasks (via map-story)
|
|
15
|
+
- walkthroughs/*.md — deep tutorial-style flow explanations (via map-story)
|
|
16
|
+
- decisions/*.md — architecture decision records (via map-story)
|
|
17
|
+
|
|
18
|
+
Also produces `.ace/artifacts/subsystems/[subsystem-name]/module-discovery/module-discovery.md`.
|
|
19
|
+
|
|
20
|
+
May also update `.docs/wiki/system-wide/system-structure.md` if this subsystem
|
|
21
|
+
is not yet listed there, and `.docs/wiki/system-wide/system-architecture.md` if
|
|
22
|
+
the subsystem is missing from the Subsystem Responsibility Matrix.
|
|
23
|
+
</purpose>
|
|
24
|
+
|
|
25
|
+
<mandatory-context>
|
|
26
|
+
All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
|
|
27
|
+
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
28
|
+
</mandatory-context>
|
|
29
|
+
|
|
30
|
+
<process>
|
|
31
|
+
|
|
32
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
33
|
+
<!-- STEP 1: SETUP -->
|
|
34
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
35
|
+
|
|
36
|
+
<step name="setup" order="1">
|
|
37
|
+
|
|
38
|
+
<substep order="1.1" name="environment-detection">
|
|
39
|
+
MANDATORY FIRST STEP — Execute environment detection before any user interaction:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
INIT is available from the preprocessed Environment Context above — do NOT re-run init.
|
|
43
|
+
|
|
44
|
+
Parse INIT JSON for: `mapper_model`, `commit_docs`, `is_brownfield`, `wiki_dir_exists`, `has_git`.
|
|
45
|
+
</substep>
|
|
46
|
+
|
|
47
|
+
<substep order="1.2" name="resolve-mapper-model">
|
|
48
|
+
MAPPER_MODEL is available from INIT.mapper_model — do NOT re-run resolve-model.
|
|
49
|
+
</substep>
|
|
50
|
+
|
|
51
|
+
<substep order="1.3" name="display-banner">
|
|
52
|
+
Display stage banner:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
╔══════════════════════════════════════════════════╗
|
|
56
|
+
║ ACE > Map Subsystem ║
|
|
57
|
+
╚══════════════════════════════════════════════════╝
|
|
58
|
+
```
|
|
59
|
+
</substep>
|
|
60
|
+
|
|
61
|
+
<substep order="1.4" name="resolve-input">
|
|
62
|
+
<variant condition="subsystem was NOT provided in $ARGUMENTS">
|
|
63
|
+
List top-level directories to offer as options, then use AskUserQuestion:
|
|
64
|
+
- header: "Subsystem"
|
|
65
|
+
- question: "Which subsystem would you like to map? Provide the path (e.g., `src/api`) or its name."
|
|
66
|
+
- options: (top 3 candidate paths from the codebase, plus a free-text prompt)
|
|
67
|
+
</variant>
|
|
68
|
+
</substep>
|
|
69
|
+
|
|
70
|
+
Continue to step 2.
|
|
71
|
+
</step>
|
|
72
|
+
|
|
73
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
74
|
+
<!-- STEP 2: LOAD SYSTEM-WIDE CONTEXT -->
|
|
75
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
76
|
+
|
|
77
|
+
<step name="load-context" order="2">
|
|
78
|
+
Read system-wide documents for context before analyzing the subsystem.
|
|
79
|
+
These orient the mapper agent and prevent repeating system-level content
|
|
80
|
+
in the subsystem docs.
|
|
81
|
+
|
|
82
|
+
<substep order="2.1" name="read-system-docs">
|
|
83
|
+
Read (if they exist):
|
|
84
|
+
<file-list>
|
|
85
|
+
<file path=".docs/wiki/system-wide/system-structure.md" />
|
|
86
|
+
<file path=".docs/wiki/system-wide/system-architecture.md" />
|
|
87
|
+
</file-list>
|
|
88
|
+
</substep>
|
|
89
|
+
|
|
90
|
+
<substep order="2.2" name="check-subsystem-index">
|
|
91
|
+
While reading `system-structure.md`, check whether the target subsystem is already
|
|
92
|
+
listed in the Subsystem Index. Set `is_new_subsystem = true` if it is NOT found.
|
|
93
|
+
</substep>
|
|
94
|
+
|
|
95
|
+
<substep order="2.3" name="check-responsibility-matrix">
|
|
96
|
+
While reading `system-architecture.md`, check whether the target subsystem appears
|
|
97
|
+
in the Subsystem Responsibility Matrix. Set `is_missing_from_matrix = true` if it
|
|
98
|
+
is NOT found.
|
|
99
|
+
|
|
100
|
+
<variant condition="system-architecture.md does not exist">
|
|
101
|
+
Set `is_missing_from_matrix = false` and note to the user that
|
|
102
|
+
system-architecture.md should be created via `/ace:map-system`.
|
|
103
|
+
</variant>
|
|
104
|
+
</substep>
|
|
105
|
+
|
|
106
|
+
Continue to step 3.
|
|
107
|
+
</step>
|
|
108
|
+
|
|
109
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
110
|
+
<!-- STEP 3: RESOLVE SUBSYSTEM -->
|
|
111
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
112
|
+
|
|
113
|
+
<step name="resolve-subsystem" order="3">
|
|
114
|
+
|
|
115
|
+
<substep order="3.1" name="normalize-input">
|
|
116
|
+
Normalize the subsystem input to:
|
|
117
|
+
<output-fields>
|
|
118
|
+
<field name="subsystem_path">Relative path from project root (e.g., `src/api`)</field>
|
|
119
|
+
<field name="subsystem_name">Slug for the wiki directory (e.g., `api`, `user-service`)</field>
|
|
120
|
+
</output-fields>
|
|
121
|
+
</substep>
|
|
122
|
+
|
|
123
|
+
<substep order="3.2" name="validate-path">
|
|
124
|
+
Validate that `subsystem_path` exists in the codebase.
|
|
125
|
+
|
|
126
|
+
<variant condition="path not found">
|
|
127
|
+
Use AskUserQuestion to clarify — list candidate paths matching the input.
|
|
128
|
+
</variant>
|
|
129
|
+
|
|
130
|
+
<variant condition="input is ambiguous (name matches multiple directories)">
|
|
131
|
+
Use AskUserQuestion with the candidates as options.
|
|
132
|
+
</variant>
|
|
133
|
+
</substep>
|
|
134
|
+
|
|
135
|
+
<substep order="3.3" name="set-output-dir">
|
|
136
|
+
Determine wiki output directory: `.docs/wiki/subsystems/[subsystem_name]/`
|
|
137
|
+
</substep>
|
|
138
|
+
|
|
139
|
+
Continue to step 4.
|
|
140
|
+
</step>
|
|
141
|
+
|
|
142
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
143
|
+
<!-- STEP 4: DOCUMENT TRIAGE -->
|
|
144
|
+
<!-- Determine per-document action: create, update, recreate, or skip -->
|
|
145
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
146
|
+
|
|
147
|
+
<step name="document-triage" order="4">
|
|
148
|
+
|
|
149
|
+
<substep order="4.1" name="check-existing">
|
|
150
|
+
Check for existing documents in `.docs/wiki/subsystems/[subsystem_name]/`:
|
|
151
|
+
<flags>
|
|
152
|
+
<flag name="has_structure">Does `structure.md` exist?</flag>
|
|
153
|
+
<flag name="has_architecture">Does `architecture.md` exist?</flag>
|
|
154
|
+
</flags>
|
|
155
|
+
</substep>
|
|
156
|
+
|
|
157
|
+
<substep order="4.2" name="triage-structure">
|
|
158
|
+
Evaluate structure.md:
|
|
159
|
+
|
|
160
|
+
<variant condition="has_structure is false">
|
|
161
|
+
Action: `create` — analyze subsystem and produce full document.
|
|
162
|
+
</variant>
|
|
163
|
+
|
|
164
|
+
<variant condition="has_structure is true">
|
|
165
|
+
Use AskUserQuestion:
|
|
166
|
+
- header: "Structure"
|
|
167
|
+
- question: "Structure document already exists at `.docs/wiki/subsystems/[subsystem_name]/structure.md`. What would you like to do?"
|
|
168
|
+
- options:
|
|
169
|
+
- "Update" — Refresh the existing document with current codebase state
|
|
170
|
+
- "Recreate" — Discard and rebuild from scratch
|
|
171
|
+
- "Skip" — Keep the current document as-is
|
|
172
|
+
Map user choice to action: `update`, `recreate`, or `skip`.
|
|
173
|
+
</variant>
|
|
174
|
+
</substep>
|
|
175
|
+
|
|
176
|
+
<substep order="4.3" name="triage-architecture">
|
|
177
|
+
Evaluate architecture.md:
|
|
178
|
+
|
|
179
|
+
<variant condition="has_architecture is false">
|
|
180
|
+
Action: `create` — analyze subsystem and produce full document.
|
|
181
|
+
</variant>
|
|
182
|
+
|
|
183
|
+
<variant condition="has_architecture is true">
|
|
184
|
+
Use AskUserQuestion:
|
|
185
|
+
- header: "Architecture"
|
|
186
|
+
- question: "Architecture document already exists at `.docs/wiki/subsystems/[subsystem_name]/architecture.md`. What would you like to do?"
|
|
187
|
+
- options:
|
|
188
|
+
- "Update" — Refresh the existing document with current codebase state
|
|
189
|
+
- "Recreate" — Discard and rebuild from scratch
|
|
190
|
+
- "Skip" — Keep the current document as-is
|
|
191
|
+
Map user choice to action: `update`, `recreate`, or `skip`.
|
|
192
|
+
</variant>
|
|
193
|
+
</substep>
|
|
194
|
+
|
|
195
|
+
<substep order="4.4" name="batch-questions">
|
|
196
|
+
IMPORTANT: Ask all questions that need asking in a SINGLE AskUserQuestion call
|
|
197
|
+
where possible (up to 4 questions). If both documents exist, batch the questions.
|
|
198
|
+
|
|
199
|
+
NEVER pass `answers` or `annotations` parameters in AskUserQuestion — only pass `questions`.
|
|
200
|
+
The user must answer interactively. If the response comes back empty, re-ask.
|
|
201
|
+
</substep>
|
|
202
|
+
|
|
203
|
+
<substep order="4.5" name="display-action-plan">
|
|
204
|
+
Display the action plan to the user:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
┌──────────────────────────────────────────────────┐
|
|
208
|
+
│ ACE > Map Subsystem > Action Plan │
|
|
209
|
+
└──────────────────────────────────────────────────┘
|
|
210
|
+
|
|
211
|
+
Subsystem [subsystem_name] ([subsystem_path])
|
|
212
|
+
──────────────────────────────────────────────────
|
|
213
|
+
Document Action
|
|
214
|
+
─────────────────── ──────────────────────────
|
|
215
|
+
structure.md [create/update/recreate/skip]
|
|
216
|
+
architecture.md [create/update/recreate/skip]
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
<variant condition="ALL actions are skip">
|
|
220
|
+
Exit workflow with message:
|
|
221
|
+
```
|
|
222
|
+
i All documents already exist and were skipped. Nothing to do.
|
|
223
|
+
|
|
224
|
+
Next > `/clear` first for a fresh context window, then:
|
|
225
|
+
|
|
226
|
+
/ace:map-subsystem [next-subsystem]
|
|
227
|
+
Map another subsystem.
|
|
228
|
+
```
|
|
229
|
+
</variant>
|
|
230
|
+
</substep>
|
|
231
|
+
|
|
232
|
+
Continue to step 5.
|
|
233
|
+
</step>
|
|
234
|
+
|
|
235
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
236
|
+
<!-- STEP 5: CREATE DIRECTORY STRUCTURE -->
|
|
237
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
238
|
+
|
|
239
|
+
<step name="create-directory" order="5">
|
|
240
|
+
Create the subsystem wiki directory if it doesn't exist:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
mkdir -p .docs/wiki/subsystems/[subsystem_name]
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Continue to step 6.
|
|
247
|
+
</step>
|
|
248
|
+
|
|
249
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
250
|
+
<!-- STEP 6: SUBSYSTEM STRUCTURE -->
|
|
251
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
252
|
+
|
|
253
|
+
<step name="subsystem-structure" order="6">
|
|
254
|
+
Skip this step if structure action is `skip`.
|
|
255
|
+
|
|
256
|
+
NOTE: This step can run IN PARALLEL with step 7 (architecture) if both
|
|
257
|
+
need agent work. Use `run_in_background=true` for both agents in steps 6 and 7,
|
|
258
|
+
then collect results in step 8.
|
|
259
|
+
|
|
260
|
+
<variant condition="action is create or recreate">
|
|
261
|
+
Spawn ace-wiki-mapper agent:
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
Task(
|
|
265
|
+
prompt="Focus: subsystem-structure
|
|
266
|
+
|
|
267
|
+
Analyze this subsystem and produce its structure document.
|
|
268
|
+
|
|
269
|
+
**Subsystem path:** [subsystem_path]
|
|
270
|
+
**Subsystem name:** [subsystem_name]
|
|
271
|
+
|
|
272
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/subsystem-structure.xml
|
|
273
|
+
**System context (if exists):** Read .docs/wiki/system-wide/system-structure.md
|
|
274
|
+
**Output:** Write to .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
275
|
+
|
|
276
|
+
<agent-instructions>
|
|
277
|
+
<instruction order="1" name="explore">
|
|
278
|
+
Explore every file and directory within [subsystem_path].
|
|
279
|
+
</instruction>
|
|
280
|
+
<instruction order="2" name="write-sections">
|
|
281
|
+
Follow the template and produce:
|
|
282
|
+
<checklist>
|
|
283
|
+
<item>Subsystem overview (root path, one-line responsibility)</item>
|
|
284
|
+
<item>Full directory layout (ASCII tree of ALL files and directories with purpose comments)</item>
|
|
285
|
+
<item>Directory purposes (one entry per meaningful directory)</item>
|
|
286
|
+
<item>Key file locations grouped by role: entry points, config, core logic, API, tests</item>
|
|
287
|
+
<item>Naming conventions (if different from system-wide; otherwise reference system-structure.md)</item>
|
|
288
|
+
<item>Where to add new code (specific paths for each code type)</item>
|
|
289
|
+
<item>Special directories (generated, build output, migrations, etc.)</item>
|
|
290
|
+
</checklist>
|
|
291
|
+
</instruction>
|
|
292
|
+
</agent-instructions>
|
|
293
|
+
|
|
294
|
+
Return confirmation only — do NOT return document contents.",
|
|
295
|
+
subagent_type="ace-wiki-mapper",
|
|
296
|
+
model="{MAPPER_MODEL}",
|
|
297
|
+
description="Map subsystem structure"
|
|
298
|
+
)
|
|
299
|
+
```
|
|
300
|
+
</variant>
|
|
301
|
+
|
|
302
|
+
<variant condition="action is update">
|
|
303
|
+
Spawn ace-wiki-mapper agent with existing content as context:
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
Task(
|
|
307
|
+
prompt="Focus: subsystem-structure
|
|
308
|
+
|
|
309
|
+
UPDATE the existing structure document for this subsystem.
|
|
310
|
+
|
|
311
|
+
**Subsystem path:** [subsystem_path]
|
|
312
|
+
**Current document:** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
313
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/subsystem-structure.xml
|
|
314
|
+
|
|
315
|
+
<agent-instructions>
|
|
316
|
+
<instruction order="1" name="compare">
|
|
317
|
+
Compare the current document against the actual codebase state.
|
|
318
|
+
</instruction>
|
|
319
|
+
<instruction order="2" name="update-sections">
|
|
320
|
+
<checklist>
|
|
321
|
+
<item>Update the directory tree for any new or removed files and directories</item>
|
|
322
|
+
<item>Update key file locations if entry points or core files have changed</item>
|
|
323
|
+
<item>Update 'Where to add new code' if new directories or patterns were introduced</item>
|
|
324
|
+
<item>Remove entries for deleted directories or files</item>
|
|
325
|
+
</checklist>
|
|
326
|
+
</instruction>
|
|
327
|
+
<instruction order="3" name="preserve">
|
|
328
|
+
Preserve accurate content. Only change what is actually stale.
|
|
329
|
+
</instruction>
|
|
330
|
+
</agent-instructions>
|
|
331
|
+
|
|
332
|
+
Write the updated file to .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
333
|
+
Return confirmation only — do NOT return document contents.",
|
|
334
|
+
subagent_type="ace-wiki-mapper",
|
|
335
|
+
model="{MAPPER_MODEL}",
|
|
336
|
+
description="Update subsystem structure"
|
|
337
|
+
)
|
|
338
|
+
```
|
|
339
|
+
</variant>
|
|
340
|
+
|
|
341
|
+
Continue to step 7.
|
|
342
|
+
</step>
|
|
343
|
+
|
|
344
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
345
|
+
<!-- STEP 7: SUBSYSTEM ARCHITECTURE -->
|
|
346
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
347
|
+
|
|
348
|
+
<step name="subsystem-architecture" order="7">
|
|
349
|
+
Skip this step if architecture action is `skip`.
|
|
350
|
+
|
|
351
|
+
<variant condition="action is create or recreate">
|
|
352
|
+
Spawn ace-wiki-mapper agent:
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
Task(
|
|
356
|
+
prompt="Focus: subsystem-architecture
|
|
357
|
+
|
|
358
|
+
Analyze this subsystem and produce its architecture document.
|
|
359
|
+
|
|
360
|
+
**Subsystem path:** [subsystem_path]
|
|
361
|
+
**Subsystem name:** [subsystem_name]
|
|
362
|
+
|
|
363
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/subsystem-architecture.xml
|
|
364
|
+
**System context (if exists):** Read .docs/wiki/system-wide/system-architecture.md
|
|
365
|
+
**Structure doc (if exists):** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
366
|
+
**Output:** Write to .docs/wiki/subsystems/[subsystem_name]/architecture.md
|
|
367
|
+
|
|
368
|
+
<agent-instructions>
|
|
369
|
+
<instruction order="1" name="analyze">
|
|
370
|
+
Follow the template structure. Fill every section with real data from the subsystem.
|
|
371
|
+
</instruction>
|
|
372
|
+
<instruction order="2" name="write-sections">
|
|
373
|
+
<checklist>
|
|
374
|
+
<item>Subsystem context: one-line responsibility and system connections (inbound/outbound)</item>
|
|
375
|
+
<item>L3 component diagram: internal layers (API -> Application -> Domain -> Infrastructure -> Data)</item>
|
|
376
|
+
<item>Component responsibilities table with key file paths</item>
|
|
377
|
+
<item>Key internal flows: 1-3 sequence diagrams for the core operations</item>
|
|
378
|
+
<item>Dependency inventory: inbound callers, outbound dependencies with failure handling</item>
|
|
379
|
+
<item>Data ownership: tables, schemas, topics this subsystem owns</item>
|
|
380
|
+
<item>Subsystem architectural decisions</item>
|
|
381
|
+
</checklist>
|
|
382
|
+
</instruction>
|
|
383
|
+
<instruction order="3" name="avoid-duplication">
|
|
384
|
+
Do NOT repeat system-wide architecture content. Reference system-architecture.md where appropriate.
|
|
385
|
+
</instruction>
|
|
386
|
+
</agent-instructions>
|
|
387
|
+
|
|
388
|
+
Return confirmation only — do NOT return document contents.",
|
|
389
|
+
subagent_type="ace-wiki-mapper",
|
|
390
|
+
model="{MAPPER_MODEL}",
|
|
391
|
+
description="Map subsystem architecture"
|
|
392
|
+
)
|
|
393
|
+
```
|
|
394
|
+
</variant>
|
|
395
|
+
|
|
396
|
+
<variant condition="action is update">
|
|
397
|
+
Spawn ace-wiki-mapper agent with update instructions:
|
|
398
|
+
|
|
399
|
+
```
|
|
400
|
+
Task(
|
|
401
|
+
prompt="Focus: subsystem-architecture
|
|
402
|
+
|
|
403
|
+
UPDATE the existing architecture document for this subsystem.
|
|
404
|
+
|
|
405
|
+
**Subsystem path:** [subsystem_path]
|
|
406
|
+
**Current document:** Read .docs/wiki/subsystems/[subsystem_name]/architecture.md
|
|
407
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/subsystem-architecture.xml
|
|
408
|
+
**System context (if exists):** Read .docs/wiki/system-wide/system-architecture.md
|
|
409
|
+
|
|
410
|
+
<agent-instructions>
|
|
411
|
+
<instruction order="1" name="compare">
|
|
412
|
+
Compare against current codebase state. Check for:
|
|
413
|
+
<checklist>
|
|
414
|
+
<item>New or removed internal components?</item>
|
|
415
|
+
<item>New inbound callers or outbound dependencies?</item>
|
|
416
|
+
<item>Data ownership changes (new tables, schemas, topics)?</item>
|
|
417
|
+
<item>Core internal flows changed shape?</item>
|
|
418
|
+
<item>New subsystem-specific architectural decisions?</item>
|
|
419
|
+
</checklist>
|
|
420
|
+
</instruction>
|
|
421
|
+
<instruction order="2" name="apply-updates">
|
|
422
|
+
Update only stale sections. Preserve accurate content.
|
|
423
|
+
</instruction>
|
|
424
|
+
</agent-instructions>
|
|
425
|
+
|
|
426
|
+
Write the updated file to .docs/wiki/subsystems/[subsystem_name]/architecture.md
|
|
427
|
+
Return confirmation only — do NOT return document contents.",
|
|
428
|
+
subagent_type="ace-wiki-mapper",
|
|
429
|
+
model="{MAPPER_MODEL}",
|
|
430
|
+
description="Update subsystem architecture"
|
|
431
|
+
)
|
|
432
|
+
```
|
|
433
|
+
</variant>
|
|
434
|
+
|
|
435
|
+
Continue to step 8.
|
|
436
|
+
</step>
|
|
437
|
+
|
|
438
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
439
|
+
<!-- STEP 8: COLLECT PARALLEL RESULTS -->
|
|
440
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
441
|
+
|
|
442
|
+
<step name="collect-parallel" order="8">
|
|
443
|
+
|
|
444
|
+
<substep order="8.1" name="wait-for-agents">
|
|
445
|
+
If steps 6 and 7 spawned background agents, wait for both to complete.
|
|
446
|
+
Read each agent's output to collect confirmations.
|
|
447
|
+
</substep>
|
|
448
|
+
|
|
449
|
+
<substep order="8.2" name="handle-failures">
|
|
450
|
+
If any agent failed, note the failure and inform the user.
|
|
451
|
+
Do NOT re-attempt — let the user decide.
|
|
452
|
+
</substep>
|
|
453
|
+
|
|
454
|
+
Continue to step 9.
|
|
455
|
+
</step>
|
|
456
|
+
|
|
457
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
458
|
+
<!-- STEP 9: UPDATE SYSTEM-WIDE STRUCTURE -->
|
|
459
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
460
|
+
|
|
461
|
+
<step name="update-system-wide" order="9">
|
|
462
|
+
Execute all applicable sub-steps. Both agents can run IN PARALLEL if both are needed —
|
|
463
|
+
use `run_in_background=true` and collect results before step 10.
|
|
464
|
+
|
|
465
|
+
<substep order="9a" name="update-system-structure" condition="is_new_subsystem is true">
|
|
466
|
+
Only execute if `is_new_subsystem` is true.
|
|
467
|
+
|
|
468
|
+
<variant condition="system-structure.md does not exist">
|
|
469
|
+
Skip 9a and note to the user that system-structure.md should be created via `/ace:map-system`.
|
|
470
|
+
</variant>
|
|
471
|
+
|
|
472
|
+
<variant condition="system-structure.md exists">
|
|
473
|
+
```
|
|
474
|
+
Task(
|
|
475
|
+
prompt="Focus: system-structure (partial update — add new subsystem entry)
|
|
476
|
+
|
|
477
|
+
A new subsystem has just been documented. Add it to the system-wide structure document.
|
|
478
|
+
|
|
479
|
+
**New subsystem:** [subsystem_name] at [subsystem_path]
|
|
480
|
+
**Current document:** Read .docs/wiki/system-wide/system-structure.md
|
|
481
|
+
**Newly created docs:** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
482
|
+
and .docs/wiki/subsystems/[subsystem_name]/architecture.md to infer responsibility.
|
|
483
|
+
|
|
484
|
+
<agent-instructions>
|
|
485
|
+
<instruction order="1" name="add-row">
|
|
486
|
+
Add this subsystem to the Subsystem Index table with:
|
|
487
|
+
<checklist>
|
|
488
|
+
<item>Name, path, one-line responsibility (inferred from the subsystem code and its new docs)</item>
|
|
489
|
+
<item>Wiki doc link: `.docs/wiki/subsystems/[subsystem_name]/`</item>
|
|
490
|
+
</checklist>
|
|
491
|
+
</instruction>
|
|
492
|
+
<instruction order="2" name="preserve">
|
|
493
|
+
Do NOT restructure or rewrite the existing document. Only add the new row.
|
|
494
|
+
</instruction>
|
|
495
|
+
</agent-instructions>
|
|
496
|
+
|
|
497
|
+
Write the updated file to .docs/wiki/system-wide/system-structure.md
|
|
498
|
+
Return confirmation only — do NOT return document contents.",
|
|
499
|
+
subagent_type="ace-wiki-mapper",
|
|
500
|
+
model="{MAPPER_MODEL}",
|
|
501
|
+
description="Add subsystem to system structure"
|
|
502
|
+
)
|
|
503
|
+
```
|
|
504
|
+
</variant>
|
|
505
|
+
</substep>
|
|
506
|
+
|
|
507
|
+
<substep order="9b" name="update-system-architecture" condition="is_missing_from_matrix is true">
|
|
508
|
+
Only execute if `is_missing_from_matrix` is true.
|
|
509
|
+
|
|
510
|
+
```
|
|
511
|
+
Task(
|
|
512
|
+
prompt="Focus: system-architecture (partial update — add subsystem to responsibility matrix)
|
|
513
|
+
|
|
514
|
+
A subsystem has just been documented and is missing from the Subsystem Responsibility Matrix.
|
|
515
|
+
Add it to the matrix in the system-wide architecture document.
|
|
516
|
+
|
|
517
|
+
**Subsystem:** [subsystem_name] at [subsystem_path]
|
|
518
|
+
**Current document:** Read .docs/wiki/system-wide/system-architecture.md
|
|
519
|
+
**Subsystem docs:** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
520
|
+
and .docs/wiki/subsystems/[subsystem_name]/architecture.md to populate the row.
|
|
521
|
+
|
|
522
|
+
<agent-instructions>
|
|
523
|
+
<instruction order="1" name="add-matrix-row">
|
|
524
|
+
Add one row to the Subsystem Responsibility Matrix table with:
|
|
525
|
+
<checklist>
|
|
526
|
+
<item>Subsystem name, one-line responsibility</item>
|
|
527
|
+
<item>Data it owns</item>
|
|
528
|
+
<item>Events/APIs it publishes</item>
|
|
529
|
+
<item>Events/APIs it consumes</item>
|
|
530
|
+
<item>Its tech stack</item>
|
|
531
|
+
</checklist>
|
|
532
|
+
</instruction>
|
|
533
|
+
<instruction order="2" name="preserve">
|
|
534
|
+
Do NOT restructure or rewrite any other part of the document. Only add the new row.
|
|
535
|
+
</instruction>
|
|
536
|
+
</agent-instructions>
|
|
537
|
+
|
|
538
|
+
Write the updated file to .docs/wiki/system-wide/system-architecture.md
|
|
539
|
+
Return confirmation only — do NOT return document contents.",
|
|
540
|
+
subagent_type="ace-wiki-mapper",
|
|
541
|
+
model="{MAPPER_MODEL}",
|
|
542
|
+
description="Add subsystem to architecture matrix"
|
|
543
|
+
)
|
|
544
|
+
```
|
|
545
|
+
</substep>
|
|
546
|
+
|
|
547
|
+
Continue to step 10.
|
|
548
|
+
</step>
|
|
549
|
+
|
|
550
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
551
|
+
<!-- STEP 10: MODULE DISCOVERY -->
|
|
552
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
553
|
+
|
|
554
|
+
<step name="module-discovery" order="10">
|
|
555
|
+
Discover the subsystem's documentation modules by reading the actual source code —
|
|
556
|
+
NOT just the wiki docs. This step traces E2E flows, identifies patterns, and finds
|
|
557
|
+
cross-cutting concerns by reading real implementation files.
|
|
558
|
+
|
|
559
|
+
Uses THREE parallel discovery agents followed by ONE synthesis agent.
|
|
560
|
+
|
|
561
|
+
<substep order="10.1" name="read-template">
|
|
562
|
+
Read the module-discovery template first:
|
|
563
|
+
`${CLAUDE_SKILL_DIR}/templates/module-discovery.xml`
|
|
564
|
+
</substep>
|
|
565
|
+
|
|
566
|
+
<substep order="10.2" name="create-artifacts-dir">
|
|
567
|
+
Create artifacts directory:
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
mkdir -p .ace/artifacts/subsystems/[subsystem_name]/module-discovery
|
|
571
|
+
```
|
|
572
|
+
</substep>
|
|
573
|
+
|
|
574
|
+
<substep order="10.3" name="launch-flow-discovery" parallel="true">
|
|
575
|
+
Launch with run_in_background=true:
|
|
576
|
+
|
|
577
|
+
```
|
|
578
|
+
Task(
|
|
579
|
+
prompt="Focus: flow-discovery
|
|
580
|
+
|
|
581
|
+
Discover the E2E domain flows in this subsystem by reading the actual source code.
|
|
582
|
+
Do NOT rely on wiki docs alone — trace the code.
|
|
583
|
+
|
|
584
|
+
**Subsystem path:** [subsystem_path]
|
|
585
|
+
**Subsystem name:** [subsystem_name]
|
|
586
|
+
**File inventory:** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
587
|
+
|
|
588
|
+
<agent-instructions>
|
|
589
|
+
<instruction order="1" name="read-inventory">
|
|
590
|
+
Read structure.md for the complete file inventory.
|
|
591
|
+
</instruction>
|
|
592
|
+
<instruction order="2" name="identify-entry-points">
|
|
593
|
+
Identify ALL entry points: HTTP controllers, CLI handlers, event consumers,
|
|
594
|
+
background jobs, gRPC services, scheduled tasks.
|
|
595
|
+
</instruction>
|
|
596
|
+
<instruction order="3" name="trace-flows">
|
|
597
|
+
For EACH entry point, open and read the file — then trace its COMPLETE E2E flow:
|
|
598
|
+
<checklist>
|
|
599
|
+
<item>Follow all imports/dependencies downward layer by layer</item>
|
|
600
|
+
<item>Collect every file that participates:
|
|
601
|
+
entry point, DTO/viewmodel, mapper, service/use-case, domain entity,
|
|
602
|
+
value objects, repository interface, repository implementation,
|
|
603
|
+
DB scripts/migrations, constants/enums</item>
|
|
604
|
+
<item>A domain model shared across flows belongs in ALL of them — do NOT exclude it</item>
|
|
605
|
+
<item>Read each file you encounter before moving on</item>
|
|
606
|
+
</checklist>
|
|
607
|
+
</instruction>
|
|
608
|
+
<instruction order="4" name="group-systems">
|
|
609
|
+
Group related entry points into one system when they share the same domain concern:
|
|
610
|
+
CreateUser + GetUser + UpdateUser + DeleteUser = 'User Management' (not 4 systems)
|
|
611
|
+
</instruction>
|
|
612
|
+
</agent-instructions>
|
|
613
|
+
|
|
614
|
+
Output to .ace/artifacts/subsystems/[subsystem_name]/module-discovery/discovery-flows.md:
|
|
615
|
+
|
|
616
|
+
```markdown
|
|
617
|
+
# Flow Discovery: [subsystem_name]
|
|
618
|
+
|
|
619
|
+
## Systems Found
|
|
620
|
+
|
|
621
|
+
| # | System Name | Entry Points | All Participating Files |
|
|
622
|
+
|---|-------------|--------------|------------------------|
|
|
623
|
+
| 1 | [name] | [entry file paths] | [ALL files in this E2E flow] |
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
Return: count of systems found + list of any entry points you could not fully trace.",
|
|
627
|
+
subagent_type="ace-wiki-mapper",
|
|
628
|
+
model="{MAPPER_MODEL}",
|
|
629
|
+
run_in_background=true,
|
|
630
|
+
description="Discover E2E system flows"
|
|
631
|
+
)
|
|
632
|
+
```
|
|
633
|
+
</substep>
|
|
634
|
+
|
|
635
|
+
<substep order="10.4" name="launch-pattern-discovery" parallel="true">
|
|
636
|
+
Launch with run_in_background=true:
|
|
637
|
+
|
|
638
|
+
```
|
|
639
|
+
Task(
|
|
640
|
+
prompt="Focus: pattern-discovery
|
|
641
|
+
|
|
642
|
+
Discover reusable implementation patterns in this subsystem by reading multiple
|
|
643
|
+
similar files and comparing their structure.
|
|
644
|
+
|
|
645
|
+
**Subsystem path:** [subsystem_path]
|
|
646
|
+
**File inventory:** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
647
|
+
|
|
648
|
+
<agent-instructions>
|
|
649
|
+
<instruction order="1" name="read-inventory">
|
|
650
|
+
Read structure.md for the complete file inventory.
|
|
651
|
+
</instruction>
|
|
652
|
+
<instruction order="2" name="identify-groups">
|
|
653
|
+
Identify groups of structurally similar files:
|
|
654
|
+
repositories, mappers, handlers, command/query objects, factories, validators.
|
|
655
|
+
</instruction>
|
|
656
|
+
<instruction order="3" name="compare-files">
|
|
657
|
+
Read 3+ files from each group.
|
|
658
|
+
</instruction>
|
|
659
|
+
<instruction order="4" name="classify-patterns">
|
|
660
|
+
When files follow the same structural template, that is a pattern.
|
|
661
|
+
Name the pattern by what it achieves, not by structural form.
|
|
662
|
+
|
|
663
|
+
Examples of patterns to look for:
|
|
664
|
+
<pattern-examples>
|
|
665
|
+
<pattern>Repository Pattern (multiple repo implementations of one interface)</pattern>
|
|
666
|
+
<pattern>CQRS Command/Query (separate handler per command/query)</pattern>
|
|
667
|
+
<pattern>Template Method (abstract base class with overridable steps)</pattern>
|
|
668
|
+
<pattern>Factory / Registry (lookup table for creating objects by type)</pattern>
|
|
669
|
+
<pattern>Mapper Pattern (bidirectional DTO <-> domain conversion)</pattern>
|
|
670
|
+
<pattern>Strategy Pattern (interchangeable algorithm implementations)</pattern>
|
|
671
|
+
</pattern-examples>
|
|
672
|
+
</instruction>
|
|
673
|
+
</agent-instructions>
|
|
674
|
+
|
|
675
|
+
Output to .ace/artifacts/subsystems/[subsystem_name]/module-discovery/discovery-patterns.md:
|
|
676
|
+
|
|
677
|
+
```markdown
|
|
678
|
+
# Pattern Discovery: [subsystem_name]
|
|
679
|
+
|
|
680
|
+
## Patterns Found
|
|
681
|
+
|
|
682
|
+
| # | Pattern Name | Representative Files (2-4 examples that demonstrate the pattern) |
|
|
683
|
+
|---|--------------|------------------------------------------------------------------|
|
|
684
|
+
| 1 | [name] | [2-4 file paths] |
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
Return: count of patterns found.",
|
|
688
|
+
subagent_type="ace-wiki-mapper",
|
|
689
|
+
model="{MAPPER_MODEL}",
|
|
690
|
+
run_in_background=true,
|
|
691
|
+
description="Discover implementation patterns"
|
|
692
|
+
)
|
|
693
|
+
```
|
|
694
|
+
</substep>
|
|
695
|
+
|
|
696
|
+
<substep order="10.5" name="launch-cross-cutting-discovery" parallel="true">
|
|
697
|
+
Launch with run_in_background=true:
|
|
698
|
+
|
|
699
|
+
```
|
|
700
|
+
Task(
|
|
701
|
+
prompt="Focus: cross-cutting-discovery
|
|
702
|
+
|
|
703
|
+
Discover cross-cutting concerns and common implementation tasks in this subsystem
|
|
704
|
+
by reading shared infrastructure files.
|
|
705
|
+
|
|
706
|
+
**Subsystem path:** [subsystem_path]
|
|
707
|
+
**File inventory:** Read .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
708
|
+
**Architecture doc:** .docs/wiki/subsystems/[subsystem_name]/architecture.md
|
|
709
|
+
|
|
710
|
+
<agent-instructions>
|
|
711
|
+
<instruction order="1" name="read-context">
|
|
712
|
+
Read structure.md and architecture.md for context.
|
|
713
|
+
</instruction>
|
|
714
|
+
<instruction order="2" name="identify-shared-infra">
|
|
715
|
+
Identify shared infrastructure that multiple domain flows depend on — then read it:
|
|
716
|
+
<checklist>
|
|
717
|
+
<item>DI container / service registration files</item>
|
|
718
|
+
<item>Event bus, message broker, pub/sub infrastructure</item>
|
|
719
|
+
<item>Cache / invalidation infrastructure</item>
|
|
720
|
+
<item>Authentication / authorization middleware</item>
|
|
721
|
+
<item>Shared abstract base classes</item>
|
|
722
|
+
<item>Error handling and logging infrastructure</item>
|
|
723
|
+
<item>Registry / factory lookup tables</item>
|
|
724
|
+
</checklist>
|
|
725
|
+
</instruction>
|
|
726
|
+
<instruction order="3" name="assess-scope">
|
|
727
|
+
For each shared infrastructure file, read it to understand its scope.
|
|
728
|
+
</instruction>
|
|
729
|
+
<instruction order="4" name="identify-guides">
|
|
730
|
+
Identify guide candidates — common tasks a developer would repeat:
|
|
731
|
+
<guide-derivation-rules>
|
|
732
|
+
<rule source="Repository Pattern" guide="How to Add a New Repository" />
|
|
733
|
+
<rule source="CRUD system exists" guide="How to Add a New CRUD Endpoint" />
|
|
734
|
+
</guide-derivation-rules>
|
|
735
|
+
</instruction>
|
|
736
|
+
</agent-instructions>
|
|
737
|
+
|
|
738
|
+
Output to .ace/artifacts/subsystems/[subsystem_name]/module-discovery/discovery-cross-cutting.md:
|
|
739
|
+
|
|
740
|
+
```markdown
|
|
741
|
+
# Cross-Cutting Discovery: [subsystem_name]
|
|
742
|
+
|
|
743
|
+
## Cross-Cutting Concerns
|
|
744
|
+
|
|
745
|
+
| # | Concern Name | Files |
|
|
746
|
+
|---|--------------|-------|
|
|
747
|
+
| 1 | [name] | [all files implementing this concern] |
|
|
748
|
+
|
|
749
|
+
## Guide Candidates
|
|
750
|
+
|
|
751
|
+
| # | Guide Name | Reference Files |
|
|
752
|
+
|---|------------|----------------|
|
|
753
|
+
| 1 | [e.g., How to Add a New CRUD Endpoint] | [files demonstrating the recipe] |
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
Return: count of cross-cutting concerns + count of guide candidates.",
|
|
757
|
+
subagent_type="ace-wiki-mapper",
|
|
758
|
+
model="{MAPPER_MODEL}",
|
|
759
|
+
run_in_background=true,
|
|
760
|
+
description="Discover cross-cutting concerns and guides"
|
|
761
|
+
)
|
|
762
|
+
```
|
|
763
|
+
</substep>
|
|
764
|
+
|
|
765
|
+
<substep order="10.6" name="wait-for-discovery">
|
|
766
|
+
Wait for all three discovery agents to complete.
|
|
767
|
+
</substep>
|
|
768
|
+
|
|
769
|
+
<substep order="10.7" name="doc-inventory" condition="existing-docs contains a directory">
|
|
770
|
+
Only spawned if existing-docs contains a directory.
|
|
771
|
+
|
|
772
|
+
Spawn a doc inventory agent to produce a compact index of the external docs.
|
|
773
|
+
This runs BEFORE the synthesis agent so that synthesis has a lightweight
|
|
774
|
+
inventory to work with instead of reading hundreds of files itself.
|
|
775
|
+
|
|
776
|
+
```
|
|
777
|
+
Task(
|
|
778
|
+
prompt="You are a documentation inventory agent. Produce a compact index of all
|
|
779
|
+
documentation files in a directory so downstream agents can match docs to modules
|
|
780
|
+
without reading every file themselves.
|
|
781
|
+
|
|
782
|
+
**Documentation directory to scan:** [directory path from existing-docs]
|
|
783
|
+
**Output file:** .ace/artifacts/subsystems/[subsystem_name]/module-discovery/existing-docs-inventory.md
|
|
784
|
+
|
|
785
|
+
<agent-instructions>
|
|
786
|
+
<instruction order="1" name="list-files">
|
|
787
|
+
Recursively list ALL files in the directory down to every leaf subdirectory.
|
|
788
|
+
Use Glob(pattern='**/*', path='[directory path]') to ensure no nesting level
|
|
789
|
+
is missed. Do NOT use shallow ls or single-level globs.
|
|
790
|
+
</instruction>
|
|
791
|
+
<instruction order="2" name="determine-depth">
|
|
792
|
+
Count total files to determine summary depth:
|
|
793
|
+
<depth-rules>
|
|
794
|
+
<rule range="up to 50 files" read-lines="30-50" summary-lines="up to 10" />
|
|
795
|
+
<rule range="51-150 files" read-lines="20-30" summary-lines="up to 5" />
|
|
796
|
+
<rule range="151-300 files" read-lines="15-20" summary-lines="up to 3" />
|
|
797
|
+
<rule range="300+ files" read-lines="10" summary-lines="1-2" />
|
|
798
|
+
</depth-rules>
|
|
799
|
+
</instruction>
|
|
800
|
+
<instruction order="3" name="read-and-summarize">
|
|
801
|
+
For each file, read the adaptive number of lines determined above.
|
|
802
|
+
</instruction>
|
|
803
|
+
<instruction order="4" name="write-inventory">
|
|
804
|
+
Write the inventory to the output file in this format:
|
|
805
|
+
|
|
806
|
+
```markdown
|
|
807
|
+
# Existing Documentation Inventory
|
|
808
|
+
|
|
809
|
+
Source directory: [directory path]
|
|
810
|
+
Total files: [count]
|
|
811
|
+
Summary depth: [lines per file based on count]
|
|
812
|
+
|
|
813
|
+
## [File Path]
|
|
814
|
+
**Title:** [first heading or filename]
|
|
815
|
+
**Summary:**
|
|
816
|
+
[Adaptive-length summary: key topics, domain concepts, APIs/interfaces described,
|
|
817
|
+
architectural decisions mentioned. Enough detail for a downstream agent to
|
|
818
|
+
determine which code modules this doc is relevant to.]
|
|
819
|
+
|
|
820
|
+
## [Next File Path]
|
|
821
|
+
...
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
Be thorough — every file must appear in the inventory.
|
|
825
|
+
</instruction>
|
|
826
|
+
</agent-instructions>
|
|
827
|
+
|
|
828
|
+
Return: total file count.",
|
|
829
|
+
subagent_type="ace-wiki-mapper",
|
|
830
|
+
model="{MAPPER_MODEL}",
|
|
831
|
+
description="Inventory existing docs"
|
|
832
|
+
)
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Display to user:
|
|
836
|
+
```
|
|
837
|
+
Existing docs inventory: [N] files indexed from [directory path]
|
|
838
|
+
Saved to .ace/artifacts/subsystems/[subsystem_name]/module-discovery/existing-docs-inventory.md
|
|
839
|
+
```
|
|
840
|
+
</substep>
|
|
841
|
+
|
|
842
|
+
<substep order="10.8" name="synthesis" sequential="true">
|
|
843
|
+
Synthesis Agent (sequential — runs after all above complete):
|
|
844
|
+
|
|
845
|
+
```
|
|
846
|
+
Task(
|
|
847
|
+
prompt="Focus: module-discovery synthesis
|
|
848
|
+
|
|
849
|
+
Synthesize three discovery reports into the final module-discovery.md artifact.
|
|
850
|
+
|
|
851
|
+
**Output template:** Read ${CLAUDE_SKILL_DIR}/templates/module-discovery.xml
|
|
852
|
+
**Discovery inputs (read all three):**
|
|
853
|
+
- .ace/artifacts/subsystems/[subsystem_name]/module-discovery/discovery-flows.md (systems)
|
|
854
|
+
- .ace/artifacts/subsystems/[subsystem_name]/module-discovery/discovery-patterns.md (patterns)
|
|
855
|
+
- .ace/artifacts/subsystems/[subsystem_name]/module-discovery/discovery-cross-cutting.md (cross-cutting + guides)
|
|
856
|
+
**File inventory:** .docs/wiki/subsystems/[subsystem_name]/structure.md
|
|
857
|
+
**External docs inventory (if exists):** .ace/artifacts/subsystems/[subsystem_name]/module-discovery/existing-docs-inventory.md
|
|
858
|
+
|
|
859
|
+
<agent-instructions>
|
|
860
|
+
<instruction order="1" name="read-inputs">
|
|
861
|
+
Read all three discovery inputs.
|
|
862
|
+
</instruction>
|
|
863
|
+
<instruction order="2" name="discover-existing-docs">
|
|
864
|
+
Discover existing documentation:
|
|
865
|
+
<checklist>
|
|
866
|
+
<item>Scan the subsystem directory ([subsystem_path]) recursively for *.md files</item>
|
|
867
|
+
<item>Also scan common doc locations: docs/, documentation/, .docs/</item>
|
|
868
|
+
<item>If existing-docs-inventory.md exists, read it and INCLUDE all entries
|
|
869
|
+
in the Existing Documentation Inventory table (these are external docs
|
|
870
|
+
already indexed — do NOT re-scan the original directory)</item>
|
|
871
|
+
<item>Read each locally-discovered doc's title and first few lines to understand its subject</item>
|
|
872
|
+
<item>Build the Existing Documentation Inventory table (local + external combined)</item>
|
|
873
|
+
</checklist>
|
|
874
|
+
</instruction>
|
|
875
|
+
<instruction order="3" name="merge-modules">
|
|
876
|
+
Merge all discovery results into ONE flat Modules table:
|
|
877
|
+
<checklist>
|
|
878
|
+
<item>E2E flows from discovery-flows.md become modules</item>
|
|
879
|
+
<item>Patterns from discovery-patterns.md become modules</item>
|
|
880
|
+
<item>Cross-cutting concerns from discovery-cross-cutting.md become modules</item>
|
|
881
|
+
<item>Do NOT categorize by type — map-story decides what docs to produce</item>
|
|
882
|
+
</checklist>
|
|
883
|
+
</instruction>
|
|
884
|
+
<instruction order="4" name="curate-docs-to-modules">
|
|
885
|
+
Curate docs to modules (populate the Relevant Docs column):
|
|
886
|
+
<checklist>
|
|
887
|
+
<item>Match each discovered doc to the module(s) whose domain it describes</item>
|
|
888
|
+
<item>A doc can appear in multiple modules</item>
|
|
889
|
+
<item>Architecture docs and READMEs are typically relevant to all flow modules</item>
|
|
890
|
+
<item>Implementation docs match the module they describe</item>
|
|
891
|
+
<item>Mark unmatched docs in the inventory table</item>
|
|
892
|
+
</checklist>
|
|
893
|
+
</instruction>
|
|
894
|
+
<instruction order="5" name="file-coverage-check">
|
|
895
|
+
File coverage check:
|
|
896
|
+
<checklist>
|
|
897
|
+
<item>Read structure.md for the complete file inventory</item>
|
|
898
|
+
<item>Every non-trivial file must appear in at least one module</item>
|
|
899
|
+
<item>List any uncovered files; create new modules for files with meaningful logic</item>
|
|
900
|
+
<item>Exclude only: index re-exports, empty stubs, generated code, test files</item>
|
|
901
|
+
</checklist>
|
|
902
|
+
</instruction>
|
|
903
|
+
<instruction order="6" name="preserve-overlaps">
|
|
904
|
+
Preserve overlaps — files appearing in multiple modules are correct.
|
|
905
|
+
</instruction>
|
|
906
|
+
</agent-instructions>
|
|
907
|
+
|
|
908
|
+
Write to .ace/artifacts/subsystems/[subsystem_name]/module-discovery/module-discovery.md
|
|
909
|
+
|
|
910
|
+
Return: total module count + uncovered file count + existing docs found count.",
|
|
911
|
+
subagent_type="ace-wiki-mapper",
|
|
912
|
+
model="{MAPPER_MODEL}",
|
|
913
|
+
description="Synthesize module discovery"
|
|
914
|
+
)
|
|
915
|
+
```
|
|
916
|
+
</substep>
|
|
917
|
+
|
|
918
|
+
Continue to step 11.
|
|
919
|
+
</step>
|
|
920
|
+
|
|
921
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
922
|
+
<!-- STEP 11: KNOWLEDGE DOCUMENTATION VIA MAP-STORY -->
|
|
923
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
924
|
+
|
|
925
|
+
<step name="knowledge-documentation" order="11">
|
|
926
|
+
For each module row in module-discovery.md, spawn one ace-wiki-mapper agent
|
|
927
|
+
that follows the map-story workflow in file mode.
|
|
928
|
+
|
|
929
|
+
Run agents SEQUENTIALLY — wait for each to complete before starting the next.
|
|
930
|
+
Sequential prevents write conflicts: map-story writes multiple doc files per call
|
|
931
|
+
and two concurrent agents could clash on the same file.
|
|
932
|
+
|
|
933
|
+
<substep order="11.1" name="read-module-discovery">
|
|
934
|
+
Read .ace/artifacts/subsystems/[subsystem_name]/module-discovery/module-discovery.md.
|
|
935
|
+
|
|
936
|
+
The file has one Modules table.
|
|
937
|
+
Each row has: # | Module Name | Files | Relevant Docs
|
|
938
|
+
</substep>
|
|
939
|
+
|
|
940
|
+
<substep order="11.2" name="merge-existing-docs">
|
|
941
|
+
If the `existing-docs` parameter was provided to map-subsystem,
|
|
942
|
+
merge those entries (files and/or directories, as-is) with each row's Relevant Docs
|
|
943
|
+
column.
|
|
944
|
+
|
|
945
|
+
<merge-rules>
|
|
946
|
+
<rule>For each module row, the final existing-docs list =
|
|
947
|
+
(command-level existing-docs) + (row's Relevant Docs)</rule>
|
|
948
|
+
<rule>Deduplicate any overlapping paths</rule>
|
|
949
|
+
<rule>If both are empty, use `none`</rule>
|
|
950
|
+
<rule>Do NOT expand directories here — map-story handles directory resolution internally
|
|
951
|
+
by spinning up a curation agent that selects only relevant docs</rule>
|
|
952
|
+
</merge-rules>
|
|
953
|
+
|
|
954
|
+
If existing-docs-inventory.md was produced in step 10, also pass its path to
|
|
955
|
+
each map-story invocation so the curation agent can use the pre-built inventory
|
|
956
|
+
instead of re-scanning the directory from scratch for every module.
|
|
957
|
+
</substep>
|
|
958
|
+
|
|
959
|
+
<substep order="11.3" name="iterate-modules">
|
|
960
|
+
Iterate ALL rows (one at a time, sequential):
|
|
961
|
+
|
|
962
|
+
```
|
|
963
|
+
Task(
|
|
964
|
+
prompt="Load and follow the map-story workflow in file mode.
|
|
965
|
+
|
|
966
|
+
**Workflow:** This agent should invoke /ace:map-story or follow the map-story skill workflow
|
|
967
|
+
**Mode:** file mode — document existing code (no git diff)
|
|
968
|
+
|
|
969
|
+
**Module name:** [Module Name from row]
|
|
970
|
+
**Files to document:** [comma-separated file list from Files column]
|
|
971
|
+
**Existing docs context:** [merged existing-docs: command-level + row Relevant Docs, deduplicated, or `none`]
|
|
972
|
+
**Existing docs inventory:** [path to existing-docs-inventory.md if it was produced, or `none`]
|
|
973
|
+
**Subsystem name:** [subsystem_name]
|
|
974
|
+
|
|
975
|
+
**TEMPLATES — Read ALL of these before writing ANY docs:**
|
|
976
|
+
- System docs: ${CLAUDE_SKILL_DIR}/templates/system.xml
|
|
977
|
+
- Pattern docs: ${CLAUDE_SKILL_DIR}/templates/pattern.xml
|
|
978
|
+
- Cross-cutting docs: ${CLAUDE_SKILL_DIR}/templates/system-cross-cutting.xml
|
|
979
|
+
- Guide docs: ${CLAUDE_SKILL_DIR}/templates/guide.xml
|
|
980
|
+
- Decision docs: ${CLAUDE_SKILL_DIR}/templates/decizions.xml
|
|
981
|
+
|
|
982
|
+
<agent-instructions>
|
|
983
|
+
<instruction order="1" name="read-source">
|
|
984
|
+
Read ALL source files listed in Files. Understand the actual code — classes,
|
|
985
|
+
interfaces, patterns, state, flows, DI registrations, constants, error handling.
|
|
986
|
+
</instruction>
|
|
987
|
+
|
|
988
|
+
<instruction order="2" name="read-existing-docs">
|
|
989
|
+
If Existing docs context is not `none`, read those documents FIRST —
|
|
990
|
+
they contain prior knowledge, intent, and decisions about this module's domain.
|
|
991
|
+
Use them as additional context when writing, but the actual source code is
|
|
992
|
+
always the source of truth.
|
|
993
|
+
</instruction>
|
|
994
|
+
|
|
995
|
+
<instruction order="3" name="read-wiki">
|
|
996
|
+
Read ALL existing wiki docs under .docs/wiki/subsystems/[subsystem_name]/ —
|
|
997
|
+
EVERY .md file, FULLY. Not titles. Not summaries. THE COMPLETE CONTENT.
|
|
998
|
+
Build a mental map of what is already documented so you do NOT create
|
|
999
|
+
duplicate documentation. This is MANDATORY.
|
|
1000
|
+
</instruction>
|
|
1001
|
+
|
|
1002
|
+
<instruction order="4" name="decide-docs">
|
|
1003
|
+
You decide what docs to create or update — systems/, patterns/, cross-cutting/,
|
|
1004
|
+
guides/, walkthroughs/, decisions/ — based on what you find in the code files. One call may
|
|
1005
|
+
produce multiple docs across different categories.
|
|
1006
|
+
</instruction>
|
|
1007
|
+
|
|
1008
|
+
<instruction order="5" name="update-vs-create">
|
|
1009
|
+
When an existing doc already covers a topic, UPDATE it (add/expand sections).
|
|
1010
|
+
Only CREATE new docs for genuinely new topics not covered anywhere.
|
|
1011
|
+
</instruction>
|
|
1012
|
+
|
|
1013
|
+
<instruction order="6" name="topic-scoped-only">
|
|
1014
|
+
NEVER create a story-scoped or module-scoped document.
|
|
1015
|
+
All docs are TOPIC-scoped — about the concern, not about the module.
|
|
1016
|
+
</instruction>
|
|
1017
|
+
</agent-instructions>
|
|
1018
|
+
|
|
1019
|
+
Return: list of all docs created/updated with line counts.",
|
|
1020
|
+
subagent_type="ace-wiki-mapper",
|
|
1021
|
+
model="{MAPPER_MODEL}",
|
|
1022
|
+
description="Document [module_name]"
|
|
1023
|
+
)
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
Collect each agent's report before spawning the next.
|
|
1027
|
+
</substep>
|
|
1028
|
+
|
|
1029
|
+
<substep order="11.4" name="compile-report">
|
|
1030
|
+
After all rows are processed, compile the full knowledge docs report.
|
|
1031
|
+
</substep>
|
|
1032
|
+
|
|
1033
|
+
Continue to step 12.
|
|
1034
|
+
</step>
|
|
1035
|
+
|
|
1036
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
1037
|
+
<!-- STEP 12: VERIFY AND COMMIT -->
|
|
1038
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
1039
|
+
|
|
1040
|
+
<step name="verify-and-commit" order="12">
|
|
1041
|
+
|
|
1042
|
+
<substep order="12.1" name="verify-documents">
|
|
1043
|
+
Verify all expected documents exist and are non-empty.
|
|
1044
|
+
|
|
1045
|
+
For each document where the action was NOT `skip`:
|
|
1046
|
+
<verification-checks>
|
|
1047
|
+
<check>File exists</check>
|
|
1048
|
+
<check>File has content (>20 lines for create/update/recreate)</check>
|
|
1049
|
+
</verification-checks>
|
|
1050
|
+
|
|
1051
|
+
If any document is missing or empty, warn the user.
|
|
1052
|
+
</substep>
|
|
1053
|
+
|
|
1054
|
+
<substep order="12.2" name="security-scan">
|
|
1055
|
+
Security scan before commit — use the Grep tool (NOT bash grep):
|
|
1056
|
+
|
|
1057
|
+
```
|
|
1058
|
+
Grep(
|
|
1059
|
+
pattern="(sk-[a-zA-Z0-9]{20,}|sk_live_|sk_test_|ghp_[a-zA-Z0-9]{36}|AKIA[A-Z0-9]{16}|-----BEGIN.*PRIVATE KEY)",
|
|
1060
|
+
path=".docs/wiki/subsystems/[subsystem_name]/",
|
|
1061
|
+
output_mode="content"
|
|
1062
|
+
)
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
<variant condition="matches found">SECRETS_FOUND — pause and alert user.</variant>
|
|
1066
|
+
<variant condition="no matches">CLEAN.</variant>
|
|
1067
|
+
</substep>
|
|
1068
|
+
|
|
1069
|
+
<substep order="12.3" name="commit" condition="commit_docs is true">
|
|
1070
|
+
Commit (if `commit_docs` is true):
|
|
1071
|
+
|
|
1072
|
+
<stage-files>
|
|
1073
|
+
<always>
|
|
1074
|
+
```bash
|
|
1075
|
+
git add .docs/wiki/subsystems/[subsystem_name]/
|
|
1076
|
+
```
|
|
1077
|
+
</always>
|
|
1078
|
+
|
|
1079
|
+
<conditional condition="system-structure.md was updated in step 9a">
|
|
1080
|
+
```bash
|
|
1081
|
+
git add .docs/wiki/system-wide/system-structure.md
|
|
1082
|
+
```
|
|
1083
|
+
</conditional>
|
|
1084
|
+
|
|
1085
|
+
<conditional condition="system-architecture.md was updated in step 9b">
|
|
1086
|
+
```bash
|
|
1087
|
+
git add .docs/wiki/system-wide/system-architecture.md
|
|
1088
|
+
```
|
|
1089
|
+
</conditional>
|
|
1090
|
+
|
|
1091
|
+
<conditional condition="module-discovery artifacts were written in step 10">
|
|
1092
|
+
```bash
|
|
1093
|
+
git add .ace/artifacts/subsystems/[subsystem_name]/module-discovery/
|
|
1094
|
+
```
|
|
1095
|
+
</conditional>
|
|
1096
|
+
</stage-files>
|
|
1097
|
+
|
|
1098
|
+
```bash
|
|
1099
|
+
git commit -m "docs: map [subsystem_name] subsystem wiki and knowledge base"
|
|
1100
|
+
```
|
|
1101
|
+
</substep>
|
|
1102
|
+
|
|
1103
|
+
Continue to step 13.
|
|
1104
|
+
</step>
|
|
1105
|
+
|
|
1106
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
1107
|
+
<!-- STEP 13: COMPLETION -->
|
|
1108
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
1109
|
+
|
|
1110
|
+
<step name="completion" order="13">
|
|
1111
|
+
Display completion banner and next steps.
|
|
1112
|
+
|
|
1113
|
+
```
|
|
1114
|
+
╔══════════════════════════════════════════════════╗
|
|
1115
|
+
║ ACE > Subsystem Mapped ║
|
|
1116
|
+
╚══════════════════════════════════════════════════╝
|
|
1117
|
+
|
|
1118
|
+
Subsystem: [subsystem_name] ([subsystem_path])
|
|
1119
|
+
|
|
1120
|
+
Documents:
|
|
1121
|
+
──────────
|
|
1122
|
+
[For each document, show action taken and line count]
|
|
1123
|
+
+ structure.md ([N] lines) — [created/updated/recreated]
|
|
1124
|
+
+ architecture.md ([N] lines) — [created/updated/recreated]
|
|
1125
|
+
- [document] skipped
|
|
1126
|
+
|
|
1127
|
+
[If system-structure.md was updated in step 9a:]
|
|
1128
|
+
~ system-structure.md — subsystem entry added
|
|
1129
|
+
|
|
1130
|
+
[If system-architecture.md was updated in step 9b:]
|
|
1131
|
+
~ system-architecture.md — subsystem responsibility matrix updated
|
|
1132
|
+
|
|
1133
|
+
[If knowledge docs were produced in step 11:]
|
|
1134
|
+
Knowledge Docs (.docs/wiki/subsystems/[subsystem_name]/):
|
|
1135
|
+
──────────────────────────────────────────────────────────
|
|
1136
|
+
[For each doc written by map-story: show filename and line count]
|
|
1137
|
+
|
|
1138
|
+
Next > `/clear` first for a fresh context window, then:
|
|
1139
|
+
|
|
1140
|
+
/ace:map-subsystem [next-subsystem]
|
|
1141
|
+
Map another subsystem.
|
|
1142
|
+
|
|
1143
|
+
Also available (`/clear` first):
|
|
1144
|
+
- /ace:map-system — Re-run to refresh system-wide documents
|
|
1145
|
+
- /ace:init-coding-standards — Define coding standards
|
|
1146
|
+
- Review files in .docs/wiki/subsystems/[subsystem_name]/
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
End workflow.
|
|
1150
|
+
</step>
|
|
1151
|
+
|
|
1152
|
+
</process>
|
|
1153
|
+
|
|
1154
|
+
<success_criteria>
|
|
1155
|
+
<criterion>Init function executed (environment detected, mapper model resolved)</criterion>
|
|
1156
|
+
<criterion>Subsystem path resolved and validated against the codebase</criterion>
|
|
1157
|
+
<criterion>System-wide docs read for context before analysis begins</criterion>
|
|
1158
|
+
<criterion>Each document triaged independently (create/update/recreate/skip)</criterion>
|
|
1159
|
+
<criterion>Agents spawned in parallel (structure + architecture) where possible</criterion>
|
|
1160
|
+
<criterion>system-structure.md updated if this is a previously undocumented subsystem</criterion>
|
|
1161
|
+
<criterion>system-architecture.md subsystem responsibility matrix updated if subsystem was missing</criterion>
|
|
1162
|
+
<criterion>All created documents verified for content (non-empty, >20 lines)</criterion>
|
|
1163
|
+
<criterion>Security scan passed (no secrets in generated docs)</criterion>
|
|
1164
|
+
<criterion>Documents committed to .docs/wiki/subsystems/[subsystem_name]/</criterion>
|
|
1165
|
+
<criterion>Module discovery completed; .ace/artifacts/subsystems/[subsystem_name]/module-discovery/module-discovery.md written</criterion>
|
|
1166
|
+
<criterion>map-story called sequentially for each module row; all completed</criterion>
|
|
1167
|
+
<criterion>Each map-story agent reads ALL existing wiki docs FULLY before writing (no duplication)</criterion>
|
|
1168
|
+
<criterion>Knowledge docs written to .docs/wiki/subsystems/[subsystem_name]/</criterion>
|
|
1169
|
+
<criterion>module-discovery.md staged and committed</criterion>
|
|
1170
|
+
<criterion>User sees clear completion summary with next steps</criterion>
|
|
1171
|
+
</success_criteria>
|
|
1172
|
+
|
|
1173
|
+
</workflow>
|