Execution strategy - how the work runs, not only what it changes, checked in tiers
A plan that names every file to change can still run badly: on the wrong route (a direct edit where
the change needed the user's sign-off, a gated flow for a two-file fix), serial where independent
parts could have run at once, fanned out where two parts share a file and collide, or on a model the
work does not need. So before a build or a fix starts, decide HOW it runs - the route, the mode and
the model - and recommend the parallel form whenever nothing is lost by it. Multi-agent work costs
several times a single session, so parallel SEATS need units that are each sizeable as well as
quality-safe; batched calls are the free parallel form. Every number below is a starting point to
tune on what the project measures, not a law.
The measurements behind these rules live in references/evidence.md - an audit appendix, not a run-time load.
When to use
- Fires before the first edit of a task that needs more than a few steps across more than one file or subtask, spans stacks, touches auth, a migration or a public contract, or would fan work out to seats. A small task settles route, mode and model inline from the always-on line (a direct edit, one agent, batched calls, the session's model) - no load.
- It decides the route, the mode, the model and the check tiers. Test-first (
habits-test-first) still runs inside each track, and this skill never replaces it.
- Inside a flow that owns dispatch - the solve flows, the diagnose flow, the version-upgrade flow - the flow calls it before its build-mode ask (the upgrade flow's approval gate) or its fix task cards. The route is then the flow, so it supplies the mode and the model in the
Execution: verdict and the option it recommends; the flow keeps the plan file, the approval gate, the dispatch and the seats. A serial verdict moves the gate's mark to the in-session option, never past the gate: the flow's seats stand until the user picks in-session there.
Route - where the work runs
Outside a flow, pick the lightest route that keeps the work safe, from the task and the code it
touches:
- Direct - this session edits and verifies. The default for any task the session can finish
and check itself.
- The gated single-chat solve flow - a change whose design should be signed off before it is
built: an auth, payment, migration or public-contract path, or a request that asks for approvals.
Also the route for parallel EDIT seats on one stack (its agents mode).
- The cross-domain solve flow - work spanning backend and frontend, or one that needs seats
routed and a seam held between them.
- The diagnose flow - a failure whose evidence is outside the code (logs, a red CI run, a trace,
a screenshot) and whose cause is not yet known. A failure in front of you goes to the root-cause
habit first, here.
- The greenfield or framework-upgrade flows - a new app before any code exists, or a version
bump with breaking changes across the codebase.
Parallel edit seats are a flow's job: an implementer seat dispatches only on an approval stamp that a
flow writes from the user's answer, so on the direct route the seats are read-only ones
(investigation, evidence) and edits run here.
The flows are user-invoked, so a route other than direct is never a silent switch: put it through
this ask before the first edit, and end the turn on it.
This task fits <the flow>: <what it adds for THIS task>. Start it, or proceed here directly?
- 'Start <the flow's slash command> (Recommended)' - <what the flow adds for this task>
- 'Proceed direct' - <what is given up: the sign-off, the parallel seats, the seam check>
'Start' hands the user the command to type. 'Proceed direct', or a flow that is not installed,
leaves the route direct; a parallel-edit verdict then runs as batched calls or in order here.
How it runs - decide before the mode
For each subtask of the plan, or each task card of a flow, settle four things from the code, not
from the task's wording:
- What it writes - the files, and any shared contract, manifest, lockfile, migration or DI
registration it touches.
- What it needs first - another unit's output (a type, an endpoint, a migration) or nothing.
- How it is verified alone - the test or build that shows it works without the others, or
'only the integrated run shows it'.
- Whether the design is settled - a unit whose decision is still open is not ready to run
anywhere but here.
Then ask the one question that sets the mode: can these units run at the same time without losing
quality? Quality is lost when two units write the same file or shared contract, when one needs
another's output, when a unit cannot be verified alone, or when a unit still needs a decision only
this session holds. When none of those holds for two or more units, parallel loses nothing and
parallel is the recommendation - batched tool calls for small units, parallel seats for sizeable
ones (Mode, below). When one holds, those units run in order; the rest may still run side by side.
Model - what each part runs on
- This session runs on the model and effort the user chose; this skill never changes them.
Name a switch in the verdict only when the work's risk needs deeper reasoning than the session
has - a cross-domain contract design, a hard root cause - never by default.
- A seat runs on its frontmatter pin; that pin is the default. Where the platform takes a model
per dispatch, the model can be overridden for one task; the effort too (Claude Code 2.1.292+), but
only on the user's explicit ask, never on your own judgment. A lighter model only for
a mechanical task whose correctness shows on the diff AND an independent verifier re-runs its
gates; never below the pin on auth, a migration, concurrency, security, a shared contract seam or
unclear legacy code. The heaviest model is for design and hard root cause, not routine edits.
- A seat type with no pin (a general-purpose or explore subagent) runs on the session's model
unless the dispatch names one - the heaviest model, when the session runs on it. Name its model in
the verdict: the lighter one for read-only search, inventory and classification; the session's only
when the unit needs its reasoning - an unnamed read-only fan-out pays the heaviest model's price for
work the lighter one does.
- Inside the cross-domain solve flow its model-routing reference (the role table, the escalation
column, the designer's per-task model) wins; outside it, these lines are the whole rule.
The verdict
State it in one line, the line a flow's mode ask carries as its reason (inside a flow, route is
the flow):
Execution: route <direct | the flow offered> - mode <serial | batched | parallel seats: <n>> - model <session | seat pins | <seat>=<model>> - <why>; parallel keeps quality: <yes - each unit owns its files and is verified alone | no - <the shared file, contract or output>>
Filled in, for a change whose two handlers both read a new DTO:
Execution: route direct - mode serial - model session - the DTO lands first, both handlers read it; parallel keeps quality: no - each handler needs the DTO's output
Inside a flow, the recommended option follows the verdict: parallel seats marks the flow's
seats option, serial or batched the in-session one. Where no dispatch is available,
parallel seats becomes batched calls in this session, said in the verdict.
The plan - inline, five to ten lines
In the reply or the todo list, never a plan file - a flow's plan file included: there the
Execution: line rides the flow's mode ask, and a diagnose flow states it in its close. Then
proceed without waiting unless a stop below applies.
Where a scorer: on line naming the inline plan or a scorer: stacked line is in context, the FIRST action before releasing the plan and its Execution: line is the mode-output-scorer Skill call with output inline-plan.
- Subtasks - each with the files it touches.
- Dependencies - dependent when one consumes the other's output, or both touch the same file, project or manifest file, lockfile, migration, DI registration or shared contract.
- Route, mode, model - the
Execution: verdict above.
- Checks - what runs per batch, what runs once at the end.
Mode
- One agent, in order - the quality check fails for these units.
- One agent, batched calls - the check passes and the units are small. Reads, searches and commands that do not depend on each other go in the same turn; a call whose input is another's result waits.
- Parallel seats - the check passes for two or more units that are each sizeable (about ten tool calls, or a wide read that would flood this context) and whose shared contracts already exist in code. Up to
ALFRED_CODE_MAXIMUM_RUN_AGENTS at once (the start line's 'Agents at once', else 5), queueing the rest as seats return. Never for a handful of calls (those are batched), never to re-check your own work.
- A fork or a briefed seat - a fork starts from this whole conversation and re-sends it on every turn it takes; a named or Explore seat starts from its own floor plus the brief. Past the install's fresh-session trigger, brief a named or Explore seat; fork only a seat that needs this conversation's own state - the re-sent parent dominates a fork's input.
Edit seats are the house <stack>-implementer, inside a flow (Route, above); read-only seats run on any route. The dispatch guard blocks a generic dispatch while a flow stamp is live. Seats that edit files in one directory each get a separate worktree where the platform offers one - and only when every contract they build on is COMMITTED: a worktree branches from HEAD, so seats that need this session's uncommitted plan, keys or files build in the shared tree, one owner per file. With no dispatch available, run the tracks inline in order.
A fan-out, in three steps
- Contracts first, in order. Shared interfaces, DTOs, schema and migrations, DI registrations and file ownership, then one build to prove they compile.
- Brief each seat completely - it cannot see this conversation: the objective, the files it owns and the ones it must not touch, the contract to code against, the tier-1 checks it must pass, and the report shape (changes, files, check results, open questions).
- Integrate one track at a time, conflicts settled here. A seat's 'tests pass' or 'no other callers' stays unverified until the integrated build and tests confirm it.
Inside the cross-domain solve flow its domain-trio protocol (split balance, the worktree brief, status routing, fan-in) wins; outside it, these three steps are the whole rule.
Checks, in three tiers
Errors compound across steps, so check as you go, but never run the heavy suite after every step.
- Tier 1, per batch (seconds) - build or typecheck the affected project, lint the changed files, run only the tests covering the change. Fix before the next batch.
- Tier 2, once after the whole change (minutes) - the full build and the full unit and integration suites, e2e where the project has them; the done gate runs on this.
- Tier 3, once before a push - only where the project has a CI compose file or a Dockerfile test stage that CI calls: run it locally, images built from this branch. What ran, or
NOT RUN - <reason>, is the push receipt's live-probe: line (the commit checkpoint owns the receipt). A CI step that cannot run here (secrets, cloud services, another OS's runner, signing) is named in the close. No such file: no Tier 3 - never invent one.
A wait of minutes runs in the background (the quality-gates rule).
Stops
Beyond the always-on stops:
A plan needing more than about five seats, or a scope far past the request: ONE AskUserQuestion first, the trimmed plan recommended:
The plan needs <N> seats / reaches <the scope past the request>. Run the trimmed plan?
- 'Run the trimmed plan (Recommended)' - <the seats or scope kept, and what is left out>
- 'Run the full plan' - <N> seats, queued at the agent cap
A required secret or service is missing and no local stand-in exists: report it, do not work around it.
The close
One line on the route, mode and model and why, what changed, each tier's command with its result, and what was not verified here with the reason.
Signs it was skipped
- This skill loaded and no
Execution: line after it - no plan, no mode, no close with the tiers.
- A seat type with no pin dispatched with no model named.
- Seats dispatched for work a few tool calls would have finished.
- Independent, separately verifiable units built one after another with no
Execution: line saying why.
- A flow's mode ask whose recommendation names no execution verdict.
- A gated or cross-domain change started as a direct edit with no route ask, or an implementer seat dispatched on the direct route.
- A seat dispatched below its pin on a risk path.
- A fork dispatched past the fresh-session trigger for a unit a brief could carry.
- Inside a flow, its seats dropped with no gate answer picking in-session.
- The full suite re-run after every step, or CI treated as the first real test.
- Two seats editing one file or one shared contract.
- A seat's report taken as proof without the integrated run.
1---2name: habits-execution-strategy3description: "Use before deciding how to run a multi-step build or fix - route, mode, seats, 'split this up', 'run in parallel'. Not for a small task, which settles inline."4metadata:5 source: https://skillmd.com/skills/envoydev/habits-execution-strategy6---78# Execution strategy - how the work runs, not only what it changes, checked in tiers910A plan that names every file to change can still run badly: on the wrong route (a direct edit where11the change needed the user's sign-off, a gated flow for a two-file fix), serial where independent12parts could have run at once, fanned out where two parts share a file and collide, or on a model the13work does not need. So before a build or a fix starts, decide HOW it runs - the route, the mode and14the model - and recommend the parallel form whenever nothing is lost by it. Multi-agent work costs15several times a single session, so parallel SEATS need units that are each sizeable as well as16quality-safe; batched calls are the free parallel form. Every number below is a starting point to17tune on what the project measures, not a law.1819The measurements behind these rules live in `references/evidence.md` - an audit appendix, not a run-time load.2021## When to use2223- Fires before the first edit of a task that needs more than a few steps across more than one file or subtask, spans stacks, touches auth, a migration or a public contract, or would fan work out to seats. A small task settles route, mode and model inline from the always-on line (a direct edit, one agent, batched calls, the session's model) - no load.24- It decides the route, the mode, the model and the check tiers. Test-first (`habits-test-first`) still runs inside each track, and this skill never replaces it.25- Inside a flow that owns dispatch - the solve flows, the diagnose flow, the version-upgrade flow - the flow calls it before its build-mode ask (the upgrade flow's approval gate) or its fix task cards. The route is then the flow, so it supplies the mode and the model in the `Execution:` verdict and the option it recommends; the flow keeps the plan file, the approval gate, the dispatch and the seats. A `serial` verdict moves the gate's mark to the in-session option, never past the gate: the flow's seats stand until the user picks in-session there.2627## Route - where the work runs2829Outside a flow, pick the lightest route that keeps the work safe, from the task and the code it30touches:3132- **Direct** - this session edits and verifies. The default for any task the session can finish33 and check itself.34- **The gated single-chat solve flow** - a change whose design should be signed off before it is35 built: an auth, payment, migration or public-contract path, or a request that asks for approvals.36 Also the route for parallel EDIT seats on one stack (its agents mode).37- **The cross-domain solve flow** - work spanning backend and frontend, or one that needs seats38 routed and a seam held between them.39- **The diagnose flow** - a failure whose evidence is outside the code (logs, a red CI run, a trace,40 a screenshot) and whose cause is not yet known. A failure in front of you goes to the root-cause41 habit first, here.42- **The greenfield or framework-upgrade flows** - a new app before any code exists, or a version43 bump with breaking changes across the codebase.4445Parallel edit seats are a flow's job: an implementer seat dispatches only on an approval stamp that a46flow writes from the user's answer, so on the direct route the seats are read-only ones47(investigation, evidence) and edits run here.4849The flows are user-invoked, so a route other than direct is never a silent switch: put it through50this ask before the first edit, and end the turn on it.5152```ask53This task fits <the flow>: <what it adds for THIS task>. Start it, or proceed here directly?54- 'Start <the flow's slash command> (Recommended)' - <what the flow adds for this task>55- 'Proceed direct' - <what is given up: the sign-off, the parallel seats, the seam check>56```5758'Start' hands the user the command to type. 'Proceed direct', or a flow that is not installed,59leaves the route direct; a parallel-edit verdict then runs as batched calls or in order here.6061## How it runs - decide before the mode6263For each subtask of the plan, or each task card of a flow, settle four things from the code, not64from the task's wording:65661. **What it writes** - the files, and any shared contract, manifest, lockfile, migration or DI67 registration it touches.682. **What it needs first** - another unit's output (a type, an endpoint, a migration) or nothing.693. **How it is verified alone** - the test or build that shows it works without the others, or70 'only the integrated run shows it'.714. **Whether the design is settled** - a unit whose decision is still open is not ready to run72 anywhere but here.7374Then ask the one question that sets the mode: **can these units run at the same time without losing75quality?** Quality is lost when two units write the same file or shared contract, when one needs76another's output, when a unit cannot be verified alone, or when a unit still needs a decision only77this session holds. When none of those holds for two or more units, parallel loses nothing and78**parallel is the recommendation** - batched tool calls for small units, parallel seats for sizeable79ones (Mode, below). When one holds, those units run in order; the rest may still run side by side.8081## Model - what each part runs on8283- **This session** runs on the model and effort the user chose; this skill never changes them.84 Name a switch in the verdict only when the work's risk needs deeper reasoning than the session85 has - a cross-domain contract design, a hard root cause - never by default.86- **A seat** runs on its frontmatter pin; that pin is the default. Where the platform takes a model87 per dispatch, the model can be overridden for one task; the effort too (Claude Code 2.1.292+), but88 only on the user's explicit ask, never on your own judgment. A lighter model only for89 a mechanical task whose correctness shows on the diff AND an independent verifier re-runs its90 gates; never below the pin on auth, a migration, concurrency, security, a shared contract seam or91 unclear legacy code. The heaviest model is for design and hard root cause, not routine edits.92- **A seat type with no pin** (a general-purpose or explore subagent) runs on the session's model93 unless the dispatch names one - the heaviest model, when the session runs on it. Name its model in94 the verdict: the lighter one for read-only search, inventory and classification; the session's only95 when the unit needs its reasoning - an unnamed read-only fan-out pays the heaviest model's price for96 work the lighter one does.97- Inside the cross-domain solve flow its model-routing reference (the role table, the escalation98 column, the designer's per-task model) wins; outside it, these lines are the whole rule.99100## The verdict101102State it in one line, the line a flow's mode ask carries as its reason (inside a flow, `route` is103the flow):104105```106Execution: route <direct | the flow offered> - mode <serial | batched | parallel seats: <n>> - model <session | seat pins | <seat>=<model>> - <why>; parallel keeps quality: <yes - each unit owns its files and is verified alone | no - <the shared file, contract or output>>107```108109Filled in, for a change whose two handlers both read a new DTO:110111```112Execution: route direct - mode serial - model session - the DTO lands first, both handlers read it; parallel keeps quality: no - each handler needs the DTO's output113```114115Inside a flow, the recommended option follows the verdict: `parallel seats` marks the flow's116seats option, `serial` or `batched` the in-session one. Where no dispatch is available,117`parallel seats` becomes batched calls in this session, said in the verdict.118119## The plan - inline, five to ten lines120121In the reply or the todo list, never a plan file - a flow's plan file included: there the122`Execution:` line rides the flow's mode ask, and a diagnose flow states it in its close. Then123proceed without waiting unless a stop below applies.124125Where a `scorer: on` line naming the inline plan or a `scorer: stacked` line is in context, the FIRST action before releasing the plan and its `Execution:` line is the `mode-output-scorer` Skill call with output `inline-plan`.1261271. **Subtasks** - each with the files it touches.1282. **Dependencies** - dependent when one consumes the other's output, or both touch the same file, project or manifest file, lockfile, migration, DI registration or shared contract.1293. **Route, mode, model** - the `Execution:` verdict above.1304. **Checks** - what runs per batch, what runs once at the end.131132## Mode133134- **One agent, in order** - the quality check fails for these units.135- **One agent, batched calls** - the check passes and the units are small. Reads, searches and commands that do not depend on each other go in the same turn; a call whose input is another's result waits.136- **Parallel seats** - the check passes for two or more units that are each sizeable (about ten tool calls, or a wide read that would flood this context) and whose shared contracts already exist in code. Up to `ALFRED_CODE_MAXIMUM_RUN_AGENTS` at once (the start line's 'Agents at once', else 5), queueing the rest as seats return. Never for a handful of calls (those are batched), never to re-check your own work.137- **A fork or a briefed seat** - a fork starts from this whole conversation and re-sends it on every turn it takes; a named or Explore seat starts from its own floor plus the brief. Past the install's fresh-session trigger, brief a named or Explore seat; fork only a seat that needs this conversation's own state - the re-sent parent dominates a fork's input.138139Edit seats are the house `<stack>-implementer`, inside a flow (Route, above); read-only seats run on any route. The dispatch guard blocks a generic dispatch while a flow stamp is live. Seats that edit files in one directory each get a separate worktree where the platform offers one - and only when every contract they build on is COMMITTED: a worktree branches from HEAD, so seats that need this session's uncommitted plan, keys or files build in the shared tree, one owner per file. With no dispatch available, run the tracks inline in order.140141## A fan-out, in three steps1421431. **Contracts first, in order.** Shared interfaces, DTOs, schema and migrations, DI registrations and file ownership, then one build to prove they compile.1442. **Brief each seat completely** - it cannot see this conversation: the objective, the files it owns and the ones it must not touch, the contract to code against, the tier-1 checks it must pass, and the report shape (changes, files, check results, open questions).1453. **Integrate one track at a time,** conflicts settled here. A seat's 'tests pass' or 'no other callers' stays unverified until the integrated build and tests confirm it.146147Inside the cross-domain solve flow its domain-trio protocol (split balance, the worktree brief, status routing, fan-in) wins; outside it, these three steps are the whole rule.148149## Checks, in three tiers150151Errors compound across steps, so check as you go, but never run the heavy suite after every step.152153- **Tier 1, per batch (seconds)** - build or typecheck the affected project, lint the changed files, run only the tests covering the change. Fix before the next batch.154- **Tier 2, once after the whole change (minutes)** - the full build and the full unit and integration suites, e2e where the project has them; the done gate runs on this.155- **Tier 3, once before a push** - only where the project has a CI compose file or a Dockerfile test stage that CI calls: run it locally, images built from this branch. What ran, or `NOT RUN - <reason>`, is the push receipt's `live-probe:` line (the commit checkpoint owns the receipt). A CI step that cannot run here (secrets, cloud services, another OS's runner, signing) is named in the close. No such file: no Tier 3 - never invent one.156157A wait of minutes runs in the background (the quality-gates rule).158159## Stops160161Beyond the always-on stops:162163- A plan needing more than about five seats, or a scope far past the request: ONE AskUserQuestion first, the trimmed plan recommended:164165 ```ask166 The plan needs <N> seats / reaches <the scope past the request>. Run the trimmed plan?167 - 'Run the trimmed plan (Recommended)' - <the seats or scope kept, and what is left out>168 - 'Run the full plan' - <N> seats, queued at the agent cap169 ```170- A required secret or service is missing and no local stand-in exists: report it, do not work around it.171172## The close173174One line on the route, mode and model and why, what changed, each tier's command with its result, and what was not verified here with the reason.175176## Signs it was skipped177178- This skill loaded and no `Execution:` line after it - no plan, no mode, no close with the tiers.179- A seat type with no pin dispatched with no model named.180- Seats dispatched for work a few tool calls would have finished.181- Independent, separately verifiable units built one after another with no `Execution:` line saying why.182- A flow's mode ask whose recommendation names no execution verdict.183- A gated or cross-domain change started as a direct edit with no route ask, or an implementer seat dispatched on the direct route.184- A seat dispatched below its pin on a risk path.185- A fork dispatched past the fresh-session trigger for a unit a brief could carry.186- Inside a flow, its seats dropped with no gate answer picking in-session.187- The full suite re-run after every step, or CI treated as the first real test.188- Two seats editing one file or one shared contract.189- A seat's report taken as proof without the integrated run.