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-system.xml → skills/map-system/workflow.xml}
RENAMED
|
@@ -1,672 +1,667 @@
|
|
|
1
|
-
<workflow>
|
|
2
|
-
|
|
3
|
-
<purpose>
|
|
4
|
-
Orchestrate system-wide wiki mapping: detect environment, determine which documents need
|
|
5
|
-
creation or updates, spawn ace-wiki-mapper agents to produce them, and optionally add
|
|
6
|
-
CLAUDE.md instructions to keep the wiki current.
|
|
7
|
-
|
|
8
|
-
Produces documents in `.docs/wiki/system-wide/`:
|
|
9
|
-
- system-structure.md — physical layout, subsystem index, shared directories
|
|
10
|
-
- testing-framework.md — test runner, patterns, conventions
|
|
11
|
-
- system-architecture.md — L1/L2 views, core flows, tech stack
|
|
12
|
-
|
|
13
|
-
Brownfield projects get documents filled from codebase analysis.
|
|
14
|
-
Greenfield projects get system-architecture.md via deep questioning (structure and testing
|
|
15
|
-
are scaffolded with headings only — filled as code is added).
|
|
16
|
-
</purpose>
|
|
17
|
-
|
|
18
|
-
<mandatory-context>
|
|
19
|
-
|
|
20
|
-
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
21
|
-
</mandatory-context>
|
|
22
|
-
|
|
23
|
-
<process>
|
|
24
|
-
|
|
25
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
26
|
-
<!-- STEP 1: SETUP -->
|
|
27
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
28
|
-
|
|
29
|
-
<step name="setup" order="1">
|
|
30
|
-
**MANDATORY FIRST STEP — Execute environment detection before any user interaction:**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
```bash
|
|
599
|
-
git add .docs/wiki/
|
|
600
|
-
```
|
|
601
|
-
|
|
602
|
-
If
|
|
603
|
-
```bash
|
|
604
|
-
git add .
|
|
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
|
-
-
|
|
660
|
-
-
|
|
661
|
-
-
|
|
662
|
-
-
|
|
663
|
-
-
|
|
664
|
-
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
- Documents committed to .docs/wiki/system-wide/ (and .docs/wiki/wiki-readme.md)
|
|
669
|
-
- User sees clear completion summary and next steps
|
|
670
|
-
</success_criteria>
|
|
671
|
-
|
|
672
|
-
</workflow>
|
|
1
|
+
<workflow>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Orchestrate system-wide wiki mapping: detect environment, determine which documents need
|
|
5
|
+
creation or updates, spawn ace-wiki-mapper agents to produce them, and optionally add
|
|
6
|
+
CLAUDE.md instructions to keep the wiki current.
|
|
7
|
+
|
|
8
|
+
Produces documents in `.docs/wiki/system-wide/`:
|
|
9
|
+
- system-structure.md — physical layout, subsystem index, shared directories
|
|
10
|
+
- testing-framework.md — test runner, patterns, conventions
|
|
11
|
+
- system-architecture.md — L1/L2 views, core flows, tech stack
|
|
12
|
+
|
|
13
|
+
Brownfield projects get documents filled from codebase analysis.
|
|
14
|
+
Greenfield projects get system-architecture.md via deep questioning (structure and testing
|
|
15
|
+
are scaffolded with headings only — filled as code is added).
|
|
16
|
+
</purpose>
|
|
17
|
+
|
|
18
|
+
<mandatory-context>
|
|
19
|
+
All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
|
|
20
|
+
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
21
|
+
</mandatory-context>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
|
|
25
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
26
|
+
<!-- STEP 1: SETUP -->
|
|
27
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
28
|
+
|
|
29
|
+
<step name="setup" order="1">
|
|
30
|
+
**MANDATORY FIRST STEP — Execute environment detection before any user interaction:**
|
|
31
|
+
|
|
32
|
+
INIT is available from the preprocessed Environment Context above — do NOT re-run init.
|
|
33
|
+
|
|
34
|
+
Parse INIT JSON for: `mapper_model`, `commit_docs`, `is_brownfield`, `is_greenfield`,
|
|
35
|
+
`has_existing_code`, `has_package_file`, `wiki_dir_exists`, `existing_wiki_files`,
|
|
36
|
+
`has_system_structure`, `has_system_architecture`, `has_testing_framework`,
|
|
37
|
+
`has_coding_standards`, `has_git`.
|
|
38
|
+
|
|
39
|
+
MAPPER_MODEL is available from INIT.mapper_model — do NOT re-run resolve-model.
|
|
40
|
+
|
|
41
|
+
Display stage banner:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
╔══════════════════════════════════════════════════╗
|
|
45
|
+
║ ACE > Map System ║
|
|
46
|
+
╚══════════════════════════════════════════════════╝
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**If `has_git` is false:** Initialize git:
|
|
50
|
+
```bash
|
|
51
|
+
git init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Continue to step 2 (document triage).
|
|
55
|
+
</step>
|
|
56
|
+
|
|
57
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
58
|
+
<!-- STEP 2: DOCUMENT TRIAGE -->
|
|
59
|
+
<!-- Determine per-document action: create, update, recreate, or skip -->
|
|
60
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
61
|
+
|
|
62
|
+
<step name="document-triage" order="2">
|
|
63
|
+
|
|
64
|
+
Build a **document action plan** — a list of `{ document, action }` entries where
|
|
65
|
+
action is one of: `create`, `update`, `recreate`, `scaffold`, `skip`.
|
|
66
|
+
|
|
67
|
+
Evaluate each document independently:
|
|
68
|
+
|
|
69
|
+
<!-- ── system-structure.md ────────────────────────────────────── -->
|
|
70
|
+
|
|
71
|
+
**system-structure.md:**
|
|
72
|
+
|
|
73
|
+
If `is_greenfield`:
|
|
74
|
+
- Action: `scaffold` — create with headings and placeholder sections.
|
|
75
|
+
The document will be filled as subsystems are added.
|
|
76
|
+
|
|
77
|
+
If `is_brownfield` AND `has_system_structure` is false:
|
|
78
|
+
- Action: `create` — analyze codebase and produce full document.
|
|
79
|
+
|
|
80
|
+
If `is_brownfield` AND `has_system_structure` is true:
|
|
81
|
+
- Use AskUserQuestion:
|
|
82
|
+
- header: "Structure"
|
|
83
|
+
- question: "System structure document already exists at `.docs/wiki/system-wide/system-structure.md`. What would you like to do?"
|
|
84
|
+
- options:
|
|
85
|
+
- "Update" — Refresh the existing document with current codebase state
|
|
86
|
+
- "Recreate" — Discard and rebuild from scratch
|
|
87
|
+
- "Skip" — Keep the current document as-is
|
|
88
|
+
- Map user choice to action: `update`, `recreate`, or `skip`.
|
|
89
|
+
|
|
90
|
+
<!-- ── testing-framework.md ───────────────────────────────────── -->
|
|
91
|
+
|
|
92
|
+
**testing-framework.md:**
|
|
93
|
+
|
|
94
|
+
If `is_greenfield`:
|
|
95
|
+
- Action: `scaffold` — create with headings and placeholder sections.
|
|
96
|
+
Filled once a test framework is chosen and tests are written.
|
|
97
|
+
|
|
98
|
+
If `is_brownfield` AND `has_testing_framework` is false:
|
|
99
|
+
- Action: `create` — analyze codebase and produce full document.
|
|
100
|
+
|
|
101
|
+
If `is_brownfield` AND `has_testing_framework` is true:
|
|
102
|
+
- Use AskUserQuestion:
|
|
103
|
+
- header: "Testing"
|
|
104
|
+
- question: "Testing framework document already exists at `.docs/wiki/system-wide/testing-framework.md`. What would you like to do?"
|
|
105
|
+
- options:
|
|
106
|
+
- "Update" — Refresh the existing document with current codebase state
|
|
107
|
+
- "Recreate" — Discard and rebuild from scratch
|
|
108
|
+
- "Skip" — Keep the current document as-is
|
|
109
|
+
- Map user choice to action: `update`, `recreate`, or `skip`.
|
|
110
|
+
|
|
111
|
+
<!-- ── system-architecture.md ─────────────────────────────────── -->
|
|
112
|
+
|
|
113
|
+
**system-architecture.md:**
|
|
114
|
+
|
|
115
|
+
If `is_greenfield`:
|
|
116
|
+
- Action: `create_with_interview` — requires deep questioning before writing.
|
|
117
|
+
Cannot be scaffolded because architecture decisions must be made upfront.
|
|
118
|
+
|
|
119
|
+
If `is_brownfield` AND `has_system_architecture` is false:
|
|
120
|
+
- Action: `create` — analyze codebase and produce full document.
|
|
121
|
+
|
|
122
|
+
If `is_brownfield` AND `has_system_architecture` is true:
|
|
123
|
+
- Use AskUserQuestion:
|
|
124
|
+
- header: "Architecture"
|
|
125
|
+
- question: "System architecture document already exists at `.docs/wiki/system-wide/system-architecture.md`. What would you like to do?"
|
|
126
|
+
- options:
|
|
127
|
+
- "Update" — Refresh the existing document with current codebase state
|
|
128
|
+
- "Recreate" — Discard and rebuild from scratch
|
|
129
|
+
- "Skip" — Keep the current document as-is
|
|
130
|
+
- Map user choice to action: `update`, `recreate`, or `skip`.
|
|
131
|
+
|
|
132
|
+
**IMPORTANT:** Ask all questions that need asking in a SINGLE AskUserQuestion call
|
|
133
|
+
where possible (up to 4 questions). If multiple documents exist, batch the questions.
|
|
134
|
+
|
|
135
|
+
Display the action plan to the user:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
┌──────────────────────────────────────────────────┐
|
|
139
|
+
│ ACE > Map System > Action Plan │
|
|
140
|
+
└──────────────────────────────────────────────────┘
|
|
141
|
+
|
|
142
|
+
Document Action
|
|
143
|
+
──────────────────────── ──────────
|
|
144
|
+
system-structure.md [create/update/recreate/scaffold/skip]
|
|
145
|
+
testing-framework.md [create/update/recreate/scaffold/skip]
|
|
146
|
+
system-architecture.md [create/update/recreate/scaffold/skip/create_with_interview]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
If ALL actions are `skip`, exit workflow with message:
|
|
150
|
+
```
|
|
151
|
+
i All documents already exist and were skipped. Nothing to do.
|
|
152
|
+
|
|
153
|
+
Next > `/clear` first for a fresh context window, then:
|
|
154
|
+
|
|
155
|
+
/ace:map-subsystems
|
|
156
|
+
Map individual subsystem internals.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Continue to step 3 (create directory structure).
|
|
160
|
+
</step>
|
|
161
|
+
|
|
162
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
163
|
+
<!-- STEP 3: CREATE DIRECTORY STRUCTURE -->
|
|
164
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
165
|
+
|
|
166
|
+
<step name="create-directories" order="3">
|
|
167
|
+
Create the wiki directory if it doesn't exist:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
mkdir -p .docs/wiki/system-wide
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Generate wiki-readme.md if it does not already exist:**
|
|
174
|
+
|
|
175
|
+
Check if `.docs/wiki/wiki-readme.md` exists. If it does NOT exist, generate it
|
|
176
|
+
from the wiki-readme template (`${CLAUDE_SKILL_DIR}/templates/wiki-readme.xml`).
|
|
177
|
+
|
|
178
|
+
Read the template's `<template>` section and write the markdown content to
|
|
179
|
+
`.docs/wiki/wiki-readme.md`. This is a mostly-static meta-document — fill it
|
|
180
|
+
directly without spawning an agent:
|
|
181
|
+
- Directory Structure section: use as-is from template (canonical layout)
|
|
182
|
+
- Document Types tables: use as-is from template
|
|
183
|
+
- How to Use sections: use as-is from template
|
|
184
|
+
- Creating New Documents section: use as-is from template
|
|
185
|
+
- Keeping Current section: use as-is from template
|
|
186
|
+
- Subsystems table: leave with placeholder rows — will be populated when
|
|
187
|
+
`/ace:map-subsystem` runs
|
|
188
|
+
|
|
189
|
+
If `.docs/wiki/wiki-readme.md` already exists, skip — do not overwrite.
|
|
190
|
+
|
|
191
|
+
Continue to step 4.
|
|
192
|
+
</step>
|
|
193
|
+
|
|
194
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
195
|
+
<!-- STEP 4: SYSTEM STRUCTURE -->
|
|
196
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
197
|
+
|
|
198
|
+
<step name="system-structure" order="4">
|
|
199
|
+
Skip this step if system-structure action is `skip`.
|
|
200
|
+
|
|
201
|
+
**If action is `scaffold` (greenfield):**
|
|
202
|
+
|
|
203
|
+
Create an empty file:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
touch .docs/wiki/system-wide/system-structure.md
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
It will be filled by `/ace:map-system` once source code exists.
|
|
210
|
+
|
|
211
|
+
**If action is `create` or `recreate`:**
|
|
212
|
+
|
|
213
|
+
Spawn ace-wiki-mapper agent:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
Task(
|
|
217
|
+
prompt="Focus: system-structure
|
|
218
|
+
|
|
219
|
+
Analyze this codebase and produce the system-wide structure document.
|
|
220
|
+
|
|
221
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/system-structure.xml
|
|
222
|
+
**Output:** Write to .docs/wiki/system-wide/system-structure.md
|
|
223
|
+
|
|
224
|
+
Follow the template structure. Fill every section with real data from the codebase.
|
|
225
|
+
Identify all subsystems (microservices, monolith modules, or library packages).
|
|
226
|
+
|
|
227
|
+
Return confirmation only — do NOT return document contents.",
|
|
228
|
+
subagent_type="ace-wiki-mapper",
|
|
229
|
+
model="{MAPPER_MODEL}",
|
|
230
|
+
description="Map system structure"
|
|
231
|
+
)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**If action is `update`:**
|
|
235
|
+
|
|
236
|
+
Spawn ace-wiki-mapper agent with existing content as context:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
Task(
|
|
240
|
+
prompt="Focus: system-structure
|
|
241
|
+
|
|
242
|
+
UPDATE the existing system structure document.
|
|
243
|
+
|
|
244
|
+
**Current document:** Read .docs/wiki/system-wide/system-structure.md
|
|
245
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/system-structure.xml
|
|
246
|
+
|
|
247
|
+
Compare the current document against the actual codebase state.
|
|
248
|
+
Update sections that are stale. Add new subsystems or shared directories
|
|
249
|
+
that were added since the document was written. Remove entries for
|
|
250
|
+
deleted subsystems or directories.
|
|
251
|
+
|
|
252
|
+
Preserve accurate content. Only change what's actually stale.
|
|
253
|
+
|
|
254
|
+
Write the updated file to .docs/wiki/system-wide/system-structure.md
|
|
255
|
+
Return confirmation only — do NOT return document contents.",
|
|
256
|
+
subagent_type="ace-wiki-mapper",
|
|
257
|
+
model="{MAPPER_MODEL}",
|
|
258
|
+
description="Update system structure"
|
|
259
|
+
)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Continue to step 5.
|
|
263
|
+
</step>
|
|
264
|
+
|
|
265
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
266
|
+
<!-- STEP 5: TESTING FRAMEWORK -->
|
|
267
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
268
|
+
|
|
269
|
+
<step name="testing-framework" order="5">
|
|
270
|
+
Skip this step if testing-framework action is `skip`.
|
|
271
|
+
|
|
272
|
+
**NOTE:** This step can run IN PARALLEL with step 4 (system-structure) if both
|
|
273
|
+
need agent work. Use `run_in_background=true` for the agents in steps 4 and 5,
|
|
274
|
+
then collect results before step 6.
|
|
275
|
+
|
|
276
|
+
**If action is `scaffold` (greenfield):**
|
|
277
|
+
|
|
278
|
+
Create an empty file:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
touch .docs/wiki/system-wide/testing-framework.md
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
It will be filled by `/ace:map-system` once tests exist.
|
|
285
|
+
|
|
286
|
+
**If action is `create` or `recreate`:**
|
|
287
|
+
|
|
288
|
+
Spawn ace-wiki-mapper agent:
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
Task(
|
|
292
|
+
prompt="Focus: testing-framework
|
|
293
|
+
|
|
294
|
+
Analyze this codebase and produce the testing framework document.
|
|
295
|
+
|
|
296
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/testing-framework.xml
|
|
297
|
+
**Output:** Write to .docs/wiki/system-wide/testing-framework.md
|
|
298
|
+
|
|
299
|
+
Check package.json/config files for test runner and scripts.
|
|
300
|
+
Read 3-5 existing test files for patterns.
|
|
301
|
+
Look for test utilities, fixtures, factories.
|
|
302
|
+
If NO tests exist, write a minimal document noting 'No tests found'
|
|
303
|
+
instead of a document full of placeholders.
|
|
304
|
+
|
|
305
|
+
Return confirmation only — do NOT return document contents.",
|
|
306
|
+
subagent_type="ace-wiki-mapper",
|
|
307
|
+
model="{MAPPER_MODEL}",
|
|
308
|
+
description="Map testing framework"
|
|
309
|
+
)
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**If action is `update`:**
|
|
313
|
+
|
|
314
|
+
Spawn ace-wiki-mapper agent with update instructions:
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
Task(
|
|
318
|
+
prompt="Focus: testing-framework
|
|
319
|
+
|
|
320
|
+
UPDATE the existing testing framework document.
|
|
321
|
+
|
|
322
|
+
**Current document:** Read .docs/wiki/system-wide/testing-framework.md
|
|
323
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/testing-framework.xml
|
|
324
|
+
|
|
325
|
+
Compare against current codebase state. Update stale sections only.
|
|
326
|
+
Check for new test runner config, new test patterns, changed coverage settings.
|
|
327
|
+
|
|
328
|
+
Write the updated file to .docs/wiki/system-wide/testing-framework.md
|
|
329
|
+
Return confirmation only — do NOT return document contents.",
|
|
330
|
+
subagent_type="ace-wiki-mapper",
|
|
331
|
+
model="{MAPPER_MODEL}",
|
|
332
|
+
description="Update testing framework"
|
|
333
|
+
)
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Continue to step 6 (wait for parallel agents from steps 4-5 if applicable).
|
|
337
|
+
</step>
|
|
338
|
+
|
|
339
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
340
|
+
<!-- STEP 5.5: COLLECT PARALLEL RESULTS -->
|
|
341
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
342
|
+
|
|
343
|
+
<step name="collect-parallel" order="5.5">
|
|
344
|
+
If steps 4 and 5 spawned background agents, wait for both to complete.
|
|
345
|
+
Read each agent's output to collect confirmations.
|
|
346
|
+
|
|
347
|
+
If any agent failed, note the failure and inform the user.
|
|
348
|
+
Do NOT re-attempt — let the user decide.
|
|
349
|
+
|
|
350
|
+
Continue to step 6.
|
|
351
|
+
</step>
|
|
352
|
+
|
|
353
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
354
|
+
<!-- STEP 6: SYSTEM ARCHITECTURE -->
|
|
355
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
356
|
+
|
|
357
|
+
<step name="system-architecture" order="6">
|
|
358
|
+
Skip this step if system-architecture action is `skip`.
|
|
359
|
+
|
|
360
|
+
<!-- ── 6a: BROWNFIELD CREATE / RECREATE ──────────────────────── -->
|
|
361
|
+
|
|
362
|
+
**If action is `create` or `recreate` AND `is_brownfield`:**
|
|
363
|
+
|
|
364
|
+
Spawn ace-wiki-mapper agent directly (codebase provides all the answers):
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
Task(
|
|
368
|
+
prompt="Focus: system-architecture
|
|
369
|
+
|
|
370
|
+
Analyze this codebase and produce the system-wide architecture document.
|
|
371
|
+
|
|
372
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/system-architecture.xml
|
|
373
|
+
**Output:** Write to .docs/wiki/system-wide/system-architecture.md
|
|
374
|
+
|
|
375
|
+
**Also read (if it exists):** .docs/wiki/system-wide/system-structure.md
|
|
376
|
+
— use the subsystem index from the structure doc to inform the L2 container diagram
|
|
377
|
+
and subsystem responsibility matrix. Do NOT duplicate content.
|
|
378
|
+
|
|
379
|
+
Follow the template structure. Fill every section with real data.
|
|
380
|
+
Generate C4 L1 and L2 Mermaid diagrams.
|
|
381
|
+
Trace 1-2 core flows as sequence diagrams.
|
|
382
|
+
Catalog the tech stack from actual dependency files (versions from lock files).
|
|
383
|
+
|
|
384
|
+
Return confirmation only — do NOT return document contents.",
|
|
385
|
+
subagent_type="ace-wiki-mapper",
|
|
386
|
+
model="{MAPPER_MODEL}",
|
|
387
|
+
description="Map system architecture"
|
|
388
|
+
)
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
<!-- ── 6b: BROWNFIELD UPDATE ─────────────────────────────────── -->
|
|
392
|
+
|
|
393
|
+
**If action is `update`:**
|
|
394
|
+
|
|
395
|
+
Spawn ace-wiki-mapper agent with update instructions:
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
Task(
|
|
399
|
+
prompt="Focus: system-architecture
|
|
400
|
+
|
|
401
|
+
UPDATE the existing system architecture document.
|
|
402
|
+
|
|
403
|
+
**Current document:** Read .docs/wiki/system-wide/system-architecture.md
|
|
404
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/system-architecture.xml
|
|
405
|
+
**Also read (if it exists):** .docs/wiki/system-wide/system-structure.md
|
|
406
|
+
|
|
407
|
+
Compare against current codebase state. Check:
|
|
408
|
+
- New subsystems or removed subsystems?
|
|
409
|
+
- New external integrations?
|
|
410
|
+
- Tech stack changes (new frameworks, version bumps)?
|
|
411
|
+
- Core flow shape changes?
|
|
412
|
+
|
|
413
|
+
Update only stale sections. Preserve accurate content.
|
|
414
|
+
|
|
415
|
+
Write the updated file to .docs/wiki/system-wide/system-architecture.md
|
|
416
|
+
Return confirmation only — do NOT return document contents.",
|
|
417
|
+
subagent_type="ace-wiki-mapper",
|
|
418
|
+
model="{MAPPER_MODEL}",
|
|
419
|
+
description="Update system architecture"
|
|
420
|
+
)
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
<!-- ── 6c: GREENFIELD — DEEP QUESTIONING ─────────────────────── -->
|
|
424
|
+
|
|
425
|
+
**If action is `create_with_interview` (greenfield):**
|
|
426
|
+
|
|
427
|
+
Architecture cannot be inferred from code that doesn't exist yet.
|
|
428
|
+
Conduct a deep questioning session to gather architecture decisions.
|
|
429
|
+
|
|
430
|
+
Follow the questioning guide from `questioning.xml`. You are a thinking partner
|
|
431
|
+
helping the user articulate their system architecture.
|
|
432
|
+
|
|
433
|
+
**Opening:**
|
|
434
|
+
```
|
|
435
|
+
┌──────────────────────────────────────────────────┐
|
|
436
|
+
│ ACE > Map System > Architecture Interview │
|
|
437
|
+
└──────────────────────────────────────────────────┘
|
|
438
|
+
|
|
439
|
+
This is a greenfield project — no codebase to analyze.
|
|
440
|
+
I need to understand your architecture plans to create
|
|
441
|
+
the system-architecture document.
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**Key areas to explore (adapt based on conversation, don't checklist):**
|
|
445
|
+
|
|
446
|
+
1. **System purpose**
|
|
447
|
+
"In 2-3 sentences, what does this system do and who uses it?"
|
|
448
|
+
|
|
449
|
+
2. **Subsystem breakdown**
|
|
450
|
+
"What are the major components/services/modules?"
|
|
451
|
+
Use AskUserQuestion:
|
|
452
|
+
- header: "Topology"
|
|
453
|
+
- question: "What's your deployment topology?"
|
|
454
|
+
- options:
|
|
455
|
+
- "Monolith" — Single deployable with internal modules
|
|
456
|
+
- "Microservices" — Multiple independently deployed services
|
|
457
|
+
- "Monorepo packages" — Multiple packages in one repo
|
|
458
|
+
- "Hybrid" — Mix of approaches
|
|
459
|
+
|
|
460
|
+
3. **External integrations**
|
|
461
|
+
"What external systems will this integrate with?"
|
|
462
|
+
(databases, auth providers, third-party APIs, message brokers)
|
|
463
|
+
|
|
464
|
+
4. **Communication patterns**
|
|
465
|
+
If multiple subsystems: "How will they communicate?"
|
|
466
|
+
- Sync (HTTP/gRPC) vs Async (events/queues) vs Hybrid
|
|
467
|
+
|
|
468
|
+
5. **Tech stack**
|
|
469
|
+
"What technologies are you using?"
|
|
470
|
+
Use AskUserQuestion:
|
|
471
|
+
- header: "Backend"
|
|
472
|
+
- question: "What's your primary backend technology?"
|
|
473
|
+
- options: (adapt to context, e.g., "Node.js/TypeScript", "C#/.NET", "Python", "Go")
|
|
474
|
+
|
|
475
|
+
Follow up for: frontend, database, cache, messaging if applicable.
|
|
476
|
+
|
|
477
|
+
6. **Key architectural decisions**
|
|
478
|
+
"Any architectural patterns you're committed to?"
|
|
479
|
+
(Clean Architecture, CQRS, Event Sourcing, etc.)
|
|
480
|
+
|
|
481
|
+
**Decision gate:**
|
|
482
|
+
When you understand the architecture:
|
|
483
|
+
- header: "Ready?"
|
|
484
|
+
- question: "I have enough to create your architecture document. Ready to generate?"
|
|
485
|
+
- options:
|
|
486
|
+
- "Generate" — Create the document
|
|
487
|
+
- "Keep exploring" — I have more to share
|
|
488
|
+
|
|
489
|
+
Loop until "Generate" selected.
|
|
490
|
+
|
|
491
|
+
**Then prepare a context brief (300-500 words) that distills:**
|
|
492
|
+
- System purpose and users
|
|
493
|
+
- Subsystem breakdown (names, responsibilities)
|
|
494
|
+
- External integrations (what, direction, protocol)
|
|
495
|
+
- Communication patterns between subsystems
|
|
496
|
+
- Tech stack with expected versions
|
|
497
|
+
- Key architectural decisions
|
|
498
|
+
|
|
499
|
+
**Spawn the ace-wiki-mapper agent with the interview context:**
|
|
500
|
+
|
|
501
|
+
```
|
|
502
|
+
Task(
|
|
503
|
+
prompt="Focus: system-architecture
|
|
504
|
+
|
|
505
|
+
Create the system-wide architecture document for a GREENFIELD project.
|
|
506
|
+
|
|
507
|
+
**Architecture brief from user interview:**
|
|
508
|
+
{paste the context brief here}
|
|
509
|
+
|
|
510
|
+
**Template:** Read ${CLAUDE_SKILL_DIR}/templates/system-architecture.xml
|
|
511
|
+
**Output:** Write to .docs/wiki/system-wide/system-architecture.md
|
|
512
|
+
|
|
513
|
+
**Also read (if it exists):** .docs/wiki/system-wide/system-structure.md
|
|
514
|
+
|
|
515
|
+
Follow the template structure. Generate Mermaid C4 diagrams based on the
|
|
516
|
+
interview data. For greenfield, subsystem boxes in L2 may be planned but
|
|
517
|
+
not yet implemented — that's fine, document the intended architecture.
|
|
518
|
+
|
|
519
|
+
Return confirmation only — do NOT return document contents.",
|
|
520
|
+
subagent_type="ace-wiki-mapper",
|
|
521
|
+
model="{MAPPER_MODEL}",
|
|
522
|
+
description="Write system architecture (greenfield)"
|
|
523
|
+
)
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Continue to step 7.
|
|
527
|
+
</step>
|
|
528
|
+
|
|
529
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
530
|
+
<!-- STEP 7: CLAUDE.MD INSTRUCTIONS -->
|
|
531
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
532
|
+
|
|
533
|
+
<step name="claude-md-instructions" order="7">
|
|
534
|
+
**Add wiki maintenance instructions to CLAUDE.md** so that future code changes
|
|
535
|
+
trigger wiki updates.
|
|
536
|
+
|
|
537
|
+
Check if `CLAUDE.md` exists at project root. If not, create it.
|
|
538
|
+
If it exists, append the wiki section only if it's not already present.
|
|
539
|
+
|
|
540
|
+
Search for "Wiki Maintenance" in CLAUDE.md. If found, skip this step.
|
|
541
|
+
|
|
542
|
+
**Content to add:**
|
|
543
|
+
|
|
544
|
+
```markdown
|
|
545
|
+
|
|
546
|
+
## Wiki Maintenance
|
|
547
|
+
|
|
548
|
+
When adding, removing, or renaming files or directories:
|
|
549
|
+
- Update `.docs/wiki/system-wide/system-structure.md` if the change affects subsystem boundaries, shared directories, or root config files.
|
|
550
|
+
- Update `.docs/wiki/subsystems/[subsystem-name]/structure.md` for any subsystem where files changed.
|
|
551
|
+
|
|
552
|
+
When adding a new subsystem, external integration, or changing communication patterns:
|
|
553
|
+
- Update `.docs/wiki/system-wide/system-architecture.md`.
|
|
554
|
+
|
|
555
|
+
When changing test framework, runner, mocking approach, or coverage config:
|
|
556
|
+
- Update `.docs/wiki/system-wide/testing-framework.md`.
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
Continue to step 8.
|
|
560
|
+
</step>
|
|
561
|
+
|
|
562
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
563
|
+
<!-- STEP 8: VERIFY AND COMMIT -->
|
|
564
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
565
|
+
|
|
566
|
+
<step name="verify-and-commit" order="8">
|
|
567
|
+
**Verify all expected documents exist and are non-empty:**
|
|
568
|
+
|
|
569
|
+
For each document where the action was NOT `skip`:
|
|
570
|
+
- Check file exists
|
|
571
|
+
- Check file has content (>5 lines for scaffold, >20 lines for create/update/recreate)
|
|
572
|
+
|
|
573
|
+
If any document is missing or empty, warn the user.
|
|
574
|
+
|
|
575
|
+
**Security scan** before commit — use the Grep tool (NOT bash grep):
|
|
576
|
+
|
|
577
|
+
```
|
|
578
|
+
Grep(
|
|
579
|
+
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)",
|
|
580
|
+
path=".docs/wiki/system-wide/",
|
|
581
|
+
glob="*.md",
|
|
582
|
+
output_mode="content"
|
|
583
|
+
)
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
If matches found: SECRETS_FOUND — pause and alert user.
|
|
587
|
+
If no matches: CLEAN.
|
|
588
|
+
|
|
589
|
+
If SECRETS_FOUND: pause and alert user before committing.
|
|
590
|
+
|
|
591
|
+
**Commit** (if `commit_docs` is true):
|
|
592
|
+
|
|
593
|
+
```bash
|
|
594
|
+
git add .docs/wiki/system-wide/
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
If wiki-readme.md was created in step 3:
|
|
598
|
+
```bash
|
|
599
|
+
git add .docs/wiki/wiki-readme.md
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
If CLAUDE.md was created or updated:
|
|
603
|
+
```bash
|
|
604
|
+
git add CLAUDE.md
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
```bash
|
|
608
|
+
git commit -m "docs: map system-wide wiki documents"
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
Continue to step 9.
|
|
612
|
+
</step>
|
|
613
|
+
|
|
614
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
615
|
+
<!-- STEP 9: COMPLETION -->
|
|
616
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
617
|
+
|
|
618
|
+
<step name="completion" order="9">
|
|
619
|
+
Display completion banner and next steps.
|
|
620
|
+
|
|
621
|
+
```
|
|
622
|
+
╔══════════════════════════════════════════════════╗
|
|
623
|
+
║ ACE > System Mapped ║
|
|
624
|
+
╚══════════════════════════════════════════════════╝
|
|
625
|
+
|
|
626
|
+
Documents:
|
|
627
|
+
──────────
|
|
628
|
+
[For each document, show action taken and line count]
|
|
629
|
+
+ wiki-readme.md ([N] lines) — [created | already exists]
|
|
630
|
+
+ system-structure.md ([N] lines) — [created/updated/recreated/scaffolded]
|
|
631
|
+
+ testing-framework.md ([N] lines) — [created/updated/recreated/scaffolded]
|
|
632
|
+
+ system-architecture.md ([N] lines) — [created/updated/recreated/scaffolded]
|
|
633
|
+
- [document] skipped
|
|
634
|
+
|
|
635
|
+
i Wiki maintenance rules added to CLAUDE.md.
|
|
636
|
+
|
|
637
|
+
Next > `/clear` first for a fresh context window, then:
|
|
638
|
+
|
|
639
|
+
/ace:map-subsystems
|
|
640
|
+
Map individual subsystem internals.
|
|
641
|
+
|
|
642
|
+
Also available (`/clear` first):
|
|
643
|
+
- /ace:init-coding-standards — Define coding standards
|
|
644
|
+
- /ace:map-system — Re-run this command to refresh
|
|
645
|
+
- Review files in .docs/wiki/system-wide/
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
End workflow.
|
|
649
|
+
</step>
|
|
650
|
+
|
|
651
|
+
</process>
|
|
652
|
+
|
|
653
|
+
<success_criteria>
|
|
654
|
+
- Init function executed (brownfield/greenfield detected, document existence checked)
|
|
655
|
+
- wiki-readme.md created at .docs/wiki/wiki-readme.md if it did not already exist
|
|
656
|
+
- Each document triaged independently (create/update/recreate/scaffold/skip)
|
|
657
|
+
- Greenfield: structure and testing scaffolded, architecture created via interview
|
|
658
|
+
- Brownfield: all documents created/updated by ace-wiki-mapper agents
|
|
659
|
+
- Agents spawned in parallel where possible (structure + testing)
|
|
660
|
+
- CLAUDE.md updated with wiki maintenance instructions
|
|
661
|
+
- All created documents verified for content (non-empty, non-placeholder for brownfield)
|
|
662
|
+
- Security scan passed (no secrets in generated docs)
|
|
663
|
+
- Documents committed to .docs/wiki/system-wide/ (and .docs/wiki/wiki-readme.md)
|
|
664
|
+
- User sees clear completion summary and next steps
|
|
665
|
+
</success_criteria>
|
|
666
|
+
|
|
667
|
+
</workflow>
|