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,1145 +1,1219 @@
|
|
|
1
|
-
<workflow>
|
|
2
|
-
|
|
3
|
-
<purpose>
|
|
4
|
-
Orchestrate story execution: load a fully-planned story (with AC + Technical Solution),
|
|
5
|
-
create an execution plan via Claude Code Plan Mode, execute the plan (solo or agent teams),
|
|
6
|
-
run code review, present results for user verification, update state across all ACE
|
|
7
|
-
artifacts, and trigger wiki mapping.
|
|
8
|
-
|
|
9
|
-
The story file IS the plan — AC + Technical Solution = the specification.
|
|
10
|
-
Claude Code Plan Mode creates a tactical execution plan on top of that.
|
|
11
|
-
|
|
12
|
-
Two execution modes:
|
|
13
|
-
- **Solo Mode** (default): Main plans → executor subagent implements (fresh 200k context)
|
|
14
|
-
- **Agent Teams Mode** (when enabled + assessment recommends it): Lead + teammates for parallel work
|
|
15
|
-
|
|
16
|
-
NO intermediary commits during implementation. Only ONE commit after user approval.
|
|
17
|
-
</purpose>
|
|
18
|
-
|
|
19
|
-
<mandatory-context>
|
|
20
|
-
Read all files referenced by the invoking command's execution-context before starting.
|
|
21
|
-
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
22
|
-
</mandatory-context>
|
|
23
|
-
|
|
24
|
-
<process>
|
|
25
|
-
|
|
26
|
-
**STRICT STEP-BY-STEP EXECUTION. This workflow is NOT a reference document — it is a
|
|
27
|
-
script you MUST follow in order. Complete each step and ALL its substeps before moving
|
|
28
|
-
to the next step. Do NOT read ahead and freestyle. Do NOT explore the codebase or read
|
|
29
|
-
the story file before running the init command. Do NOT create your own plan or ask
|
|
30
|
-
"Shall I proceed?" — follow the workflow steps exactly as written.**
|
|
31
|
-
|
|
32
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
33
|
-
<!-- STEP 1: INIT & VALIDATE -->
|
|
34
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
35
|
-
|
|
36
|
-
<step name="init-and-validate" order="1">
|
|
37
|
-
|
|
38
|
-
**MANDATORY FIRST STEP — Run the init command (substep 1.2) BEFORE any other action.
|
|
39
|
-
Do NOT read the story file. Do NOT explore code. Do NOT start planning.
|
|
40
|
-
Run init FIRST, parse the output, THEN proceed through substeps 1.3-1.7 in order.**
|
|
41
|
-
|
|
42
|
-
<substep order="1.1" name="parse-arguments">
|
|
43
|
-
Parse `$ARGUMENTS` to extract:
|
|
44
|
-
- `story` (REQUIRED): file path or GitHub URL/issue number
|
|
45
|
-
- `--agent-teams-off` (OPTIONAL FLAG): force solo mode
|
|
46
|
-
</substep>
|
|
47
|
-
|
|
48
|
-
<substep order="1.2" name="run-init">
|
|
49
|
-
Execute environment detection:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init execute-story {story_param})
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Parse INIT JSON for:
|
|
56
|
-
- `executor_model`, `reviewer_model`
|
|
57
|
-
- `commit_docs`, `has_git`, `has_gh_cli`, `github_project`
|
|
58
|
-
- `agent_teams`
|
|
59
|
-
- `story_source`, `story_valid`, `story_error`, `story_content`
|
|
60
|
-
- `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
|
|
61
|
-
- `has_acceptance_criteria`, `acceptance_criteria_count`
|
|
62
|
-
- `has_technical_solution`, `has_wiki_refs`, `has_coding_standards`
|
|
63
|
-
- `paths.*`
|
|
64
|
-
</substep>
|
|
65
|
-
|
|
66
|
-
<substep order="1.3" name="display-banner">
|
|
67
|
-
```
|
|
68
|
-
╔══════════════════════════════════════════════════╗
|
|
69
|
-
║ ACE > Execute Story ║
|
|
70
|
-
╚══════════════════════════════════════════════════╝
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
If `has_git` is false: `git init`
|
|
74
|
-
</substep>
|
|
75
|
-
|
|
76
|
-
<substep order="1.4" name="validate-story">
|
|
77
|
-
<validation-gate condition="INIT.story_valid is false">
|
|
78
|
-
Display `INIT.story_error` and STOP:
|
|
79
|
-
```
|
|
80
|
-
x {INIT.story_error}
|
|
81
|
-
Provide a valid story file path or GitHub issue.
|
|
82
|
-
```
|
|
83
|
-
</validation-gate>
|
|
84
|
-
|
|
85
|
-
<validation-gate condition="INIT.has_acceptance_criteria is false">
|
|
86
|
-
STOP:
|
|
87
|
-
```
|
|
88
|
-
x Story has no acceptance criteria.
|
|
89
|
-
Run /ace:plan-story first to define AC scenarios.
|
|
90
|
-
```
|
|
91
|
-
</validation-gate>
|
|
92
|
-
|
|
93
|
-
<validation-gate condition="INIT.has_technical_solution is false">
|
|
94
|
-
STOP:
|
|
95
|
-
```
|
|
96
|
-
x Story has no technical solution.
|
|
97
|
-
Run /ace:plan-story first to generate the technical solution.
|
|
98
|
-
```
|
|
99
|
-
</validation-gate>
|
|
100
|
-
|
|
101
|
-
<validation-gate condition="INIT.story.status is 'Done'">
|
|
102
|
-
STOP:
|
|
103
|
-
```
|
|
104
|
-
x Story is already marked as Done. Nothing to execute.
|
|
105
|
-
```
|
|
106
|
-
</validation-gate>
|
|
107
|
-
|
|
108
|
-
<validation-gate condition="INIT.story.status is 'DevReady'">
|
|
109
|
-
Story was previously implemented and approved as DevReady (pending manual testing).
|
|
110
|
-
Resuming from verification to allow promoting to Done.
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
i Story status: DevReady — previously implemented, pending verification.
|
|
114
|
-
Resuming from verification (step 5.2).
|
|
115
|
-
Skipping planning, execution, and code review.
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Set `RESUME_FROM_DEVREADY = true`.
|
|
119
|
-
After displaying context (substep 1.7), jump DIRECTLY to step 5.2.
|
|
120
|
-
Skip substeps 1.5, 1.6 and steps 2, 3, 4, 5.1 entirely.
|
|
121
|
-
</validation-gate>
|
|
122
|
-
</substep>
|
|
123
|
-
|
|
124
|
-
<substep order="1.5" name="detect-existing-implementation">
|
|
125
|
-
First check if there are any uncommitted changes (staged or unstaged):
|
|
126
|
-
```bash
|
|
127
|
-
git status --short
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
<variant condition="git status output is EMPTY (no uncommitted changes)">
|
|
131
|
-
Fresh start — no uncommitted changes detected. Proceed normally to step 2.
|
|
132
|
-
</variant>
|
|
133
|
-
|
|
134
|
-
<variant condition="git status output is NOT EMPTY (uncommitted changes exist)">
|
|
135
|
-
Uncommitted changes detected. Check if they relate to this story's implementation.
|
|
136
|
-
|
|
137
|
-
Extract the list of expected files from the Technical Solution section
|
|
138
|
-
of the story file (component breakdown — file paths).
|
|
139
|
-
|
|
140
|
-
Check which of these files already exist in the working tree:
|
|
141
|
-
```bash
|
|
142
|
-
for file in [expected_files_from_technical_solution]; do
|
|
143
|
-
[ -f "$file" ] && echo "EXISTS: $file" || echo "MISSING: $file"
|
|
144
|
-
done
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
<variant condition="ALL expected files exist">
|
|
148
|
-
```
|
|
149
|
-
! Implementation appears complete — all expected files exist.
|
|
150
|
-
Uncommitted changes detected in working tree.
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Display the file check results (EXISTS/MISSING for each expected file).
|
|
154
|
-
|
|
155
|
-
Use AskUserQuestion:
|
|
156
|
-
- header: "Resume?"
|
|
157
|
-
- question: "All files from the Technical Solution already exist and there are uncommitted changes. Is the implementation done? Do you want to skip to code review (step 4)?"
|
|
158
|
-
- options:
|
|
159
|
-
- "Yes, skip to review" — Implementation is done, continue from step 4 (code review → approval → state → wiki → commit)
|
|
160
|
-
- "No, start fresh" — Plan and execute from scratch (I'll handle the working tree)
|
|
161
|
-
|
|
162
|
-
<option value="Yes, skip to review">
|
|
163
|
-
Skip steps 2 and 3 entirely.
|
|
164
|
-
Jump DIRECTLY to step 4 (code review).
|
|
165
|
-
</option>
|
|
166
|
-
<option value="No, start fresh">
|
|
167
|
-
Proceed normally from step 2 (user is responsible for cleaning working tree).
|
|
168
|
-
</option>
|
|
169
|
-
</variant>
|
|
170
|
-
|
|
171
|
-
<variant condition="SOME expected files exist (partial implementation)">
|
|
172
|
-
```
|
|
173
|
-
! Partial implementation detected — some expected files exist.
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Display the file check results (EXISTS/MISSING for each expected file).
|
|
177
|
-
|
|
178
|
-
Use AskUserQuestion:
|
|
179
|
-
- header: "Resume?"
|
|
180
|
-
- question: "Some files from the Technical Solution already exist. What would you like to do?"
|
|
181
|
-
- options:
|
|
182
|
-
- "Continue from plan" — Create a plan that accounts for existing files
|
|
183
|
-
- "Start fresh" — Plan and execute from scratch (I'll handle the working tree)
|
|
184
|
-
|
|
185
|
-
<option value="Continue from plan">
|
|
186
|
-
Proceed to step 2. The plan must account for already-existing files
|
|
187
|
-
and only implement what's missing.
|
|
188
|
-
</option>
|
|
189
|
-
<option value="Start fresh">
|
|
190
|
-
Proceed normally from step 2 (user is responsible for cleaning working tree).
|
|
191
|
-
</option>
|
|
192
|
-
</variant>
|
|
193
|
-
|
|
194
|
-
<variant condition="NO expected files from Technical Solution exist">
|
|
195
|
-
Uncommitted changes exist but none match expected story files.
|
|
196
|
-
Proceed normally to step 2.
|
|
197
|
-
</variant>
|
|
198
|
-
</variant>
|
|
199
|
-
</substep>
|
|
200
|
-
|
|
201
|
-
<substep order="1.6" name="resolve-agent-teams">
|
|
202
|
-
<rule condition="--agent-teams-off flag present">Set `USE_AGENT_TEAMS = false` regardless of setting.</rule>
|
|
203
|
-
<rule condition="flag not present">Set `USE_AGENT_TEAMS = INIT.agent_teams`.</rule>
|
|
204
|
-
</substep>
|
|
205
|
-
|
|
206
|
-
<substep order="1.7" name="display-context">
|
|
207
|
-
```
|
|
208
|
-
i Story: {INIT.story.id} — {INIT.story.title}
|
|
209
|
-
Feature: {INIT.feature.id} — {INIT.feature.title}
|
|
210
|
-
Status: {INIT.story.status} | Size: {INIT.story.size}
|
|
211
|
-
AC scenarios: {INIT.acceptance_criteria_count}
|
|
212
|
-
Technical solution: present
|
|
213
|
-
Agent teams: {USE_AGENT_TEAMS ? "enabled" : "disabled"}
|
|
214
|
-
```
|
|
215
|
-
</substep>
|
|
216
|
-
|
|
217
|
-
</step>
|
|
218
|
-
|
|
219
|
-
<!-- ═══ CHECKPOINT: Step 1 MUST be complete. Init MUST have run. Banner MUST be displayed. Context MUST be shown. ═══ -->
|
|
220
|
-
|
|
221
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
222
|
-
<!-- STEP 2: LOAD CONTEXT & CHOOSE EXECUTION MODE -->
|
|
223
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
224
|
-
|
|
225
|
-
<step name="load-and-decide" order="2">
|
|
226
|
-
|
|
227
|
-
<substep order="2.1" name="display-banner">
|
|
228
|
-
```
|
|
229
|
-
┌──────────────────────────────────────────────────┐
|
|
230
|
-
│ ACE > Execute Story > Planning │
|
|
231
|
-
└──────────────────────────────────────────────────┘
|
|
232
|
-
```
|
|
233
|
-
</substep>
|
|
234
|
-
|
|
235
|
-
<substep order="2.2" name="read-story-sections">
|
|
236
|
-
Read `INIT.paths.story_file` and extract:
|
|
237
|
-
- **Acceptance Criteria** — Gherkin scenarios (WHAT to build)
|
|
238
|
-
- **Technical Solution** — component breakdown, sequence diagrams (HOW)
|
|
239
|
-
- **Relevant Wiki** — file references for codebase context (WHERE)
|
|
240
|
-
- **Out of Scope** — explicit exclusions (what NOT to build)
|
|
241
|
-
- **Dependencies** — what must exist before this story
|
|
242
|
-
- **Definition of Done** — quality checklist
|
|
243
|
-
</substep>
|
|
244
|
-
|
|
245
|
-
<substep order="2.3" name="read-coding-standards">
|
|
246
|
-
<variant condition="INIT.has_coding_standards is true">
|
|
247
|
-
Read `INIT.paths.coding_standards` in full — coding standards are mandatory context.
|
|
248
|
-
</variant>
|
|
249
|
-
</substep>
|
|
250
|
-
|
|
251
|
-
<substep order="2.4" name="assess-and-choose-execution-mode">
|
|
252
|
-
**BEFORE any planning — analyze the story and ask the user to choose execution mode.**
|
|
253
|
-
|
|
254
|
-
Analyze the Technical Solution to assess complexity. Count ALL of the following signals:
|
|
255
|
-
|
|
256
|
-
<complexity-signals>
|
|
257
|
-
<signal weight="high" name="story-size">Story size >= 5 SP</signal>
|
|
258
|
-
<signal weight="high" name="file-count">Technical solution touches 6+ files</signal>
|
|
259
|
-
<signal weight="high" name="new-code-volume">Technical solution estimates 100+ new lines of code</signal>
|
|
260
|
-
<signal weight="high" name="implementation-phases">Technical solution defines 3+ implementation phases</signal>
|
|
261
|
-
<signal weight="medium" name="cross-cutting">Changes span multiple layers (state + UI + services + tests)</signal>
|
|
262
|
-
<signal weight="medium" name="complex-patterns">Story involves concurrency, cancellation, retry logic, race conditions, or state machines</signal>
|
|
263
|
-
<signal weight="medium" name="independent-components">Technical solution shows 3+ independent components that could be built in parallel</signal>
|
|
264
|
-
<signal weight="medium" name="ac-count">Story has 5+ acceptance criteria scenarios</signal>
|
|
265
|
-
<signal weight="low" name="multi-subsystem">Changes touch multiple backend/frontend subsystems via API calls</signal>
|
|
266
|
-
<signal weight="low" name="context-window-risk">Estimated implementation would exceed ~140k tokens (70% of 200k context)</signal>
|
|
267
|
-
</complexity-signals>
|
|
268
|
-
|
|
269
|
-
<assessment-rules>
|
|
270
|
-
**Recommend Agent Teams** when ANY of:
|
|
271
|
-
- 3+ HIGH signals present
|
|
272
|
-
- 2+ HIGH signals AND 2+ MEDIUM signals
|
|
273
|
-
- Story has independent components that can genuinely be built in parallel
|
|
274
|
-
|
|
275
|
-
**Recommend Solo** when:
|
|
276
|
-
- Mostly sequential work with tight dependencies between components
|
|
277
|
-
- Small story (1-3 SP) with few files
|
|
278
|
-
- Simple CRUD or single-file changes
|
|
279
|
-
|
|
280
|
-
**When in doubt → recommend Agent Teams.** It's better to have teammates
|
|
281
|
-
that finish early than a solo session that runs out of context window.
|
|
282
|
-
</assessment-rules>
|
|
283
|
-
|
|
284
|
-
**MANDATORY: Always present this choice to the user using AskUserQuestion — NEVER skip it, NEVER auto-decide.**
|
|
285
|
-
|
|
286
|
-
Present your complexity assessment summary, then ask:
|
|
287
|
-
|
|
288
|
-
<variant condition="USE_AGENT_TEAMS is true">
|
|
289
|
-
Use AskUserQuestion:
|
|
290
|
-
- header: "Execution"
|
|
291
|
-
- question: "How should this story be executed?\n\nComplexity: {count high/medium/low signals hit}\n{list the signals that matched}\n\nMy recommendation: {Solo|Agent Teams} because {reasoning}"
|
|
292
|
-
- options:
|
|
293
|
-
- "{Recommended option} (Recommended)" — with reasoning
|
|
294
|
-
- "{Other option}" — with reasoning
|
|
295
|
-
- The recommended option goes first with "(Recommended)" suffix
|
|
296
|
-
</variant>
|
|
297
|
-
|
|
298
|
-
<variant condition="USE_AGENT_TEAMS is false">
|
|
299
|
-
Agent teams are disabled by configuration. Use AskUserQuestion:
|
|
300
|
-
- header: "Execution"
|
|
301
|
-
- question: "Agent teams are disabled.\n\nComplexity: {count signals hit}\n{list the signals that matched}\n\nExecute in solo mode?"
|
|
302
|
-
- options:
|
|
303
|
-
- "Solo (Confirmed)" — proceed with solo execution
|
|
304
|
-
- "Enable Agent Teams" — I want agent teams for this story (override the setting)
|
|
305
|
-
|
|
306
|
-
<variant condition="user chose Enable Agent Teams">
|
|
307
|
-
Override: set `USE_AGENT_TEAMS = true` and re-present the full
|
|
308
|
-
Solo vs Agent Teams choice as in the variant above.
|
|
309
|
-
</variant>
|
|
310
|
-
</variant>
|
|
311
|
-
|
|
312
|
-
Store the user's choice as `EXECUTION_MODE` (solo | agent-teams).
|
|
313
|
-
</substep>
|
|
314
|
-
|
|
315
|
-
<!-- ─────────────────────────────────────────────────── -->
|
|
316
|
-
<!-- SOLO PATH: Main creates plan, executor agent runs -->
|
|
317
|
-
<!-- ─────────────────────────────────────────────────── -->
|
|
318
|
-
|
|
319
|
-
<substep order="2.5" name="solo-plan-mode" condition="EXECUTION_MODE is solo">
|
|
320
|
-
**BEFORE entering Plan Mode, display this highlighted warning to the user:**
|
|
321
|
-
|
|
322
|
-
```
|
|
323
|
-
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
324
|
-
┃ ⚠️ IMPORTANT — READ BEFORE EXITING PLAN MODE ┃
|
|
325
|
-
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
326
|
-
┃ ┃
|
|
327
|
-
┃ When Claude Code wants to exit plan mode, do NOT choose ┃
|
|
328
|
-
┃ the option with "clear context" no matter how filled ┃
|
|
329
|
-
┃ the context is! This will interrupt our command! ┃
|
|
330
|
-
┃ ┃
|
|
331
|
-
┃ The implementation in solo mode is done by a different ┃
|
|
332
|
-
┃ subagent with a fresh context window — no need to clear it. ┃
|
|
333
|
-
┃ ┃
|
|
334
|
-
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
Enter Plan Mode using the EnterPlanMode tool.
|
|
338
|
-
|
|
339
|
-
Feed into Plan Mode context:
|
|
340
|
-
|
|
341
|
-
```
|
|
342
|
-
Create an execution plan for this story based on the technical solution.
|
|
343
|
-
|
|
344
|
-
STORY: {INIT.story.id} — {INIT.story.title}
|
|
345
|
-
|
|
346
|
-
ACCEPTANCE CRITERIA:
|
|
347
|
-
{extracted AC scenarios}
|
|
348
|
-
|
|
349
|
-
TECHNICAL SOLUTION:
|
|
350
|
-
{extracted technical solution}
|
|
351
|
-
|
|
352
|
-
RELEVANT WIKI:
|
|
353
|
-
{extracted wiki references}
|
|
354
|
-
|
|
355
|
-
CODING STANDARDS:
|
|
356
|
-
{full coding standards document}
|
|
357
|
-
|
|
358
|
-
OUT OF SCOPE:
|
|
359
|
-
{extracted out-of-scope items}
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
<plan-rules>
|
|
363
|
-
<rule>Follow the technical solution's component breakdown and sequence diagrams</rule>
|
|
364
|
-
<rule>Each task must map to one or more AC scenarios</rule>
|
|
365
|
-
<rule>Include verification steps (tests, build checks) after implementation tasks</rule>
|
|
366
|
-
<rule>Follow coding standards from wiki</rule>
|
|
367
|
-
<rule>DO NOT implement anything outside the AC scenarios (respect Out of Scope)</rule>
|
|
368
|
-
<rule>NO intermediary commits — all changes accumulate as working tree changes</rule>
|
|
369
|
-
<rule>ONE commit happens AFTER user approval at the end</rule>
|
|
370
|
-
</plan-rules>
|
|
371
|
-
|
|
372
|
-
<deviation-rules>
|
|
373
|
-
<rule id="1" name="Auto-fix Bugs" approval="auto">Broken behavior, errors, type errors, security → fix inline, track as [Rule 1 - Bug]</rule>
|
|
374
|
-
<rule id="2" name="Auto-add Missing Critical" approval="auto">Missing validation, error handling, auth → add, track as [Rule 2 - Missing Critical]</rule>
|
|
375
|
-
<rule id="3" name="Auto-fix Blocking" approval="auto">Missing deps, broken imports, build errors → fix, track as [Rule 3 - Blocking]</rule>
|
|
376
|
-
<rule id="4" name="Architectural Changes" approval="user">New DB tables, switching libraries, breaking API → STOP and ask user</rule>
|
|
377
|
-
</deviation-rules>
|
|
378
|
-
|
|
379
|
-
<self-verification>
|
|
380
|
-
After each significant step:
|
|
381
|
-
- Build check: run build command — must pass
|
|
382
|
-
- Test check: run relevant tests — must pass
|
|
383
|
-
- File existence: verify created files exist
|
|
384
|
-
- Import check: verify new modules are imported/used where expected
|
|
385
|
-
</self-verification>
|
|
386
|
-
</substep>
|
|
387
|
-
|
|
388
|
-
<substep order="2.6" name="solo-approve-plan" condition="EXECUTION_MODE is solo">
|
|
389
|
-
User approves the plan (standard Plan Mode approval flow via ExitPlanMode).
|
|
390
|
-
|
|
391
|
-
After plan approval, **read the plan file** that Plan Mode created.
|
|
392
|
-
Store its contents as `APPROVED_PLAN` — this will be passed to the executor agent.
|
|
393
|
-
|
|
394
|
-
Proceed to step 3b (solo execution via executor agent).
|
|
395
|
-
</substep>
|
|
396
|
-
|
|
397
|
-
<!-- ─────────────────────────────────────────────────── -->
|
|
398
|
-
<!-- AGENT TEAMS PATH: Main stays out of Plan Mode -->
|
|
399
|
-
<!-- Teammates plan their own work — lead approves -->
|
|
400
|
-
<!-- ─────────────────────────────────────────────────── -->
|
|
401
|
-
|
|
402
|
-
<substep order="2.7" name="teams-task-decomposition" condition="EXECUTION_MODE is agent-teams">
|
|
403
|
-
**Main does NOT enter Plan Mode.** The Technical Solution IS the high-level plan.
|
|
404
|
-
|
|
405
|
-
Decompose the Technical Solution into teammate assignments:
|
|
406
|
-
- Identify 2-4 independent work streams from the implementation phases/components
|
|
407
|
-
- Assign each stream to a teammate role (e.g., "state-layer", "ui-layer", "integration", "tests")
|
|
408
|
-
- Map AC scenarios to teammates (each AC must be covered by at least one teammate)
|
|
409
|
-
- Identify shared interfaces/contracts between teammates
|
|
410
|
-
- Identify task dependencies (which teammate's work blocks another)
|
|
411
|
-
|
|
412
|
-
Present the team composition to the user using AskUserQuestion:
|
|
413
|
-
- header: "Team"
|
|
414
|
-
- question: "Proposed agent team:\n\n{for each teammate: role, files owned, tasks, AC coverage}\n\nDoes this look right?"
|
|
415
|
-
- options:
|
|
416
|
-
- "Approve team" — create the team as proposed
|
|
417
|
-
- "Adjust" — I want to change the team composition
|
|
418
|
-
|
|
419
|
-
<variant condition="user chose Adjust">
|
|
420
|
-
Ask what they want to change → adjust → re-present.
|
|
421
|
-
</variant>
|
|
422
|
-
|
|
423
|
-
Proceed to step 3a (agent teams execution).
|
|
424
|
-
</substep>
|
|
425
|
-
|
|
426
|
-
</step>
|
|
427
|
-
|
|
428
|
-
<!-- ═══ CHECKPOINT: Step 2 MUST be complete. Execution mode MUST be chosen via AskUserQuestion. Plan MUST be approved (solo) or team MUST be approved (teams). ═══ -->
|
|
429
|
-
|
|
430
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
431
|
-
<!-- STEP 3a: AGENT TEAMS EXECUTION -->
|
|
432
|
-
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
433
|
-
|
|
434
|
-
<step name="agent-teams-execution" order="3a">
|
|
435
|
-
**This step only runs when agent teams mode is selected.**
|
|
436
|
-
**Main (lead) does NOT enter Plan Mode — teammates plan their own work.**
|
|
437
|
-
|
|
438
|
-
<substep order="3a.1" name="display-banner">
|
|
439
|
-
```
|
|
440
|
-
┌──────────────────────────────────────────────────┐
|
|
441
|
-
│ ACE > Execute Story > Agent Teams │
|
|
442
|
-
└──────────────────────────────────────────────────┘
|
|
443
|
-
|
|
444
|
-
i Creating agent team for story implementation...
|
|
445
|
-
```
|
|
446
|
-
</substep>
|
|
447
|
-
|
|
448
|
-
<substep order="3a.2" name="create-team">
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
<task>
|
|
496
|
-
<task>
|
|
497
|
-
<task>
|
|
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
|
-
<task>
|
|
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
|
-
Story
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
Story
|
|
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
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
<!--
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
{
|
|
860
|
-
|
|
861
|
-
###
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
<!--
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
<!-- ─────────────────────────────────────────────────── -->
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
```
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1
|
+
<workflow>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Orchestrate story execution: load a fully-planned story (with AC + Technical Solution),
|
|
5
|
+
create an execution plan via Claude Code Plan Mode, execute the plan (solo or agent teams),
|
|
6
|
+
run code review, present results for user verification, update state across all ACE
|
|
7
|
+
artifacts, and trigger wiki mapping.
|
|
8
|
+
|
|
9
|
+
The story file IS the plan — AC + Technical Solution = the specification.
|
|
10
|
+
Claude Code Plan Mode creates a tactical execution plan on top of that.
|
|
11
|
+
|
|
12
|
+
Two execution modes:
|
|
13
|
+
- **Solo Mode** (default): Main plans → executor subagent implements (fresh 200k context)
|
|
14
|
+
- **Agent Teams Mode** (when enabled + assessment recommends it): Lead + teammates for parallel work
|
|
15
|
+
|
|
16
|
+
NO intermediary commits during implementation. Only ONE commit after user approval.
|
|
17
|
+
</purpose>
|
|
18
|
+
|
|
19
|
+
<mandatory-context>
|
|
20
|
+
Read all files referenced by the invoking command's execution-context before starting.
|
|
21
|
+
Also read any document or text passed as parameter ($ARGUMENTS) in the invoking command.
|
|
22
|
+
</mandatory-context>
|
|
23
|
+
|
|
24
|
+
<process>
|
|
25
|
+
|
|
26
|
+
**STRICT STEP-BY-STEP EXECUTION. This workflow is NOT a reference document — it is a
|
|
27
|
+
script you MUST follow in order. Complete each step and ALL its substeps before moving
|
|
28
|
+
to the next step. Do NOT read ahead and freestyle. Do NOT explore the codebase or read
|
|
29
|
+
the story file before running the init command. Do NOT create your own plan or ask
|
|
30
|
+
"Shall I proceed?" — follow the workflow steps exactly as written.**
|
|
31
|
+
|
|
32
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
33
|
+
<!-- STEP 1: INIT & VALIDATE -->
|
|
34
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
35
|
+
|
|
36
|
+
<step name="init-and-validate" order="1">
|
|
37
|
+
|
|
38
|
+
**MANDATORY FIRST STEP — Run the init command (substep 1.2) BEFORE any other action.
|
|
39
|
+
Do NOT read the story file. Do NOT explore code. Do NOT start planning.
|
|
40
|
+
Run init FIRST, parse the output, THEN proceed through substeps 1.3-1.7 in order.**
|
|
41
|
+
|
|
42
|
+
<substep order="1.1" name="parse-arguments">
|
|
43
|
+
Parse `$ARGUMENTS` to extract:
|
|
44
|
+
- `story` (REQUIRED): file path or GitHub URL/issue number
|
|
45
|
+
- `--agent-teams-off` (OPTIONAL FLAG): force solo mode
|
|
46
|
+
</substep>
|
|
47
|
+
|
|
48
|
+
<substep order="1.2" name="run-init">
|
|
49
|
+
Execute environment detection:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
INIT=$(node ~/.claude/agile-context-engineering/src/ace-tools.js init execute-story {story_param})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Parse INIT JSON for:
|
|
56
|
+
- `executor_model`, `reviewer_model`
|
|
57
|
+
- `commit_docs`, `has_git`, `has_gh_cli`, `github_project`
|
|
58
|
+
- `agent_teams`
|
|
59
|
+
- `story_source`, `story_valid`, `story_error`, `story_content`
|
|
60
|
+
- `story` (id, title, status, size), `feature` (id, title), `epic` (id, title)
|
|
61
|
+
- `has_acceptance_criteria`, `acceptance_criteria_count`
|
|
62
|
+
- `has_technical_solution`, `has_wiki_refs`, `has_coding_standards`
|
|
63
|
+
- `paths.*`
|
|
64
|
+
</substep>
|
|
65
|
+
|
|
66
|
+
<substep order="1.3" name="display-banner">
|
|
67
|
+
```
|
|
68
|
+
╔══════════════════════════════════════════════════╗
|
|
69
|
+
║ ACE > Execute Story ║
|
|
70
|
+
╚══════════════════════════════════════════════════╝
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If `has_git` is false: `git init`
|
|
74
|
+
</substep>
|
|
75
|
+
|
|
76
|
+
<substep order="1.4" name="validate-story">
|
|
77
|
+
<validation-gate condition="INIT.story_valid is false">
|
|
78
|
+
Display `INIT.story_error` and STOP:
|
|
79
|
+
```
|
|
80
|
+
x {INIT.story_error}
|
|
81
|
+
Provide a valid story file path or GitHub issue.
|
|
82
|
+
```
|
|
83
|
+
</validation-gate>
|
|
84
|
+
|
|
85
|
+
<validation-gate condition="INIT.has_acceptance_criteria is false">
|
|
86
|
+
STOP:
|
|
87
|
+
```
|
|
88
|
+
x Story has no acceptance criteria.
|
|
89
|
+
Run /ace:plan-story first to define AC scenarios.
|
|
90
|
+
```
|
|
91
|
+
</validation-gate>
|
|
92
|
+
|
|
93
|
+
<validation-gate condition="INIT.has_technical_solution is false">
|
|
94
|
+
STOP:
|
|
95
|
+
```
|
|
96
|
+
x Story has no technical solution.
|
|
97
|
+
Run /ace:plan-story first to generate the technical solution.
|
|
98
|
+
```
|
|
99
|
+
</validation-gate>
|
|
100
|
+
|
|
101
|
+
<validation-gate condition="INIT.story.status is 'Done'">
|
|
102
|
+
STOP:
|
|
103
|
+
```
|
|
104
|
+
x Story is already marked as Done. Nothing to execute.
|
|
105
|
+
```
|
|
106
|
+
</validation-gate>
|
|
107
|
+
|
|
108
|
+
<validation-gate condition="INIT.story.status is 'DevReady'">
|
|
109
|
+
Story was previously implemented and approved as DevReady (pending manual testing).
|
|
110
|
+
Resuming from verification to allow promoting to Done.
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
i Story status: DevReady — previously implemented, pending verification.
|
|
114
|
+
Resuming from verification (step 5.2).
|
|
115
|
+
Skipping planning, execution, and code review.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Set `RESUME_FROM_DEVREADY = true`.
|
|
119
|
+
After displaying context (substep 1.7), jump DIRECTLY to step 5.2.
|
|
120
|
+
Skip substeps 1.5, 1.6 and steps 2, 3, 4, 5.1 entirely.
|
|
121
|
+
</validation-gate>
|
|
122
|
+
</substep>
|
|
123
|
+
|
|
124
|
+
<substep order="1.5" name="detect-existing-implementation">
|
|
125
|
+
First check if there are any uncommitted changes (staged or unstaged):
|
|
126
|
+
```bash
|
|
127
|
+
git status --short
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
<variant condition="git status output is EMPTY (no uncommitted changes)">
|
|
131
|
+
Fresh start — no uncommitted changes detected. Proceed normally to step 2.
|
|
132
|
+
</variant>
|
|
133
|
+
|
|
134
|
+
<variant condition="git status output is NOT EMPTY (uncommitted changes exist)">
|
|
135
|
+
Uncommitted changes detected. Check if they relate to this story's implementation.
|
|
136
|
+
|
|
137
|
+
Extract the list of expected files from the Technical Solution section
|
|
138
|
+
of the story file (component breakdown — file paths).
|
|
139
|
+
|
|
140
|
+
Check which of these files already exist in the working tree:
|
|
141
|
+
```bash
|
|
142
|
+
for file in [expected_files_from_technical_solution]; do
|
|
143
|
+
[ -f "$file" ] && echo "EXISTS: $file" || echo "MISSING: $file"
|
|
144
|
+
done
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
<variant condition="ALL expected files exist">
|
|
148
|
+
```
|
|
149
|
+
! Implementation appears complete — all expected files exist.
|
|
150
|
+
Uncommitted changes detected in working tree.
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Display the file check results (EXISTS/MISSING for each expected file).
|
|
154
|
+
|
|
155
|
+
Use AskUserQuestion:
|
|
156
|
+
- header: "Resume?"
|
|
157
|
+
- question: "All files from the Technical Solution already exist and there are uncommitted changes. Is the implementation done? Do you want to skip to code review (step 4)?"
|
|
158
|
+
- options:
|
|
159
|
+
- "Yes, skip to review" — Implementation is done, continue from step 4 (code review → approval → state → wiki → commit)
|
|
160
|
+
- "No, start fresh" — Plan and execute from scratch (I'll handle the working tree)
|
|
161
|
+
|
|
162
|
+
<option value="Yes, skip to review">
|
|
163
|
+
Skip steps 2 and 3 entirely.
|
|
164
|
+
Jump DIRECTLY to step 4 (code review).
|
|
165
|
+
</option>
|
|
166
|
+
<option value="No, start fresh">
|
|
167
|
+
Proceed normally from step 2 (user is responsible for cleaning working tree).
|
|
168
|
+
</option>
|
|
169
|
+
</variant>
|
|
170
|
+
|
|
171
|
+
<variant condition="SOME expected files exist (partial implementation)">
|
|
172
|
+
```
|
|
173
|
+
! Partial implementation detected — some expected files exist.
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Display the file check results (EXISTS/MISSING for each expected file).
|
|
177
|
+
|
|
178
|
+
Use AskUserQuestion:
|
|
179
|
+
- header: "Resume?"
|
|
180
|
+
- question: "Some files from the Technical Solution already exist. What would you like to do?"
|
|
181
|
+
- options:
|
|
182
|
+
- "Continue from plan" — Create a plan that accounts for existing files
|
|
183
|
+
- "Start fresh" — Plan and execute from scratch (I'll handle the working tree)
|
|
184
|
+
|
|
185
|
+
<option value="Continue from plan">
|
|
186
|
+
Proceed to step 2. The plan must account for already-existing files
|
|
187
|
+
and only implement what's missing.
|
|
188
|
+
</option>
|
|
189
|
+
<option value="Start fresh">
|
|
190
|
+
Proceed normally from step 2 (user is responsible for cleaning working tree).
|
|
191
|
+
</option>
|
|
192
|
+
</variant>
|
|
193
|
+
|
|
194
|
+
<variant condition="NO expected files from Technical Solution exist">
|
|
195
|
+
Uncommitted changes exist but none match expected story files.
|
|
196
|
+
Proceed normally to step 2.
|
|
197
|
+
</variant>
|
|
198
|
+
</variant>
|
|
199
|
+
</substep>
|
|
200
|
+
|
|
201
|
+
<substep order="1.6" name="resolve-agent-teams">
|
|
202
|
+
<rule condition="--agent-teams-off flag present">Set `USE_AGENT_TEAMS = false` regardless of setting.</rule>
|
|
203
|
+
<rule condition="flag not present">Set `USE_AGENT_TEAMS = INIT.agent_teams`.</rule>
|
|
204
|
+
</substep>
|
|
205
|
+
|
|
206
|
+
<substep order="1.7" name="display-context">
|
|
207
|
+
```
|
|
208
|
+
i Story: {INIT.story.id} — {INIT.story.title}
|
|
209
|
+
Feature: {INIT.feature.id} — {INIT.feature.title}
|
|
210
|
+
Status: {INIT.story.status} | Size: {INIT.story.size}
|
|
211
|
+
AC scenarios: {INIT.acceptance_criteria_count}
|
|
212
|
+
Technical solution: present
|
|
213
|
+
Agent teams: {USE_AGENT_TEAMS ? "enabled" : "disabled"}
|
|
214
|
+
```
|
|
215
|
+
</substep>
|
|
216
|
+
|
|
217
|
+
</step>
|
|
218
|
+
|
|
219
|
+
<!-- ═══ CHECKPOINT: Step 1 MUST be complete. Init MUST have run. Banner MUST be displayed. Context MUST be shown. ═══ -->
|
|
220
|
+
|
|
221
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
222
|
+
<!-- STEP 2: LOAD CONTEXT & CHOOSE EXECUTION MODE -->
|
|
223
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
224
|
+
|
|
225
|
+
<step name="load-and-decide" order="2">
|
|
226
|
+
|
|
227
|
+
<substep order="2.1" name="display-banner">
|
|
228
|
+
```
|
|
229
|
+
┌──────────────────────────────────────────────────┐
|
|
230
|
+
│ ACE > Execute Story > Planning │
|
|
231
|
+
└──────────────────────────────────────────────────┘
|
|
232
|
+
```
|
|
233
|
+
</substep>
|
|
234
|
+
|
|
235
|
+
<substep order="2.2" name="read-story-sections">
|
|
236
|
+
Read `INIT.paths.story_file` and extract:
|
|
237
|
+
- **Acceptance Criteria** — Gherkin scenarios (WHAT to build)
|
|
238
|
+
- **Technical Solution** — component breakdown, sequence diagrams (HOW)
|
|
239
|
+
- **Relevant Wiki** — file references for codebase context (WHERE)
|
|
240
|
+
- **Out of Scope** — explicit exclusions (what NOT to build)
|
|
241
|
+
- **Dependencies** — what must exist before this story
|
|
242
|
+
- **Definition of Done** — quality checklist
|
|
243
|
+
</substep>
|
|
244
|
+
|
|
245
|
+
<substep order="2.3" name="read-coding-standards">
|
|
246
|
+
<variant condition="INIT.has_coding_standards is true">
|
|
247
|
+
Read `INIT.paths.coding_standards` in full — coding standards are mandatory context.
|
|
248
|
+
</variant>
|
|
249
|
+
</substep>
|
|
250
|
+
|
|
251
|
+
<substep order="2.4" name="assess-and-choose-execution-mode">
|
|
252
|
+
**BEFORE any planning — analyze the story and ask the user to choose execution mode.**
|
|
253
|
+
|
|
254
|
+
Analyze the Technical Solution to assess complexity. Count ALL of the following signals:
|
|
255
|
+
|
|
256
|
+
<complexity-signals>
|
|
257
|
+
<signal weight="high" name="story-size">Story size >= 5 SP</signal>
|
|
258
|
+
<signal weight="high" name="file-count">Technical solution touches 6+ files</signal>
|
|
259
|
+
<signal weight="high" name="new-code-volume">Technical solution estimates 100+ new lines of code</signal>
|
|
260
|
+
<signal weight="high" name="implementation-phases">Technical solution defines 3+ implementation phases</signal>
|
|
261
|
+
<signal weight="medium" name="cross-cutting">Changes span multiple layers (state + UI + services + tests)</signal>
|
|
262
|
+
<signal weight="medium" name="complex-patterns">Story involves concurrency, cancellation, retry logic, race conditions, or state machines</signal>
|
|
263
|
+
<signal weight="medium" name="independent-components">Technical solution shows 3+ independent components that could be built in parallel</signal>
|
|
264
|
+
<signal weight="medium" name="ac-count">Story has 5+ acceptance criteria scenarios</signal>
|
|
265
|
+
<signal weight="low" name="multi-subsystem">Changes touch multiple backend/frontend subsystems via API calls</signal>
|
|
266
|
+
<signal weight="low" name="context-window-risk">Estimated implementation would exceed ~140k tokens (70% of 200k context)</signal>
|
|
267
|
+
</complexity-signals>
|
|
268
|
+
|
|
269
|
+
<assessment-rules>
|
|
270
|
+
**Recommend Agent Teams** when ANY of:
|
|
271
|
+
- 3+ HIGH signals present
|
|
272
|
+
- 2+ HIGH signals AND 2+ MEDIUM signals
|
|
273
|
+
- Story has independent components that can genuinely be built in parallel
|
|
274
|
+
|
|
275
|
+
**Recommend Solo** when:
|
|
276
|
+
- Mostly sequential work with tight dependencies between components
|
|
277
|
+
- Small story (1-3 SP) with few files
|
|
278
|
+
- Simple CRUD or single-file changes
|
|
279
|
+
|
|
280
|
+
**When in doubt → recommend Agent Teams.** It's better to have teammates
|
|
281
|
+
that finish early than a solo session that runs out of context window.
|
|
282
|
+
</assessment-rules>
|
|
283
|
+
|
|
284
|
+
**MANDATORY: Always present this choice to the user using AskUserQuestion — NEVER skip it, NEVER auto-decide.**
|
|
285
|
+
|
|
286
|
+
Present your complexity assessment summary, then ask:
|
|
287
|
+
|
|
288
|
+
<variant condition="USE_AGENT_TEAMS is true">
|
|
289
|
+
Use AskUserQuestion:
|
|
290
|
+
- header: "Execution"
|
|
291
|
+
- question: "How should this story be executed?\n\nComplexity: {count high/medium/low signals hit}\n{list the signals that matched}\n\nMy recommendation: {Solo|Agent Teams} because {reasoning}"
|
|
292
|
+
- options:
|
|
293
|
+
- "{Recommended option} (Recommended)" — with reasoning
|
|
294
|
+
- "{Other option}" — with reasoning
|
|
295
|
+
- The recommended option goes first with "(Recommended)" suffix
|
|
296
|
+
</variant>
|
|
297
|
+
|
|
298
|
+
<variant condition="USE_AGENT_TEAMS is false">
|
|
299
|
+
Agent teams are disabled by configuration. Use AskUserQuestion:
|
|
300
|
+
- header: "Execution"
|
|
301
|
+
- question: "Agent teams are disabled.\n\nComplexity: {count signals hit}\n{list the signals that matched}\n\nExecute in solo mode?"
|
|
302
|
+
- options:
|
|
303
|
+
- "Solo (Confirmed)" — proceed with solo execution
|
|
304
|
+
- "Enable Agent Teams" — I want agent teams for this story (override the setting)
|
|
305
|
+
|
|
306
|
+
<variant condition="user chose Enable Agent Teams">
|
|
307
|
+
Override: set `USE_AGENT_TEAMS = true` and re-present the full
|
|
308
|
+
Solo vs Agent Teams choice as in the variant above.
|
|
309
|
+
</variant>
|
|
310
|
+
</variant>
|
|
311
|
+
|
|
312
|
+
Store the user's choice as `EXECUTION_MODE` (solo | agent-teams).
|
|
313
|
+
</substep>
|
|
314
|
+
|
|
315
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
316
|
+
<!-- SOLO PATH: Main creates plan, executor agent runs -->
|
|
317
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
318
|
+
|
|
319
|
+
<substep order="2.5" name="solo-plan-mode" condition="EXECUTION_MODE is solo">
|
|
320
|
+
**BEFORE entering Plan Mode, display this highlighted warning to the user:**
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
324
|
+
┃ ⚠️ IMPORTANT — READ BEFORE EXITING PLAN MODE ┃
|
|
325
|
+
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
326
|
+
┃ ┃
|
|
327
|
+
┃ When Claude Code wants to exit plan mode, do NOT choose ┃
|
|
328
|
+
┃ the option with "clear context" no matter how filled ┃
|
|
329
|
+
┃ the context is! This will interrupt our command! ┃
|
|
330
|
+
┃ ┃
|
|
331
|
+
┃ The implementation in solo mode is done by a different ┃
|
|
332
|
+
┃ subagent with a fresh context window — no need to clear it. ┃
|
|
333
|
+
┃ ┃
|
|
334
|
+
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Enter Plan Mode using the EnterPlanMode tool.
|
|
338
|
+
|
|
339
|
+
Feed into Plan Mode context:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
Create an execution plan for this story based on the technical solution.
|
|
343
|
+
|
|
344
|
+
STORY: {INIT.story.id} — {INIT.story.title}
|
|
345
|
+
|
|
346
|
+
ACCEPTANCE CRITERIA:
|
|
347
|
+
{extracted AC scenarios}
|
|
348
|
+
|
|
349
|
+
TECHNICAL SOLUTION:
|
|
350
|
+
{extracted technical solution}
|
|
351
|
+
|
|
352
|
+
RELEVANT WIKI:
|
|
353
|
+
{extracted wiki references}
|
|
354
|
+
|
|
355
|
+
CODING STANDARDS:
|
|
356
|
+
{full coding standards document}
|
|
357
|
+
|
|
358
|
+
OUT OF SCOPE:
|
|
359
|
+
{extracted out-of-scope items}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
<plan-rules>
|
|
363
|
+
<rule>Follow the technical solution's component breakdown and sequence diagrams</rule>
|
|
364
|
+
<rule>Each task must map to one or more AC scenarios</rule>
|
|
365
|
+
<rule>Include verification steps (tests, build checks) after implementation tasks</rule>
|
|
366
|
+
<rule>Follow coding standards from wiki</rule>
|
|
367
|
+
<rule>DO NOT implement anything outside the AC scenarios (respect Out of Scope)</rule>
|
|
368
|
+
<rule>NO intermediary commits — all changes accumulate as working tree changes</rule>
|
|
369
|
+
<rule>ONE commit happens AFTER user approval at the end</rule>
|
|
370
|
+
</plan-rules>
|
|
371
|
+
|
|
372
|
+
<deviation-rules>
|
|
373
|
+
<rule id="1" name="Auto-fix Bugs" approval="auto">Broken behavior, errors, type errors, security → fix inline, track as [Rule 1 - Bug]</rule>
|
|
374
|
+
<rule id="2" name="Auto-add Missing Critical" approval="auto">Missing validation, error handling, auth → add, track as [Rule 2 - Missing Critical]</rule>
|
|
375
|
+
<rule id="3" name="Auto-fix Blocking" approval="auto">Missing deps, broken imports, build errors → fix, track as [Rule 3 - Blocking]</rule>
|
|
376
|
+
<rule id="4" name="Architectural Changes" approval="user">New DB tables, switching libraries, breaking API → STOP and ask user</rule>
|
|
377
|
+
</deviation-rules>
|
|
378
|
+
|
|
379
|
+
<self-verification>
|
|
380
|
+
After each significant step:
|
|
381
|
+
- Build check: run build command — must pass
|
|
382
|
+
- Test check: run relevant tests — must pass
|
|
383
|
+
- File existence: verify created files exist
|
|
384
|
+
- Import check: verify new modules are imported/used where expected
|
|
385
|
+
</self-verification>
|
|
386
|
+
</substep>
|
|
387
|
+
|
|
388
|
+
<substep order="2.6" name="solo-approve-plan" condition="EXECUTION_MODE is solo">
|
|
389
|
+
User approves the plan (standard Plan Mode approval flow via ExitPlanMode).
|
|
390
|
+
|
|
391
|
+
After plan approval, **read the plan file** that Plan Mode created.
|
|
392
|
+
Store its contents as `APPROVED_PLAN` — this will be passed to the executor agent.
|
|
393
|
+
|
|
394
|
+
Proceed to step 3b (solo execution via executor agent).
|
|
395
|
+
</substep>
|
|
396
|
+
|
|
397
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
398
|
+
<!-- AGENT TEAMS PATH: Main stays out of Plan Mode -->
|
|
399
|
+
<!-- Teammates plan their own work — lead approves -->
|
|
400
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
401
|
+
|
|
402
|
+
<substep order="2.7" name="teams-task-decomposition" condition="EXECUTION_MODE is agent-teams">
|
|
403
|
+
**Main does NOT enter Plan Mode.** The Technical Solution IS the high-level plan.
|
|
404
|
+
|
|
405
|
+
Decompose the Technical Solution into teammate assignments:
|
|
406
|
+
- Identify 2-4 independent work streams from the implementation phases/components
|
|
407
|
+
- Assign each stream to a teammate role (e.g., "state-layer", "ui-layer", "integration", "tests")
|
|
408
|
+
- Map AC scenarios to teammates (each AC must be covered by at least one teammate)
|
|
409
|
+
- Identify shared interfaces/contracts between teammates
|
|
410
|
+
- Identify task dependencies (which teammate's work blocks another)
|
|
411
|
+
|
|
412
|
+
Present the team composition to the user using AskUserQuestion:
|
|
413
|
+
- header: "Team"
|
|
414
|
+
- question: "Proposed agent team:\n\n{for each teammate: role, files owned, tasks, AC coverage}\n\nDoes this look right?"
|
|
415
|
+
- options:
|
|
416
|
+
- "Approve team" — create the team as proposed
|
|
417
|
+
- "Adjust" — I want to change the team composition
|
|
418
|
+
|
|
419
|
+
<variant condition="user chose Adjust">
|
|
420
|
+
Ask what they want to change → adjust → re-present.
|
|
421
|
+
</variant>
|
|
422
|
+
|
|
423
|
+
Proceed to step 3a (agent teams execution).
|
|
424
|
+
</substep>
|
|
425
|
+
|
|
426
|
+
</step>
|
|
427
|
+
|
|
428
|
+
<!-- ═══ CHECKPOINT: Step 2 MUST be complete. Execution mode MUST be chosen via AskUserQuestion. Plan MUST be approved (solo) or team MUST be approved (teams). ═══ -->
|
|
429
|
+
|
|
430
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
431
|
+
<!-- STEP 3a: AGENT TEAMS EXECUTION -->
|
|
432
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
433
|
+
|
|
434
|
+
<step name="agent-teams-execution" order="3a">
|
|
435
|
+
**This step only runs when agent teams mode is selected.**
|
|
436
|
+
**Main (lead) does NOT enter Plan Mode — teammates plan their own work.**
|
|
437
|
+
|
|
438
|
+
<substep order="3a.1" name="display-banner">
|
|
439
|
+
```
|
|
440
|
+
┌──────────────────────────────────────────────────┐
|
|
441
|
+
│ ACE > Execute Story > Agent Teams │
|
|
442
|
+
└──────────────────────────────────────────────────┘
|
|
443
|
+
|
|
444
|
+
i Creating agent team for story implementation...
|
|
445
|
+
```
|
|
446
|
+
</substep>
|
|
447
|
+
|
|
448
|
+
<substep order="3a.2" name="create-team">
|
|
449
|
+
**Safety net: if a leftover team exists from a crashed/interrupted previous run,
|
|
450
|
+
delete it first with TeamDelete before creating the new team.**
|
|
451
|
+
|
|
452
|
+
Create an agent team using the decomposition from step 2.7.
|
|
453
|
+
|
|
454
|
+
Tell Claude Code to create the team in natural language:
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
Create an agent team for implementing story {INIT.story.id} — {INIT.story.title}.
|
|
458
|
+
|
|
459
|
+
Teammates:
|
|
460
|
+
{For each teammate from the approved decomposition:}
|
|
461
|
+
N. "{role}" — {description of work}
|
|
462
|
+
Files owned: {list of files this teammate owns — NO overlap with other teammates}
|
|
463
|
+
Tasks: {task list from decomposition}
|
|
464
|
+
Require plan approval before they make any changes.
|
|
465
|
+
|
|
466
|
+
{If coding standards exist:}
|
|
467
|
+
N+1. "reviewer" — Review code written by other teammates
|
|
468
|
+
Watches for: TODOs, stubs, placeholders, hardcoded values, missing tests,
|
|
469
|
+
deviation from coding standards, missing error handling, dead code,
|
|
470
|
+
backwards-compatible shims.
|
|
471
|
+
Messages teammates directly when issues found.
|
|
472
|
+
Creates tasks in shared task list for issues requiring fixes.
|
|
473
|
+
Does a final sweep when all teammates are done.
|
|
474
|
+
|
|
475
|
+
All teammates must follow:
|
|
476
|
+
- Coding standards from {INIT.paths.coding_standards}
|
|
477
|
+
- Technical solution from story file
|
|
478
|
+
- NO intermediary commits — changes accumulate as working tree changes
|
|
479
|
+
- Deviation rules: auto-fix bugs/critical/blocking (Rules 1-3), STOP for architectural (Rule 4)
|
|
480
|
+
|
|
481
|
+
Only approve plans that:
|
|
482
|
+
- Follow the technical solution's component design exactly
|
|
483
|
+
- Include verification steps (build check, type check) after implementation
|
|
484
|
+
- Do NOT touch files owned by another teammate
|
|
485
|
+
- Map to AC scenarios from the story
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Each teammate enters plan mode automatically (via "Require plan approval").
|
|
489
|
+
The lead reviews and approves/rejects each teammate's plan autonomously.
|
|
490
|
+
</substep>
|
|
491
|
+
|
|
492
|
+
<substep order="3a.3" name="monitor-execution">
|
|
493
|
+
After plans are approved, teammates execute in parallel:
|
|
494
|
+
|
|
495
|
+
<task>Each teammate implements their approved plan</task>
|
|
496
|
+
<task>Teammates message each other for coordination on shared interfaces</task>
|
|
497
|
+
<task>Reviewer teammate monitors — checks code as it's written, messages others about issues</task>
|
|
498
|
+
<task>User can interact with any teammate via `Shift+Down`</task>
|
|
499
|
+
<task>If lead starts implementing tasks itself, tell it: "Wait for your teammates to complete their tasks before proceeding"</task>
|
|
500
|
+
<task>When all teammates idle → lead collects results</task>
|
|
501
|
+
</substep>
|
|
502
|
+
|
|
503
|
+
<substep order="3a.4" name="final-verification">
|
|
504
|
+
After all teammates complete:
|
|
505
|
+
<task>Run `git status` to see all changes</task>
|
|
506
|
+
<task>Run build + test suite to verify everything works together</task>
|
|
507
|
+
<task>If build/tests fail → coordinate fixes with relevant teammate</task>
|
|
508
|
+
|
|
509
|
+
Proceed to step 4 (reviewer teammate's final sweep serves as the review).
|
|
510
|
+
</substep>
|
|
511
|
+
|
|
512
|
+
</step>
|
|
513
|
+
|
|
514
|
+
<!-- ═══ CHECKPOINT: Step 3a runs ONLY if agent-teams mode was chosen. Otherwise skip to 3b. ═══ -->
|
|
515
|
+
|
|
516
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
517
|
+
<!-- STEP 3b: SOLO EXECUTION -->
|
|
518
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
519
|
+
|
|
520
|
+
<step name="solo-execution" order="3b">
|
|
521
|
+
**This step runs when solo mode is selected.**
|
|
522
|
+
**Main spawns an executor subagent with a FRESH context window.**
|
|
523
|
+
|
|
524
|
+
<substep order="3b.1" name="display-banner">
|
|
525
|
+
```
|
|
526
|
+
┌──────────────────────────────────────────────────┐
|
|
527
|
+
│ ACE > Execute Story > Implementing │
|
|
528
|
+
└──────────────────────────────────────────────────┘
|
|
529
|
+
|
|
530
|
+
i Spawning executor agent with fresh context...
|
|
531
|
+
```
|
|
532
|
+
</substep>
|
|
533
|
+
|
|
534
|
+
<substep order="3b.2" name="spawn-executor-agent">
|
|
535
|
+
Spawn a subagent to execute the approved plan in a **fresh 200k context window**.
|
|
536
|
+
The main session's context is preserved for post-implementation steps (review, state, wiki).
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
Agent(
|
|
540
|
+
prompt="You are the ACE Story Executor. Implement this story by following
|
|
541
|
+
the approved execution plan EXACTLY.
|
|
542
|
+
|
|
543
|
+
STORY: {INIT.story.id} — {INIT.story.title}
|
|
544
|
+
STORY FILE: {INIT.paths.story_file}
|
|
545
|
+
|
|
546
|
+
Read the story file to get the full Acceptance Criteria and Technical Solution.
|
|
547
|
+
|
|
548
|
+
{If INIT.has_coding_standards:}
|
|
549
|
+
CODING STANDARDS: {INIT.paths.coding_standards}
|
|
550
|
+
Read coding standards in full before starting implementation.
|
|
551
|
+
|
|
552
|
+
APPROVED EXECUTION PLAN:
|
|
553
|
+
{APPROVED_PLAN}
|
|
554
|
+
|
|
555
|
+
RULES:
|
|
556
|
+
- Follow the plan step by step — do NOT skip steps or reorder
|
|
557
|
+
- After each significant step: run build check + test check
|
|
558
|
+
- NO commits — all changes stay as working tree changes
|
|
559
|
+
- Auto-fix bugs, missing critical code, and blocking issues (Rules 1-3)
|
|
560
|
+
- For architectural changes beyond story scope (Rule 4): STOP and include
|
|
561
|
+
in your return report — main will ask the user
|
|
562
|
+
- Respect Out of Scope — do NOT implement anything not in the AC
|
|
563
|
+
|
|
564
|
+
SELF-VERIFICATION (after ALL implementation is complete):
|
|
565
|
+
- Verify all key files from the plan exist
|
|
566
|
+
- Run full build — must pass
|
|
567
|
+
- Run full test suite — must pass
|
|
568
|
+
- If verification fails, fix before returning
|
|
569
|
+
|
|
570
|
+
**Return format — ONLY this, nothing else:**
|
|
571
|
+
IMPLEMENTATION COMPLETE
|
|
572
|
+
- Files created: {list}
|
|
573
|
+
- Files modified: {list}
|
|
574
|
+
- Build: {pass/fail}
|
|
575
|
+
- Tests: {pass/fail — include test command and result}
|
|
576
|
+
- Deviations: {list of [Rule N] deviations, or 'None'}
|
|
577
|
+
- Rule 4 blockers: {list of architectural issues needing user decision, or 'None'}
|
|
578
|
+
- Notes: {anything the main session needs to know}",
|
|
579
|
+
subagent_type="general-purpose",
|
|
580
|
+
model="{INIT.executor_model}",
|
|
581
|
+
description="Execute {INIT.story.id}"
|
|
582
|
+
)
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
Parse the executor's return report.
|
|
586
|
+
</substep>
|
|
587
|
+
|
|
588
|
+
<substep order="3b.3" name="handle-executor-result">
|
|
589
|
+
<variant condition="Rule 4 blockers reported">
|
|
590
|
+
The executor hit architectural issues it couldn't auto-resolve.
|
|
591
|
+
Present each blocker to the user:
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
! Executor reported architectural issue(s) requiring your decision:
|
|
595
|
+
|
|
596
|
+
{For each Rule 4 blocker:}
|
|
597
|
+
? {description}
|
|
598
|
+
Proposed change: {what the executor wants to do}
|
|
599
|
+
Impact: {what it affects}
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
Use AskUserQuestion for each blocker:
|
|
603
|
+
- header: "Rule 4"
|
|
604
|
+
- question: "{blocker description} — approve this change?"
|
|
605
|
+
- options:
|
|
606
|
+
- "Approve" — allow the change
|
|
607
|
+
- "Reject" — find an alternative approach
|
|
608
|
+
- "Reject and stop" — stop implementation entirely
|
|
609
|
+
|
|
610
|
+
If approved: spawn a follow-up executor agent to apply the approved changes.
|
|
611
|
+
If rejected: spawn a follow-up executor agent with alternative instructions.
|
|
612
|
+
If stopped: proceed to step 5 with partial implementation for user review.
|
|
613
|
+
</variant>
|
|
614
|
+
|
|
615
|
+
<variant condition="Build or tests failed">
|
|
616
|
+
```
|
|
617
|
+
x Executor reported build/test failures.
|
|
618
|
+
Spawning follow-up agent to fix...
|
|
619
|
+
```
|
|
620
|
+
Spawn a follow-up executor agent focused on fixing the failures.
|
|
621
|
+
Include the failure output in the prompt.
|
|
622
|
+
</variant>
|
|
623
|
+
|
|
624
|
+
<variant condition="All clear — implementation complete">
|
|
625
|
+
Proceed to step 4 (code review).
|
|
626
|
+
</variant>
|
|
627
|
+
</substep>
|
|
628
|
+
|
|
629
|
+
<substep order="3b.4" name="no-intermediary-commits">
|
|
630
|
+
**CRITICAL: Do NOT commit during implementation.**
|
|
631
|
+
All changes accumulate as working tree changes (unstaged/staged).
|
|
632
|
+
Only ONE commit happens after user approval in step 5.
|
|
633
|
+
|
|
634
|
+
Store the executor's deviation list for the Summary & State section.
|
|
635
|
+
</substep>
|
|
636
|
+
|
|
637
|
+
</step>
|
|
638
|
+
|
|
639
|
+
<!-- ═══ CHECKPOINT: Implementation MUST be complete (step 3a or 3b). Executor report MUST be parsed. ═══ -->
|
|
640
|
+
|
|
641
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
642
|
+
<!-- STEP 4: CODE REVIEW -->
|
|
643
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
644
|
+
|
|
645
|
+
<step name="code-review" order="4">
|
|
646
|
+
|
|
647
|
+
<substep order="4.1" name="display-banner">
|
|
648
|
+
```
|
|
649
|
+
┌──────────────────────────────────────────────────┐
|
|
650
|
+
│ ACE > Execute Story > Code Review │
|
|
651
|
+
└──────────────────────────────────────────────────┘
|
|
652
|
+
|
|
653
|
+
i Running code review...
|
|
654
|
+
```
|
|
655
|
+
</substep>
|
|
656
|
+
|
|
657
|
+
<substep order="4.2" name="determine-review-mode">
|
|
658
|
+
<variant condition="Agent Teams mode">
|
|
659
|
+
The reviewer teammate's final sweep serves as the review.
|
|
660
|
+
Skip the subagent spawn — use the reviewer teammate's report.
|
|
661
|
+
If the reviewer has already flagged and resolved all issues, proceed to step 5.
|
|
662
|
+
</variant>
|
|
663
|
+
|
|
664
|
+
<variant condition="Solo mode">
|
|
665
|
+
Dispatch /ace:review-story as a subagent (see substep 4.3).
|
|
666
|
+
</variant>
|
|
667
|
+
</substep>
|
|
668
|
+
|
|
669
|
+
<substep order="4.3" name="dispatch-review-story">
|
|
670
|
+
**Solo mode only.** Dispatch the review-story command:
|
|
671
|
+
|
|
672
|
+
```
|
|
673
|
+
Agent(
|
|
674
|
+
prompt="/ace:review-story story={INIT.paths.story_file}
|
|
675
|
+
|
|
676
|
+
Execute the review-story workflow end-to-end.
|
|
677
|
+
|
|
678
|
+
**Return format — ONLY this, nothing else:**
|
|
679
|
+
REVIEW COMPLETE
|
|
680
|
+
Status: {passed | issues_found}
|
|
681
|
+
- Blockers: {count}
|
|
682
|
+
- Warnings: {count}
|
|
683
|
+
- Files reviewed: {count}
|
|
684
|
+
- Artifacts verified: {passed}/{total} (3-level)
|
|
685
|
+
- AC coverage: {covered}/{total} scenarios
|
|
686
|
+
- Tech debt items discovered: {count}
|
|
687
|
+
|
|
688
|
+
[Blocker list with file:line, description, severity, suggested fix]
|
|
689
|
+
[Warning list with file:line, description, severity, suggested fix]
|
|
690
|
+
[Tech debt list in YAML format]",
|
|
691
|
+
subagent_type="ace-code-reviewer",
|
|
692
|
+
model="{INIT.reviewer_model}",
|
|
693
|
+
description="Code review for {INIT.story.id}"
|
|
694
|
+
)
|
|
695
|
+
```
|
|
696
|
+
</substep>
|
|
697
|
+
|
|
698
|
+
<substep order="4.4" name="fix-verify-loop">
|
|
699
|
+
**If blockers found → auto-fix cycle:**
|
|
700
|
+
|
|
701
|
+
<loop max-iterations="3">
|
|
702
|
+
<task>Review reports blockers</task>
|
|
703
|
+
<task>Fix them (deviation rules 1-3 apply — most blocker fixes are auto-approved)</task>
|
|
704
|
+
<task>Re-run review (focused on previously-failed items only)</task>
|
|
705
|
+
<task>Repeat until zero blockers</task>
|
|
706
|
+
</loop>
|
|
707
|
+
|
|
708
|
+
<escalation condition="blockers persist after 3 rounds">
|
|
709
|
+
Escalate to user (Rule 4 behavior).
|
|
710
|
+
</escalation>
|
|
711
|
+
|
|
712
|
+
Warnings don't block — they're presented to user alongside verification.
|
|
713
|
+
Each fix round is tracked as a deviation in the summary.
|
|
714
|
+
Store the code review results (including tech debt YAML) for later steps.
|
|
715
|
+
</substep>
|
|
716
|
+
|
|
717
|
+
</step>
|
|
718
|
+
|
|
719
|
+
<!-- ═══ CHECKPOINT: Code review MUST be complete with zero blockers before proceeding. ═══ -->
|
|
720
|
+
|
|
721
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
722
|
+
<!-- STEP 5: USER VERIFICATION & COMMIT -->
|
|
723
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
724
|
+
|
|
725
|
+
<step name="user-verification" order="5">
|
|
726
|
+
|
|
727
|
+
<substep order="5.1" name="display-verification">
|
|
728
|
+
<variant condition="RESUME_FROM_DEVREADY is true">
|
|
729
|
+
```
|
|
730
|
+
╔══════════════════════════════════════════════════╗
|
|
731
|
+
║ ACE > Execute Story > Verification ║
|
|
732
|
+
╚══════════════════════════════════════════════════╝
|
|
733
|
+
|
|
734
|
+
Story: {INIT.story.id} — {INIT.story.title}
|
|
735
|
+
|
|
736
|
+
Previously implemented and marked DevReady.
|
|
737
|
+
Ready to promote to Done after manual verification.
|
|
738
|
+
```
|
|
739
|
+
</variant>
|
|
740
|
+
|
|
741
|
+
<variant condition="RESUME_FROM_DEVREADY is false (normal execution)">
|
|
742
|
+
```
|
|
743
|
+
╔══════════════════════════════════════════════════╗
|
|
744
|
+
║ ACE > Execute Story > Verification ║
|
|
745
|
+
╚══════════════════════════════════════════════════╝
|
|
746
|
+
|
|
747
|
+
Story: {INIT.story.id} — {INIT.story.title}
|
|
748
|
+
|
|
749
|
+
Implementation complete. Please verify:
|
|
750
|
+
|
|
751
|
+
Acceptance Criteria Walkthrough:
|
|
752
|
+
────────────────────────────────
|
|
753
|
+
1. ✓ {scenario name} — [auto-verified: tests pass]
|
|
754
|
+
2. ? {scenario name} — [needs manual check: {instructions}]
|
|
755
|
+
...
|
|
756
|
+
|
|
757
|
+
Code Review Results:
|
|
758
|
+
────────────────────
|
|
759
|
+
✓ No blockers found
|
|
760
|
+
{⚠ N warning(s): {brief descriptions}}
|
|
761
|
+
|
|
762
|
+
Deviations:
|
|
763
|
+
────────────
|
|
764
|
+
{deviation list or "None — plan executed as written"}
|
|
765
|
+
```
|
|
766
|
+
</variant>
|
|
767
|
+
</substep>
|
|
768
|
+
|
|
769
|
+
<substep order="5.2" name="ask-user">
|
|
770
|
+
<variant condition="RESUME_FROM_DEVREADY is true">
|
|
771
|
+
Use AskUserQuestion:
|
|
772
|
+
- header: "Verify"
|
|
773
|
+
- question: "Story was previously implemented as DevReady. Has manual testing passed?"
|
|
774
|
+
- options:
|
|
775
|
+
- "Approve (Done)" — Manual testing passed, promote to Done
|
|
776
|
+
- "Fix issues" — Something still needs to be changed
|
|
777
|
+
|
|
778
|
+
<option value="Fix issues">
|
|
779
|
+
Ask what needs fixing → apply fixes (deviation rules apply) →
|
|
780
|
+
return to this verification prompt.
|
|
781
|
+
</option>
|
|
782
|
+
|
|
783
|
+
<option value="Approve (Done)">
|
|
784
|
+
Set `FINAL_STATUS = Done`.
|
|
785
|
+
Proceed to step 6 (state updates) → step 7 (wiki + commit).
|
|
786
|
+
</option>
|
|
787
|
+
</variant>
|
|
788
|
+
|
|
789
|
+
<variant condition="RESUME_FROM_DEVREADY is false (normal execution)">
|
|
790
|
+
Use AskUserQuestion:
|
|
791
|
+
- header: "Verify"
|
|
792
|
+
- question: "Implementation and code review complete. Does everything look correct?"
|
|
793
|
+
- options:
|
|
794
|
+
- "Approve (Done)" — All AC verified, mark story as Done
|
|
795
|
+
- "Approve (DevReady)" — Implementation done but I need to test manually first
|
|
796
|
+
- "Fix issues" — Something needs to be changed
|
|
797
|
+
|
|
798
|
+
<option value="Fix issues">
|
|
799
|
+
Ask what needs fixing → apply fixes (deviation rules apply) →
|
|
800
|
+
re-run code review (focused) → return to verification prompt.
|
|
801
|
+
</option>
|
|
802
|
+
|
|
803
|
+
<option value="Approve (Done)">
|
|
804
|
+
Set `FINAL_STATUS = Done`.
|
|
805
|
+
Proceed to step 6 (state updates) → step 7 (wiki + commit).
|
|
806
|
+
</option>
|
|
807
|
+
|
|
808
|
+
<option value="Approve (DevReady)">
|
|
809
|
+
Set `FINAL_STATUS = DevReady`.
|
|
810
|
+
|
|
811
|
+
Present manual testing instructions:
|
|
812
|
+
```
|
|
813
|
+
! Manual testing required before wiki mapping.
|
|
814
|
+
The following scenarios need manual verification:
|
|
815
|
+
|
|
816
|
+
{For each AC scenario that was NOT auto-verified by tests:}
|
|
817
|
+
? {scenario name}
|
|
818
|
+
How to test: {step-by-step manual test instructions}
|
|
819
|
+
|
|
820
|
+
After testing, run /ace:execute-story again with this story.
|
|
821
|
+
It will detect DevReady status and skip directly to verification.
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
**DevReady path: skip wiki, commit code + state only.**
|
|
825
|
+
Proceed to step 6 (state updates) → step 7.6 (commit) directly.
|
|
826
|
+
Do NOT run step 7.1-7.5 (wiki mapping) — the code may still change
|
|
827
|
+
after manual testing. Wiki mapping happens when the story reaches Done.
|
|
828
|
+
</option>
|
|
829
|
+
</variant>
|
|
830
|
+
</substep>
|
|
831
|
+
|
|
832
|
+
</step>
|
|
833
|
+
|
|
834
|
+
<!-- ═══ CHECKPOINT: User MUST have approved via AskUserQuestion (Done or DevReady). ═══ -->
|
|
835
|
+
|
|
836
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
837
|
+
<!-- STEP 6: STATE UPDATES -->
|
|
838
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
839
|
+
|
|
840
|
+
<step name="state-updates" order="6">
|
|
841
|
+
|
|
842
|
+
<substep order="6.1" name="display-banner">
|
|
843
|
+
```
|
|
844
|
+
┌──────────────────────────────────────────────────┐
|
|
845
|
+
│ ACE > Execute Story > State Updates │
|
|
846
|
+
└──────────────────────────────────────────────────┘
|
|
847
|
+
```
|
|
848
|
+
</substep>
|
|
849
|
+
|
|
850
|
+
<substep order="6.2" name="write-summary-section">
|
|
851
|
+
Write `## Summary & State` section into the story file at the
|
|
852
|
+
`<section name="summary-and-state">` location:
|
|
853
|
+
|
|
854
|
+
```markdown
|
|
855
|
+
## Summary & State
|
|
856
|
+
|
|
857
|
+
**Status**: {FINAL_STATUS}
|
|
858
|
+
**Executed**: {current date YYYY-MM-DD}
|
|
859
|
+
**Duration**: {execution duration}
|
|
860
|
+
|
|
861
|
+
### Implementation Summary
|
|
862
|
+
{Substantive one-liner — e.g., "OAuth buttons with Google/GitHub using next-auth providers"}
|
|
863
|
+
|
|
864
|
+
### Commits
|
|
865
|
+
| # | Hash | Type | Description |
|
|
866
|
+
|---|---------|----------|--------------------------------------|
|
|
867
|
+
| 1 | {hash} | feat | {description} |
|
|
868
|
+
|
|
869
|
+
### Deviations
|
|
870
|
+
{None — plan executed as written}
|
|
871
|
+
OR
|
|
872
|
+
{1. [Rule N] description of deviation}
|
|
873
|
+
|
|
874
|
+
### Code Review
|
|
875
|
+
- Blockers found: {count} (all resolved)
|
|
876
|
+
- Warnings: {count}
|
|
877
|
+
- AC coverage: {covered}/{total} scenarios
|
|
878
|
+
- Tech debt discovered: {count} items
|
|
879
|
+
```
|
|
880
|
+
</substep>
|
|
881
|
+
|
|
882
|
+
<substep order="6.3" name="update-state-via-tools">
|
|
883
|
+
```bash
|
|
884
|
+
node ~/.claude/agile-context-engineering/src/ace-tools.js story update-state \
|
|
885
|
+
story={INIT.paths.story_file} \
|
|
886
|
+
status={FINAL_STATUS}
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
Parse result for: `story_updated`, `feature_updated`, `backlog_updated`, `feature_status_changed`.
|
|
890
|
+
|
|
891
|
+
```
|
|
892
|
+
+ Story status updated to {FINAL_STATUS}
|
|
893
|
+
{+ Feature file updated (if feature_updated)}
|
|
894
|
+
{+ Product backlog updated (if backlog_updated)}
|
|
895
|
+
{+ Feature status changed to Done! (if feature_status_changed)}
|
|
896
|
+
```
|
|
897
|
+
</substep>
|
|
898
|
+
|
|
899
|
+
<substep order="6.4" name="update-github">
|
|
900
|
+
<variant condition="INIT.github_project.enabled is false OR INIT.has_gh_cli is false">
|
|
901
|
+
```
|
|
902
|
+
— GitHub sync skipped (not configured or gh CLI unavailable).
|
|
903
|
+
```
|
|
904
|
+
</variant>
|
|
905
|
+
|
|
906
|
+
<variant condition="INIT.github_project.enabled is true AND INIT.has_gh_cli is true">
|
|
907
|
+
Sync story and feature GitHub issues in a single call.
|
|
908
|
+
This command prints status lines directly to the console (stderr)
|
|
909
|
+
so the user ALWAYS sees whether each issue was updated or not.
|
|
910
|
+
|
|
911
|
+
```bash
|
|
912
|
+
node ~/.claude/agile-context-engineering/src/ace-tools.js github sync-story \
|
|
913
|
+
repo={INIT.github_project.repo} \
|
|
914
|
+
story_file={INIT.paths.story_file} \
|
|
915
|
+
feature_file={INIT.paths.feature_file} \
|
|
916
|
+
owner={INIT.github_project.owner} \
|
|
917
|
+
project={INIT.github_project.project_number}
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
The command handles all cases:
|
|
921
|
+
- Story/feature has no GitHub issue linked → prints skip message
|
|
922
|
+
- Update succeeds → prints success message with issue number
|
|
923
|
+
- Update fails → prints error message with details
|
|
924
|
+
</variant>
|
|
925
|
+
</substep>
|
|
926
|
+
|
|
927
|
+
</step>
|
|
928
|
+
|
|
929
|
+
<!-- ═══ CHECKPOINT: State updates MUST be complete (story, feature, backlog, GitHub). ═══ -->
|
|
930
|
+
|
|
931
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
932
|
+
<!-- STEP 7: WIKI UPDATE -->
|
|
933
|
+
<!-- ══════════════════════════════════════════════════════════════════ -->
|
|
934
|
+
|
|
935
|
+
<step name="wiki-and-commit" order="7">
|
|
936
|
+
|
|
937
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
938
|
+
<!-- WIKI MAPPING: Only when FINAL_STATUS = Done -->
|
|
939
|
+
<!-- DevReady skips straight to commit (7.6) -->
|
|
940
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
941
|
+
|
|
942
|
+
<substep order="7.1" name="display-banner" condition="FINAL_STATUS is Done">
|
|
943
|
+
```
|
|
944
|
+
┌──────────────────────────────────────────────────┐
|
|
945
|
+
│ ACE > Execute Story > Wiki Update │
|
|
946
|
+
└──────────────────────────────────────────────────┘
|
|
947
|
+
|
|
948
|
+
i Wiki mapper running (background agent)...
|
|
949
|
+
```
|
|
950
|
+
</substep>
|
|
951
|
+
|
|
952
|
+
<substep order="7.2" name="dispatch-map-story" condition="FINAL_STATUS is Done">
|
|
953
|
+
Dispatch /ace:map-story as a background agent.
|
|
954
|
+
Pass tech debt from the code review output as a parameter — map-story
|
|
955
|
+
handles all tech debt integration (wiki docs + index).
|
|
956
|
+
|
|
957
|
+
**CRITICAL — Context Window Protection:**
|
|
958
|
+
The agent writes directly to wiki files and returns ONLY a confirmation.
|
|
959
|
+
Do NOT call TaskOutput on the background agent — it pollutes the main context.
|
|
960
|
+
|
|
961
|
+
```
|
|
962
|
+
Agent(
|
|
963
|
+
prompt="/ace:map-story story-context={INIT.paths.story_file} tech-debt=\"{tech_debt_yaml from code review output}\"
|
|
964
|
+
|
|
965
|
+
Execute the map-story workflow end-to-end.
|
|
966
|
+
|
|
967
|
+
**Return format — ONLY this, nothing else:**
|
|
968
|
+
WIKI UPDATE COMPLETE
|
|
969
|
+
- Updated: {list of updated wiki docs}
|
|
970
|
+
- Created: {list of new wiki docs}
|
|
971
|
+
- Tech debt integrated: {count} items across {count} wiki docs
|
|
972
|
+
- No change needed: {list}
|
|
973
|
+
WALKTHROUGH SUGGESTIONS
|
|
974
|
+
- FLOW: {flow description} | SUBSYSTEM: {name} | EMPHASIS: {frameworks or none} | REASON: {why}
|
|
975
|
+
[or: WALKTHROUGH SUGGESTIONS: none]",
|
|
976
|
+
subagent_type="ace-wiki-mapper",
|
|
977
|
+
run_in_background=true,
|
|
978
|
+
description="Wiki update for {INIT.story.id}"
|
|
979
|
+
)
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
Store the agent task ID as `WIKI_TASK`.
|
|
983
|
+
</substep>
|
|
984
|
+
|
|
985
|
+
<substep order="7.3" name="wait-for-wiki-completion" condition="FINAL_STATUS is Done">
|
|
986
|
+
**BLOCKING WAIT — Do NOT proceed to substep 7.4 until the wiki mapper has finished.**
|
|
987
|
+
|
|
988
|
+
Poll using TaskGet until the background agent completes:
|
|
989
|
+
```
|
|
990
|
+
Loop (max 60 iterations, 10 second intervals):
|
|
991
|
+
TaskGet(id=WIKI_TASK)
|
|
992
|
+
If status is "completed" → break, proceed to 7.4
|
|
993
|
+
If status is "failed" → log warning, proceed to 7.4 (commit without wiki)
|
|
994
|
+
Otherwise → continue polling
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
Once complete, verify wiki files exist:
|
|
998
|
+
```bash
|
|
999
|
+
git status --short .docs/wiki/
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
Read the agent result to extract walkthrough suggestions. The return format
|
|
1003
|
+
is compact — it will NOT pollute the context window.
|
|
1004
|
+
|
|
1005
|
+
Parse the result for the `WALKTHROUGH SUGGESTIONS` section.
|
|
1006
|
+
Store as WALKTHROUGH_SUGGESTIONS (list of { flow, subsystem, emphasis, reason }).
|
|
1007
|
+
If "none" or not found, set WALKTHROUGH_SUGGESTIONS = empty.
|
|
1008
|
+
</substep>
|
|
1009
|
+
|
|
1010
|
+
<substep order="7.4" name="write-wiki-updates-section" condition="FINAL_STATUS is Done">
|
|
1011
|
+
Write `## Wiki Updates` section into the story file:
|
|
1012
|
+
|
|
1013
|
+
```markdown
|
|
1014
|
+
## Wiki Updates
|
|
1015
|
+
|
|
1016
|
+
**Updated**: {current date}
|
|
1017
|
+
|
|
1018
|
+
| Document | Action | Path |
|
|
1019
|
+
|----------|--------|------|
|
|
1020
|
+
| {doc name} | Updated | {path} |
|
|
1021
|
+
| {doc name} | Created | {path} |
|
|
1022
|
+
| {doc name} | No change | {path} |
|
|
1023
|
+
```
|
|
1024
|
+
</substep>
|
|
1025
|
+
|
|
1026
|
+
<substep order="7.5" name="update-github-with-wiki" condition="FINAL_STATUS is Done">
|
|
1027
|
+
<variant condition="INIT.github_project.enabled is true AND INIT.has_gh_cli is true">
|
|
1028
|
+
Update GitHub issues again (story file now includes the Wiki Updates section):
|
|
1029
|
+
|
|
1030
|
+
```bash
|
|
1031
|
+
node ~/.claude/agile-context-engineering/src/ace-tools.js github sync-story \
|
|
1032
|
+
repo={INIT.github_project.repo} \
|
|
1033
|
+
story_file={INIT.paths.story_file} \
|
|
1034
|
+
feature_file={INIT.paths.feature_file} \
|
|
1035
|
+
owner={INIT.github_project.owner} \
|
|
1036
|
+
project={INIT.github_project.project_number}
|
|
1037
|
+
```
|
|
1038
|
+
</variant>
|
|
1039
|
+
</substep>
|
|
1040
|
+
|
|
1041
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
1042
|
+
<!-- WALKTHROUGHS: Offer suggestions from map-story -->
|
|
1043
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
1044
|
+
|
|
1045
|
+
<substep order="7.5.1" name="offer-walkthroughs" condition="FINAL_STATUS is Done AND WALKTHROUGH_SUGGESTIONS is not empty">
|
|
1046
|
+
Present walkthrough suggestions to the user.
|
|
1047
|
+
|
|
1048
|
+
Display:
|
|
1049
|
+
```
|
|
1050
|
+
i Potential walkthroughs detected from this story's code:
|
|
1051
|
+
|
|
1052
|
+
[For each suggestion, numbered:]
|
|
1053
|
+
[N]. [flow description]
|
|
1054
|
+
Subsystem: [subsystem] | Emphasis: [frameworks or "none"]
|
|
1055
|
+
[reason]
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
Use AskUserQuestion:
|
|
1059
|
+
- header: "Walkthroughs"
|
|
1060
|
+
- question: "Would you like to create any of these walkthroughs?\nYou can also describe your own."
|
|
1061
|
+
- options:
|
|
1062
|
+
- "Create [numbers]" — e.g., "Create 1,3" or "Create all"
|
|
1063
|
+
- "Custom" — user describes their own walkthrough
|
|
1064
|
+
- "Skip" — no walkthroughs
|
|
1065
|
+
|
|
1066
|
+
**If "Skip":** Continue to commit.
|
|
1067
|
+
|
|
1068
|
+
**If "Create [numbers]" or "Create all":**
|
|
1069
|
+
For each selected suggestion, spawn a background agent:
|
|
1070
|
+
|
|
1071
|
+
```
|
|
1072
|
+
Agent(
|
|
1073
|
+
prompt="/ace:map-walkthrough flow=\"{suggestion.flow}\" subsystem=\"{suggestion.subsystem}\" emphasis-frameworks=\"{suggestion.emphasis}\"
|
|
1074
|
+
|
|
1075
|
+
Execute the map-walkthrough workflow end-to-end.",
|
|
1076
|
+
subagent_type="ace-wiki-mapper",
|
|
1077
|
+
run_in_background=true,
|
|
1078
|
+
description="Walkthrough: {short flow name}"
|
|
1079
|
+
)
|
|
1080
|
+
```
|
|
1081
|
+
|
|
1082
|
+
**If "Custom":**
|
|
1083
|
+
Ask the user for their flow description, subsystem, and optional emphasis-frameworks.
|
|
1084
|
+
Spawn a background agent for that walkthrough too.
|
|
1085
|
+
|
|
1086
|
+
Wait for all walkthrough agents to complete.
|
|
1087
|
+
|
|
1088
|
+
Display:
|
|
1089
|
+
```
|
|
1090
|
+
+ [N] walkthrough(s) created.
|
|
1091
|
+
[For each: path and line count]
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
Stage walkthrough files:
|
|
1095
|
+
```bash
|
|
1096
|
+
git add .docs/wiki/subsystems/*/walkthroughs/
|
|
1097
|
+
```
|
|
1098
|
+
</substep>
|
|
1099
|
+
|
|
1100
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
1101
|
+
<!-- COMMIT: Always runs (both Done and DevReady) -->
|
|
1102
|
+
<!-- ─────────────────────────────────────────────────── -->
|
|
1103
|
+
|
|
1104
|
+
<substep order="7.6" name="create-story-commit">
|
|
1105
|
+
**ONE single commit for the entire story — code + state {+ wiki if Done}.**
|
|
1106
|
+
|
|
1107
|
+
Stage all files individually (NEVER `git add .` or `git add -A`):
|
|
1108
|
+
```bash
|
|
1109
|
+
git status --short
|
|
1110
|
+
git add {each implementation file}
|
|
1111
|
+
git add {INIT.paths.story_file} {INIT.paths.feature_file} .ace/artifacts/product/product-backlog.md
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
<variant condition="FINAL_STATUS is Done">
|
|
1115
|
+
Also stage wiki files:
|
|
1116
|
+
```bash
|
|
1117
|
+
git add .docs/wiki/
|
|
1118
|
+
```
|
|
1119
|
+
</variant>
|
|
1120
|
+
|
|
1121
|
+
Commit with conventional format:
|
|
1122
|
+
```
|
|
1123
|
+
feat({INIT.story.id}): {INIT.story.title}
|
|
1124
|
+
|
|
1125
|
+
- {key change 1}
|
|
1126
|
+
- {key change 2}
|
|
1127
|
+
- {key change 3}
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
Record commit hash:
|
|
1131
|
+
```bash
|
|
1132
|
+
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
1133
|
+
```
|
|
1134
|
+
|
|
1135
|
+
```
|
|
1136
|
+
+ Story committed: {COMMIT_HASH}
|
|
1137
|
+
```
|
|
1138
|
+
</substep>
|
|
1139
|
+
|
|
1140
|
+
<substep order="7.7" name="cleanup-agent-team" condition="EXECUTION_MODE is agent-teams">
|
|
1141
|
+
**Clean up the agent team so future stories can create a new one.**
|
|
1142
|
+
Delete the active team using TeamDelete. This prevents the
|
|
1143
|
+
"already leading team" error on the next /ace:execute-story run.
|
|
1144
|
+
</substep>
|
|
1145
|
+
|
|
1146
|
+
<substep order="7.8" name="display-completion">
|
|
1147
|
+
<variant condition="FINAL_STATUS is Done">
|
|
1148
|
+
```
|
|
1149
|
+
╔══════════════════════════════════════════════════╗
|
|
1150
|
+
║ ACE > Story Executed ║
|
|
1151
|
+
║ {INIT.story.id} "{INIT.story.title}" ║
|
|
1152
|
+
╚══════════════════════════════════════════════════╝
|
|
1153
|
+
|
|
1154
|
+
+ Story execution complete.
|
|
1155
|
+
|
|
1156
|
+
Status: Done
|
|
1157
|
+
Commit: {COMMIT_HASH}
|
|
1158
|
+
AC coverage: {covered}/{total} scenarios
|
|
1159
|
+
Deviations: {count}
|
|
1160
|
+
Wiki docs updated: {count}
|
|
1161
|
+
|
|
1162
|
+
Next > /ace:execute-story story={next story path}
|
|
1163
|
+
Execute the next story in the feature.
|
|
1164
|
+
> /ace:plan-story story={next story path}
|
|
1165
|
+
Plan the next story.
|
|
1166
|
+
```
|
|
1167
|
+
</variant>
|
|
1168
|
+
|
|
1169
|
+
<variant condition="FINAL_STATUS is DevReady">
|
|
1170
|
+
```
|
|
1171
|
+
╔══════════════════════════════════════════════════╗
|
|
1172
|
+
║ ACE > Story Implemented (DevReady) ║
|
|
1173
|
+
║ {INIT.story.id} "{INIT.story.title}" ║
|
|
1174
|
+
╚══════════════════════════════════════════════════╝
|
|
1175
|
+
|
|
1176
|
+
! Implementation committed. Manual testing required.
|
|
1177
|
+
|
|
1178
|
+
Status: DevReady
|
|
1179
|
+
Commit: {COMMIT_HASH}
|
|
1180
|
+
AC coverage: {covered}/{total} scenarios
|
|
1181
|
+
Deviations: {count}
|
|
1182
|
+
Wiki: skipped (waiting for Done)
|
|
1183
|
+
|
|
1184
|
+
After manual testing:
|
|
1185
|
+
> /ace:execute-story story={INIT.paths.story_file}
|
|
1186
|
+
Re-run to promote to Done (will detect DevReady status
|
|
1187
|
+
and skip directly to verification → approve as Done → wiki mapping).
|
|
1188
|
+
```
|
|
1189
|
+
</variant>
|
|
1190
|
+
</substep>
|
|
1191
|
+
|
|
1192
|
+
</step>
|
|
1193
|
+
|
|
1194
|
+
</process>
|
|
1195
|
+
|
|
1196
|
+
<success_criteria>
|
|
1197
|
+
<criterion>Init function executed (environment detected, story validated, paths computed)</criterion>
|
|
1198
|
+
<criterion>Acceptance criteria present — STOPPED if missing</criterion>
|
|
1199
|
+
<criterion>Technical solution present — STOPPED if missing</criterion>
|
|
1200
|
+
<criterion>Plan Mode entered and execution plan created</criterion>
|
|
1201
|
+
<criterion>User approved execution plan</criterion>
|
|
1202
|
+
<criterion>Agent teams vs solo decision correctly made</criterion>
|
|
1203
|
+
<criterion>Implementation executed following technical solution</criterion>
|
|
1204
|
+
<criterion>Deviation rules applied correctly (Rules 1-3 auto, Rule 4 asks)</criterion>
|
|
1205
|
+
<criterion>Self-verification passed (build, tests, file existence, imports)</criterion>
|
|
1206
|
+
<criterion>Code review completed with zero blockers</criterion>
|
|
1207
|
+
<criterion>All coding standards violations resolved (mandatory check)</criterion>
|
|
1208
|
+
<criterion>Dead code and backwards-compatible shims DELETED (zero tolerance)</criterion>
|
|
1209
|
+
<criterion>User verified and approved implementation</criterion>
|
|
1210
|
+
<criterion>Story file updated with Summary & State section</criterion>
|
|
1211
|
+
<criterion>Story status updated in story file, feature file, product backlog</criterion>
|
|
1212
|
+
<criterion>GitHub issue updated (if applicable)</criterion>
|
|
1213
|
+
<criterion>Feature status updated to Done if all stories are Done</criterion>
|
|
1214
|
+
<criterion>Wiki mapper dispatched (background) with tech debt integration</criterion>
|
|
1215
|
+
<criterion>Wiki Updates section written to story file</criterion>
|
|
1216
|
+
<criterion>ONE single commit created after everything is done (code + state + wiki)</criterion>
|
|
1217
|
+
</success_criteria>
|
|
1218
|
+
|
|
1219
|
+
</workflow>
|