agile-context-engineering 0.2.2 → 0.3.0
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/CHANGELOG.md +82 -0
- package/LICENSE +51 -51
- package/README.md +324 -323
- package/agents/ace-research-synthesizer.md +228 -228
- package/agents/ace-technical-application-architect.md +28 -0
- package/agents/ace-wiki-mapper.md +445 -334
- package/agile-context-engineering/src/ace-tools.test.js +1089 -1089
- package/agile-context-engineering/templates/_command.md +53 -53
- package/agile-context-engineering/templates/_workflow.xml +16 -16
- package/agile-context-engineering/templates/product/product-backlog.xml +231 -231
- package/agile-context-engineering/templates/product/story-integration-solution.xml +1 -0
- package/agile-context-engineering/templates/product/story-wiki.xml +4 -0
- package/agile-context-engineering/templates/wiki/coding-standards.xml +38 -0
- package/agile-context-engineering/templates/wiki/decizions.xml +115 -115
- package/agile-context-engineering/templates/wiki/guide.xml +137 -137
- package/agile-context-engineering/templates/wiki/module-discovery.xml +174 -174
- package/agile-context-engineering/templates/wiki/pattern.xml +159 -159
- package/agile-context-engineering/templates/wiki/system-architecture.xml +254 -254
- package/agile-context-engineering/templates/wiki/system-cross-cutting.xml +197 -197
- package/agile-context-engineering/templates/wiki/system.xml +381 -381
- package/agile-context-engineering/templates/wiki/walkthrough.xml +255 -0
- package/agile-context-engineering/templates/wiki/wiki-readme.xml +297 -276
- package/agile-context-engineering/utils/questioning.xml +110 -110
- package/agile-context-engineering/workflows/execute-story.xml +1219 -1145
- package/agile-context-engineering/workflows/help.xml +540 -540
- package/agile-context-engineering/workflows/init-coding-standards.xml +386 -386
- package/agile-context-engineering/workflows/map-story.xml +1046 -797
- package/agile-context-engineering/workflows/map-subsystem.xml +2 -1
- package/agile-context-engineering/workflows/map-walkthrough.xml +457 -0
- package/agile-context-engineering/workflows/plan-feature.xml +1495 -1495
- package/agile-context-engineering/workflows/plan-story.xml +36 -1
- package/agile-context-engineering/workflows/research-integration-solution.xml +1 -0
- package/agile-context-engineering/workflows/research-story-wiki.xml +2 -1
- package/agile-context-engineering/workflows/research-technical-solution.xml +1 -0
- package/agile-context-engineering/workflows/review-story.xml +281 -281
- package/agile-context-engineering/workflows/update.xml +238 -207
- package/bin/install.js +8 -0
- package/commands/ace/execute-story.md +1 -0
- package/commands/ace/help.md +93 -93
- package/commands/ace/init-coding-standards.md +83 -83
- package/commands/ace/map-story.md +165 -156
- package/commands/ace/map-subsystem.md +140 -138
- package/commands/ace/map-system.md +92 -92
- package/commands/ace/map-walkthrough.md +127 -0
- package/commands/ace/plan-feature.md +89 -89
- package/commands/ace/plan-story.md +15 -1
- package/commands/ace/review-story.md +109 -109
- package/commands/ace/update.md +56 -54
- package/hooks/ace-check-update.js +62 -62
- package/hooks/ace-statusline.js +89 -89
- package/package.json +4 -3
|
@@ -1,797 +1,1046 @@
|
|
|
1
|
-
<workflow>
|
|
2
|
-
|
|
3
|
-
<purpose>
|
|
4
|
-
Orchestrate living knowledge documentation: analyze what was built (story mode) or what
|
|
5
|
-
exists (file mode), then create or update topic-scoped documents in
|
|
6
|
-
`.docs/wiki/subsystems/[subsystem-name]/`.
|
|
7
|
-
|
|
8
|
-
Produces documents across
|
|
9
|
-
- systems/ — WHAT exists (domain subsystems and their current state)
|
|
10
|
-
- patterns/ — HOW things work (reusable implementation patterns)
|
|
11
|
-
- cross-cutting/ — concerns spanning multiple systems
|
|
12
|
-
- guides/ — step-by-step recipes for common implementation tasks
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<!--
|
|
36
|
-
<!--
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<rule condition="
|
|
46
|
-
<rule condition="
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<param name="
|
|
54
|
-
<param name="
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<param name="
|
|
60
|
-
<param name="
|
|
61
|
-
<param name="
|
|
62
|
-
<param name="existing-docs
|
|
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
|
-
git
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
git
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
git diff --name-status
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<rule path="src/Qarc/Web/qarc-
|
|
142
|
-
<rule path="src/Qarc/Web/qarc-
|
|
143
|
-
<rule path="src/Qarc/
|
|
144
|
-
<rule path="src/Qarc/
|
|
145
|
-
<rule path="src/Qarc/
|
|
146
|
-
<rule path="src/Qarc/
|
|
147
|
-
<rule path="src/Qarc/
|
|
148
|
-
<rule path="src/Qarc/
|
|
149
|
-
<rule path="
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<task>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- [subsystem] ([
|
|
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
|
-
<instruction order="
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
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
|
-
|
|
723
|
-
|
|
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
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
</
|
|
1
|
+
<workflow>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Orchestrate living knowledge documentation: analyze what was built (story mode) or what
|
|
5
|
+
exists (file mode), then create or update topic-scoped documents in
|
|
6
|
+
`.docs/wiki/subsystems/[subsystem-name]/`.
|
|
7
|
+
|
|
8
|
+
Produces documents across six categories:
|
|
9
|
+
- systems/ — WHAT exists (domain subsystems and their current state)
|
|
10
|
+
- patterns/ — HOW things work (reusable implementation patterns)
|
|
11
|
+
- cross-cutting/ — concerns spanning multiple systems
|
|
12
|
+
- guides/ — step-by-step recipes for common implementation tasks
|
|
13
|
+
- walkthroughs/ — deep tutorial-style flow explanations with actual code snippets
|
|
14
|
+
- decisions/ — WHY significant choices were made (ADRs)
|
|
15
|
+
|
|
16
|
+
Two input modes that converge into ONE execution flow:
|
|
17
|
+
- **Story mode** (user-invoked): Analyzes git changes after story implementation,
|
|
18
|
+
detects affected subsystem(s), spawns one agent per subsystem.
|
|
19
|
+
- **File mode** (invoked by map-subsystem step 8.7): Receives a file list for one
|
|
20
|
+
module in one subsystem, spawns one agent for that subsystem.
|
|
21
|
+
|
|
22
|
+
Both modes produce the same output: `{ subsystem: files }` map fed to per-subsystem
|
|
23
|
+
agents. The agents are identical regardless of mode — they read all source files,
|
|
24
|
+
read ALL existing wiki docs, and make thorough create-vs-update decisions.
|
|
25
|
+
</purpose>
|
|
26
|
+
|
|
27
|
+
<mandatory-context>
|
|
28
|
+
The orchestrator reads ONLY this workflow — it stays lightweight.
|
|
29
|
+
Each sub-agent reads the five document templates itself before writing.
|
|
30
|
+
Also read any parameters passed as $ARGUMENTS in the invoking command.
|
|
31
|
+
</mandatory-context>
|
|
32
|
+
|
|
33
|
+
<process>
|
|
34
|
+
|
|
35
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
36
|
+
<!-- STEP 1: SETUP AND MODE DETECTION -->
|
|
37
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
38
|
+
|
|
39
|
+
<step name="setup" order="1">
|
|
40
|
+
|
|
41
|
+
<substep order="1.1" name="detect-mode">
|
|
42
|
+
Parse $ARGUMENTS to determine execution mode:
|
|
43
|
+
|
|
44
|
+
<mode-rules>
|
|
45
|
+
<rule condition="files parameter provided" result="file mode" />
|
|
46
|
+
<rule condition="story-context parameter provided" result="story mode" />
|
|
47
|
+
<rule condition="neither parameter provided" result="story mode (analyze staged + unstaged changes)" />
|
|
48
|
+
</mode-rules>
|
|
49
|
+
</substep>
|
|
50
|
+
|
|
51
|
+
<substep order="1.2" name="parse-parameters">
|
|
52
|
+
<parameters mode="story">
|
|
53
|
+
<param name="story-context" required="false" type="path">Path to story artifacts folder</param>
|
|
54
|
+
<param name="commits" required="false" type="string">Number of recent commits OR comma-separated SHAs</param>
|
|
55
|
+
<param name="tech-debt" required="false" type="text|path">Tech debt from code review. Plain text, YAML, or file path.</param>
|
|
56
|
+
</parameters>
|
|
57
|
+
|
|
58
|
+
<parameters mode="file">
|
|
59
|
+
<param name="files" required="true" type="csv">Comma-separated source file paths</param>
|
|
60
|
+
<param name="module-name" required="true" type="string">Human-readable module name</param>
|
|
61
|
+
<param name="subsystem-name" required="true" type="string">Subsystem this module belongs to</param>
|
|
62
|
+
<param name="existing-docs" required="false" type="csv">Comma-separated file paths and/or directory paths to pre-existing documentation</param>
|
|
63
|
+
<param name="existing-docs-inventory" required="false" type="path">Path to a pre-built inventory file (existing-docs-inventory.md) that indexes a large doc directory. When provided, the curation agent reads this inventory instead of re-scanning the directory.</param>
|
|
64
|
+
</parameters>
|
|
65
|
+
</substep>
|
|
66
|
+
|
|
67
|
+
<substep order="1.3" name="display-banner">
|
|
68
|
+
Display stage banner:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
┌──────────────────────────────────────────────────┐
|
|
72
|
+
│ ACE > Map Story > [story mode | file mode] │
|
|
73
|
+
└──────────────────────────────────────────────────┘
|
|
74
|
+
```
|
|
75
|
+
</substep>
|
|
76
|
+
|
|
77
|
+
Continue to step 2.
|
|
78
|
+
</step>
|
|
79
|
+
|
|
80
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
81
|
+
<!-- STEP 2: BUILD SUBSYSTEM WORK MAP -->
|
|
82
|
+
<!-- -->
|
|
83
|
+
<!-- This is the ONLY step that differs by mode. -->
|
|
84
|
+
<!-- Both modes produce the same output: a subsystem_work map. -->
|
|
85
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
86
|
+
|
|
87
|
+
<step name="build-work-map" order="2">
|
|
88
|
+
|
|
89
|
+
<output-schema>
|
|
90
|
+
```
|
|
91
|
+
subsystem_work = {
|
|
92
|
+
"[subsystem-name]": {
|
|
93
|
+
"files": [list of source file paths],
|
|
94
|
+
"file_statuses": { "path": "A|M|D" }, // story mode only
|
|
95
|
+
"story_summary": "...", // story mode only
|
|
96
|
+
"tech_debt_items": [...] // story mode only, if tech-debt provided
|
|
97
|
+
"module_name": "...", // file mode only
|
|
98
|
+
"existing_docs": [...] // file mode only, if provided
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
</output-schema>
|
|
103
|
+
|
|
104
|
+
<!-- ── Story Mode ─────────────────────────────────────────────── -->
|
|
105
|
+
|
|
106
|
+
<mode name="story">
|
|
107
|
+
|
|
108
|
+
<substep order="2a" name="collect-changes">
|
|
109
|
+
Collect changed file names and statuses.
|
|
110
|
+
|
|
111
|
+
Determine the diff range:
|
|
112
|
+
|
|
113
|
+
<variant condition="commits is a number N">
|
|
114
|
+
```bash
|
|
115
|
+
git log --name-status -n [N]
|
|
116
|
+
git diff --name-status HEAD~[N]..HEAD
|
|
117
|
+
```
|
|
118
|
+
</variant>
|
|
119
|
+
|
|
120
|
+
<variant condition="commits is comma-separated SHAs">
|
|
121
|
+
```bash
|
|
122
|
+
git log --name-status [first-sha]^..[last-sha]
|
|
123
|
+
git diff --name-status [first-sha]^..[last-sha]
|
|
124
|
+
```
|
|
125
|
+
</variant>
|
|
126
|
+
|
|
127
|
+
<variant condition="commits not provided">
|
|
128
|
+
```bash
|
|
129
|
+
git diff --name-status
|
|
130
|
+
git diff --name-status --cached
|
|
131
|
+
```
|
|
132
|
+
</variant>
|
|
133
|
+
|
|
134
|
+
Collect every changed file with its status (A = added, M = modified, D = deleted).
|
|
135
|
+
</substep>
|
|
136
|
+
|
|
137
|
+
<substep order="2b" name="group-by-subsystem">
|
|
138
|
+
Map each changed file path to its subsystem:
|
|
139
|
+
|
|
140
|
+
<mapping-rules>
|
|
141
|
+
<rule path="src/Qarc/Web/qarc-charts-v2/" subsystem="qarc-charts-v2" />
|
|
142
|
+
<rule path="src/Qarc/Web/qarc-workspace/" subsystem="qarc-workspace" />
|
|
143
|
+
<rule path="src/Qarc/Web/qarc-web/" subsystem="qarc-web" />
|
|
144
|
+
<rule path="src/Qarc/Engine/" subsystem="engine" />
|
|
145
|
+
<rule path="src/Qarc/DataIngestion/" subsystem="data-ingestion" />
|
|
146
|
+
<rule path="src/Qarc/DataStreaming/" subsystem="data-streaming" />
|
|
147
|
+
<rule path="src/Qarc/ChartManagement/" subsystem="chart-management" />
|
|
148
|
+
<rule path="src/Qarc/Gateway/" subsystem="gateway" />
|
|
149
|
+
<rule path="src/Qarc/[ServiceName]/" subsystem="[service-name] (kebab-case)" />
|
|
150
|
+
<rule path="outside src/Qarc/" subsystem="skip" />
|
|
151
|
+
</mapping-rules>
|
|
152
|
+
|
|
153
|
+
Build one entry per subsystem in `subsystem_work`.
|
|
154
|
+
</substep>
|
|
155
|
+
|
|
156
|
+
<substep order="2c" name="read-story-context">
|
|
157
|
+
Read story context (if provided) and produce a brief summary.
|
|
158
|
+
|
|
159
|
+
<variant condition="story-context parameter was provided">
|
|
160
|
+
<task-list>
|
|
161
|
+
<task>Read all markdown files in the story artifacts folder</task>
|
|
162
|
+
<task>Extract a summary (10-15 lines max): what the story intended, key acceptance
|
|
163
|
+
criteria, significant decisions mentioned</task>
|
|
164
|
+
<task>Attach the same summary to every subsystem entry (shared intent context)</task>
|
|
165
|
+
</task-list>
|
|
166
|
+
NOTE: The implementation may deviate from the plan — agents document
|
|
167
|
+
what WAS built, not what was planned.
|
|
168
|
+
</variant>
|
|
169
|
+
|
|
170
|
+
<variant condition="no story-context">
|
|
171
|
+
Set story_summary = "No story artifacts. Document from code changes."
|
|
172
|
+
</variant>
|
|
173
|
+
|
|
174
|
+
Display to user:
|
|
175
|
+
```
|
|
176
|
+
Affected subsystems:
|
|
177
|
+
- [subsystem] ([N] files changed)
|
|
178
|
+
- [subsystem] ([M] files changed)
|
|
179
|
+
```
|
|
180
|
+
</substep>
|
|
181
|
+
|
|
182
|
+
<substep order="2d" name="distribute-tech-debt">
|
|
183
|
+
<variant condition="tech-debt parameter was provided">
|
|
184
|
+
Parse the tech debt input (plain text, YAML, or read from file path).
|
|
185
|
+
Each tech debt item has a `file` field — use the same subsystem mapping
|
|
186
|
+
rules from step 2b to assign each item to its subsystem.
|
|
187
|
+
Attach the filtered items to each subsystem entry as `tech_debt_items`.
|
|
188
|
+
|
|
189
|
+
Store the full parsed tech debt list as `ALL_TECH_DEBT` for step 4
|
|
190
|
+
(tech-debt-index update).
|
|
191
|
+
|
|
192
|
+
Display:
|
|
193
|
+
```
|
|
194
|
+
i Tech debt: {total_count} items distributed across {subsystem_count} subsystem(s)
|
|
195
|
+
```
|
|
196
|
+
</variant>
|
|
197
|
+
|
|
198
|
+
<variant condition="no tech-debt parameter">
|
|
199
|
+
Skip — no tech debt to integrate.
|
|
200
|
+
</variant>
|
|
201
|
+
</substep>
|
|
202
|
+
|
|
203
|
+
<substep order="2e" name="detect-new-subsystems">
|
|
204
|
+
Detect whether any subsystems in `subsystem_work` are NEW (not yet documented
|
|
205
|
+
in system-structure.md). If found, offer to run full subsystem mapping via
|
|
206
|
+
/ace:map-subsystem before proceeding with per-change documentation.
|
|
207
|
+
|
|
208
|
+
Only runs in story mode. Naturally skipped when map-story is invoked as a
|
|
209
|
+
background agent (e.g., from execute-story) because the required tools —
|
|
210
|
+
Agent, AskUserQuestion — are unavailable to ace-wiki-mapper agents.
|
|
211
|
+
|
|
212
|
+
<substep order="2e.1" name="check-system-structure">
|
|
213
|
+
Check if `.docs/wiki/system-wide/system-structure.md` exists.
|
|
214
|
+
|
|
215
|
+
<variant condition="file does not exist">
|
|
216
|
+
Display:
|
|
217
|
+
```
|
|
218
|
+
i system-structure.md not found — skipping new subsystem detection.
|
|
219
|
+
Run /ace:map-system first to create system-wide documentation.
|
|
220
|
+
```
|
|
221
|
+
Skip the rest of substep 2e.
|
|
222
|
+
</variant>
|
|
223
|
+
|
|
224
|
+
<variant condition="file exists">
|
|
225
|
+
Read `.docs/wiki/system-wide/system-structure.md`.
|
|
226
|
+
Parse the **Subsystem Index** table to extract known subsystem
|
|
227
|
+
directory paths (the Directory column values).
|
|
228
|
+
Store as `known_subsystems`.
|
|
229
|
+
</variant>
|
|
230
|
+
</substep>
|
|
231
|
+
|
|
232
|
+
<substep order="2e.2" name="identify-new-subsystems">
|
|
233
|
+
For each subsystem key in `subsystem_work`, determine its source
|
|
234
|
+
directory path from the changed file paths (the common parent
|
|
235
|
+
directory at the subsystem root level).
|
|
236
|
+
|
|
237
|
+
Compare against `known_subsystems`. Any subsystem whose directory
|
|
238
|
+
path is NOT in the list → add to `new_subsystems` with name and path.
|
|
239
|
+
|
|
240
|
+
<variant condition="new_subsystems is empty">
|
|
241
|
+
No new subsystems detected — skip the rest of substep 2e.
|
|
242
|
+
</variant>
|
|
243
|
+
</substep>
|
|
244
|
+
|
|
245
|
+
<substep order="2e.3" name="ask-user-approval">
|
|
246
|
+
Display:
|
|
247
|
+
```
|
|
248
|
+
! New subsystem(s) detected — not yet in system-structure.md:
|
|
249
|
+
|
|
250
|
+
[For each new subsystem:]
|
|
251
|
+
- [subsystem-name] at [path] ([N] changed files)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Use AskUserQuestion:
|
|
255
|
+
- header: "New Subsystem"
|
|
256
|
+
- question: "This story added files in [count] subsystem(s) not yet
|
|
257
|
+
documented in system-structure.md:\n\n[list: name at path]\n\nFull
|
|
258
|
+
mapping creates structure.md, architecture.md, module discovery, and
|
|
259
|
+
all knowledge docs (systems/, patterns/, cross-cutting/, guides/,
|
|
260
|
+
decisions/). It also updates system-structure.md and
|
|
261
|
+
system-architecture.md.\n\nShould I run full subsystem mapping?"
|
|
262
|
+
- options:
|
|
263
|
+
- "Yes, map new subsystem(s)" — Run /ace:map-subsystem for each
|
|
264
|
+
new subsystem, then continue with remaining work
|
|
265
|
+
- "No, just document the changes" — Treat them like existing
|
|
266
|
+
subsystems (lightweight per-change docs only)
|
|
267
|
+
|
|
268
|
+
<option value="No, just document the changes">
|
|
269
|
+
Skip the rest of substep 2e — new subsystems stay in
|
|
270
|
+
`subsystem_work` for normal step 3 processing.
|
|
271
|
+
</option>
|
|
272
|
+
</substep>
|
|
273
|
+
|
|
274
|
+
<substep order="2e.4" name="run-map-subsystem" condition="user approved">
|
|
275
|
+
For each subsystem in `new_subsystems`, run map-subsystem SEQUENTIALLY
|
|
276
|
+
(each spawns many internal sub-agents — parallel would be too heavy).
|
|
277
|
+
|
|
278
|
+
Store results in `new_subsystem_reports` list.
|
|
279
|
+
|
|
280
|
+
<loop for-each="subsystem in new_subsystems">
|
|
281
|
+
Display:
|
|
282
|
+
```
|
|
283
|
+
┌──────────────────────────────────────────────────┐
|
|
284
|
+
│ ACE > Map Story > New Subsystem Mapping │
|
|
285
|
+
└──────────────────────────────────────────────────┘
|
|
286
|
+
|
|
287
|
+
Mapping [subsystem.name] at [subsystem.path]...
|
|
288
|
+
([index] of [total] new subsystems)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
Agent(
|
|
293
|
+
prompt="/ace:map-subsystem subsystem=\"[subsystem.path]\"
|
|
294
|
+
|
|
295
|
+
Execute the map-subsystem workflow end-to-end.
|
|
296
|
+
This is a NEW subsystem — no existing docs to triage
|
|
297
|
+
(all documents will be created fresh).
|
|
298
|
+
|
|
299
|
+
**Return format — ONLY this, nothing else:**
|
|
300
|
+
MAP-SUBSYSTEM COMPLETE
|
|
301
|
+
Subsystem: [subsystem.name]
|
|
302
|
+
- Structure: created ([N] lines)
|
|
303
|
+
- Architecture: created ([N] lines)
|
|
304
|
+
- Modules discovered: [count]
|
|
305
|
+
- Knowledge docs created: [count]
|
|
306
|
+
- system-structure.md: updated
|
|
307
|
+
- system-architecture.md: updated",
|
|
308
|
+
subagent_type="general-purpose",
|
|
309
|
+
description="Map new subsystem [subsystem.name]"
|
|
310
|
+
)
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Parse the agent's return and add to `new_subsystem_reports`.
|
|
314
|
+
|
|
315
|
+
Display:
|
|
316
|
+
```
|
|
317
|
+
+ [subsystem.name] mapping complete — [count] docs created
|
|
318
|
+
```
|
|
319
|
+
</loop>
|
|
320
|
+
</substep>
|
|
321
|
+
|
|
322
|
+
<substep order="2e.5" name="prune-work-map" condition="user approved">
|
|
323
|
+
Remove all `new_subsystems` entries from `subsystem_work` to prevent
|
|
324
|
+
duplicate documentation in step 3 (map-subsystem already created full
|
|
325
|
+
structure, architecture, module discovery, AND all knowledge docs).
|
|
326
|
+
|
|
327
|
+
Display:
|
|
328
|
+
```
|
|
329
|
+
i Removed [count] fully-mapped subsystem(s) from work queue.
|
|
330
|
+
Remaining for per-change documentation: [list remaining, or "none"]
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
<variant condition="subsystem_work is now empty AND tech_debt_items exist for new subsystems">
|
|
334
|
+
map-subsystem does NOT handle tech debt integration. Spawn a
|
|
335
|
+
lightweight ace-wiki-mapper agent per new subsystem that has
|
|
336
|
+
tech_debt_items, with instructions to ONLY add ## Tech Debt
|
|
337
|
+
sections to the docs that map-subsystem just created.
|
|
338
|
+
</variant>
|
|
339
|
+
|
|
340
|
+
<variant condition="subsystem_work is now empty AND no tech debt">
|
|
341
|
+
Skip steps 3-4, jump to step 5 (tech debt index update).
|
|
342
|
+
</variant>
|
|
343
|
+
|
|
344
|
+
<variant condition="subsystem_work still has entries">
|
|
345
|
+
Continue to step 3 normally with the reduced work map.
|
|
346
|
+
</variant>
|
|
347
|
+
</substep>
|
|
348
|
+
</substep>
|
|
349
|
+
|
|
350
|
+
</mode>
|
|
351
|
+
|
|
352
|
+
<!-- ── File Mode ──────────────────────────────────────────────── -->
|
|
353
|
+
|
|
354
|
+
<mode name="file">
|
|
355
|
+
|
|
356
|
+
<substep order="2a" name="resolve-existing-docs">
|
|
357
|
+
Resolve existing-docs entries.
|
|
358
|
+
|
|
359
|
+
Split the `existing-docs` parameter into individual entries. Classify each entry:
|
|
360
|
+
|
|
361
|
+
<classification>
|
|
362
|
+
<type name="file-path">Keep as-is (already curated by the caller)</type>
|
|
363
|
+
<type name="directory-path">Needs curation (may contain hundreds of irrelevant files)</type>
|
|
364
|
+
</classification>
|
|
365
|
+
|
|
366
|
+
<variant condition="ANY entry is a directory">
|
|
367
|
+
Spawn a curation agent to select only relevant docs.
|
|
368
|
+
If `existing-docs-inventory` was provided (not `none`), pass it to the agent
|
|
369
|
+
so it reads the pre-built inventory instead of re-scanning the directory.
|
|
370
|
+
|
|
371
|
+
```
|
|
372
|
+
Task(
|
|
373
|
+
prompt="You are a documentation curation agent. Your job is to select ONLY the
|
|
374
|
+
documentation files relevant to a specific code module from a large doc directory.
|
|
375
|
+
|
|
376
|
+
**Module name:** [module-name param]
|
|
377
|
+
**Source files in this module:** [files param]
|
|
378
|
+
**Documentation directory:** [directory path]
|
|
379
|
+
**Pre-built inventory (if available):** [existing-docs-inventory path, or 'none']
|
|
380
|
+
|
|
381
|
+
Process:
|
|
382
|
+
|
|
383
|
+
IF a pre-built inventory file was provided (not 'none'):
|
|
384
|
+
1. Read the inventory file — it contains file paths, titles, and summaries
|
|
385
|
+
for every doc in the directory, already indexed
|
|
386
|
+
2. Compare each inventory entry against the module's source files and name
|
|
387
|
+
3. Select ONLY entries whose subject matter is relevant to this module
|
|
388
|
+
4. Return the file paths from the selected inventory entries
|
|
389
|
+
(Do NOT re-scan the directory — the inventory is the source of truth)
|
|
390
|
+
|
|
391
|
+
IF no inventory file is available:
|
|
392
|
+
1. Recursively list ALL files in the documentation directory down to every leaf
|
|
393
|
+
subdirectory. Use Glob(pattern='**/*', path='[directory path]') to ensure
|
|
394
|
+
no nesting level is missed. Do NOT use shallow ls or single-level globs.
|
|
395
|
+
2. For each file, read its title and first 10-20 lines to understand its subject
|
|
396
|
+
3. Compare against the module's source files and module name
|
|
397
|
+
4. Select ONLY files whose subject matter is relevant to this module
|
|
398
|
+
|
|
399
|
+
Relevance criteria (both paths):
|
|
400
|
+
- Documents describing the same domain concepts
|
|
401
|
+
- Architecture docs covering systems these files participate in
|
|
402
|
+
- API docs for interfaces these files implement or consume
|
|
403
|
+
- Decision records about choices visible in this code
|
|
404
|
+
Be SELECTIVE — fewer relevant docs is better than many tangential ones.
|
|
405
|
+
|
|
406
|
+
Return ONLY a comma-separated list of relevant file paths (absolute or relative).
|
|
407
|
+
If no docs are relevant, return 'none'.
|
|
408
|
+
Do NOT return explanations — just the file list.",
|
|
409
|
+
subagent_type="ace-wiki-mapper",
|
|
410
|
+
description="Curate relevant docs for [module-name]"
|
|
411
|
+
)
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Replace the directory entry with the curated file list returned by the agent.
|
|
415
|
+
Merge with any file-path entries that were already curated.
|
|
416
|
+
The final `existing_docs` is a flat list of relevant file paths only.
|
|
417
|
+
|
|
418
|
+
Display curated docs to user:
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
┌──────────────────────────────────────────────────┐
|
|
422
|
+
│ Curated Existing Docs for [module-name] │
|
|
423
|
+
└──────────────────────────────────────────────────┘
|
|
424
|
+
|
|
425
|
+
Directory scanned: [directory path]
|
|
426
|
+
Relevant docs selected ([N] of [total] files):
|
|
427
|
+
|
|
428
|
+
- [file path 1]
|
|
429
|
+
- [file path 2]
|
|
430
|
+
- ...
|
|
431
|
+
|
|
432
|
+
[If none selected: "No relevant docs found in directory."]
|
|
433
|
+
```
|
|
434
|
+
</variant>
|
|
435
|
+
|
|
436
|
+
<variant condition="ALL entries are file paths">
|
|
437
|
+
Skip curation — use them directly.
|
|
438
|
+
</variant>
|
|
439
|
+
</substep>
|
|
440
|
+
|
|
441
|
+
<substep order="2b" name="build-work-map">
|
|
442
|
+
Build the work map:
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
subsystem_work = {
|
|
446
|
+
"[subsystem-name param]": {
|
|
447
|
+
"files": [split files param into list],
|
|
448
|
+
"module_name": "[module-name param]",
|
|
449
|
+
"existing_docs": [resolved flat list of curated file paths, or empty]
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
</substep>
|
|
454
|
+
|
|
455
|
+
</mode>
|
|
456
|
+
|
|
457
|
+
Continue to step 3.
|
|
458
|
+
</step>
|
|
459
|
+
|
|
460
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
461
|
+
<!-- STEP 3: SPAWN PER-SUBSYSTEM AGENTS -->
|
|
462
|
+
<!-- -->
|
|
463
|
+
<!-- From here, story mode and file mode are IDENTICAL. -->
|
|
464
|
+
<!-- One agent per subsystem. Same agent logic. Same thoroughness. -->
|
|
465
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
466
|
+
|
|
467
|
+
<step name="spawn-agents" order="3">
|
|
468
|
+
|
|
469
|
+
<substep order="3.1" name="determine-parallelism">
|
|
470
|
+
<rule condition="1 subsystem">Run agent in foreground.</rule>
|
|
471
|
+
<rule condition="2+ subsystems">Run ALL agents with `run_in_background=true`.</rule>
|
|
472
|
+
</substep>
|
|
473
|
+
|
|
474
|
+
<substep order="3.2" name="spawn-agent-per-subsystem">
|
|
475
|
+
For each entry in `subsystem_work`, spawn one ace-wiki-mapper agent.
|
|
476
|
+
|
|
477
|
+
Each agent receives a self-contained prompt. The prompt MUST include all the
|
|
478
|
+
instructions below — the agent has no other source of truth for how to work.
|
|
479
|
+
|
|
480
|
+
```
|
|
481
|
+
Task(
|
|
482
|
+
prompt="You are creating or updating living knowledge documentation for the
|
|
483
|
+
[subsystem_name] subsystem.
|
|
484
|
+
|
|
485
|
+
<agent-instructions>
|
|
486
|
+
|
|
487
|
+
<instruction order="0" name="read-templates">
|
|
488
|
+
TEMPLATES — Read ALL of these before writing ANY docs:
|
|
489
|
+
|
|
490
|
+
- System docs: .claude/templates/system.xml
|
|
491
|
+
- Pattern docs: .claude/templates/pattern.xml
|
|
492
|
+
- Cross-cutting docs: .claude/templates/system-cross-cutting.xml
|
|
493
|
+
- Guide docs: .claude/templates/guide.xml
|
|
494
|
+
- Walkthrough docs: .claude/templates/walkthrough.xml
|
|
495
|
+
- Decision docs: .claude/templates/decizions.xml
|
|
496
|
+
</instruction>
|
|
497
|
+
|
|
498
|
+
<instruction order="0" name="inputs">
|
|
499
|
+
YOUR INPUTS:
|
|
500
|
+
|
|
501
|
+
**Subsystem:** [subsystem_name]
|
|
502
|
+
**Wiki directory:** .docs/wiki/subsystems/[subsystem_name]/
|
|
503
|
+
|
|
504
|
+
**Source files to analyze:**
|
|
505
|
+
[list every file path with its A/M/D status (story mode) or just paths (file mode)]
|
|
506
|
+
|
|
507
|
+
<variant condition="story mode">
|
|
508
|
+
**Story context:**
|
|
509
|
+
[story_summary from step 2c]
|
|
510
|
+
</variant>
|
|
511
|
+
|
|
512
|
+
<variant condition="file mode">
|
|
513
|
+
**Module name:** [module_name]
|
|
514
|
+
**Pre-existing documentation:** [existing_docs paths, or 'none']
|
|
515
|
+
</variant>
|
|
516
|
+
|
|
517
|
+
<variant condition="tech_debt_items is not empty">
|
|
518
|
+
**Tech debt items to integrate:**
|
|
519
|
+
[tech_debt_items YAML for this subsystem]
|
|
520
|
+
</variant>
|
|
521
|
+
</instruction>
|
|
522
|
+
|
|
523
|
+
<instruction order="A" name="read-source-files">
|
|
524
|
+
Read EVERY source file listed above (skip deleted files — note them for
|
|
525
|
+
removal from existing docs). For each file, understand:
|
|
526
|
+
|
|
527
|
+
<checklist>
|
|
528
|
+
<item>Class hierarchies and interface implementations</item>
|
|
529
|
+
<item>Function signatures and contracts</item>
|
|
530
|
+
<item>State management (Redux slices, local state, database)</item>
|
|
531
|
+
<item>Constants, enums, and configuration</item>
|
|
532
|
+
<item>Integration points (imports from other systems, event handling)</item>
|
|
533
|
+
<item>Error handling patterns</item>
|
|
534
|
+
<item>DI registrations, factory/registry entries</item>
|
|
535
|
+
</checklist>
|
|
536
|
+
|
|
537
|
+
THE ACTUAL CODE IS THE SOURCE OF TRUTH. Story docs and existing docs
|
|
538
|
+
are context for intent — the code is what gets documented.
|
|
539
|
+
|
|
540
|
+
<variant condition="file mode and existing_docs is not 'none'">
|
|
541
|
+
Also read the pre-existing documentation files. These contain prior
|
|
542
|
+
knowledge about intent, decisions, and history. Use them to understand
|
|
543
|
+
WHY things were built a certain way, but the source code always wins
|
|
544
|
+
when there is a conflict.
|
|
545
|
+
</variant>
|
|
546
|
+
</instruction>
|
|
547
|
+
|
|
548
|
+
<instruction order="B" name="read-existing-wiki">
|
|
549
|
+
READ ALL EXISTING WIKI DOCS (MANDATORY — NO SHORTCUTS)
|
|
550
|
+
|
|
551
|
+
Before writing ANYTHING, you MUST read ALL existing wiki documents for
|
|
552
|
+
this subsystem. Not titles. Not summaries. THE FULL CONTENT of every
|
|
553
|
+
single document.
|
|
554
|
+
|
|
555
|
+
<substep order="B.1">
|
|
556
|
+
Scan for existing docs — use the Glob tool (NOT bash find):
|
|
557
|
+
```
|
|
558
|
+
Glob(pattern='**/*.md', path='.docs/wiki/subsystems/[subsystem_name]')
|
|
559
|
+
```
|
|
560
|
+
</substep>
|
|
561
|
+
|
|
562
|
+
<substep order="B.2">
|
|
563
|
+
Read EVERY document found — fully:
|
|
564
|
+
<checklist>
|
|
565
|
+
<item>systems/*.md — every system document, complete</item>
|
|
566
|
+
<item>patterns/*.md — every pattern document, complete</item>
|
|
567
|
+
<item>cross-cutting/*.md — every cross-cutting document, complete</item>
|
|
568
|
+
<item>guides/*.md — every guide document, complete</item>
|
|
569
|
+
<item>walkthroughs/*.md — every walkthrough document, complete</item>
|
|
570
|
+
<item>decisions/*.md — every ADR, complete</item>
|
|
571
|
+
</checklist>
|
|
572
|
+
</substep>
|
|
573
|
+
|
|
574
|
+
<substep order="B.3">
|
|
575
|
+
Build a mental map of what is ALREADY documented:
|
|
576
|
+
<checklist>
|
|
577
|
+
<item>Which systems already have docs? What sections do they cover?</item>
|
|
578
|
+
<item>Which patterns are already documented? What implementations are listed?</item>
|
|
579
|
+
<item>Which cross-cutting concerns are documented? What registrations are listed?</item>
|
|
580
|
+
<item>Which guides exist? Are the steps still accurate?</item>
|
|
581
|
+
<item>Which walkthroughs exist? Are the code snippets still accurate? Which flows do they cover?</item>
|
|
582
|
+
<item>Which decisions are recorded?</item>
|
|
583
|
+
</checklist>
|
|
584
|
+
</substep>
|
|
585
|
+
|
|
586
|
+
This map is your ANTI-DUPLICATION defense. You cannot avoid creating
|
|
587
|
+
duplicate content if you have not read what already exists.
|
|
588
|
+
|
|
589
|
+
If the wiki directory does not exist:
|
|
590
|
+
```bash
|
|
591
|
+
mkdir -p .docs/wiki/subsystems/[subsystem_name]/{systems,patterns,cross-cutting,guides,walkthroughs,decisions}
|
|
592
|
+
```
|
|
593
|
+
</instruction>
|
|
594
|
+
|
|
595
|
+
<instruction order="C" name="analyze-and-categorize">
|
|
596
|
+
ANALYZE AND CATEGORIZE
|
|
597
|
+
|
|
598
|
+
<substep order="C.1" name="classify-code">
|
|
599
|
+
For each significant component/change in the source files, determine
|
|
600
|
+
which doc category it affects:
|
|
601
|
+
|
|
602
|
+
<categorization-rules>
|
|
603
|
+
<rule pattern="Coherent domain system (E2E flow)" target="systems/" />
|
|
604
|
+
<rule pattern="Reusable structural pattern (2+ similar)" target="patterns/" />
|
|
605
|
+
<rule pattern="Shared infrastructure (DI, events, registry)" target="cross-cutting/" />
|
|
606
|
+
<rule pattern="Common repeatable task recipe" target="guides/" />
|
|
607
|
+
<rule pattern="Complex multi-class flow with framework involvement" target="walkthroughs/" />
|
|
608
|
+
<rule pattern="Significant architectural 'why' decision" target="decisions/" />
|
|
609
|
+
</categorization-rules>
|
|
610
|
+
</substep>
|
|
611
|
+
|
|
612
|
+
<substep order="C.2" name="create-vs-update">
|
|
613
|
+
CREATE vs UPDATE — the critical decision.
|
|
614
|
+
|
|
615
|
+
For EACH item you want to document, check your mental map from Step B:
|
|
616
|
+
|
|
617
|
+
<decision-tree>
|
|
618
|
+
<question ask="Does an existing doc ALREADY cover this topic?">
|
|
619
|
+
<answer value="yes">UPDATE that doc. Add/expand sections. Do NOT create a new doc.</answer>
|
|
620
|
+
<answer value="no">CREATE a new doc. But ONLY if this is a genuinely new topic.</answer>
|
|
621
|
+
</question>
|
|
622
|
+
<question ask="Could this content be a new SECTION in an existing system/pattern doc?">
|
|
623
|
+
<answer value="yes">Add the section there. Do NOT create a separate doc.</answer>
|
|
624
|
+
</question>
|
|
625
|
+
<question ask="Is there ANY overlap with existing docs?">
|
|
626
|
+
<answer value="yes">Merge into the existing doc. NEVER create parallel docs about the same concern.</answer>
|
|
627
|
+
</question>
|
|
628
|
+
</decision-tree>
|
|
629
|
+
|
|
630
|
+
NEVER create a story-scoped or module-scoped document.
|
|
631
|
+
All docs are TOPIC-scoped — about the concern, not about the story or module.
|
|
632
|
+
|
|
633
|
+
When updating: ADD new sections or expand existing ones. Do NOT rewrite
|
|
634
|
+
sections that have not changed. UPDATE file trees to reflect current state.
|
|
635
|
+
REMOVE references to deleted files or components.
|
|
636
|
+
</substep>
|
|
637
|
+
</instruction>
|
|
638
|
+
|
|
639
|
+
<instruction order="D" name="write-documentation">
|
|
640
|
+
WRITE DOCUMENTATION
|
|
641
|
+
|
|
642
|
+
For each item in your action plan:
|
|
643
|
+
|
|
644
|
+
<substep order="D.1" name="apply-template">
|
|
645
|
+
Read the appropriate template XML (from the list above).
|
|
646
|
+
<variant condition="CREATE">Follow the template structure, fill all relevant sections,
|
|
647
|
+
omit sections that genuinely don't apply.</variant>
|
|
648
|
+
<variant condition="UPDATE">Read the existing doc, add/expand sections, preserve
|
|
649
|
+
unchanged content, match existing style.</variant>
|
|
650
|
+
</substep>
|
|
651
|
+
|
|
652
|
+
<substep order="D.2" name="diagram-rules">
|
|
653
|
+
DIAGRAM RULE — ALL visual representations of architecture, dependencies, flows,
|
|
654
|
+
or relationships MUST use ```mermaid fenced code blocks.
|
|
655
|
+
This means: NO ASCII arrows (->), NO tree structures for dependencies, NO PlantUML,
|
|
656
|
+
NO custom notation. If you would write `A -> B -> C`, write a mermaid flowchart instead.
|
|
657
|
+
The ONLY exception for ASCII is file trees (directory listings).
|
|
658
|
+
</substep>
|
|
659
|
+
|
|
660
|
+
<substep order="D.3" name="e2e-flow-rule">
|
|
661
|
+
E2E FLOW RULE — Every systems/*.md doc MUST have at least one ```mermaid sequenceDiagram.
|
|
662
|
+
This is non-negotiable. Trace the complete E2E flow from entry point through all layers
|
|
663
|
+
to data store and back. If you cannot trace it, read more source files until you can.
|
|
664
|
+
</substep>
|
|
665
|
+
|
|
666
|
+
<substep order="D.4" name="style-guidelines">
|
|
667
|
+
Documentation style (ALL docs):
|
|
668
|
+
<checklist>
|
|
669
|
+
<item>EXTREMELY SUCCINCT — every word must add value</item>
|
|
670
|
+
<item>NO FLUFF — direct, actionable information only</item>
|
|
671
|
+
<item>Bullet points over paragraphs</item>
|
|
672
|
+
<item>File trees: ASCII only (|-- and backtick-dash-dash) — NEVER Unicode box-drawing</item>
|
|
673
|
+
<item>Diagrams (sequence, class, boundary): MUST be ```mermaid fenced blocks</item>
|
|
674
|
+
<item>Code references: `file-path:ClassName.methodName` or `file-path:functionName`
|
|
675
|
+
NEVER use line numbers (they go stale with every edit)</item>
|
|
676
|
+
<item>Inline snippets ONLY for interfaces, types, and contracts that define API shape</item>
|
|
677
|
+
<item>When referencing a class/module: `file-path:ClassName`</item>
|
|
678
|
+
<item>When referencing a method: `file-path:ClassName.methodName`</item>
|
|
679
|
+
<item>When referencing a function: `file-path:functionName`</item>
|
|
680
|
+
<item>When referencing a type/interface: `file-path:InterfaceName`</item>
|
|
681
|
+
<item>Cross-reference related docs with markdown links</item>
|
|
682
|
+
</checklist>
|
|
683
|
+
</substep>
|
|
684
|
+
|
|
685
|
+
<substep order="D.5" name="exclusions">
|
|
686
|
+
What NOT to document:
|
|
687
|
+
<exclusion-list>
|
|
688
|
+
<exclude>Story numbers, sprint context, or agile artifacts</exclude>
|
|
689
|
+
<exclude>Planned vs Actual comparisons</exclude>
|
|
690
|
+
<exclude>Acceptance criteria checklists</exclude>
|
|
691
|
+
<exclude>Revision history (git handles this)</exclude>
|
|
692
|
+
<exclude>Duplicated implementation code (reference it, don't copy it)</exclude>
|
|
693
|
+
<exclude>Line numbers in references (they go stale)</exclude>
|
|
694
|
+
<exclude>Testing docs, coverage metrics, test code</exclude>
|
|
695
|
+
<exclude>Performance benchmarks</exclude>
|
|
696
|
+
<exclude>Debugging utilities or monitoring code</exclude>
|
|
697
|
+
<exclude>ASCII art for diagrams (ALL diagrams MUST be ```mermaid blocks; exception: file trees use ASCII)</exclude>
|
|
698
|
+
</exclusion-list>
|
|
699
|
+
</substep>
|
|
700
|
+
</instruction>
|
|
701
|
+
|
|
702
|
+
<instruction order="E" name="quality-verification">
|
|
703
|
+
QUALITY VERIFICATION
|
|
704
|
+
|
|
705
|
+
After writing all docs, verify each one:
|
|
706
|
+
|
|
707
|
+
<verification-checklist>
|
|
708
|
+
<check>File exists and has substantial content (>10 lines for new docs)</check>
|
|
709
|
+
<check>Code references use `file:Symbol` format — no line numbers</check>
|
|
710
|
+
<check>No document is story-scoped or module-scoped in its title or structure</check>
|
|
711
|
+
<check>Related systems/patterns/cross-cutting docs are cross-referenced with links</check>
|
|
712
|
+
<check>File trees use ASCII only — no Unicode box-drawing characters</check>
|
|
713
|
+
<check>Constants and enums locations are documented (agents must never hardcode)</check>
|
|
714
|
+
<check>No content duplicated from another existing doc in this subsystem</check>
|
|
715
|
+
<check>Every doc answers ONE clear question about how the system works</check>
|
|
716
|
+
</verification-checklist>
|
|
717
|
+
</instruction>
|
|
718
|
+
|
|
719
|
+
<instruction order="E2" name="integrate-tech-debt">
|
|
720
|
+
TECH DEBT INTEGRATION (only if tech_debt_items were provided)
|
|
721
|
+
|
|
722
|
+
For each tech debt item assigned to this subsystem:
|
|
723
|
+
|
|
724
|
+
<substep order="E2.1" name="find-target-doc">
|
|
725
|
+
Determine which wiki doc the item belongs to based on the file path
|
|
726
|
+
and the item's subsystem/description. It will be a systems/ or
|
|
727
|
+
cross-cutting/ doc (tech debt lives in concrete code areas).
|
|
728
|
+
</substep>
|
|
729
|
+
|
|
730
|
+
<substep order="E2.2" name="add-tech-debt-section">
|
|
731
|
+
If the target doc exists: add or update the `## Tech Debt` section.
|
|
732
|
+
If the target doc was just created: include the `## Tech Debt` section.
|
|
733
|
+
|
|
734
|
+
Use the verbose format from the wiki templates (NOT tables):
|
|
735
|
+
```
|
|
736
|
+
### [Short descriptive title]
|
|
737
|
+
- **Severity:** high | medium | low
|
|
738
|
+
- **File:** `[file-path:SymbolName]`
|
|
739
|
+
- **Description:** What the issue is, why it matters
|
|
740
|
+
- **Discovered during:** [story-id] — [story title]
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
Do NOT duplicate items already in the doc's Tech Debt section.
|
|
744
|
+
Remove items that have been fixed (file no longer has the issue).
|
|
745
|
+
</substep>
|
|
746
|
+
|
|
747
|
+
Include tech debt integration in your report.
|
|
748
|
+
</instruction>
|
|
749
|
+
|
|
750
|
+
<instruction order="F" name="walkthrough-suggestions">
|
|
751
|
+
WALKTHROUGH SUGGESTIONS
|
|
752
|
+
|
|
753
|
+
After documenting, analyze the code you just read for potential
|
|
754
|
+
walkthrough candidates. A flow is a walkthrough candidate when:
|
|
755
|
+
- It spans 3+ classes across multiple layers (handler -> service -> repository -> db)
|
|
756
|
+
- External frameworks/libraries are involved (SignalR, EF Core, gRPC, Microsoft Agent Framework etc.)
|
|
757
|
+
- The flow is complex enough that an intern couldn't follow it from code alone
|
|
758
|
+
- No existing walkthrough already covers this flow
|
|
759
|
+
|
|
760
|
+
Check `.docs/wiki/subsystems/[subsystem_name]/walkthroughs/` for existing
|
|
761
|
+
walkthroughs. Do NOT suggest flows already covered.
|
|
762
|
+
|
|
763
|
+
For each candidate, identify:
|
|
764
|
+
- A natural language flow description (start -> end)
|
|
765
|
+
- Which emphasis-frameworks would be valuable (if any)
|
|
766
|
+
- Why this flow deserves a walkthrough (1 line)
|
|
767
|
+
</instruction>
|
|
768
|
+
|
|
769
|
+
<instruction order="G" name="report">
|
|
770
|
+
YOUR REPORT (return this)
|
|
771
|
+
|
|
772
|
+
Return a structured report:
|
|
773
|
+
|
|
774
|
+
Subsystem: [subsystem_name]
|
|
775
|
+
|
|
776
|
+
Documents created:
|
|
777
|
+
- [path] ([line count] lines) — [what this doc covers]
|
|
778
|
+
|
|
779
|
+
Documents updated:
|
|
780
|
+
- [path] — [what sections were added/changed]
|
|
781
|
+
|
|
782
|
+
Documents unchanged:
|
|
783
|
+
- [path] — [why no change was needed]
|
|
784
|
+
|
|
785
|
+
Issues found (if any):
|
|
786
|
+
- [description of any problems encountered]
|
|
787
|
+
|
|
788
|
+
Walkthrough suggestions:
|
|
789
|
+
- FLOW: [natural language flow description]
|
|
790
|
+
SUBSYSTEM: [subsystem_name]
|
|
791
|
+
EMPHASIS: [framework1, framework2, or "none"]
|
|
792
|
+
REASON: [why this deserves a walkthrough]
|
|
793
|
+
- FLOW: ...
|
|
794
|
+
|
|
795
|
+
[If no walkthrough candidates found:]
|
|
796
|
+
Walkthrough suggestions: none
|
|
797
|
+
</instruction>
|
|
798
|
+
|
|
799
|
+
</agent-instructions>
|
|
800
|
+
",
|
|
801
|
+
|
|
802
|
+
subagent_type="ace-wiki-mapper",
|
|
803
|
+
description="Document [subsystem_name] subsystem"
|
|
804
|
+
)
|
|
805
|
+
```
|
|
806
|
+
</substep>
|
|
807
|
+
|
|
808
|
+
Continue to step 4.
|
|
809
|
+
</step>
|
|
810
|
+
|
|
811
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
812
|
+
<!-- STEP 4: COLLECT RESULTS -->
|
|
813
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
814
|
+
|
|
815
|
+
<step name="collect-results" order="4">
|
|
816
|
+
|
|
817
|
+
<substep order="4.1" name="wait-for-agents">
|
|
818
|
+
If agents were spawned in background, wait for all to complete.
|
|
819
|
+
Read each agent's report.
|
|
820
|
+
</substep>
|
|
821
|
+
|
|
822
|
+
<substep order="4.2" name="handle-failures">
|
|
823
|
+
If any agent failed:
|
|
824
|
+
<task-list>
|
|
825
|
+
<task>Note the failure and the subsystem affected</task>
|
|
826
|
+
<task>Do NOT re-attempt — inform the user and let them decide</task>
|
|
827
|
+
</task-list>
|
|
828
|
+
</substep>
|
|
829
|
+
|
|
830
|
+
<substep order="4.3" name="merge-reports">
|
|
831
|
+
Merge all agent reports into a combined result.
|
|
832
|
+
</substep>
|
|
833
|
+
|
|
834
|
+
Continue to step 5.
|
|
835
|
+
</step>
|
|
836
|
+
|
|
837
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
838
|
+
<!-- STEP 5: UPDATE TECH DEBT INDEX (story mode only, if tech debt) -->
|
|
839
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
840
|
+
|
|
841
|
+
<step name="update-tech-debt-index" order="5">
|
|
842
|
+
|
|
843
|
+
<variant condition="story mode AND ALL_TECH_DEBT is not empty">
|
|
844
|
+
Update `.docs/wiki/system-wide/tech-debt-index.md` using the
|
|
845
|
+
tech-debt-index template (from execution-context).
|
|
846
|
+
|
|
847
|
+
<substep order="5.1" name="read-existing-index">
|
|
848
|
+
Read `.docs/wiki/system-wide/tech-debt-index.md` if it exists.
|
|
849
|
+
If it doesn't exist, create it from the template.
|
|
850
|
+
</substep>
|
|
851
|
+
|
|
852
|
+
<substep order="5.2" name="merge-items">
|
|
853
|
+
For each item in ALL_TECH_DEBT:
|
|
854
|
+
- Add to the By Subsystem table under the correct subsystem
|
|
855
|
+
- Add to the By Severity table under the correct severity
|
|
856
|
+
- Do NOT duplicate items already in the index
|
|
857
|
+
- Remove items that have been fixed
|
|
858
|
+
</substep>
|
|
859
|
+
|
|
860
|
+
<substep order="5.3" name="recalculate-counts">
|
|
861
|
+
Recalculate all summary counts:
|
|
862
|
+
- Total items, high/medium/low breakdown
|
|
863
|
+
- Per-subsystem counts
|
|
864
|
+
- Update the "Last updated" date
|
|
865
|
+
</substep>
|
|
866
|
+
</variant>
|
|
867
|
+
|
|
868
|
+
<variant condition="file mode OR no tech debt">
|
|
869
|
+
Skip — no tech debt index update needed.
|
|
870
|
+
</variant>
|
|
871
|
+
|
|
872
|
+
Continue to step 6.
|
|
873
|
+
</step>
|
|
874
|
+
|
|
875
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
876
|
+
<!-- STEP 6: SECURITY SCAN AND REPORT -->
|
|
877
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
878
|
+
|
|
879
|
+
<step name="report" order="6">
|
|
880
|
+
|
|
881
|
+
<substep order="5.1" name="security-scan">
|
|
882
|
+
Security scan across all affected subsystems — use the Grep tool (NOT bash grep):
|
|
883
|
+
|
|
884
|
+
```
|
|
885
|
+
Grep(
|
|
886
|
+
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)",
|
|
887
|
+
path=".docs/wiki/subsystems/",
|
|
888
|
+
output_mode="content"
|
|
889
|
+
)
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
<variant condition="matches found">SECRETS_FOUND — pause and alert user.</variant>
|
|
893
|
+
<variant condition="no matches">CLEAN.</variant>
|
|
894
|
+
</substep>
|
|
895
|
+
|
|
896
|
+
<substep order="5.2" name="display-report">
|
|
897
|
+
|
|
898
|
+
<!-- ── Story Mode Report ──────────────────────────────────────── -->
|
|
899
|
+
|
|
900
|
+
<mode name="story">
|
|
901
|
+
Display the combined report:
|
|
902
|
+
|
|
903
|
+
```
|
|
904
|
+
┌──────────────────────────────────────────────────┐
|
|
905
|
+
│ ACE > Map Story > Complete │
|
|
906
|
+
└──────────────────────────────────────────────────┘
|
|
907
|
+
|
|
908
|
+
## Documentation Update Report
|
|
909
|
+
|
|
910
|
+
**Story**: [story name from artifacts, or "Git changes"]
|
|
911
|
+
**Affected Subsystems**: [list]
|
|
912
|
+
|
|
913
|
+
[If new_subsystem_reports is not empty:]
|
|
914
|
+
|
|
915
|
+
### New Subsystems Mapped (via map-subsystem)
|
|
916
|
+
[For each new subsystem report:]
|
|
917
|
+
- **[subsystem.name]** at `[subsystem.path]` — [modules] modules, [docs] knowledge docs
|
|
918
|
+
Docs: `.docs/wiki/subsystems/[subsystem.name]/`
|
|
919
|
+
|
|
920
|
+
[For each remaining subsystem, include the agent's report:]
|
|
921
|
+
|
|
922
|
+
### [subsystem_name]
|
|
923
|
+
|
|
924
|
+
Documents created:
|
|
925
|
+
- [path] ([line count] lines) — [description]
|
|
926
|
+
|
|
927
|
+
Documents updated:
|
|
928
|
+
- [path] — [what changed]
|
|
929
|
+
|
|
930
|
+
[If tech debt was integrated:]
|
|
931
|
+
### Tech Debt Integrated
|
|
932
|
+
- [N] items added across [M] subsystem wiki docs
|
|
933
|
+
- Tech debt index updated: .docs/wiki/system-wide/tech-debt-index.md
|
|
934
|
+
|
|
935
|
+
[If any agent failures:]
|
|
936
|
+
### Failures
|
|
937
|
+
- [subsystem]: [error]
|
|
938
|
+
|
|
939
|
+
[If any agent reports contain walkthrough suggestions:]
|
|
940
|
+
|
|
941
|
+
### Walkthrough Suggestions
|
|
942
|
+
|
|
943
|
+
[For each suggestion, numbered:]
|
|
944
|
+
[N]. [flow description]
|
|
945
|
+
Subsystem: [subsystem] | Emphasis: [frameworks or "none"]
|
|
946
|
+
[reason]
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
**If walkthrough suggestions exist:**
|
|
950
|
+
Use AskUserQuestion:
|
|
951
|
+
- header: "Walkthroughs"
|
|
952
|
+
- question: "Would you like to create any of these walkthroughs?\nYou can also describe your own."
|
|
953
|
+
- options:
|
|
954
|
+
- "Create [numbers]" — e.g., "Create 1,3" or "Create all"
|
|
955
|
+
- "Custom" — user describes their own walkthrough
|
|
956
|
+
- "Skip" — no walkthroughs
|
|
957
|
+
|
|
958
|
+
**If "Skip":** Display next steps and end.
|
|
959
|
+
|
|
960
|
+
**If "Create [numbers]" or "Create all":**
|
|
961
|
+
For each selected suggestion, spawn a background agent:
|
|
962
|
+
|
|
963
|
+
```
|
|
964
|
+
Agent(
|
|
965
|
+
prompt="/ace:map-walkthrough flow=\"{suggestion.flow}\" subsystem=\"{suggestion.subsystem}\" emphasis-frameworks=\"{suggestion.emphasis}\"
|
|
966
|
+
|
|
967
|
+
Execute the map-walkthrough workflow end-to-end.",
|
|
968
|
+
subagent_type="ace-wiki-mapper",
|
|
969
|
+
run_in_background=true,
|
|
970
|
+
description="Walkthrough: {short flow name}"
|
|
971
|
+
)
|
|
972
|
+
```
|
|
973
|
+
|
|
974
|
+
**If "Custom":**
|
|
975
|
+
Ask the user for their flow description, subsystem, and optional emphasis-frameworks.
|
|
976
|
+
Spawn a background agent for that walkthrough too.
|
|
977
|
+
|
|
978
|
+
Wait for all walkthrough agents to complete.
|
|
979
|
+
|
|
980
|
+
Display:
|
|
981
|
+
```
|
|
982
|
+
+ [N] walkthrough(s) created.
|
|
983
|
+
[For each: path and line count]
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
Stage and commit walkthrough files:
|
|
987
|
+
```bash
|
|
988
|
+
git add .docs/wiki/subsystems/*/walkthroughs/
|
|
989
|
+
git commit -m "docs: add walkthroughs from map-story suggestions"
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
**After walkthroughs (or if no suggestions):**
|
|
993
|
+
|
|
994
|
+
```
|
|
995
|
+
Next > `/clear` first for a fresh context window, then:
|
|
996
|
+
|
|
997
|
+
/ace:map-story — document another story
|
|
998
|
+
/ace:map-walkthrough — create another walkthrough
|
|
999
|
+
/ace:map-subsystem [subsystem] — map or refresh an entire subsystem
|
|
1000
|
+
Review files in .docs/wiki/subsystems/
|
|
1001
|
+
```
|
|
1002
|
+
</mode>
|
|
1003
|
+
|
|
1004
|
+
<!-- ── File Mode Report ───────────────────────────────────────── -->
|
|
1005
|
+
|
|
1006
|
+
<mode name="file">
|
|
1007
|
+
Return the agent's report directly to the calling workflow
|
|
1008
|
+
(map-subsystem step 8.7). Do NOT display banners or next steps —
|
|
1009
|
+
the calling workflow handles presentation.
|
|
1010
|
+
</mode>
|
|
1011
|
+
|
|
1012
|
+
</substep>
|
|
1013
|
+
|
|
1014
|
+
End workflow.
|
|
1015
|
+
</step>
|
|
1016
|
+
|
|
1017
|
+
</process>
|
|
1018
|
+
|
|
1019
|
+
<success_criteria>
|
|
1020
|
+
<criterion>Mode correctly detected from parameters</criterion>
|
|
1021
|
+
<criterion>subsystem_work map built correctly from either mode's inputs</criterion>
|
|
1022
|
+
<criterion>One agent spawned per subsystem (parallel when 2+)</criterion>
|
|
1023
|
+
<criterion>Each agent reads ALL source files for its subsystem (not just names)</criterion>
|
|
1024
|
+
<criterion>Each agent reads ALL existing wiki docs for its subsystem FULLY (not summaries, not titles — complete content)</criterion>
|
|
1025
|
+
<criterion>Each agent checks every existing doc before deciding create vs update</criterion>
|
|
1026
|
+
<criterion>No duplicate documentation created — agent merges into existing docs when topic overlaps</criterion>
|
|
1027
|
+
<criterion>No story-scoped or module-scoped documents created (all topic-scoped)</criterion>
|
|
1028
|
+
<criterion>Each document follows its template structure from the XML templates</criterion>
|
|
1029
|
+
<criterion>Updates ADD to existing docs rather than rewriting unchanged sections</criterion>
|
|
1030
|
+
<criterion>Code references use `file:Symbol` format (not line numbers)</criterion>
|
|
1031
|
+
<criterion>File trees use ASCII only (no Unicode box-drawing)</criterion>
|
|
1032
|
+
<criterion>Diagrams use mermaid (not ASCII art)</criterion>
|
|
1033
|
+
<criterion>Every systems/*.md doc has at least one mermaid sequenceDiagram (E2E flow is mandatory)</criterion>
|
|
1034
|
+
<criterion>Inline code only for interface/type contracts</criterion>
|
|
1035
|
+
<criterion>Related systems cross-referenced with markdown links</criterion>
|
|
1036
|
+
<criterion>Tech debt items integrated into relevant subsystem wiki docs (if provided)</criterion>
|
|
1037
|
+
<criterion>Tech debt index updated with new items and recalculated counts (if provided)</criterion>
|
|
1038
|
+
<criterion>Security scan passed (no secrets in generated docs)</criterion>
|
|
1039
|
+
<criterion>Clear structured report from each agent, merged into final report</criterion>
|
|
1040
|
+
<criterion>New subsystems detected by comparing subsystem_work against system-structure.md Subsystem Index (story mode only)</criterion>
|
|
1041
|
+
<criterion>User approval required before running map-subsystem on new subsystems</criterion>
|
|
1042
|
+
<criterion>New subsystems removed from subsystem_work after map-subsystem to prevent duplicate docs</criterion>
|
|
1043
|
+
<criterion>New subsystem mapping results included in final report</criterion>
|
|
1044
|
+
</success_criteria>
|
|
1045
|
+
|
|
1046
|
+
</workflow>
|