agile-context-engineering 0.3.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +10 -0
  3. package/CHANGELOG.md +7 -1
  4. package/LICENSE +51 -51
  5. package/README.md +330 -318
  6. package/agents/ace-code-discovery-analyst.md +245 -245
  7. package/agents/ace-code-integration-analyst.md +248 -248
  8. package/agents/ace-code-reviewer.md +375 -375
  9. package/agents/ace-product-owner.md +365 -361
  10. package/agents/ace-project-researcher.md +606 -606
  11. package/agents/ace-research-synthesizer.md +228 -228
  12. package/agents/ace-technical-application-architect.md +315 -315
  13. package/agents/ace-wiki-mapper.md +449 -445
  14. package/bin/install.js +605 -195
  15. package/hooks/ace-check-update.js +71 -62
  16. package/hooks/ace-statusline.js +107 -89
  17. package/hooks/hooks.json +14 -0
  18. package/package.json +7 -5
  19. package/shared/lib/ace-core.js +361 -0
  20. package/shared/lib/ace-core.test.js +308 -0
  21. package/shared/lib/ace-github.js +753 -0
  22. package/shared/lib/ace-story.js +400 -0
  23. package/shared/lib/ace-story.test.js +250 -0
  24. package/{agile-context-engineering → shared}/utils/questioning.xml +110 -110
  25. package/{agile-context-engineering → shared}/utils/ui-formatting.md +299 -299
  26. package/{commands/ace/execute-story.md → skills/execute-story/SKILL.md} +116 -138
  27. package/skills/execute-story/script.js +291 -0
  28. package/skills/execute-story/script.test.js +261 -0
  29. package/{agile-context-engineering/templates/product/story.xml → skills/execute-story/story-template.xml} +451 -451
  30. package/skills/execute-story/walkthrough-template.xml +255 -0
  31. package/{agile-context-engineering/workflows/execute-story.xml → skills/execute-story/workflow.xml} +1221 -1219
  32. package/skills/help/SKILL.md +71 -0
  33. package/skills/help/script.js +315 -0
  34. package/skills/help/script.test.js +183 -0
  35. package/{agile-context-engineering/workflows/help.xml → skills/help/workflow.xml} +544 -533
  36. package/{commands/ace/init-coding-standards.md → skills/init-coding-standards/SKILL.md} +91 -83
  37. package/{agile-context-engineering/templates/wiki/coding-standards.xml → skills/init-coding-standards/coding-standards-template.xml} +531 -531
  38. package/skills/init-coding-standards/script.js +50 -0
  39. package/skills/init-coding-standards/script.test.js +70 -0
  40. package/{agile-context-engineering/workflows/init-coding-standards.xml → skills/init-coding-standards/workflow.xml} +381 -386
  41. package/skills/map-cross-cutting/SKILL.md +126 -0
  42. package/{agile-context-engineering/templates/wiki → skills/map-cross-cutting}/system-cross-cutting.xml +197 -197
  43. package/skills/map-cross-cutting/workflow.xml +330 -0
  44. package/skills/map-guide/SKILL.md +126 -0
  45. package/{agile-context-engineering/templates/wiki → skills/map-guide}/guide.xml +137 -137
  46. package/skills/map-guide/workflow.xml +320 -0
  47. package/skills/map-pattern/SKILL.md +125 -0
  48. package/{agile-context-engineering/templates/wiki → skills/map-pattern}/pattern.xml +159 -159
  49. package/skills/map-pattern/workflow.xml +331 -0
  50. package/{commands/ace/map-story.md → skills/map-story/SKILL.md} +180 -165
  51. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/decizions.xml +115 -115
  52. package/skills/map-story/templates/guide.xml +137 -0
  53. package/skills/map-story/templates/pattern.xml +159 -0
  54. package/skills/map-story/templates/system-cross-cutting.xml +197 -0
  55. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/system.xml +381 -381
  56. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/tech-debt-index.xml +125 -125
  57. package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/walkthrough.xml +255 -255
  58. package/{agile-context-engineering/workflows/map-story.xml → skills/map-story/workflow.xml} +1046 -1046
  59. package/{commands/ace/map-subsystem.md → skills/map-subsystem/SKILL.md} +155 -140
  60. package/skills/map-subsystem/script.js +51 -0
  61. package/skills/map-subsystem/script.test.js +68 -0
  62. package/skills/map-subsystem/templates/decizions.xml +115 -0
  63. package/skills/map-subsystem/templates/guide.xml +137 -0
  64. package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/module-discovery.xml +174 -174
  65. package/skills/map-subsystem/templates/pattern.xml +159 -0
  66. package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-architecture.xml +343 -343
  67. package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-structure.xml +234 -234
  68. package/skills/map-subsystem/templates/system-cross-cutting.xml +197 -0
  69. package/skills/map-subsystem/templates/system.xml +381 -0
  70. package/skills/map-subsystem/templates/walkthrough.xml +255 -0
  71. package/{agile-context-engineering/workflows/map-subsystem.xml → skills/map-subsystem/workflow.xml} +1173 -1178
  72. package/skills/map-sys-doc/SKILL.md +125 -0
  73. package/skills/map-sys-doc/system.xml +381 -0
  74. package/skills/map-sys-doc/workflow.xml +336 -0
  75. package/{commands/ace/map-system.md → skills/map-system/SKILL.md} +103 -92
  76. package/skills/map-system/script.js +75 -0
  77. package/skills/map-system/script.test.js +73 -0
  78. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-architecture.xml +254 -254
  79. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-structure.xml +177 -177
  80. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/testing-framework.xml +283 -283
  81. package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/wiki-readme.xml +296 -296
  82. package/{agile-context-engineering/workflows/map-system.xml → skills/map-system/workflow.xml} +667 -672
  83. package/{commands/ace/map-walkthrough.md → skills/map-walkthrough/SKILL.md} +140 -127
  84. package/skills/map-walkthrough/walkthrough.xml +255 -0
  85. package/{agile-context-engineering/workflows/map-walkthrough.xml → skills/map-walkthrough/workflow.xml} +457 -457
  86. package/{commands/ace/plan-backlog.md → skills/plan-backlog/SKILL.md} +93 -83
  87. package/{agile-context-engineering/templates/product/product-backlog.xml → skills/plan-backlog/product-backlog-template.xml} +231 -231
  88. package/skills/plan-backlog/script.js +121 -0
  89. package/skills/plan-backlog/script.test.js +83 -0
  90. package/{agile-context-engineering/workflows/plan-backlog.xml → skills/plan-backlog/workflow.xml} +1348 -1356
  91. package/{commands/ace/plan-feature.md → skills/plan-feature/SKILL.md} +99 -89
  92. package/{agile-context-engineering/templates/product/feature.xml → skills/plan-feature/feature-template.xml} +361 -361
  93. package/skills/plan-feature/script.js +131 -0
  94. package/skills/plan-feature/script.test.js +80 -0
  95. package/{agile-context-engineering/workflows/plan-feature.xml → skills/plan-feature/workflow.xml} +1487 -1495
  96. package/{commands/ace/plan-product-vision.md → skills/plan-product-vision/SKILL.md} +91 -81
  97. package/{agile-context-engineering/templates/product/product-vision.xml → skills/plan-product-vision/product-vision-template.xml} +227 -227
  98. package/skills/plan-product-vision/script.js +51 -0
  99. package/skills/plan-product-vision/script.test.js +69 -0
  100. package/{agile-context-engineering/workflows/plan-product-vision.xml → skills/plan-product-vision/workflow.xml} +337 -342
  101. package/{commands/ace/plan-story.md → skills/plan-story/SKILL.md} +139 -159
  102. package/skills/plan-story/script.js +295 -0
  103. package/skills/plan-story/script.test.js +240 -0
  104. package/skills/plan-story/story-template.xml +458 -0
  105. package/{agile-context-engineering/workflows/plan-story.xml → skills/plan-story/workflow.xml} +1301 -944
  106. package/{commands/ace/research-external-solution.md → skills/research-external-solution/SKILL.md} +120 -138
  107. package/{agile-context-engineering/templates/product/external-solution.xml → skills/research-external-solution/external-solution-template.xml} +832 -832
  108. package/skills/research-external-solution/script.js +229 -0
  109. package/skills/research-external-solution/script.test.js +134 -0
  110. package/{agile-context-engineering/workflows/research-external-solution.xml → skills/research-external-solution/workflow.xml} +657 -659
  111. package/{commands/ace/research-integration-solution.md → skills/research-integration-solution/SKILL.md} +121 -135
  112. package/{agile-context-engineering/templates/product/story-integration-solution.xml → skills/research-integration-solution/integration-solution-template.xml} +1015 -1015
  113. package/skills/research-integration-solution/script.js +223 -0
  114. package/skills/research-integration-solution/script.test.js +134 -0
  115. package/{agile-context-engineering/workflows/research-integration-solution.xml → skills/research-integration-solution/workflow.xml} +711 -713
  116. package/{commands/ace/research-story-wiki.md → skills/research-story-wiki/SKILL.md} +101 -116
  117. package/skills/research-story-wiki/script.js +223 -0
  118. package/skills/research-story-wiki/script.test.js +138 -0
  119. package/{agile-context-engineering/templates/product/story-wiki.xml → skills/research-story-wiki/story-wiki-template.xml} +194 -194
  120. package/{agile-context-engineering/workflows/research-story-wiki.xml → skills/research-story-wiki/workflow.xml} +473 -475
  121. package/{commands/ace/research-technical-solution.md → skills/research-technical-solution/SKILL.md} +131 -147
  122. package/skills/research-technical-solution/script.js +223 -0
  123. package/skills/research-technical-solution/script.test.js +134 -0
  124. package/{agile-context-engineering/templates/product/story-technical-solution.xml → skills/research-technical-solution/technical-solution-template.xml} +1025 -1025
  125. package/{agile-context-engineering/workflows/research-technical-solution.xml → skills/research-technical-solution/workflow.xml} +761 -763
  126. package/{commands/ace/review-story.md → skills/review-story/SKILL.md} +99 -109
  127. package/skills/review-story/script.js +249 -0
  128. package/skills/review-story/script.test.js +169 -0
  129. package/skills/review-story/story-template.xml +451 -0
  130. package/{agile-context-engineering/workflows/review-story.xml → skills/review-story/workflow.xml} +279 -281
  131. package/{commands/ace/update.md → skills/update/SKILL.md} +65 -56
  132. package/{agile-context-engineering/workflows/update.xml → skills/update/workflow.xml} +33 -18
  133. package/agile-context-engineering/src/ace-tools.js +0 -2881
  134. package/agile-context-engineering/src/ace-tools.test.js +0 -1089
  135. package/agile-context-engineering/templates/_command.md +0 -54
  136. package/agile-context-engineering/templates/_workflow.xml +0 -17
  137. package/agile-context-engineering/templates/config.json +0 -0
  138. package/agile-context-engineering/templates/product/integration-solution.xml +0 -0
  139. package/commands/ace/help.md +0 -93
@@ -0,0 +1,336 @@
1
+ <workflow>
2
+
3
+ <purpose>
4
+ Create or update a system document in
5
+ `.docs/wiki/subsystems/[subsystem-name]/systems/`.
6
+
7
+ A system doc describes a coherent domain system — WHAT exists, HOW it works,
8
+ WHERE things live. It is the primary document an AI agent reads before
9
+ implementing a related story.
10
+
11
+ This workflow is executed directly — NO sub-agents are spawned.
12
+ The executing agent does everything: finding relevant code, reading it,
13
+ analyzing components/flows, and writing the document.
14
+ </purpose>
15
+
16
+ <mandatory-context>
17
+ All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
18
+ Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
19
+ </mandatory-context>
20
+
21
+ <process>
22
+
23
+ <!-- ══════════════════════════════════════════════════════════════════ -->
24
+ <!-- STEP 1: SETUP AND VALIDATE -->
25
+ <!-- ══════════════════════════════════════════════════════════════════ -->
26
+
27
+ <step name="setup" order="1">
28
+
29
+ <substep order="1.1" name="display-banner">
30
+ Display stage banner:
31
+
32
+ ```
33
+ ╔══════════════════════════════════════════════════╗
34
+ ║ ACE > Map System Doc ║
35
+ ╚══════════════════════════════════════════════════╝
36
+ ```
37
+ </substep>
38
+
39
+ <substep order="1.2" name="parse-and-validate">
40
+ Parse $ARGUMENTS for: `text`, `subsystem`, `story-context`, `commits`.
41
+
42
+ **If `text` is missing:** Ask the user:
43
+ - header: "System Doc"
44
+ - question: "Describe the system to document — what domain concern does it address?\nE.g., 'Drawing system - manages all drawing tools on the chart'"
45
+
46
+ **If `subsystem` is missing:** Ask the user:
47
+ - header: "System Doc"
48
+ - question: "Which subsystem does this system belong to?"
49
+ </substep>
50
+
51
+ <substep order="1.3" name="resolve-subsystem">
52
+ Resolve the subsystem. Check if `.docs/wiki/subsystems/[subsystem-name]/` exists.
53
+
54
+ **If not found:**
55
+ ```
56
+ ! No wiki found for subsystem "[subsystem]".
57
+ Run /ace:map-subsystem first to create the subsystem wiki.
58
+ ```
59
+ Exit.
60
+
61
+ Ensure systems directory exists:
62
+ ```bash
63
+ mkdir -p .docs/wiki/subsystems/[subsystem_name]/systems
64
+ ```
65
+ </substep>
66
+
67
+ Display:
68
+ ```
69
+ i System: [text description]
70
+ Subsystem: [subsystem-name]
71
+ Story context: [path/issue, or "none"]
72
+ Commits: [value, or "search codebase directly"]
73
+ ```
74
+
75
+ Continue to step 2.
76
+ </step>
77
+
78
+ <!-- ══════════════════════════════════════════════════════════════════ -->
79
+ <!-- STEP 2: CHECK FOR EXISTING SYSTEM DOC -->
80
+ <!-- ══════════════════════════════════════════════════════════════════ -->
81
+
82
+ <step name="check-existing" order="2">
83
+
84
+ Scan for existing system docs:
85
+
86
+ ```
87
+ Glob(pattern='*.md', path='.docs/wiki/subsystems/[subsystem_name]/systems')
88
+ ```
89
+
90
+ **If existing system docs found:**
91
+ Read their titles and overview sections. Check if any covers the same
92
+ or overlapping domain concern.
93
+
94
+ **If overlap detected:**
95
+ Use AskUserQuestion:
96
+ - header: "System Doc"
97
+ - question: "An existing system doc may cover a similar concern:\n\n- `[existing-file]`: [title]\n\nShould I update the existing doc or create a new one?"
98
+ - options:
99
+ - "Update existing" — set MODE = update, set TARGET_FILE = existing path
100
+ - "Create new" — set MODE = create
101
+
102
+ **If no overlap or no existing docs:** Set MODE = create.
103
+
104
+ **If MODE = create:**
105
+ Derive file name from the system description in kebab-case.
106
+ Set TARGET_FILE = `.docs/wiki/subsystems/[subsystem_name]/systems/[system-name].md`
107
+
108
+ Continue to step 3.
109
+ </step>
110
+
111
+ <!-- ══════════════════════════════════════════════════════════════════ -->
112
+ <!-- STEP 3: GATHER CODE CONTEXT -->
113
+ <!-- ══════════════════════════════════════════════════════════════════ -->
114
+
115
+ <step name="gather-context" order="3">
116
+
117
+ <substep order="3.1" name="read-story-context">
118
+ <variant condition="story-context is a path">
119
+ Read all markdown files in the story artifacts folder.
120
+ Extract a brief summary of intent: what was built and why.
121
+ </variant>
122
+
123
+ <variant condition="story-context is a GitHub issue">
124
+ ```bash
125
+ gh issue view [issue-number] --json title,body,labels,comments
126
+ ```
127
+ Extract a brief summary of intent from the issue.
128
+ </variant>
129
+
130
+ <variant condition="no story-context">
131
+ Skip — rely on code analysis only.
132
+ </variant>
133
+ </substep>
134
+
135
+ <substep order="3.2" name="collect-relevant-files">
136
+ <variant condition="commits provided as number N">
137
+ ```bash
138
+ git diff --name-only HEAD~[N]..HEAD
139
+ ```
140
+ Filter to files within the subsystem. Read each file.
141
+ </variant>
142
+
143
+ <variant condition="commits provided as SHAs">
144
+ ```bash
145
+ git diff --name-only [first-sha]^..[last-sha]
146
+ ```
147
+ Filter to files within the subsystem. Read each file.
148
+ </variant>
149
+
150
+ <variant condition="no commits — search codebase directly">
151
+ Use the `text` description to identify the system's files:
152
+
153
+ 1. Read the subsystem's structure.md and architecture.md for orientation
154
+ 2. Grep for keywords from the text description (class names, domain terms)
155
+ 3. Follow imports/references to find all files belonging to this system
156
+ 4. Read each discovered file
157
+
158
+ **Be thorough.** A system doc covers an entire domain concern.
159
+ Follow class hierarchies, interface implementations, DI registrations,
160
+ and cross-references until you have the complete picture.
161
+ </variant>
162
+ </substep>
163
+
164
+ <substep order="3.3" name="analyze-system">
165
+ For every source file found, understand:
166
+
167
+ - Class hierarchies and interface implementations
168
+ - Entry points (API endpoints, event handlers, user actions)
169
+ - Data flow through all layers (trace E2E for sequence diagrams)
170
+ - State management (Redux, local state, database)
171
+ - Constants, enums, and configuration
172
+ - Integration points (imports from other systems, events)
173
+ - Error handling and propagation
174
+ - DI registrations, factory/registry entries
175
+
176
+ Build a mental model of the complete system.
177
+ </substep>
178
+
179
+ Continue to step 4.
180
+ </step>
181
+
182
+ <!-- ══════════════════════════════════════════════════════════════════ -->
183
+ <!-- STEP 4: WRITE THE SYSTEM DOC -->
184
+ <!-- ══════════════════════════════════════════════════════════════════ -->
185
+
186
+ <step name="write-doc" order="4">
187
+
188
+ Read ALL existing wiki docs under `.docs/wiki/subsystems/[subsystem_name]/`
189
+ for cross-referencing in the Related Systems section.
190
+
191
+ Follow the system template structure exactly.
192
+
193
+ <substep order="4.1" name="write-overview-and-file-tree">
194
+ - Overview: ONE paragraph — what the system DOES, why it exists
195
+ - File Tree: ALL files belonging to this system with purpose annotations (ASCII only)
196
+ </substep>
197
+
198
+ <substep order="4.2" name="write-system-boundary">
199
+ Build a mermaid graph diagram showing what is INSIDE vs OUTSIDE this system.
200
+ </substep>
201
+
202
+ <substep order="4.3" name="write-class-hierarchy">
203
+ Build a mermaid classDiagram for inheritance chains and interface implementations.
204
+ Include key contracts inline (interfaces/types only).
205
+ Omit if hierarchy is trivial (1 class, no inheritance).
206
+ </substep>
207
+
208
+ <substep order="4.4" name="write-entry-points">
209
+ List every "front door" into this system with `file:ClassName.method` references.
210
+ </substep>
211
+
212
+ <substep order="4.5" name="write-data-flow">
213
+ **MANDATORY — never skip.**
214
+ Write at least one mermaid sequenceDiagram showing complete E2E data flow.
215
+ One diagram per key behavior (1-5 behaviors typically).
216
+ Show COMPLETE flow from entry point through all layers to data store and back.
217
+ </substep>
218
+
219
+ <substep order="4.6" name="write-remaining-sections">
220
+ Write all remaining applicable sections from the template:
221
+ - Components (location, purpose, key interface)
222
+ - Key Behaviors (trigger, logic, effect)
223
+ - State Management (where, what shape, transitions)
224
+ - Error Propagation (throw/catch chain)
225
+ - Constants and Enums (exact file paths — agents must never hardcode)
226
+ - Related Systems (cross-reference with markdown links)
227
+ - Integration Points
228
+ - Configuration and Options
229
+ - Database (only if applicable)
230
+ - Gotchas
231
+
232
+ Omit sections that genuinely don't apply. NEVER omit Data Flow.
233
+ </substep>
234
+
235
+ <substep order="4.7" name="write-or-update">
236
+ **If MODE = create:** Write the complete document to TARGET_FILE.
237
+ **If MODE = update:** Read the existing doc, ADD/expand sections,
238
+ preserve unchanged content, match existing style, write to TARGET_FILE.
239
+ </substep>
240
+
241
+ Continue to step 5.
242
+ </step>
243
+
244
+ <!-- ══════════════════════════════════════════════════════════════════ -->
245
+ <!-- STEP 5: VERIFY, COMMIT, AND REPORT -->
246
+ <!-- ══════════════════════════════════════════════════════════════════ -->
247
+
248
+ <step name="verify-and-report" order="5">
249
+
250
+ <substep order="5.1" name="quality-check">
251
+ Re-read TARGET_FILE and verify:
252
+
253
+ <verification-checklist>
254
+ <check>50+ lines of substantial content</check>
255
+ <check>Overview present (ONE paragraph)</check>
256
+ <check>File Tree present with purpose annotations (ASCII only)</check>
257
+ <check>System Boundary mermaid diagram present</check>
258
+ <check>At least one mermaid sequenceDiagram in Data Flow section (MANDATORY)</check>
259
+ <check>Entry Points listed with file:Symbol references</check>
260
+ <check>Components listed with location, purpose, key interface</check>
261
+ <check>Constants and Enums locations documented</check>
262
+ <check>Code references use `file:Symbol` format, not line numbers</check>
263
+ <check>No pseudocode, no fabricated code, no filler phrases</check>
264
+ <check>No ASCII arrows for architecture/flows (all mermaid)</check>
265
+ <check>Related Systems cross-referenced with markdown links</check>
266
+ </verification-checklist>
267
+
268
+ Fix any failures by editing the document directly.
269
+ </substep>
270
+
271
+ <substep order="5.2" name="security-scan">
272
+ ```
273
+ Grep(
274
+ 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)",
275
+ path="[TARGET_FILE]",
276
+ output_mode="content"
277
+ )
278
+ ```
279
+
280
+ <variant condition="matches found">SECRETS_FOUND — alert user, do NOT commit.</variant>
281
+ <variant condition="no matches">CLEAN.</variant>
282
+ </substep>
283
+
284
+ <substep order="5.3" name="commit">
285
+ ```bash
286
+ git add [TARGET_FILE]
287
+ git commit -m "docs([subsystem_name]): add system doc — [system-name]"
288
+ ```
289
+ </substep>
290
+
291
+ <substep order="5.4" name="report">
292
+ Display:
293
+
294
+ ```
295
+ ╔══════════════════════════════════════════════════╗
296
+ ║ ACE > Map System Doc > Complete ║
297
+ ╚══════════════════════════════════════════════════╝
298
+
299
+ + [TARGET_FILE] ([line count] lines)
300
+
301
+ System: [text description]
302
+ Sections: [list of sections written]
303
+ Sequence diagrams: [count]
304
+
305
+ Next > /clear first for a fresh context window, then:
306
+
307
+ /ace:map-sys-doc — create another system document
308
+ /ace:map-pattern — document a pattern used by this system
309
+ /ace:map-guide — create a how-to guide for this system
310
+ Review file at [TARGET_FILE]
311
+ ```
312
+ </substep>
313
+
314
+ End workflow.
315
+ </step>
316
+
317
+ </process>
318
+
319
+ <success_criteria>
320
+ <criterion>System description parsed and subsystem validated</criterion>
321
+ <criterion>Relevant source files discovered (from commits or codebase search)</criterion>
322
+ <criterion>All source files read and analyzed for components, flows, state, errors</criterion>
323
+ <criterion>Existing docs checked to avoid duplication (create vs update decision)</criterion>
324
+ <criterion>System doc follows template structure from system.xml</criterion>
325
+ <criterion>At least one mermaid sequenceDiagram present (E2E flow mandatory)</criterion>
326
+ <criterion>System boundary mermaid diagram present</criterion>
327
+ <criterion>File tree uses ASCII only, no Unicode box-drawing</criterion>
328
+ <criterion>All diagrams use mermaid, no ASCII arrows for architecture/flows</criterion>
329
+ <criterion>Code references use file:Symbol format, no line numbers</criterion>
330
+ <criterion>Constants and enums locations documented</criterion>
331
+ <criterion>Related systems cross-referenced with markdown links</criterion>
332
+ <criterion>No filler, no pseudocode, no fabricated code</criterion>
333
+ <criterion>Security scan passed, document committed</criterion>
334
+ </success_criteria>
335
+
336
+ </workflow>
@@ -1,92 +1,103 @@
1
- ---
2
- name: ace:map-system
3
- description: Map system-wide codebase structure, architecture, and testing framework into .docs/wiki/system-wide/
4
- argument-hint: "[optional: references='existing artifacts and documents to be considered alongside the codebase']"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Glob
9
- - Grep
10
- - Write
11
- - Task
12
- - AskUserQuestion
13
- ---
14
-
15
- ```xml
16
- <command>
17
-
18
- <execution-time>
19
- <runs-after>
20
- <trigger>Before /ace:help (brownfield codebases) — understand existing code first</trigger>
21
- <trigger>After /ace:help (greenfield codebases) — document architecture decisions</trigger>
22
- <trigger>Anytime to refresh system-wide wiki documents</trigger>
23
- </runs-after>
24
- <use-when>
25
- <condition>Onboarding to an existing codebase (brownfield — analyzes code automatically)</condition>
26
- <condition>Starting a new project and need to document architecture decisions (greenfield — interviews you)</condition>
27
- <condition>System-wide documents are stale or missing</condition>
28
- <condition>After major refactoring that changed subsystem boundaries or tech stack</condition>
29
- </use-when>
30
- </execution-time>
31
-
32
- <input>
33
- <flags>
34
- </flags>
35
-
36
- <parameters>
37
- <required>
38
- </required>
39
-
40
- <optional>
41
- <param name="references" type="file | text">
42
- Existing architecture docs, ADRs, or design notes
43
- to consider alongside the codebase analysis. Absorbed before analysis begins.
44
- </param>
45
- </optional>
46
- </parameters>
47
- </input>
48
-
49
- <execution-context>
50
- <map-system-workflow>@~/.claude/agile-context-engineering/workflows/map-system.xml</map-system-workflow>
51
- <system-structure-template>@~/.claude/agile-context-engineering/templates/wiki/system-structure.xml</system-structure-template>
52
- <system-architecture-template>@~/.claude/agile-context-engineering/templates/wiki/system-architecture.xml</system-architecture-template>
53
- <testing-framework-template>@~/.claude/agile-context-engineering/templates/wiki/testing-framework.xml</testing-framework-template>
54
- <wiki-readme-template>@~/.claude/agile-context-engineering/templates/wiki/wiki-readme.xml</wiki-readme-template>
55
- <questioning>@~/.claude/agile-context-engineering/utils/questioning.xml</questioning>
56
- <ui-formatting>@~/.claude/agile-context-engineering/utils/ui-formatting.md</ui-formatting>
57
- </execution-context>
58
-
59
- <output>
60
- <objective>
61
- Detect brownfield/greenfield status and existing wiki state. For each system-wide
62
- document (structure, architecture, testing), determine whether to create, update,
63
- recreate, scaffold, or skip. Spawn ace-wiki-mapper agents to produce documents.
64
- For greenfield architecture, conduct deep questioning before generating.
65
- Add CLAUDE.md instructions to keep wiki current with future code changes.
66
- </objective>
67
-
68
- <artifacts>
69
- - .docs/wiki/wiki-readme.md (created if not already present)
70
- - .docs/wiki/system-wide/system-structure.md
71
- - .docs/wiki/system-wide/system-architecture.md
72
- - .docs/wiki/system-wide/testing-framework.md
73
- - CLAUDE.md (wiki maintenance instructions appended)
74
- </artifacts>
75
- </output>
76
-
77
- <process>
78
- Execute the map-system workflow from
79
- `@~/.claude/agile-context-engineering/workflows/map-system.xml` end-to-end.
80
- Preserve all workflow gates (validation, user questions, commits).
81
- </process>
82
-
83
- <next-steps>
84
- **After this command, `/clear` first for a fresh context window, then:**
85
- - `/ace:map-subsystems` — Map individual subsystem internals (structure, dependencies)
86
- - `/ace:init-coding-standards` — Define prescriptive coding standards
87
- - `/ace:help` — Check project initialization status and next steps
88
- - Review and edit files in `.docs/wiki/system-wide/` anytime
89
- </next-steps>
90
-
91
- </command>
92
- ```
1
+ ---
2
+ name: map-system
3
+ description: Map system-wide codebase structure, architecture, and testing framework into .docs/wiki/system-wide/
4
+ argument-hint: "[optional: references='existing artifacts and documents to be considered alongside the codebase']"
5
+ disable-model-invocation: true
6
+ allowed-tools: Read, Bash, Glob, Grep, Write, Task, AskUserQuestion
7
+ model: opus
8
+ effort: max
9
+ ---
10
+
11
+ ## Environment Context (preprocessed)
12
+
13
+ !`node "${CLAUDE_SKILL_DIR}/script.js" init 2>/dev/null`
14
+
15
+ ## Supporting Resources (auto-loaded)
16
+
17
+ !`cat "${CLAUDE_SKILL_DIR}/workflow.xml"`
18
+
19
+ !`cat "${CLAUDE_SKILL_DIR}/templates/system-structure.xml"`
20
+
21
+ !`cat "${CLAUDE_SKILL_DIR}/templates/system-architecture.xml"`
22
+
23
+ !`cat "${CLAUDE_SKILL_DIR}/templates/testing-framework.xml"`
24
+
25
+ !`cat "${CLAUDE_SKILL_DIR}/templates/wiki-readme.xml"`
26
+
27
+ !`cat "${CLAUDE_SKILL_DIR}/../../shared/utils/questioning.xml"`
28
+
29
+ !`cat "${CLAUDE_SKILL_DIR}/../../shared/utils/ui-formatting.md"`
30
+
31
+ ```xml
32
+ <command>
33
+
34
+ <execution-time>
35
+ <runs-after>
36
+ <trigger>Before /ace:help (brownfield codebases) — understand existing code first</trigger>
37
+ <trigger>After /ace:help (greenfield codebases) — document architecture decisions</trigger>
38
+ <trigger>Anytime to refresh system-wide wiki documents</trigger>
39
+ </runs-after>
40
+ <use-when>
41
+ <condition>Onboarding to an existing codebase (brownfield — analyzes code automatically)</condition>
42
+ <condition>Starting a new project and need to document architecture decisions (greenfield interviews you)</condition>
43
+ <condition>System-wide documents are stale or missing</condition>
44
+ <condition>After major refactoring that changed subsystem boundaries or tech stack</condition>
45
+ </use-when>
46
+ </execution-time>
47
+
48
+ <input>
49
+ <flags>
50
+ </flags>
51
+
52
+ <parameters>
53
+ <required>
54
+ </required>
55
+
56
+ <optional>
57
+ <param name="references" type="file | text">
58
+ Existing architecture docs, ADRs, or design notes
59
+ to consider alongside the codebase analysis. Absorbed before analysis begins.
60
+ </param>
61
+ </optional>
62
+ </parameters>
63
+ </input>
64
+
65
+ <execution-context>
66
+ <!-- All supporting files are auto-loaded in the Supporting Resources section above.
67
+ The model does NOT need to Read these files — they are already in context. -->
68
+ </execution-context>
69
+
70
+ <output>
71
+ <objective>
72
+ Detect brownfield/greenfield status and existing wiki state. For each system-wide
73
+ document (structure, architecture, testing), determine whether to create, update,
74
+ recreate, scaffold, or skip. Spawn ace-wiki-mapper agents to produce documents.
75
+ For greenfield architecture, conduct deep questioning before generating.
76
+ Add CLAUDE.md instructions to keep wiki current with future code changes.
77
+ </objective>
78
+
79
+ <artifacts>
80
+ - .docs/wiki/wiki-readme.md (created if not already present)
81
+ - .docs/wiki/system-wide/system-structure.md
82
+ - .docs/wiki/system-wide/system-architecture.md
83
+ - .docs/wiki/system-wide/testing-framework.md
84
+ - CLAUDE.md (wiki maintenance instructions appended)
85
+ </artifacts>
86
+ </output>
87
+
88
+ <process>
89
+ Execute the map-system workflow from
90
+ `workflow.xml` end-to-end.
91
+ Preserve all workflow gates (validation, user questions, commits).
92
+ </process>
93
+
94
+ <next-steps>
95
+ **After this command, `/clear` first for a fresh context window, then:**
96
+ - `/ace:map-subsystems` — Map individual subsystem internals (structure, dependencies)
97
+ - `/ace:init-coding-standards` — Define prescriptive coding standards
98
+ - `/ace:help` — Check project initialization status and next steps
99
+ - Review and edit files in `.docs/wiki/system-wide/` anytime
100
+ </next-steps>
101
+
102
+ </command>
103
+ ```
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * map-system skill script — Entry point for ace-tools operations
5
+ * needed by the map-system skill.
6
+ *
7
+ * Subcommands:
8
+ * init [args] Environment detection for map-system workflow
9
+ *
10
+ * Usage: node script.js <subcommand> [args] [--raw]
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ const {
17
+ loadConfig, pathExists, resolveModel,
18
+ detectBrownfieldStatus, output, error, runSkillScript,
19
+ } = require('../../shared/lib/ace-core');
20
+
21
+ // ─── CLI Dispatch ────────────────────────────────────────────────────────────
22
+
23
+ runSkillScript({
24
+ init: cmdInit,
25
+ });
26
+
27
+ // ─── Init: Map System ───────────────────────────────────────────────────────
28
+
29
+ function cmdInit(cwd, raw, args, parsed) {
30
+ const config = loadConfig(cwd);
31
+ const brownfield = detectBrownfieldStatus(cwd);
32
+
33
+ // Check existing wiki documents
34
+ const wikiDir = '.docs/wiki/system-wide';
35
+ const wikiDirExists = pathExists(cwd, wikiDir);
36
+
37
+ const has_system_structure = pathExists(cwd, path.join(wikiDir, 'system-structure.md'));
38
+ const has_system_architecture = pathExists(cwd, path.join(wikiDir, 'system-architecture.md'));
39
+ const has_testing_framework = pathExists(cwd, path.join(wikiDir, 'testing-framework.md'));
40
+ const has_coding_standards = pathExists(cwd, path.join(wikiDir, 'coding-standards.md'));
41
+
42
+ // List existing wiki files if directory exists
43
+ let existing_wiki_files = [];
44
+ if (wikiDirExists) {
45
+ try {
46
+ existing_wiki_files = fs.readdirSync(path.join(cwd, wikiDir)).filter(f => f.endsWith('.md'));
47
+ } catch {}
48
+ }
49
+
50
+ const result = {
51
+ // Models
52
+ mapper_model: resolveModel(cwd, 'ace-wiki-mapper'),
53
+
54
+ // Config
55
+ commit_docs: config.commit_docs,
56
+
57
+ // Brownfield detection
58
+ ...brownfield,
59
+
60
+ // Wiki directory state
61
+ wiki_dir_exists: wikiDirExists,
62
+ existing_wiki_files,
63
+
64
+ // Per-document existence
65
+ has_system_structure,
66
+ has_system_architecture,
67
+ has_testing_framework,
68
+ has_coding_standards,
69
+
70
+ // Git state
71
+ has_git: pathExists(cwd, '.git'),
72
+ };
73
+
74
+ output(result, raw);
75
+ }