ace-experience 0.1.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/LICENSE +22 -0
- package/README.md +40 -0
- package/ace/references/continuation-format.md +249 -0
- package/ace/references/gates.md +1078 -0
- package/ace/references/git-integration.md +254 -0
- package/ace/references/horsepower-profiles.md +73 -0
- package/ace/references/planning-config.md +189 -0
- package/ace/references/questioning.md +141 -0
- package/ace/references/tdd.md +263 -0
- package/ace/references/ui-brand.md +160 -0
- package/ace/references/verification-patterns.md +612 -0
- package/ace/templates/architect-prompt.md +117 -0
- package/ace/templates/brief.md +184 -0
- package/ace/templates/codebase/architecture.md +264 -0
- package/ace/templates/codebase/concerns.md +310 -0
- package/ace/templates/codebase/conventions.md +307 -0
- package/ace/templates/codebase/integrations.md +280 -0
- package/ace/templates/codebase/stack.md +186 -0
- package/ace/templates/codebase/structure.md +295 -0
- package/ace/templates/codebase/testing.md +480 -0
- package/ace/templates/config.json +36 -0
- package/ace/templates/continue-here.md +78 -0
- package/ace/templates/debug.md +159 -0
- package/ace/templates/detective-prompt.md +91 -0
- package/ace/templates/intel.md +283 -0
- package/ace/templates/milestone-archive.md +123 -0
- package/ace/templates/milestone.md +115 -0
- package/ace/templates/proof.md +322 -0
- package/ace/templates/pulse.md +176 -0
- package/ace/templates/recap.md +246 -0
- package/ace/templates/research/architecture.md +204 -0
- package/ace/templates/research/features.md +147 -0
- package/ace/templates/research/pitfalls.md +200 -0
- package/ace/templates/research/recap.md +170 -0
- package/ace/templates/research/stack.md +120 -0
- package/ace/templates/research-lite.md +146 -0
- package/ace/templates/research.md +552 -0
- package/ace/templates/specs.md +231 -0
- package/ace/templates/stage-prompt.md +567 -0
- package/ace/templates/track.md +202 -0
- package/ace/templates/uat.md +247 -0
- package/ace/templates/user-setup.md +311 -0
- package/ace/workflows/audit-stage.md +628 -0
- package/ace/workflows/audit-work.md +596 -0
- package/ace/workflows/continue-project.md +305 -0
- package/ace/workflows/diagnose-issues.md +231 -0
- package/ace/workflows/list-assumptions.md +178 -0
- package/ace/workflows/map-codebase.md +322 -0
- package/ace/workflows/research-stage.md +289 -0
- package/ace/workflows/run-plan.md +1844 -0
- package/ace/workflows/run-stage.md +686 -0
- package/ace/workflows/scope-stage.md +433 -0
- package/ace/workflows/ship-milestone.md +833 -0
- package/ace/workflows/transition.md +556 -0
- package/agents/ace-architect.md +1415 -0
- package/agents/ace-auditor.md +778 -0
- package/agents/ace-codebase-mapper.md +738 -0
- package/agents/ace-detective.md +1203 -0
- package/agents/ace-integration-checker.md +423 -0
- package/agents/ace-navigator.md +605 -0
- package/agents/ace-plan-reviewer.md +812 -0
- package/agents/ace-project-scout.md +865 -0
- package/agents/ace-runner.md +784 -0
- package/agents/ace-stage-scout.md +669 -0
- package/agents/ace-synthesizer.md +256 -0
- package/bin/install.js +1432 -0
- package/commands/ace.add-stage.md +211 -0
- package/commands/ace.add-todo.md +194 -0
- package/commands/ace.audit-milestone.md +277 -0
- package/commands/ace.audit.md +219 -0
- package/commands/ace.check-todos.md +229 -0
- package/commands/ace.complete-milestone.md +134 -0
- package/commands/ace.continue.md +46 -0
- package/commands/ace.dash.md +308 -0
- package/commands/ace.debug.md +169 -0
- package/commands/ace.discuss-stage.md +86 -0
- package/commands/ace.help.md +465 -0
- package/commands/ace.insert-stage.md +231 -0
- package/commands/ace.list-stage-assumptions.md +49 -0
- package/commands/ace.map-codebase.md +71 -0
- package/commands/ace.new-milestone.md +710 -0
- package/commands/ace.pause.md +132 -0
- package/commands/ace.plan-milestone-gaps.md +295 -0
- package/commands/ace.plan-stage.md +568 -0
- package/commands/ace.remove-stage.md +353 -0
- package/commands/ace.research-stage.md +200 -0
- package/commands/ace.run-stage.md +343 -0
- package/commands/ace.set-profile.md +116 -0
- package/commands/ace.settings.md +151 -0
- package/commands/ace.start.md +1008 -0
- package/commands/ace.status.md +364 -0
- package/hooks/dist/ace-check-update.js +67 -0
- package/hooks/dist/ace-statusline.js +96 -0
- package/package.json +85 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ace.plan-stage
|
|
3
|
+
description: Create detailed execution run for a stage (run.md) with verification loop
|
|
4
|
+
argument-hint: "[stage] [--research] [--skip-research] [--gaps] [--skip-verify]"
|
|
5
|
+
agent: ace-architect
|
|
6
|
+
allowed-tools:
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Task
|
|
13
|
+
- WebFetch
|
|
14
|
+
- mcp__context7__*
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<execution_context>
|
|
18
|
+
@~/.claude/ace/references/ui-brand.md
|
|
19
|
+
</execution_context>
|
|
20
|
+
|
|
21
|
+
<objective>
|
|
22
|
+
Create executable stage prompts (run.md files) for a track stage with integrated research and verification.
|
|
23
|
+
|
|
24
|
+
**Default flow:** Research (if needed) → Plan → Verify → Done
|
|
25
|
+
|
|
26
|
+
**Orchestrator role:** Parse arguments, validate stage, research domain (unless skipped or exists), spawn ace-architect agent, verify runs with ace-plan-reviewer, iterate until runs pass or max iterations reached, present results.
|
|
27
|
+
|
|
28
|
+
**Why subagents:** Research and planning burn context fast. Verification uses fresh context. User sees the flow between agents in main context.
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
Stage number: $ARGUMENTS (optional - auto-detects next unplanned stage if not provided)
|
|
33
|
+
|
|
34
|
+
**Flags:**
|
|
35
|
+
- `--research` — Force re-research even if research.md exists
|
|
36
|
+
- `--skip-research` — Skip research entirely, go straight to planning
|
|
37
|
+
- `--gaps` — Gap closure mode (reads proof.md, skips research)
|
|
38
|
+
- `--skip-verify` — Skip architect → reviewer verification loop
|
|
39
|
+
|
|
40
|
+
Normalize stage input in step 2 before any directory lookups.
|
|
41
|
+
</context>
|
|
42
|
+
|
|
43
|
+
<process>
|
|
44
|
+
|
|
45
|
+
## 1. Validate Environment and Resolve Model Profile
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ls .ace/ 2>/dev/null
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**If not found:** Error - user should run `/ace.start` first.
|
|
52
|
+
|
|
53
|
+
**Resolve model profile for agent spawning:**
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
MODEL_PROFILE=$(cat .ace/config.json 2>/dev/null | grep -o '"horsepower"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Default to "balanced" if not set.
|
|
60
|
+
|
|
61
|
+
**Model lookup table:**
|
|
62
|
+
|
|
63
|
+
| Agent | max | balanced | eco |
|
|
64
|
+
|-------|---------|----------|--------|
|
|
65
|
+
| ace-stage-scout | opus | sonnet | haiku |
|
|
66
|
+
| ace-architect | opus | opus | sonnet |
|
|
67
|
+
| ace-plan-reviewer | sonnet | sonnet | haiku |
|
|
68
|
+
|
|
69
|
+
Store resolved models for use in Task calls below.
|
|
70
|
+
|
|
71
|
+
## 2. Parse and Normalize Arguments
|
|
72
|
+
|
|
73
|
+
Extract from $ARGUMENTS:
|
|
74
|
+
|
|
75
|
+
- Stage number (integer or decimal like `2.1`)
|
|
76
|
+
- `--research` flag to force re-research
|
|
77
|
+
- `--skip-research` flag to skip research
|
|
78
|
+
- `--gaps` flag for gap closure mode
|
|
79
|
+
- `--skip-verify` flag to bypass verification loop
|
|
80
|
+
|
|
81
|
+
**If no stage number:** Detect next unplanned stage from track.
|
|
82
|
+
|
|
83
|
+
**Normalize stage to zero-padded format:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Normalize stage number (8 → 08, but preserve decimals like 2.1 → 02.1)
|
|
87
|
+
if [[ "$STAGE" =~ ^[0-9]+$ ]]; then
|
|
88
|
+
STAGE=$(printf "%02d" "$STAGE")
|
|
89
|
+
elif [[ "$STAGE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
|
|
90
|
+
STAGE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
|
|
91
|
+
fi
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Check for existing research and runs:**
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
ls .ace/stages/${STAGE}-*/*-research.md 2>/dev/null
|
|
98
|
+
ls .ace/stages/${STAGE}-*/*-run.md 2>/dev/null
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 3. Validate Stage
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
grep -A5 "Stage ${STAGE}:" .ace/track.md 2>/dev/null
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**If not found:** Error with available stages. **If found:** Extract stage number, name, description.
|
|
108
|
+
|
|
109
|
+
## 4. Ensure Stage Directory Exists and Load intel.md
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# STAGE is already normalized (08, 02.1, etc.) from step 2
|
|
113
|
+
STAGE_DIR=$(ls -d .ace/stages/${STAGE}-* 2>/dev/null | head -1)
|
|
114
|
+
if [ -z "$STAGE_DIR" ]; then
|
|
115
|
+
# Create stage directory from track name
|
|
116
|
+
STAGE_NAME=$(grep "Stage ${STAGE}:" .ace/track.md | sed 's/.*Stage [0-9]*: //' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
|
117
|
+
mkdir -p ".ace/stages/${STAGE}-${STAGE_NAME}"
|
|
118
|
+
STAGE_DIR=".ace/stages/${STAGE}-${STAGE_NAME}"
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
# Load intel.md immediately - this informs ALL downstream agents
|
|
122
|
+
INTEL_CONTENT=$(cat "${STAGE_DIR}"/*-intel.md 2>/dev/null)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**CRITICAL:** Store `INTEL_CONTENT` now. It must be passed to:
|
|
126
|
+
- **Scout** — constrains what to research (locked decisions vs Claude's discretion)
|
|
127
|
+
- **Architect** — locked decisions must be honored, not revisited
|
|
128
|
+
- **Reviewer** — verifies runs respect user's stated vision
|
|
129
|
+
- **Revision** — context for targeted fixes
|
|
130
|
+
|
|
131
|
+
If intel.md exists, display: `Using stage context from: ${STAGE_DIR}/*-intel.md`
|
|
132
|
+
|
|
133
|
+
## 5. Handle Research
|
|
134
|
+
|
|
135
|
+
**If `--gaps` flag:** Skip research (gap closure uses proof.md instead).
|
|
136
|
+
|
|
137
|
+
**If `--skip-research` flag:** Skip to step 6.
|
|
138
|
+
|
|
139
|
+
**Check config for research setting:**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
WORKFLOW_RESEARCH=$(cat .ace/config.json 2>/dev/null | grep -o '"research"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**If `checks.research` is `false` AND `--research` flag NOT set:** Skip to step 6.
|
|
146
|
+
|
|
147
|
+
**Otherwise:**
|
|
148
|
+
|
|
149
|
+
Check for existing research:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
ls "${STAGE_DIR}"/*-research.md 2>/dev/null
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**If research.md exists AND `--research` flag NOT set:**
|
|
156
|
+
- Display: `Using existing research: ${STAGE_DIR}/${STAGE}-research.md`
|
|
157
|
+
- Skip to step 6
|
|
158
|
+
|
|
159
|
+
**If research.md missing OR `--research` flag set:**
|
|
160
|
+
|
|
161
|
+
Display stage banner:
|
|
162
|
+
```
|
|
163
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
164
|
+
ACE ► SCOUTING STAGE {X}
|
|
165
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
166
|
+
|
|
167
|
+
◆ Spawning scout...
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Proceed to spawn scout
|
|
171
|
+
|
|
172
|
+
### Spawn ace-stage-scout
|
|
173
|
+
|
|
174
|
+
Gather additional context for research prompt:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Get stage description from track
|
|
178
|
+
STAGE_DESC=$(grep -A3 "Stage ${STAGE}:" .ace/track.md)
|
|
179
|
+
|
|
180
|
+
# Get specs if they exist
|
|
181
|
+
SPECS=$(cat .ace/specs.md 2>/dev/null | grep -A100 "## Requirements" | head -50)
|
|
182
|
+
|
|
183
|
+
# Get prior decisions from pulse.md
|
|
184
|
+
DECISIONS=$(grep -A20 "### Decisions Made" .ace/pulse.md 2>/dev/null)
|
|
185
|
+
|
|
186
|
+
# INTEL_CONTENT already loaded in step 4
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Fill research prompt and spawn:
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
<objective>
|
|
193
|
+
Research how to implement Stage {stage_number}: {stage_name}
|
|
194
|
+
|
|
195
|
+
Answer: "What do I need to know to PLAN this stage well?"
|
|
196
|
+
</objective>
|
|
197
|
+
|
|
198
|
+
<stage_context>
|
|
199
|
+
**IMPORTANT:** If intel.md exists below, it contains user decisions from /ace.discuss-stage.
|
|
200
|
+
|
|
201
|
+
- **Decisions section** = Locked choices — research THESE deeply, don't explore alternatives
|
|
202
|
+
- **Claude's Discretion section** = Your freedom areas — research options, make recommendations
|
|
203
|
+
- **Deferred Ideas section** = Out of scope — ignore completely
|
|
204
|
+
|
|
205
|
+
{intel_content}
|
|
206
|
+
</stage_context>
|
|
207
|
+
|
|
208
|
+
<additional_context>
|
|
209
|
+
**Stage description:**
|
|
210
|
+
{stage_description}
|
|
211
|
+
|
|
212
|
+
**Specs (if any):**
|
|
213
|
+
{specs}
|
|
214
|
+
|
|
215
|
+
**Prior decisions from pulse.md:**
|
|
216
|
+
{decisions}
|
|
217
|
+
</additional_context>
|
|
218
|
+
|
|
219
|
+
<output>
|
|
220
|
+
Write research findings to: {stage_dir}/{stage}-research.md
|
|
221
|
+
</output>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
Task(
|
|
226
|
+
prompt="First, read ~/.claude/agents/ace-stage-scout.md for your role and instructions.\n\n" + research_prompt,
|
|
227
|
+
subagent_type="general-purpose",
|
|
228
|
+
model="{scout_model}",
|
|
229
|
+
description="Research Stage {stage}"
|
|
230
|
+
)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Handle Scout Return
|
|
234
|
+
|
|
235
|
+
**`## RESEARCH COMPLETE`:**
|
|
236
|
+
- Display: `Research complete. Proceeding to planning...`
|
|
237
|
+
- Continue to step 6
|
|
238
|
+
|
|
239
|
+
**`## RESEARCH BLOCKED`:**
|
|
240
|
+
- Display blocker information
|
|
241
|
+
- Offer: 1) Provide more context, 2) Skip research and plan anyway, 3) Abort
|
|
242
|
+
- Wait for user response
|
|
243
|
+
|
|
244
|
+
## 6. Check Existing Runs
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
ls "${STAGE_DIR}"/*-run.md 2>/dev/null
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**If exists:** Offer: 1) Continue planning (add more runs), 2) View existing, 3) Replan from scratch. Wait for response.
|
|
251
|
+
|
|
252
|
+
## 7. Read Context Files
|
|
253
|
+
|
|
254
|
+
Read and store context file contents for the architect agent. The `@` syntax does not work across Task() boundaries - content must be inlined.
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Read required files
|
|
258
|
+
PULSE_CONTENT=$(cat .ace/pulse.md)
|
|
259
|
+
TRACK_CONTENT=$(cat .ace/track.md)
|
|
260
|
+
|
|
261
|
+
# Read optional files (empty string if missing)
|
|
262
|
+
SPECS_CONTENT=$(cat .ace/specs.md 2>/dev/null)
|
|
263
|
+
# INTEL_CONTENT already loaded in step 4
|
|
264
|
+
RESEARCH_CONTENT=$(cat "${STAGE_DIR}"/*-research.md 2>/dev/null)
|
|
265
|
+
|
|
266
|
+
# Gap closure files (only if --gaps mode)
|
|
267
|
+
PROOF_CONTENT=$(cat "${STAGE_DIR}"/*-proof.md 2>/dev/null)
|
|
268
|
+
UAT_CONTENT=$(cat "${STAGE_DIR}"/*-uat.md 2>/dev/null)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## 8. Spawn ace-architect Agent
|
|
272
|
+
|
|
273
|
+
Display stage banner:
|
|
274
|
+
```
|
|
275
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
276
|
+
ACE ► PLANNING STAGE {X}
|
|
277
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
278
|
+
|
|
279
|
+
◆ Spawning architect...
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Fill prompt with inlined content and spawn:
|
|
283
|
+
|
|
284
|
+
```markdown
|
|
285
|
+
<planning_context>
|
|
286
|
+
|
|
287
|
+
**Stage:** {stage_number}
|
|
288
|
+
**Mode:** {standard | gap_closure}
|
|
289
|
+
|
|
290
|
+
**Project Pulse:**
|
|
291
|
+
{pulse_content}
|
|
292
|
+
|
|
293
|
+
**Track:**
|
|
294
|
+
{track_content}
|
|
295
|
+
|
|
296
|
+
**Specs (if exists):**
|
|
297
|
+
{specs_content}
|
|
298
|
+
|
|
299
|
+
**Stage Intel (if exists):**
|
|
300
|
+
|
|
301
|
+
IMPORTANT: If stage intel exists below, it contains USER DECISIONS from /ace.discuss-stage.
|
|
302
|
+
- **Decisions** = LOCKED — honor these exactly, do not revisit or suggest alternatives
|
|
303
|
+
- **Claude's Discretion** = Your freedom — make implementation choices here
|
|
304
|
+
- **Deferred Ideas** = Out of scope — do NOT include in this stage
|
|
305
|
+
|
|
306
|
+
{intel_content}
|
|
307
|
+
|
|
308
|
+
**Research (if exists):**
|
|
309
|
+
{research_content}
|
|
310
|
+
|
|
311
|
+
**Gap Closure (if --gaps mode):**
|
|
312
|
+
{proof_content}
|
|
313
|
+
{uat_content}
|
|
314
|
+
|
|
315
|
+
</planning_context>
|
|
316
|
+
|
|
317
|
+
<downstream_consumer>
|
|
318
|
+
Output consumed by /ace.run-stage
|
|
319
|
+
Runs must be executable prompts with:
|
|
320
|
+
|
|
321
|
+
- Frontmatter (batch, depends_on, files_modified, autonomous)
|
|
322
|
+
- Tasks in XML format
|
|
323
|
+
- Verification criteria
|
|
324
|
+
- must_haves for goal-backward verification
|
|
325
|
+
</downstream_consumer>
|
|
326
|
+
|
|
327
|
+
<quality_gate>
|
|
328
|
+
Before returning ARCHITECTING COMPLETE:
|
|
329
|
+
|
|
330
|
+
- [ ] run.md files created in stage directory
|
|
331
|
+
- [ ] Each run has valid frontmatter
|
|
332
|
+
- [ ] Tasks are specific and actionable
|
|
333
|
+
- [ ] Dependencies correctly identified
|
|
334
|
+
- [ ] Batches assigned for parallel execution
|
|
335
|
+
- [ ] must_haves derived from stage goal
|
|
336
|
+
</quality_gate>
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
Task(
|
|
341
|
+
prompt="First, read ~/.claude/agents/ace-architect.md for your role and instructions.\n\n" + filled_prompt,
|
|
342
|
+
subagent_type="general-purpose",
|
|
343
|
+
model="{architect_model}",
|
|
344
|
+
description="Plan Stage {stage}"
|
|
345
|
+
)
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## 9. Handle Architect Return
|
|
349
|
+
|
|
350
|
+
Parse architect output:
|
|
351
|
+
|
|
352
|
+
**`## ARCHITECTING COMPLETE`:**
|
|
353
|
+
- Display: `Architect created {N} run(s). Files on disk.`
|
|
354
|
+
- If `--skip-verify`: Skip to step 13
|
|
355
|
+
- Check config: `WORKFLOW_REVIEW=$(cat .ace/config.json 2>/dev/null | grep -o '"review"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")`
|
|
356
|
+
- If `checks.review` is `false`: Skip to step 13
|
|
357
|
+
- Otherwise: Proceed to step 10
|
|
358
|
+
|
|
359
|
+
**`## GATE REACHED`:**
|
|
360
|
+
- Present to user, get response, spawn continuation (see step 12)
|
|
361
|
+
|
|
362
|
+
**`## ARCHITECTING INCONCLUSIVE`:**
|
|
363
|
+
- Show what was attempted
|
|
364
|
+
- Offer: Add context, Retry, Manual
|
|
365
|
+
- Wait for user response
|
|
366
|
+
|
|
367
|
+
## 10. Spawn ace-plan-reviewer Agent
|
|
368
|
+
|
|
369
|
+
Display:
|
|
370
|
+
```
|
|
371
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
372
|
+
ACE ► VERIFYING RUNS
|
|
373
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
374
|
+
|
|
375
|
+
◆ Spawning plan reviewer...
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
Read runs for the reviewer:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
# Read all runs in stage directory
|
|
382
|
+
RUNS_CONTENT=$(cat "${STAGE_DIR}"/*-run.md 2>/dev/null)
|
|
383
|
+
|
|
384
|
+
# INTEL_CONTENT already loaded in step 4
|
|
385
|
+
# SPECS_CONTENT already loaded in step 7
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Fill reviewer prompt with inlined content and spawn:
|
|
389
|
+
|
|
390
|
+
```markdown
|
|
391
|
+
<verification_context>
|
|
392
|
+
|
|
393
|
+
**Stage:** {stage_number}
|
|
394
|
+
**Stage Goal:** {goal from TRACK}
|
|
395
|
+
|
|
396
|
+
**Runs to verify:**
|
|
397
|
+
{runs_content}
|
|
398
|
+
|
|
399
|
+
**Specs (if exists):**
|
|
400
|
+
{specs_content}
|
|
401
|
+
|
|
402
|
+
**Stage Intel (if exists):**
|
|
403
|
+
|
|
404
|
+
IMPORTANT: If stage intel exists below, it contains USER DECISIONS from /ace.discuss-stage.
|
|
405
|
+
Runs MUST honor these decisions. Flag as issue if runs contradict user's stated vision.
|
|
406
|
+
|
|
407
|
+
- **Decisions** = LOCKED — runs must implement these exactly
|
|
408
|
+
- **Claude's Discretion** = Freedom areas — runs can choose approach
|
|
409
|
+
- **Deferred Ideas** = Out of scope — runs must NOT include these
|
|
410
|
+
|
|
411
|
+
{intel_content}
|
|
412
|
+
|
|
413
|
+
</verification_context>
|
|
414
|
+
|
|
415
|
+
<expected_output>
|
|
416
|
+
Return one of:
|
|
417
|
+
- ## VERIFICATION PASSED — all checks pass
|
|
418
|
+
- ## ISSUES FOUND — structured issue list
|
|
419
|
+
</expected_output>
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
```
|
|
423
|
+
Task(
|
|
424
|
+
prompt=reviewer_prompt,
|
|
425
|
+
subagent_type="ace-plan-reviewer",
|
|
426
|
+
model="{reviewer_model}",
|
|
427
|
+
description="Verify Stage {stage} runs"
|
|
428
|
+
)
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## 11. Handle Reviewer Return
|
|
432
|
+
|
|
433
|
+
**If `## VERIFICATION PASSED`:**
|
|
434
|
+
- Display: `Runs verified. Ready for execution.`
|
|
435
|
+
- Proceed to step 13
|
|
436
|
+
|
|
437
|
+
**If `## ISSUES FOUND`:**
|
|
438
|
+
- Display: `Reviewer found issues:`
|
|
439
|
+
- List issues from reviewer output
|
|
440
|
+
- Check iteration count
|
|
441
|
+
- Proceed to step 12
|
|
442
|
+
|
|
443
|
+
## 12. Revision Loop (Max 3 Iterations)
|
|
444
|
+
|
|
445
|
+
Track: `iteration_count` (starts at 1 after initial plan + check)
|
|
446
|
+
|
|
447
|
+
**If iteration_count < 3:**
|
|
448
|
+
|
|
449
|
+
Display: `Sending back to architect for revision... (iteration {N}/3)`
|
|
450
|
+
|
|
451
|
+
Read current runs for revision context:
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
RUNS_CONTENT=$(cat "${STAGE_DIR}"/*-run.md 2>/dev/null)
|
|
455
|
+
# INTEL_CONTENT already loaded in step 4
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Spawn ace-architect with revision prompt:
|
|
459
|
+
|
|
460
|
+
```markdown
|
|
461
|
+
<revision_context>
|
|
462
|
+
|
|
463
|
+
**Stage:** {stage_number}
|
|
464
|
+
**Mode:** revision
|
|
465
|
+
|
|
466
|
+
**Existing runs:**
|
|
467
|
+
{runs_content}
|
|
468
|
+
|
|
469
|
+
**Reviewer issues:**
|
|
470
|
+
{structured_issues_from_reviewer}
|
|
471
|
+
|
|
472
|
+
**Stage Intel (if exists):**
|
|
473
|
+
|
|
474
|
+
IMPORTANT: If stage intel exists, revisions MUST still honor user decisions.
|
|
475
|
+
|
|
476
|
+
{intel_content}
|
|
477
|
+
|
|
478
|
+
</revision_context>
|
|
479
|
+
|
|
480
|
+
<instructions>
|
|
481
|
+
Make targeted updates to address reviewer issues.
|
|
482
|
+
Do NOT replan from scratch unless issues are fundamental.
|
|
483
|
+
Revisions must still honor all locked decisions from Stage Intel.
|
|
484
|
+
Return what changed.
|
|
485
|
+
</instructions>
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
```
|
|
489
|
+
Task(
|
|
490
|
+
prompt="First, read ~/.claude/agents/ace-architect.md for your role and instructions.\n\n" + revision_prompt,
|
|
491
|
+
subagent_type="general-purpose",
|
|
492
|
+
model="{architect_model}",
|
|
493
|
+
description="Revise Stage {stage} runs"
|
|
494
|
+
)
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
- After architect returns → spawn reviewer again (step 10)
|
|
498
|
+
- Increment iteration_count
|
|
499
|
+
|
|
500
|
+
**If iteration_count >= 3:**
|
|
501
|
+
|
|
502
|
+
Display: `Max iterations reached. {N} issues remain:`
|
|
503
|
+
- List remaining issues
|
|
504
|
+
|
|
505
|
+
Offer options:
|
|
506
|
+
1. Force proceed (execute despite issues)
|
|
507
|
+
2. Provide guidance (user gives direction, retry)
|
|
508
|
+
3. Abandon (exit planning)
|
|
509
|
+
|
|
510
|
+
Wait for user response.
|
|
511
|
+
|
|
512
|
+
## 13. Present Final Status
|
|
513
|
+
|
|
514
|
+
Route to `<offer_next>`.
|
|
515
|
+
|
|
516
|
+
</process>
|
|
517
|
+
|
|
518
|
+
<offer_next>
|
|
519
|
+
Output this markdown directly (not as a code block):
|
|
520
|
+
|
|
521
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
522
|
+
ACE ► STAGE {X} PLANNED ✓
|
|
523
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
524
|
+
|
|
525
|
+
**Stage {X}: {Name}** — {N} run(s) in {M} batch(es)
|
|
526
|
+
|
|
527
|
+
| Batch | Runs | What it builds |
|
|
528
|
+
|------|-------|----------------|
|
|
529
|
+
| 1 | 01, 02 | [objectives] |
|
|
530
|
+
| 2 | 03 | [objective] |
|
|
531
|
+
|
|
532
|
+
Research: {Completed | Used existing | Skipped}
|
|
533
|
+
Verification: {Passed | Passed with override | Skipped}
|
|
534
|
+
|
|
535
|
+
───────────────────────────────────────────────────────────────
|
|
536
|
+
|
|
537
|
+
## ▶ Next Up
|
|
538
|
+
|
|
539
|
+
**Execute Stage {X}** — run all {N} runs
|
|
540
|
+
|
|
541
|
+
/ace.run-stage {X}
|
|
542
|
+
|
|
543
|
+
<sub>/clear first → fresh context window</sub>
|
|
544
|
+
|
|
545
|
+
───────────────────────────────────────────────────────────────
|
|
546
|
+
|
|
547
|
+
**Also available:**
|
|
548
|
+
- cat .ace/stages/{stage-dir}/*-run.md — review runs
|
|
549
|
+
- /ace.plan-stage {X} --research — re-research first
|
|
550
|
+
|
|
551
|
+
───────────────────────────────────────────────────────────────
|
|
552
|
+
</offer_next>
|
|
553
|
+
|
|
554
|
+
<success_criteria>
|
|
555
|
+
- [ ] .ace/ directory validated
|
|
556
|
+
- [ ] Stage validated against track
|
|
557
|
+
- [ ] Stage directory created if needed
|
|
558
|
+
- [ ] intel.md loaded early (step 4) and passed to ALL agents
|
|
559
|
+
- [ ] Research completed (unless --skip-research or --gaps or exists)
|
|
560
|
+
- [ ] ace-stage-scout spawned with intel.md (constrains research scope)
|
|
561
|
+
- [ ] Existing runs checked
|
|
562
|
+
- [ ] ace-architect spawned with context (intel.md + research.md)
|
|
563
|
+
- [ ] Runs created (ARCHITECTING COMPLETE or GATE handled)
|
|
564
|
+
- [ ] ace-plan-reviewer spawned with intel.md (verifies intel compliance)
|
|
565
|
+
- [ ] Verification passed OR user override OR max iterations with user decision
|
|
566
|
+
- [ ] User sees status between agent spawns
|
|
567
|
+
- [ ] User knows next steps (execute or review)
|
|
568
|
+
</success_criteria>
|