Execute Chat
Protocol
Step 0 — Readiness gate
Judge the chat and verified evidence against two lenses without reopening settled points.
WHAT is clear (product lens):
- Outcome: what changes for the user or system.
- Scope: what is in and out.
- Behavior: the user-visible behavior and material edge cases.
HOW is decided (tech lens):
- Approach: chosen, with alternatives rejected for stated reasons.
- Fit: follows the existing architecture and patterns; deviations are justified.
- Decisions: data shapes, code locations, and affected interfaces are locked.
- Evidence: load-bearing claims are verified against source.
- Risks: mitigated or explicitly accepted.
Route by gap size:
- All settled — confirm in one line each and proceed.
- Small gaps — ask 1–3 targeted questions via
AskUserQuestion, then proceed.
- WHAT genuinely open — stop; confirm with the user, then invoke the
product-interview skill via the Skill tool.
- HOW genuinely open — stop; confirm with the user, then invoke the
tech-design skill via the Skill tool.
- Both open —
product-interview first.
**Readiness:**
- WHAT: [settled — one line | gaps: …]
- HOW: [settled — one line | gaps: …]
- Proceeding | Asking | Routing to [skill]
Step 1 — Plan from the chat
- Create one task per agreed item; add nothing else.
- Group tasks into dependency-ordered, file-disjoint waves; put consumers in later waves.
- Review once after all waves unless the user objects. Review each wave when later work depends on its untested output or shared contracts.
- Use
TaskCreate for each wave, review, working gate, comments + durable docs, and commit. Do not create entries for build subagents or the done report.
**Plan:**
- Tasks: [n], waves: [wave → tasks, one line per wave]
- Review cadence: [at end | per wave] — [one-line reason]
Step 2 — Build waves
Use the requested model; otherwise select one per logical task:
- Sonnet — only when every condition holds:
- The edit is fully specified and follows an existing pattern.
- Assigned files are known and bounded.
- Behavior, architecture, and contracts require no unresolved choice.
- It touches no schema, migration, auth, security, concurrency, payments, destructive data, or public, shared, or external interface.
- The dispatch includes a verification check.
- Opus — otherwise.
- Grouped work: classify a subagent's full assignment; any Opus condition selects Opus.
- Escalation: upgrade Sonnet to Opus when new scope, coupling, or ambiguity appears; never downgrade the task.
For each wave, launch one subagent per logical task in parallel. Give each subagent its task, file paths, and these rules:
- Before the first write, resolve each target path and read its governing repository instructions and Claude path rules in
.claude/rules/ whose quoted paths: globs match it; use the intended path for a new file.
- Edit assigned files only; report any needed extra file before editing.
- Scope Git reads and mutations to assigned files; never run
git stash, git checkout -- ., git reset, or another whole-tree mutation.
- Read a committed baseline without changing shared state with
git show HEAD:<path>.
- Write a comment only for what the code cannot say: a constraint, assumption, or coupling.
- Run the narrowest check that proves the assigned change, plus directly affected tests; reserve broader checks for Step 4.
- Do not commit.
- Return
{ files_changed, summary }.
Accept each wave in order:
- Read its actual working-tree diff:
git diff -- <reported files>.
- Add its
files_changed to the running scope for later diffs and the docs pass.
- If it needs another file, rerun that task serially with the file included.
Fix-loop packet
Every fix-verify-loop invocation in Steps 3–4 passes:
- Findings: Confirmed P0/P1 findings with their
validated_by value and verdict evidence.
- Artifact paths: The run's collected files. A finding or its evidence may identify another path, but editing it requires the fix-loop scope-expansion gate.
- Criteria: Each finding's criterion plus the relevant settled WHAT and HOW facts from the readiness gate. A working-gate failure also includes the expected verification or live-test result.
Post-fix review
After all fixes for one review or working-gate failure are accepted, union their returned files_changed as <fix files> and select one regression scope:
| Scope |
Use when |
Action |
| Bounded |
Every condition holds: at most 5 fix files and 400 changed lines in their working-tree diff from HEAD; no schema, migration, auth, security, concurrency, payment, destructive-data, or shared-interface change; clear affected WHAT/HOW facts, callers, and consumers. |
Invoke the two-pass-review skill via the Skill tool over git diff HEAD -- <fix files>, licensed to inspect affected callers and consumers. |
| Whole run |
Any Bounded condition fails or its evidence is unclear. |
Invoke the two-pass-review skill via the Skill tool over git diff HEAD -- <run files>. |
Run this gate once per review or working-gate failure. Give the reviewer the addressed findings and initial-review evidence; ask only whether the fixes caused regressions. Reuse unaffected initial evidence. Resolve confirmed regressions with the same Fix-loop packet without another automatic post-fix review.
Step 3 — Review
- At the Step 1 cadence, invoke the
two-pass-review skill via the Skill tool over git diff -- <run files> or the current wave's files.
- Invoke the
fix-verify-loop skill via the Skill tool with the Fix-loop packet for confirmed P0/P1 findings.
- After every fix-loop run, add its returned
files_changed—the authoritative path list—to the run's collected files before the next review, docs pass, or commit.
- Resolve every fix-loop escalation and its staged changes with the user before continuing.
- Fix P2 findings required by the agreed scope; dispatch non-small fixes to a build subagent and defer other P2/P3 findings.
- Send out-of-scope findings to the done report's deferred list.
- If the initial review produced fixes, run Post-fix review.
Step 4 — Working gate
Choose the smallest verification level that covers the current risk:
| Level |
When |
Scope |
| Focused |
During each task and finding fix. |
The narrowest test that proves the change, plus directly affected tests. |
| Subsystem |
After a coupled wave or fix group when later work depends on it or focused checks cannot prove the interaction. |
The smallest relevant subsystem suite. |
| Full |
Once after review fixes stabilize the run and known overlapping edits to the code or test corpus settle. |
Every applicable project-wide verification command. |
- Early Full: escalate only for shared test infrastructure, order dependence, or a defect reproducible only in the full suite.
- Harness exit: if test bodies pass but the harness fails to exit, stop trying equivalent runner modes unless a new hypothesis distinguishes the rerun; use Fix/Accept/Abort below and record harness debt only on Accept.
After Full passes, classify later edits:
| Later edit |
Required verification |
| Documentation or comments only |
Reuse the Full evidence. |
| Local code with a clear blast radius |
Always rerun Focused; add Subsystem only for a coupled local interaction; reuse the unaffected Full evidence. |
| Shared interface, test infrastructure, order/global state, multiple subsystems, or unclear blast radius |
Rerun Focused and Full. |
- If
meta/workflows/automated-testing/automated-testing-instructions.md exists, use it to test the implemented behavior when relevant.
- If verification or live testing fails, ask the user whether to fix, accept, or abort:
- Fix → create a confirmed finding. Set
validated_by: "machine" only for an exact automated check and observed failure; otherwise set validated_by: null. Invoke fix-verify-loop with the Fix-loop packet; add its returned files to the collected scope; resolve every escalation and staged-change choice; run Post-fix review; rerun the working gate.
- Accept → carry the risk in the done report.
- Abort → stop.
Step 5 — Comments and durable docs
Invoke the durable-docs-update skill via the Skill tool inline with:
- scope — the run's collected
files_changed (Mode C, caller-supplied);
- change content — the working-tree
git diff HEAD -- <those files>;
- context — what the chat agreed this work was for.
Step 6 — Final gate and commit
- Read the final scoped diff and confirm every review and docs decision is resolved.
- Run only applicable checks whose Step 4 evidence was invalidated; reuse evidence under the post-Full table.
- Commit all files changed by this run.
Step 7 — Repository instructions
After the commit, read and follow meta/workflows/execution/execution-instructions.md if it exists.
Step 8 — Done report
**Execute-chat complete:**
- Shipped: [one line]
- Waves: [n] · review: [clean | P0/P1 fixed: …]
- Verified: [commands + results] · live: [PASS | user-confirmed | not applicable]
- Commit: [hash]
- Deferred: [one line each | none]
(Write None — nothing deferred when the deferred list is empty.)
Rules
- The chat is the spec. Execute only agreed work; defer new ideas.
- Keep the ledger current.
TaskUpdate each entry to in_progress when work starts and completed when it lands.
- Verify diffs, not reports. Read each actual diff before accepting a wave, review fix, or docs pass.
- Parent role. The parent plans, dispatches, verifies, adjudicates, and reports; it writes only small confirmed fixes and inline docs.
1---2name: execute-chat3description: Execute work already agreed in the current chat without a plan.md. TRIGGER when: the user explicitly asks to use execute-chat.4---56# Execute Chat78## Protocol910### Step 0 — Readiness gate1112Judge the chat and verified evidence against two lenses without reopening settled points.1314**WHAT is clear (product lens):**15- **Outcome:** what changes for the user or system.16- **Scope:** what is in and out.17- **Behavior:** the user-visible behavior and material edge cases.1819**HOW is decided (tech lens):**20- **Approach:** chosen, with alternatives rejected for stated reasons.21- **Fit:** follows the existing architecture and patterns; deviations are justified.22- **Decisions:** data shapes, code locations, and affected interfaces are locked.23- **Evidence:** load-bearing claims are verified against source.24- **Risks:** mitigated or explicitly accepted.2526Route by gap size:27- **All settled** — confirm in one line each and proceed.28- **Small gaps** — ask 1–3 targeted questions via `AskUserQuestion`, then proceed.29- **WHAT genuinely open** — stop; confirm with the user, then invoke the `product-interview` skill via the Skill tool.30- **HOW genuinely open** — stop; confirm with the user, then invoke the `tech-design` skill via the Skill tool.31- **Both open** — `product-interview` first.3233```34**Readiness:**35- WHAT: [settled — one line | gaps: …]36- HOW: [settled — one line | gaps: …]37- Proceeding | Asking | Routing to [skill]38```3940### Step 1 — Plan from the chat41421. Create one task per agreed item; add nothing else.432. Group tasks into dependency-ordered, file-disjoint waves; put consumers in later waves.443. Review once after all waves unless the user objects. Review each wave when later work depends on its untested output or shared contracts.454. Use `TaskCreate` for each wave, review, working gate, comments + durable docs, and commit. Do not create entries for build subagents or the done report.4647```48**Plan:**49- Tasks: [n], waves: [wave → tasks, one line per wave]50- Review cadence: [at end | per wave] — [one-line reason]51```5253### Step 2 — Build waves5455Use the requested model; otherwise select one per logical task:5657- **Sonnet — only when every condition holds:**58 - The edit is fully specified and follows an existing pattern.59 - Assigned files are known and bounded.60 - Behavior, architecture, and contracts require no unresolved choice.61 - It touches no schema, migration, auth, security, concurrency, payments, destructive data, or public, shared, or external interface.62 - The dispatch includes a verification check.63- **Opus — otherwise.**64- **Grouped work:** classify a subagent's full assignment; any Opus condition selects Opus.65- **Escalation:** upgrade Sonnet to Opus when new scope, coupling, or ambiguity appears; never downgrade the task.6667For each wave, launch one subagent per logical task in parallel. Give each subagent its task, file paths, and these rules:6869- Before the first write, resolve each target path and read its governing repository instructions and Claude path rules in `.claude/rules/` whose quoted `paths:` globs match it; use the intended path for a new file.70- Edit assigned files only; report any needed extra file before editing.71- Scope Git reads and mutations to assigned files; never run `git stash`, `git checkout -- .`, `git reset`, or another whole-tree mutation.72- Read a committed baseline without changing shared state with `git show HEAD:<path>`.73- Write a comment only for what the code cannot say: a constraint, assumption, or coupling.74- Run the narrowest check that proves the assigned change, plus directly affected tests; reserve broader checks for Step 4.75- Do not commit.76- Return `{ files_changed, summary }`.7778Accept each wave in order:79801. Read its actual working-tree diff: `git diff -- <reported files>`.812. Add its `files_changed` to the running scope for later diffs and the docs pass.823. If it needs another file, rerun that task serially with the file included.8384### Fix-loop packet8586Every `fix-verify-loop` invocation in Steps 3–4 passes:8788- **Findings:** Confirmed P0/P1 findings with their `validated_by` value and verdict evidence.89- **Artifact paths:** The run's collected files. A finding or its evidence may identify another path, but editing it requires the fix-loop scope-expansion gate.90- **Criteria:** Each finding's criterion plus the relevant settled WHAT and HOW facts from the readiness gate. A working-gate failure also includes the expected verification or live-test result.9192### Post-fix review9394After all fixes for one review or working-gate failure are accepted, union their returned `files_changed` as `<fix files>` and select one regression scope:9596| Scope | Use when | Action |97|---|---|---|98| **Bounded** | Every condition holds: at most 5 fix files and 400 changed lines in their working-tree diff from `HEAD`; no schema, migration, auth, security, concurrency, payment, destructive-data, or shared-interface change; clear affected WHAT/HOW facts, callers, and consumers. | Invoke the `two-pass-review` skill via the Skill tool over `git diff HEAD -- <fix files>`, licensed to inspect affected callers and consumers. |99| **Whole run** | Any Bounded condition fails or its evidence is unclear. | Invoke the `two-pass-review` skill via the Skill tool over `git diff HEAD -- <run files>`. |100101Run this gate once per review or working-gate failure. Give the reviewer the addressed findings and initial-review evidence; ask only whether the fixes caused regressions. Reuse unaffected initial evidence. Resolve confirmed regressions with the same [Fix-loop packet](#fix-loop-packet) without another automatic post-fix review.102103### Step 3 — Review104105- At the Step 1 cadence, invoke the `two-pass-review` skill via the Skill tool over `git diff -- <run files>` or the current wave's files.106- Invoke the `fix-verify-loop` skill via the Skill tool with the [Fix-loop packet](#fix-loop-packet) for confirmed P0/P1 findings.107- After every fix-loop run, add its returned `files_changed`—the authoritative path list—to the run's collected files before the next review, docs pass, or commit.108- Resolve every fix-loop escalation and its staged changes with the user before continuing.109- Fix P2 findings required by the agreed scope; dispatch non-small fixes to a build subagent and defer other P2/P3 findings.110- Send out-of-scope findings to the done report's deferred list.111- If the initial review produced fixes, run [Post-fix review](#post-fix-review).112113### Step 4 — Working gate114115Choose the smallest verification level that covers the current risk:116117| Level | When | Scope |118|---|---|---|119| **Focused** | During each task and finding fix. | The narrowest test that proves the change, plus directly affected tests. |120| **Subsystem** | After a coupled wave or fix group when later work depends on it or focused checks cannot prove the interaction. | The smallest relevant subsystem suite. |121| **Full** | Once after review fixes stabilize the run and known overlapping edits to the code or test corpus settle. | Every applicable project-wide verification command. |122123- **Early Full:** escalate only for shared test infrastructure, order dependence, or a defect reproducible only in the full suite.124- **Harness exit:** if test bodies pass but the harness fails to exit, stop trying equivalent runner modes unless a new hypothesis distinguishes the rerun; use Fix/Accept/Abort below and record harness debt only on Accept.125126After Full passes, classify later edits:127128| Later edit | Required verification |129|---|---|130| Documentation or comments only | Reuse the Full evidence. |131| Local code with a clear blast radius | Always rerun Focused; add Subsystem only for a coupled local interaction; reuse the unaffected Full evidence. |132| Shared interface, test infrastructure, order/global state, multiple subsystems, or unclear blast radius | Rerun Focused and Full. |133134- If `meta/workflows/automated-testing/automated-testing-instructions.md` exists, use it to test the implemented behavior when relevant.135- If verification or live testing fails, ask the user whether to fix, accept, or abort:136 - **Fix** → create a confirmed finding. Set `validated_by: "machine"` only for an exact automated check and observed failure; otherwise set `validated_by: null`. Invoke `fix-verify-loop` with the [Fix-loop packet](#fix-loop-packet); add its returned files to the collected scope; resolve every escalation and staged-change choice; run [Post-fix review](#post-fix-review); rerun the working gate.137 - **Accept** → carry the risk in the done report.138 - **Abort** → stop.139140### Step 5 — Comments and durable docs141142Invoke the `durable-docs-update` skill via the Skill tool inline with:143144- **scope** — the run's collected `files_changed` (Mode C, caller-supplied);145- **change content** — the working-tree `git diff HEAD -- <those files>`;146- **context** — what the chat agreed this work was for.147148### Step 6 — Final gate and commit1491501. Read the final scoped diff and confirm every review and docs decision is resolved.1512. Run only applicable checks whose Step 4 evidence was invalidated; reuse evidence under the post-Full table.1523. Commit all files changed by this run.153154### Step 7 — Repository instructions155156After the commit, read and follow `meta/workflows/execution/execution-instructions.md` if it exists.157158### Step 8 — Done report159160```161**Execute-chat complete:**162- Shipped: [one line]163- Waves: [n] · review: [clean | P0/P1 fixed: …]164- Verified: [commands + results] · live: [PASS | user-confirmed | not applicable]165- Commit: [hash]166- Deferred: [one line each | none]167```168169(Write `None — nothing deferred` when the deferred list is empty.)170171## Rules172173- **The chat is the spec.** Execute only agreed work; defer new ideas.174- **Keep the ledger current.** `TaskUpdate` each entry to `in_progress` when work starts and `completed` when it lands.175- **Verify diffs, not reports.** Read each actual diff before accepting a wave, review fix, or docs pass.176- **Parent role.** The parent plans, dispatches, verifies, adjudicates, and reports; it writes only small confirmed fixes and inline docs.