Role
EXECUTE. Decompose work into waves of atomic items. Verify each, iterate
until done. Observable evidence over assumed completion. Retry with context,
not from scratch.
Principles
- Every criterion maps to ≥1 work item — If a criterion from shape
has no corresponding work item, the decomposition is incomplete.
- Retry with feedback, not from scratch — When an item fails
verification, carry it to the next wave with
[VERIFY] FAIL: [reason]
so the retry transforms with context, not blindly repeats.
- Never ship on assumption alone — Execution output and measurements
are sufficient evidence. Code review ships with monitoring. Assumptions
block until verified.
- mustNot violations are hard stops — These are inviolable constraints
from shape. When violated, stop immediately and surface to user.
- Holdout separation — Generation subagents see criteria[] + mustNot[]
(guidance + prevention). holdout[] is reserved for an independent
verification subagent. The generator never sees the holdout set.
- Surface what the wave revealed — Every wave ends with
[LEARN] [one domain insight the wave revealed ≤15w, not the process].
Process
Accept brief + shape — Scan for intent brief (ACCEPTANCE/STOP
criteria) and shape output (criteria[]/holdout[]/mustNot[]/shape). If
missing, clarify before proceeding. If shape recommended Colleague mode
and task has multiple work items, recommend team composition (bond) —
persistent dialogue serves understanding better than fire-and-forget
subagents.
Decompose — Break into 5-21 atomic work items. Each passes the
"one sentence without and" test. Every criteria[] entry maps to ≥1
item. Mark dependencies between items. If Disposable=yes from shape:
keep items ≤3, expect to discard.
Zone 3 override: decompose regardless of item count. Each item gets
retrieval (search/read) before generation. Carry includes "retrieved
vs assumed" in failure context.
When decomposition requires codebase understanding (multi-module,
unfamiliar codebase, 8+ items expected), spawn an Explore agent:
Task(prompt="[session + criteria + mustNot] Analyze the codebase for
[scope]. Return: files involved, module boundaries, dependencies
between components.", subagent_type="Explore")
Use findings to inform item breakdown. For straightforward tasks,
decompose inline.
Announce: [LOOP] Starting | Shape: {shape} | Items: {N} | Feasible: {axis} — {bound}
Execute in waves — A wave = items with no unresolved dependencies.
Within a wave: reversible before irreversible.
Spawn per ready item (generator sees criteria + mustNot, NOT holdout):
Task(prompt="[session + criteria + mustNot + ACCEPTANCE.constraints] [work item]", subagent_type="general-purpose")
After wave completes, spawn holdout verification (independent evaluator):
Task(prompt="[HOLDOUT-VERIFY] [holdout[] + mustNot[]] Evaluate work output. Per holdout item, score: PASS(1.0) / WEAK(0.7) / PARTIAL(0.3) / FAIL(0.0). Report satisfaction, confidence, basis. Do not fix.", subagent_type="general-purpose")
Wave report:
[WAVE {N}] satisfaction: {0-100} | confidence: {high/med/low} | basis: {execution/observation/inspection}
- Per holdout item:
{item}: {score} {verdict} — {evidence}
- Footer:
Done: {n} | Carry: {n} | Stall: {n}
[LEARN] What this wave revealed: [one insight ≤15w]
- Carry = WEAK (evidence quality) or PARTIAL/FAIL (incomplete).
Context travels WITH the retry prompt (co-located, not referenced).
- Stall = no progress — diagnose from output, revise remaining items
- Critical risk (13+ points or irreversible): emit comprehension probe
per wave — one question (≤10w) targeting what changed and why.
Standard/Trivial: probe at completion only (step 5).
Satisfaction gating (advisory by default, blocking for critical risk):
| Satisfaction |
Standard risk |
Critical risk |
| ≥ 85 |
→ review |
→ review |
| 60–84 |
advisory |
blocking |
| < 60 |
advisory |
blocking |
Review — When satisfaction ≥ threshold, get expert review against
spec and mustNot constraints. Findings: BLOCKER (must fix) / WARNING /
SUGGESTION. BLOCKERs create new work items, return to waves.
Verify + present — Final report:
- OUTCOME: 1 sentence +
satisfaction: {N} | confidence: {X} | basis: {Y}
- DECISIONS: 2-4 bullets, risk-ordered. Each states impact, not just
action.
- EVIDENCE: per holdout item, score + command/output that proves it.
- DETAILS: grouped by concern, available on request.
After verification, generate one question (≤10w) targeting where
understanding would break. Gate: Autonomous=skip, Collaborative/Guided=emit.
User: Adjust → re-enter | Done → complete.
Circuit Breakers
| Trigger |
Action |
| Max iterations (user-configured) |
Pause, announce progress |
| Budget exceeded (user-configured) |
Pause, offer continue |
| mustNot violated |
Stop immediately |
Cancel
"Cancel loop", "stop", "abort" → report completed/remaining. Current
wave completes before cancel.
Boundaries
Execute against locked criteria; surface scope questions, never resolve
them. Gates flag deviations; user resolves. User owns continuation —
loop never decides to stop or continue on its own.
Handoff
Loop is a terminal phase — it produces completed, verified work. No
outbound Skill() calls. When finished or cancelled, present results
to the user.
Back-transitions (when discovered mid-execution):
- Wrong intent → surface to user, recommend re-entering intent phase
- Approach failing → surface to user, recommend reshaping
1---2name: loop-33description: Start autonomous iteration loop. Triggers on "loop", "keep going", "continue until done", "implement feature", "fix all", "loop status", "cancel loop".4---5
6# Role
7
8EXECUTE. Decompose work into waves of atomic items. Verify each, iterate
9until done. Observable evidence over assumed completion. Retry with context,
10not from scratch.
11
12## Principles
13
141. **Every criterion maps to ≥1 work item** — If a criterion from shape
15 has no corresponding work item, the decomposition is incomplete.
162. **Retry with feedback, not from scratch** — When an item fails
17 verification, carry it to the next wave with `[VERIFY] FAIL: [reason]`
18 so the retry transforms with context, not blindly repeats.
193. **Never ship on assumption alone** — Execution output and measurements
20 are sufficient evidence. Code review ships with monitoring. Assumptions
21 block until verified.
224. **mustNot violations are hard stops** — These are inviolable constraints
23 from shape. When violated, stop immediately and surface to user.
245. **Holdout separation** — Generation subagents see criteria[] + mustNot[]
25 (guidance + prevention). holdout[] is reserved for an independent
26 verification subagent. The generator never sees the holdout set.
276. **Surface what the wave revealed** — Every wave ends with
28 `[LEARN] [one domain insight the wave revealed ≤15w, not the process]`.
29
30## Process
31
321. **Accept brief + shape** — Scan for intent brief (ACCEPTANCE/STOP
33 criteria) and shape output (criteria[]/holdout[]/mustNot[]/shape). If
34 missing, clarify before proceeding. If shape recommended Colleague mode
35 and task has multiple work items, recommend team composition (bond) —
36 persistent dialogue serves understanding better than fire-and-forget
37 subagents.
38
392. **Decompose** — Break into 5-21 atomic work items. Each passes the
40 "one sentence without and" test. Every criteria[] entry maps to ≥1
41 item. Mark dependencies between items. If Disposable=yes from shape:
42 keep items ≤3, expect to discard.
43
44 Zone 3 override: decompose regardless of item count. Each item gets
45 retrieval (search/read) before generation. Carry includes "retrieved
46 vs assumed" in failure context.
47
48 When decomposition requires codebase understanding (multi-module,
49 unfamiliar codebase, 8+ items expected), spawn an Explore agent:
50 Task(prompt="[session + criteria + mustNot] Analyze the codebase for
51 [scope]. Return: files involved, module boundaries, dependencies
52 between components.", subagent_type="Explore")
53 Use findings to inform item breakdown. For straightforward tasks,
54 decompose inline.
55
56 Announce: `[LOOP] Starting | Shape: {shape} | Items: {N} | Feasible: {axis} — {bound}`
57
583. **Execute in waves** — A wave = items with no unresolved dependencies.
59 Within a wave: reversible before irreversible.
60
61 Spawn per ready item (generator sees criteria + mustNot, NOT holdout):
62 `Task(prompt="[session + criteria + mustNot + ACCEPTANCE.constraints]
63 [work item]", subagent_type="general-purpose")`
64
65 After wave completes, spawn holdout verification (independent evaluator):
66 `Task(prompt="[HOLDOUT-VERIFY] [holdout[] + mustNot[]]
67 Evaluate work output. Per holdout item, score:
68 PASS(1.0) / WEAK(0.7) / PARTIAL(0.3) / FAIL(0.0).
69 Report satisfaction, confidence, basis. Do not fix.",
70 subagent_type="general-purpose")`
71
72 Wave report:
73 - `[WAVE {N}] satisfaction: {0-100} | confidence: {high/med/low} | basis: {execution/observation/inspection}`
74 - Per holdout item: `{item}: {score} {verdict} — {evidence}`
75 - Footer: `Done: {n} | Carry: {n} | Stall: {n}`
76 - `[LEARN] What this wave revealed: [one insight ≤15w]`
77 - Carry = WEAK (evidence quality) or PARTIAL/FAIL (incomplete).
78 Context travels WITH the retry prompt (co-located, not referenced).
79 - Stall = no progress — diagnose from output, revise remaining items
80 - Critical risk (13+ points or irreversible): emit comprehension probe
81 per wave — one question (≤10w) targeting what changed and why.
82 Standard/Trivial: probe at completion only (step 5).
83
84 Satisfaction gating (advisory by default, blocking for critical risk):
85
86 | Satisfaction | Standard risk | Critical risk |
87 | ------------ | ------------- | ------------- |
88 | ≥ 85 | → review | → review |
89 | 60–84 | advisory | blocking |
90 | < 60 | advisory | blocking |
91
924. **Review** — When satisfaction ≥ threshold, get expert review against
93 spec and mustNot constraints. Findings: BLOCKER (must fix) / WARNING /
94 SUGGESTION. BLOCKERs create new work items, return to waves.
95
965. **Verify + present** — Final report:
97 - OUTCOME: 1 sentence + `satisfaction: {N} | confidence: {X} | basis: {Y}`
98 - DECISIONS: 2-4 bullets, risk-ordered. Each states impact, not just
99 action.
100 - EVIDENCE: per holdout item, score + command/output that proves it.
101 - DETAILS: grouped by concern, available on request.
102
103 After verification, generate one question (≤10w) targeting where
104 understanding would break. Gate: Autonomous=skip, Collaborative/Guided=emit.
105
106 User: Adjust → re-enter | Done → complete.
107
108### Circuit Breakers
109
110| Trigger | Action |
111| --------------------------------- | ------------------------ |
112| Max iterations (user-configured) | Pause, announce progress |
113| Budget exceeded (user-configured) | Pause, offer continue |
114| mustNot violated | Stop immediately |
115
116### Cancel
117
118"Cancel loop", "stop", "abort" → report completed/remaining. Current
119wave completes before cancel.
120
121## Boundaries
122
123Execute against locked criteria; surface scope questions, never resolve
124them. Gates flag deviations; user resolves. User owns continuation —
125loop never decides to stop or continue on its own.
126
127## Handoff
128
129Loop is a terminal phase — it produces completed, verified work. No
130outbound Skill() calls. When finished or cancelled, present results
131to the user.
132
133Back-transitions (when discovered mid-execution):
134
135- Wrong intent → surface to user, recommend re-entering intent phase
136- Approach failing → surface to user, recommend reshaping