agile-context-engineering 0.2.2 → 0.5.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/.claude-plugin/plugin.json +10 -0
- package/CHANGELOG.md +82 -0
- package/README.md +27 -18
- package/agents/ace-product-owner.md +1 -1
- package/agents/ace-technical-application-architect.md +28 -0
- package/agents/ace-wiki-mapper.md +144 -29
- package/bin/install.js +67 -63
- package/hooks/ace-check-update.js +17 -9
- package/package.json +7 -5
- package/shared/lib/ace-core.js +308 -0
- package/shared/lib/ace-core.test.js +308 -0
- package/shared/lib/ace-github.js +753 -0
- package/shared/lib/ace-story.js +400 -0
- package/shared/lib/ace-story.test.js +250 -0
- package/{agile-context-engineering → shared}/utils/ui-formatting.md +299 -299
- package/skills/execute-story/SKILL.md +110 -0
- package/skills/execute-story/script.js +305 -0
- package/skills/execute-story/script.test.js +261 -0
- package/skills/execute-story/walkthrough-template.xml +255 -0
- package/{agile-context-engineering/workflows/execute-story.xml → skills/execute-story/workflow.xml} +83 -9
- package/skills/help/SKILL.md +69 -0
- package/skills/help/script.js +318 -0
- package/skills/help/script.test.js +183 -0
- package/{agile-context-engineering/workflows/help.xml → skills/help/workflow.xml} +8 -8
- package/skills/init-coding-standards/SKILL.md +72 -0
- package/{agile-context-engineering/templates/wiki/coding-standards.xml → skills/init-coding-standards/coding-standards-template.xml} +38 -0
- package/skills/init-coding-standards/script.js +59 -0
- package/skills/init-coding-standards/script.test.js +70 -0
- package/{agile-context-engineering/workflows/init-coding-standards.xml → skills/init-coding-standards/workflow.xml} +4 -9
- package/skills/map-cross-cutting/SKILL.md +89 -0
- package/skills/map-cross-cutting/workflow.xml +330 -0
- package/skills/map-guide/SKILL.md +89 -0
- package/skills/map-guide/workflow.xml +320 -0
- package/skills/map-pattern/SKILL.md +89 -0
- package/skills/map-pattern/workflow.xml +331 -0
- package/skills/map-story/SKILL.md +127 -0
- package/skills/map-story/templates/guide.xml +137 -0
- package/skills/map-story/templates/pattern.xml +159 -0
- package/skills/map-story/templates/system-cross-cutting.xml +197 -0
- package/skills/map-story/templates/walkthrough.xml +255 -0
- package/{agile-context-engineering/workflows/map-story.xml → skills/map-story/workflow.xml} +258 -9
- package/skills/map-subsystem/SKILL.md +111 -0
- package/skills/map-subsystem/script.js +60 -0
- package/skills/map-subsystem/script.test.js +68 -0
- package/skills/map-subsystem/templates/decizions.xml +115 -0
- package/skills/map-subsystem/templates/guide.xml +137 -0
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/module-discovery.xml +3 -3
- package/skills/map-subsystem/templates/pattern.xml +159 -0
- package/skills/map-subsystem/templates/system-cross-cutting.xml +197 -0
- package/skills/map-subsystem/templates/system.xml +381 -0
- package/skills/map-subsystem/templates/walkthrough.xml +255 -0
- package/{agile-context-engineering/workflows/map-subsystem.xml → skills/map-subsystem/workflow.xml} +17 -21
- package/skills/map-sys-doc/SKILL.md +90 -0
- package/skills/map-sys-doc/system.xml +381 -0
- package/skills/map-sys-doc/workflow.xml +336 -0
- package/skills/map-system/SKILL.md +85 -0
- package/skills/map-system/script.js +84 -0
- package/skills/map-system/script.test.js +73 -0
- package/skills/map-system/templates/wiki-readme.xml +297 -0
- package/{agile-context-engineering/workflows/map-system.xml → skills/map-system/workflow.xml} +11 -16
- package/skills/map-walkthrough/SKILL.md +92 -0
- package/skills/map-walkthrough/walkthrough.xml +255 -0
- package/skills/map-walkthrough/workflow.xml +457 -0
- package/skills/plan-backlog/SKILL.md +75 -0
- package/skills/plan-backlog/script.js +136 -0
- package/skills/plan-backlog/script.test.js +83 -0
- package/{agile-context-engineering/workflows/plan-backlog.xml → skills/plan-backlog/workflow.xml} +13 -21
- package/skills/plan-feature/SKILL.md +76 -0
- package/skills/plan-feature/script.js +148 -0
- package/skills/plan-feature/script.test.js +80 -0
- package/{agile-context-engineering/workflows/plan-feature.xml → skills/plan-feature/workflow.xml} +21 -29
- package/skills/plan-product-vision/SKILL.md +75 -0
- package/skills/plan-product-vision/script.js +60 -0
- package/skills/plan-product-vision/script.test.js +69 -0
- package/{agile-context-engineering/workflows/plan-product-vision.xml → skills/plan-product-vision/workflow.xml} +4 -9
- package/skills/plan-story/SKILL.md +116 -0
- package/skills/plan-story/script.js +326 -0
- package/skills/plan-story/script.test.js +240 -0
- package/skills/plan-story/story-template.xml +451 -0
- package/{agile-context-engineering/workflows/plan-story.xml → skills/plan-story/workflow.xml} +1285 -909
- package/skills/research-external-solution/SKILL.md +107 -0
- package/skills/research-external-solution/script.js +238 -0
- package/skills/research-external-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-external-solution.xml → skills/research-external-solution/workflow.xml} +4 -6
- package/skills/research-integration-solution/SKILL.md +98 -0
- package/{agile-context-engineering/templates/product/story-integration-solution.xml → skills/research-integration-solution/integration-solution-template.xml} +1 -0
- package/skills/research-integration-solution/script.js +231 -0
- package/skills/research-integration-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-integration-solution.xml → skills/research-integration-solution/workflow.xml} +4 -5
- package/skills/research-story-wiki/SKILL.md +92 -0
- package/skills/research-story-wiki/script.js +231 -0
- package/skills/research-story-wiki/script.test.js +138 -0
- package/{agile-context-engineering/templates/product/story-wiki.xml → skills/research-story-wiki/story-wiki-template.xml} +4 -0
- package/{agile-context-engineering/workflows/research-story-wiki.xml → skills/research-story-wiki/workflow.xml} +5 -6
- package/skills/research-technical-solution/SKILL.md +103 -0
- package/skills/research-technical-solution/script.js +231 -0
- package/skills/research-technical-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-technical-solution.xml → skills/research-technical-solution/workflow.xml} +4 -5
- package/skills/review-story/SKILL.md +100 -0
- package/skills/review-story/script.js +257 -0
- package/skills/review-story/script.test.js +169 -0
- package/skills/review-story/story-template.xml +451 -0
- package/{agile-context-engineering/workflows/review-story.xml → skills/review-story/workflow.xml} +1 -3
- package/skills/update/SKILL.md +53 -0
- package/{agile-context-engineering/workflows/update.xml → skills/update/workflow.xml} +237 -207
- package/agile-context-engineering/src/ace-tools.js +0 -2881
- package/agile-context-engineering/src/ace-tools.test.js +0 -1089
- package/agile-context-engineering/templates/_command.md +0 -54
- package/agile-context-engineering/templates/_workflow.xml +0 -17
- package/agile-context-engineering/templates/config.json +0 -0
- package/agile-context-engineering/templates/product/integration-solution.xml +0 -0
- package/agile-context-engineering/templates/wiki/wiki-readme.xml +0 -276
- package/commands/ace/execute-story.md +0 -137
- package/commands/ace/help.md +0 -93
- package/commands/ace/init-coding-standards.md +0 -83
- package/commands/ace/map-story.md +0 -156
- package/commands/ace/map-subsystem.md +0 -138
- package/commands/ace/map-system.md +0 -92
- package/commands/ace/plan-backlog.md +0 -83
- package/commands/ace/plan-feature.md +0 -89
- package/commands/ace/plan-product-vision.md +0 -81
- package/commands/ace/plan-story.md +0 -145
- package/commands/ace/research-external-solution.md +0 -138
- package/commands/ace/research-integration-solution.md +0 -135
- package/commands/ace/research-story-wiki.md +0 -116
- package/commands/ace/research-technical-solution.md +0 -147
- package/commands/ace/review-story.md +0 -109
- package/commands/ace/update.md +0 -54
- /package/{agile-context-engineering → shared}/utils/questioning.xml +0 -0
- /package/{agile-context-engineering/templates/product/story.xml → skills/execute-story/story-template.xml} +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-cross-cutting}/system-cross-cutting.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-guide}/guide.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-pattern}/pattern.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/decizions.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/system.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/tech-debt-index.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-architecture.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-structure.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-architecture.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-structure.xml +0 -0
- /package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/testing-framework.xml +0 -0
- /package/{agile-context-engineering/templates/product/product-backlog.xml → skills/plan-backlog/product-backlog-template.xml} +0 -0
- /package/{agile-context-engineering/templates/product/feature.xml → skills/plan-feature/feature-template.xml} +0 -0
- /package/{agile-context-engineering/templates/product/product-vision.xml → skills/plan-product-vision/product-vision-template.xml} +0 -0
- /package/{agile-context-engineering/templates/product/external-solution.xml → skills/research-external-solution/external-solution-template.xml} +0 -0
- /package/{agile-context-engineering/templates/product/story-technical-solution.xml → skills/research-technical-solution/technical-solution-template.xml} +0 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
<workflow>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Create or update a guide document in
|
|
5
|
+
`.docs/wiki/subsystems/[subsystem-name]/guides/`.
|
|
6
|
+
|
|
7
|
+
A guide is a step-by-step recipe for a common implementation task. It combines
|
|
8
|
+
knowledge from multiple systems, patterns, and cross-cutting concerns into one
|
|
9
|
+
actionable recipe. The document an AI agent follows when performing a recurring
|
|
10
|
+
task end-to-end.
|
|
11
|
+
|
|
12
|
+
This workflow is executed directly — NO sub-agents are spawned.
|
|
13
|
+
The executing agent does everything: finding reference implementations, reading code,
|
|
14
|
+
deriving the recipe, and writing the document.
|
|
15
|
+
</purpose>
|
|
16
|
+
|
|
17
|
+
<mandatory-context>
|
|
18
|
+
Read all files referenced by the invoking command's execution-context before starting.
|
|
19
|
+
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
20
|
+
</mandatory-context>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
25
|
+
<!-- STEP 1: SETUP AND VALIDATE -->
|
|
26
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
27
|
+
|
|
28
|
+
<step name="setup" order="1">
|
|
29
|
+
|
|
30
|
+
<substep order="1.1" name="display-banner">
|
|
31
|
+
Display stage banner:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
╔══════════════════════════════════════════════════╗
|
|
35
|
+
║ ACE > Map Guide ║
|
|
36
|
+
╚══════════════════════════════════════════════════╝
|
|
37
|
+
```
|
|
38
|
+
</substep>
|
|
39
|
+
|
|
40
|
+
<substep order="1.2" name="parse-and-validate">
|
|
41
|
+
Parse $ARGUMENTS for: `text`, `subsystem`, `story-context`, `commits`.
|
|
42
|
+
|
|
43
|
+
**If `text` is missing:** Ask the user:
|
|
44
|
+
- header: "Guide"
|
|
45
|
+
- question: "Describe the recurring task this guide should teach.\nE.g., 'How to add a new drawing tool' or 'How to add a new CRUD endpoint'"
|
|
46
|
+
|
|
47
|
+
**If `subsystem` is missing:** Ask the user:
|
|
48
|
+
- header: "Guide"
|
|
49
|
+
- question: "Which subsystem does this guide belong to?"
|
|
50
|
+
</substep>
|
|
51
|
+
|
|
52
|
+
<substep order="1.3" name="resolve-subsystem">
|
|
53
|
+
Resolve the subsystem. Check if `.docs/wiki/subsystems/[subsystem-name]/` exists.
|
|
54
|
+
|
|
55
|
+
**If not found:**
|
|
56
|
+
```
|
|
57
|
+
! No wiki found for subsystem "[subsystem]".
|
|
58
|
+
Run /ace:map-subsystem first to create the subsystem wiki.
|
|
59
|
+
```
|
|
60
|
+
Exit.
|
|
61
|
+
|
|
62
|
+
Ensure guides directory exists:
|
|
63
|
+
```bash
|
|
64
|
+
mkdir -p .docs/wiki/subsystems/[subsystem_name]/guides
|
|
65
|
+
```
|
|
66
|
+
</substep>
|
|
67
|
+
|
|
68
|
+
Display:
|
|
69
|
+
```
|
|
70
|
+
i Guide: [text description]
|
|
71
|
+
Subsystem: [subsystem-name]
|
|
72
|
+
Story context: [path/issue, or "none"]
|
|
73
|
+
Commits: [value, or "search codebase directly"]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Continue to step 2.
|
|
77
|
+
</step>
|
|
78
|
+
|
|
79
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
80
|
+
<!-- STEP 2: CHECK FOR EXISTING GUIDE -->
|
|
81
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
82
|
+
|
|
83
|
+
<step name="check-existing" order="2">
|
|
84
|
+
|
|
85
|
+
Scan for existing guides:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Glob(pattern='*.md', path='.docs/wiki/subsystems/[subsystem_name]/guides')
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**If existing guides found:**
|
|
92
|
+
Read their titles. Check if any covers the same or overlapping task.
|
|
93
|
+
|
|
94
|
+
**If overlap detected:**
|
|
95
|
+
Use AskUserQuestion:
|
|
96
|
+
- header: "Guide"
|
|
97
|
+
- question: "An existing guide may cover a similar task:\n\n- `[existing-file]`: [title]\n\nShould I update the existing guide 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 guides:** Set MODE = create.
|
|
103
|
+
|
|
104
|
+
**If MODE = create:**
|
|
105
|
+
Derive file name from task description in kebab-case (e.g., "how-to-add-drawing-tool.md").
|
|
106
|
+
Set TARGET_FILE = `.docs/wiki/subsystems/[subsystem_name]/guides/[guide-name].md`
|
|
107
|
+
|
|
108
|
+
Continue to step 3.
|
|
109
|
+
</step>
|
|
110
|
+
|
|
111
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
112
|
+
<!-- STEP 3: GATHER CODE CONTEXT AND DERIVE RECIPE -->
|
|
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: what was built, which files were touched, which registrations were added.
|
|
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 context about the task and implementation.
|
|
128
|
+
</variant>
|
|
129
|
+
|
|
130
|
+
<variant condition="no story-context">
|
|
131
|
+
Skip — derive recipe from codebase patterns only.
|
|
132
|
+
</variant>
|
|
133
|
+
</substep>
|
|
134
|
+
|
|
135
|
+
<substep order="3.2" name="find-reference-implementations">
|
|
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. These are the most recent example.
|
|
141
|
+
Read each file to understand the implementation steps taken.
|
|
142
|
+
</variant>
|
|
143
|
+
|
|
144
|
+
<variant condition="commits provided as SHAs">
|
|
145
|
+
```bash
|
|
146
|
+
git diff --name-only [first-sha]^..[last-sha]
|
|
147
|
+
```
|
|
148
|
+
Filter to files within the subsystem. Read each file.
|
|
149
|
+
</variant>
|
|
150
|
+
|
|
151
|
+
<variant condition="no commits — search codebase directly">
|
|
152
|
+
Use the `text` description to find existing implementations of this task:
|
|
153
|
+
|
|
154
|
+
1. Read the subsystem's structure.md and architecture.md for orientation
|
|
155
|
+
2. Read existing system/pattern/cross-cutting docs for this subsystem
|
|
156
|
+
3. Grep for keywords related to the task (class names, registrations, etc.)
|
|
157
|
+
4. Find 2-3 existing implementations that followed the same recipe
|
|
158
|
+
5. Read each implementation to extract the common steps
|
|
159
|
+
</variant>
|
|
160
|
+
</substep>
|
|
161
|
+
|
|
162
|
+
<substep order="3.3" name="derive-recipe">
|
|
163
|
+
From the reference implementations, derive the step-by-step recipe:
|
|
164
|
+
|
|
165
|
+
1. What files need to be created? In what order?
|
|
166
|
+
2. What existing files need to be modified (registrations, configurations)?
|
|
167
|
+
3. What patterns must be followed (from patterns/ docs)?
|
|
168
|
+
4. What cross-cutting registrations are needed (from cross-cutting/ docs)?
|
|
169
|
+
5. What is the closest existing implementation to copy from?
|
|
170
|
+
6. What commonly goes wrong?
|
|
171
|
+
|
|
172
|
+
Build an ordered list of steps with "copy from" references.
|
|
173
|
+
</substep>
|
|
174
|
+
|
|
175
|
+
Continue to step 4.
|
|
176
|
+
</step>
|
|
177
|
+
|
|
178
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
179
|
+
<!-- STEP 4: WRITE THE GUIDE -->
|
|
180
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
181
|
+
|
|
182
|
+
<step name="write-doc" order="4">
|
|
183
|
+
|
|
184
|
+
Read ALL existing wiki docs under `.docs/wiki/subsystems/[subsystem_name]/`
|
|
185
|
+
for cross-referencing in Prerequisites and linking to patterns/systems.
|
|
186
|
+
|
|
187
|
+
Follow the guide template structure exactly.
|
|
188
|
+
|
|
189
|
+
<substep order="4.1" name="write-title-and-prerequisites">
|
|
190
|
+
- Title: "# How to [Task]"
|
|
191
|
+
- Prerequisites: links to pattern docs, system docs, cross-cutting docs
|
|
192
|
+
that an agent should read BEFORE starting
|
|
193
|
+
</substep>
|
|
194
|
+
|
|
195
|
+
<substep order="4.2" name="write-steps">
|
|
196
|
+
Write NUMBERED, ORDERED steps. Each step must have:
|
|
197
|
+
- WHAT to do
|
|
198
|
+
- WHERE to do it (exact file path)
|
|
199
|
+
- WHAT to copy from (reference implementation)
|
|
200
|
+
- Key changes from the reference
|
|
201
|
+
|
|
202
|
+
Include ALL steps: file creation, registration, configuration, wiring.
|
|
203
|
+
Don't skip "obvious" steps — agents don't infer implicit requirements.
|
|
204
|
+
</substep>
|
|
205
|
+
|
|
206
|
+
<substep order="4.3" name="write-verification">
|
|
207
|
+
Write a verification checklist:
|
|
208
|
+
- Compilation check
|
|
209
|
+
- Runtime check
|
|
210
|
+
- Behavioral check
|
|
211
|
+
Reference specific files or commands.
|
|
212
|
+
</substep>
|
|
213
|
+
|
|
214
|
+
<substep order="4.4" name="write-common-mistakes">
|
|
215
|
+
List things that commonly go wrong:
|
|
216
|
+
- WHY each mistake happens
|
|
217
|
+
- HOW to avoid it
|
|
218
|
+
Drawn from actual gotchas in pattern/system docs and codebase analysis.
|
|
219
|
+
</substep>
|
|
220
|
+
|
|
221
|
+
<substep order="4.5" name="write-or-update">
|
|
222
|
+
**If MODE = create:** Write the complete document to TARGET_FILE.
|
|
223
|
+
**If MODE = update:** Read the existing guide, update steps, add new
|
|
224
|
+
mistakes, update "copy from" references. Write to TARGET_FILE.
|
|
225
|
+
</substep>
|
|
226
|
+
|
|
227
|
+
Continue to step 5.
|
|
228
|
+
</step>
|
|
229
|
+
|
|
230
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
231
|
+
<!-- STEP 5: VERIFY, COMMIT, AND REPORT -->
|
|
232
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
233
|
+
|
|
234
|
+
<step name="verify-and-report" order="5">
|
|
235
|
+
|
|
236
|
+
<substep order="5.1" name="quality-check">
|
|
237
|
+
Re-read TARGET_FILE and verify:
|
|
238
|
+
|
|
239
|
+
<verification-checklist>
|
|
240
|
+
<check>Title follows "# How to [Task]" format</check>
|
|
241
|
+
<check>Prerequisites section links to relevant docs</check>
|
|
242
|
+
<check>Steps are NUMBERED and ORDERED</check>
|
|
243
|
+
<check>Every step has WHAT, WHERE, and WHAT to copy from</check>
|
|
244
|
+
<check>All registrations and configurations included (no implicit steps)</check>
|
|
245
|
+
<check>Verification checklist present with compilation, runtime, behavioral checks</check>
|
|
246
|
+
<check>Common Mistakes section present with WHY and HOW</check>
|
|
247
|
+
<check>Code references use `file:Symbol` format, not line numbers</check>
|
|
248
|
+
<check>No filler phrases, no generic advice</check>
|
|
249
|
+
<check>An agent could follow this guide end-to-end without guessing</check>
|
|
250
|
+
</verification-checklist>
|
|
251
|
+
|
|
252
|
+
Fix any failures by editing the document directly.
|
|
253
|
+
</substep>
|
|
254
|
+
|
|
255
|
+
<substep order="5.2" name="security-scan">
|
|
256
|
+
```
|
|
257
|
+
Grep(
|
|
258
|
+
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)",
|
|
259
|
+
path="[TARGET_FILE]",
|
|
260
|
+
output_mode="content"
|
|
261
|
+
)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
<variant condition="matches found">SECRETS_FOUND — alert user, do NOT commit.</variant>
|
|
265
|
+
<variant condition="no matches">CLEAN.</variant>
|
|
266
|
+
</substep>
|
|
267
|
+
|
|
268
|
+
<substep order="5.3" name="commit">
|
|
269
|
+
```bash
|
|
270
|
+
git add [TARGET_FILE]
|
|
271
|
+
git commit -m "docs([subsystem_name]): add guide — [guide-name]"
|
|
272
|
+
```
|
|
273
|
+
</substep>
|
|
274
|
+
|
|
275
|
+
<substep order="5.4" name="report">
|
|
276
|
+
Display:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
╔══════════════════════════════════════════════════╗
|
|
280
|
+
║ ACE > Map Guide > Complete ║
|
|
281
|
+
╚══════════════════════════════════════════════════╝
|
|
282
|
+
|
|
283
|
+
+ [TARGET_FILE] ([line count] lines)
|
|
284
|
+
|
|
285
|
+
Guide: [text description]
|
|
286
|
+
Steps: [step count]
|
|
287
|
+
Prerequisites: [count] docs linked
|
|
288
|
+
Common Mistakes: [count]
|
|
289
|
+
|
|
290
|
+
Next > /clear first for a fresh context window, then:
|
|
291
|
+
|
|
292
|
+
/ace:map-guide — create another guide
|
|
293
|
+
/ace:map-pattern — document a pattern referenced by this guide
|
|
294
|
+
/ace:map-sys-doc — document a system referenced by this guide
|
|
295
|
+
Review file at [TARGET_FILE]
|
|
296
|
+
```
|
|
297
|
+
</substep>
|
|
298
|
+
|
|
299
|
+
End workflow.
|
|
300
|
+
</step>
|
|
301
|
+
|
|
302
|
+
</process>
|
|
303
|
+
|
|
304
|
+
<success_criteria>
|
|
305
|
+
<criterion>Task description parsed and subsystem validated</criterion>
|
|
306
|
+
<criterion>Reference implementations found (from commits or codebase search)</criterion>
|
|
307
|
+
<criterion>Recipe derived from actual code — not invented from generic knowledge</criterion>
|
|
308
|
+
<criterion>Existing guides checked to avoid duplication (create vs update decision)</criterion>
|
|
309
|
+
<criterion>Guide follows template structure from guide.xml</criterion>
|
|
310
|
+
<criterion>Prerequisites link to relevant pattern/system/cross-cutting docs</criterion>
|
|
311
|
+
<criterion>Steps are numbered, ordered, and each has WHAT/WHERE/copy-from</criterion>
|
|
312
|
+
<criterion>ALL steps included — no implicit requirements</criterion>
|
|
313
|
+
<criterion>Verification checklist covers compilation, runtime, and behavior</criterion>
|
|
314
|
+
<criterion>Common Mistakes section includes WHY and HOW for each</criterion>
|
|
315
|
+
<criterion>Code references use file:Symbol format, no line numbers</criterion>
|
|
316
|
+
<criterion>No filler, no generic advice, no pseudocode</criterion>
|
|
317
|
+
<criterion>Security scan passed, document committed</criterion>
|
|
318
|
+
</success_criteria>
|
|
319
|
+
|
|
320
|
+
</workflow>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: map-pattern
|
|
3
|
+
description: Create or update a pattern document in .docs/wiki/subsystems/[name]/patterns/ — reusable implementation patterns
|
|
4
|
+
argument-hint: "text='Template Method pattern used by all drawing paths' subsystem='qarc-charts-v2' commits=3"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
allowed-tools:
|
|
7
|
+
- Read
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Write
|
|
12
|
+
- Edit
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
model: opus
|
|
15
|
+
effort: max
|
|
16
|
+
context: fork
|
|
17
|
+
agent: ace-wiki-mapper
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Map Pattern
|
|
21
|
+
|
|
22
|
+
Create or update a pattern document describing reusable implementation patterns.
|
|
23
|
+
|
|
24
|
+
## When to Use
|
|
25
|
+
|
|
26
|
+
- When a reusable structural pattern needs documentation
|
|
27
|
+
- After identifying a recurring approach used by 2+ implementations
|
|
28
|
+
- When agents need to understand HOW to implement something following an established pattern
|
|
29
|
+
- A structural approach appears across 2+ implementations
|
|
30
|
+
- New code must follow the same pattern for consistency
|
|
31
|
+
- An agent needs to know the abstract structure + concrete steps to add a new implementation
|
|
32
|
+
|
|
33
|
+
## Input
|
|
34
|
+
|
|
35
|
+
### Required
|
|
36
|
+
|
|
37
|
+
- **`text`** (text) — Natural language description of the pattern to document. Describes WHAT the pattern is and WHERE it appears in the codebase. E.g.: "Template Method pattern used by all drawing paths", "Repository pattern for all database access", "CQRS command/query handler pattern". If not provided, pause and ask the user.
|
|
38
|
+
|
|
39
|
+
- **`subsystem`** (path | text) — Subsystem where this pattern doc belongs. Wiki location: `.docs/wiki/subsystems/[subsystem]/patterns/`. If not provided, pause and ask the user.
|
|
40
|
+
|
|
41
|
+
### Optional
|
|
42
|
+
|
|
43
|
+
- **`story-context`** (path | GitHub issue) — Path to story artifacts folder (in `.ace/artifacts/`) OR GitHub issue number/URL. Provides context about a story that introduced or modified this pattern. When not provided, the agent discovers the pattern from codebase analysis.
|
|
44
|
+
|
|
45
|
+
- **`commits`** (number | comma-separated commit SHAs) — Specifies which commits to analyze for understanding pattern changes. As a number: analyze the N most recent commits (e.g., commits=3). As commit SHAs: analyze specific commits (e.g., commits='abc123,def456'). When not provided: search the codebase directly to find all implementations and extract the pattern structure.
|
|
46
|
+
|
|
47
|
+
## Supporting Resources
|
|
48
|
+
|
|
49
|
+
Read ALL of these before starting the workflow:
|
|
50
|
+
|
|
51
|
+
- **Workflow**: Read [workflow.xml](workflow.xml) — complete orchestration process with all steps
|
|
52
|
+
- **Pattern template**: Read [pattern.xml](pattern.xml) — output format for the pattern document
|
|
53
|
+
- **Questioning guide**: Read `${CLAUDE_SKILL_DIR}/../../shared/utils/questioning.xml` — deep questioning techniques
|
|
54
|
+
- **UI formatting**: Read `${CLAUDE_SKILL_DIR}/../../shared/utils/ui-formatting.md` — ACE output formatting rules
|
|
55
|
+
|
|
56
|
+
## Process
|
|
57
|
+
|
|
58
|
+
Use the `ace-wiki-mapper` agent that's specialized in wiki exploration and documentation writing.
|
|
59
|
+
|
|
60
|
+
Read all supporting resources listed above, then execute the workflow defined in [workflow.xml](workflow.xml) end-to-end. Preserve all workflow gates (validation, user questions, commits).
|
|
61
|
+
|
|
62
|
+
**Objective:** Create or update a pattern document that describes a reusable structural approach — structure diagram (mermaid classDiagram), how it works step-by-step, how to apply it for new implementations, current implementations list, and gotchas. The document an AI agent reads to ensure new code follows established conventions.
|
|
63
|
+
|
|
64
|
+
## Artifacts
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
.docs/wiki/subsystems/[subsystem-name]/patterns/[pattern-name].md
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Example Usage
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
# Basic pattern
|
|
74
|
+
/ace:map-pattern text='Template Method pattern used by all drawing paths' subsystem='qarc-charts-v2'
|
|
75
|
+
|
|
76
|
+
# With recent commits
|
|
77
|
+
/ace:map-pattern text='Repository pattern for all database access' subsystem='api' commits=3
|
|
78
|
+
|
|
79
|
+
# With story context
|
|
80
|
+
/ace:map-pattern text='CQRS command/query handler pattern' subsystem='api' story-context='.ace/artifacts/product/e1-api/f2-cqrs/s1-setup/s1-setup.md'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Next Steps
|
|
84
|
+
|
|
85
|
+
- `/clear` first for a fresh context window
|
|
86
|
+
- `/ace:map-pattern` — create another pattern document
|
|
87
|
+
- `/ace:map-guide` — create a guide that uses this pattern
|
|
88
|
+
- `/ace:map-sys-doc` — document a system that uses this pattern
|
|
89
|
+
- Review file at `.docs/wiki/subsystems/[subsystem-name]/patterns/`
|