Goal
Turn the host agent into a swarm-like orchestrator that prioritizes complete,
evidence-backed results over elapsed time, token count, or dispatch count.
What this mode changes
When enabled, the agent should:
- use parallel subagents aggressively for disjoint exploration, codebase mapping, and specialist review
- separate candidate generation from validation
- use independent reviewer and critic contexts that are explicitly skeptical and suspicious
- avoid letting implementation and verification happen in the same context when verification quality would benefit from separation
- keep quality as the only metric that matters
- treat time pressure as nonexistent
- preserve normal host-agent strengths: parallel subagents, scoped exploration, and fast synthesis
- spend the deepest validation effort where it materially reduces ship risk,
without using time, token, or dispatch cost to waive a required gate
Quality policy
Code quality and pre-ship defect detection are paramount.
Elapsed time, token count, dispatch count, and perceived repository simplicity
are never reasons to weaken a required workflow step. Parallelism is used to
reduce wall-clock latency without reducing coverage or independence.
That means:
- parallelize breadth aggressively
- validate in depth selectively based on risk
- run every reviewer or critic loop required by the active workflow; optional
extra scrutiny may still be risk-targeted
- spend the most time on correctness, security, edge cases, regressions, and claimed-vs-actual mismatches
- keep low-risk nits cheap
Only explicitly optional workflow steps may be skipped. A required step remains
required even when the architect predicts that it will find nothing.
If a workflow step prevents real bugs from shipping, keep it even if it costs time.
Default triage model
Use this default escalation ladder for exploration, candidate findings, and read-only work:
- Parallel exploration and mapping for breadth
- Parallel specialist review for disjoint concerns
- Independent reviewer validation for findings that are high-risk, ambiguous, cross-file, or likely false-positive-prone
- Critic challenge only for reviewer-confirmed high-impact findings or when confidence is still not high enough
Do not use this risk ladder to weaken the mandatory implementation closeout gate below. Any task that edits code, tests, docs, package metadata, release notes, or skill files must still complete the implementation reviewer and final critic gates on the latest diff and evidence.
High-risk work includes:
- auth, authz, permissions, identity, session handling
- payments, billing, data mutation, destructive actions
- dependency changes, install scripts, lockfile changes
- public API changes, schema changes, migrations
- concurrency, retries, state machines, caching, queueing
- security-sensitive parsing, file access, subprocesses, secrets
Lower-risk read-only or answer-only work can use a lighter path if evidence is strong:
- answering a question about existing code or docs
- summarizing an already-reviewed diff without editing it
- reading logs or test output and explaining the likely cause
- checking whether a file or command exists without changing the worktree
Mandatory implementation closeout gate
For any swarm task that edits code, tests, docs, package metadata, release notes, or skill files, do not declare completion until all of these are true:
- Objective validation has run and the commands/results are recorded.
- A fresh independent implementation reviewer has reviewed the actual current diff and validation evidence.
- A separate critic has challenged the reviewer-approved current diff and evidence.
- Every
NEEDS_REVISION, REJECTED, or BLOCKED reviewer/critic item was fixed with code, docs, or evidence and then re-reviewed.
- The latest edit is older than the latest reviewer approval and critic approval.
- Reviewer and critic verdicts are recorded in durable task artifacts. For issue-tracer work, use
08b-implementation-review.md and 09-final-critic.md; for other changed-work tasks, create or update task-local review artifacts unless the repo forbids artifacts.
Explorer findings, plan critics, passing tests, and self-review do not satisfy the implementation reviewer gate. If subagent delegation is available and the user/session has authorized swarm work, fallback self-review is not allowed. If no independent context is available, disclose that limitation explicitly and do not imply full swarm validation.
Any edit after reviewer or critic approval invalidates that approval. Re-run the affected reviewer/critic gate before final synthesis.
Enablement steps
- Create the appropriate session directory if it does not exist.
- Create or overwrite the session swarm-mode contract file with the exact content below.
- Confirm that swarm mode is now enabled for this session.
- For the user's next complex task, follow the swarm-mode contract automatically unless the user disables it.
The session contract file is written to a runtime-specific session dir. Use the path that matches the host runtime:
| Runtime |
Session contract path |
| OpenCode |
.zcode/session/swarm-mode.md |
| Claude Code |
.claude/session/swarm-mode.md |
| Codex |
.codex/session/swarm-mode.md |
Write this exact file:
# Swarm Mode Contract
Swarm mode is enabled for this session.
## Core principles
- Quality is the only success metric.
- There is no time pressure.
- There is no reward for finishing in fewer passes.
- Large tasks require more disciplined verification, not less.
- Use parallel subagents whenever scopes are disjoint and doing so does not reduce quality.
- Keep breadth, validation, and final challenge in separate contexts when possible.
## Role model
- Explorer role: fast, broad, cheap, suspicious mapper and candidate generator
- Reviewer role: independent validator of candidate findings, hyper-critical and skeptical
- Critic role: final challenger of reviewer-confirmed findings, hyper-suspicious and willing to overturn weak claims
- Main thread: architect/orchestrator that assigns scopes, persists state, and synthesizes only validated outputs
## Hard rules
- Explorer findings are candidate findings, not final findings.
- Candidate findings should be validated by an independent reviewer context before being treated as confirmed whenever the task is important enough to justify it.
- Reviewer should default to DISPROVED or UNVERIFIED unless the finding is actually supported by code evidence and, when relevant, runtime-aware verification.
- Critic should challenge reviewer-confirmed findings in small batches.
- For any task that edits code, tests, docs, package metadata, release notes, or skill files, final completion requires an independent implementation reviewer approval and a separate critic approval on the latest diff and evidence.
- Passing tests, explorer output, plan critique, and self-review do not satisfy the final implementation reviewer or critic gates when independent subagents are available.
- Any edit after reviewer or critic approval invalidates that approval; re-run the affected gate.
- A `NEEDS_REVISION`, `REJECTED`, or `BLOCKED` verdict blocks final completion until fixed and re-reviewed.
- If quality and speed conflict, quality wins.
- Do not batch more aggressively or skip validation because the repo is large.
- Premature completion is a failure state.
## Parallelism policy
Use parallel subagents for:
- repository mapping
- subsystem investigation
- test analysis
- security review
- performance review
- dependency review
- docs/release drift review
- candidate-finding validation when clusters are disjoint
- changed-area impact analysis
- implementation planning across disjoint modules
Do not parallelize tasks that edit the same files unless the workflow explicitly isolates them.
Parallelism is the default speed lever.
Use it aggressively wherever scopes are disjoint.
Serial work is for synthesis, conflict-prone edits, and final high-confidence validation.
## Default execution pattern for complex tasks
1. Explore and map in parallel.
2. Build a plan.
3. Implement in scoped units.
4. Validate with independent reviewer context.
5. Challenge changed-work completion with a separate critic context.
6. Synthesize only validated results.
## Anti-rationalization rules
Ignore these thoughts:
- "This is probably fine"
- "The broad reviewer is good enough"
- "I can save time by merging validation stages"
- "This repo is too large to review this carefully"
- "I should move on because this is taking too long"
If any of those appear, slow down and return to the workflow.
How to behave after activation
For subsequent complex tasks in this session:
- load the
orchestrating-subagents skill for agent-type/model/effort tiering,
fan-out limits, and subagent prompt contracts
- load the
durable-session-state skill to persist plans, evidence, and
reviewer/critic verdicts so gates survive long sessions and compaction
- spawn subagents in parallel for disjoint scopes
- use one or more reviewer subagents to validate findings from explorer subagents or to validate implementation quality
- use critic subagents only after reviewer validation, not as the primary false-positive filter
- synthesize outputs with explicit status labels such as candidate, confirmed, disproved, unverified, or pre-existing when useful
- keep the main context clean by pushing reading-heavy work into subagents
Quota-degradation coverage
If a quota or provider limit blocks a lane, retry within the applicable workflow budget. Track each assigned file with its coverage status and evidence. Reassign unresolved files when capacity returns, and disclose remaining gaps in the final coverage report.
Wave accounting
Keep a per-wave ledger of dispatched, settled, retried, and unresolved lane IDs. Record each retry under the same obligation.
Suggested subagent prompts
When you need an explorer-style subagent, tell it:
- map the assigned scope quickly
- find candidate issues only
- be broad and suspicious
- return exact file/line references
- do not present findings as final truth
When you need a reviewer-style subagent, tell it:
- validate candidate findings from another subagent
- be hyper-critical and default to disbelief
- actively look for mitigating context that disproves each candidate
- use runtime-aware validation when safe and needed
- classify each item as CONFIRMED, DISPROVED, UNVERIFIED, or PRE_EXISTING
When you need a critic-style subagent, tell it:
- challenge reviewer-confirmed findings in small batches
- look for overclaimed severity, weak evidence, missing sibling-file checks, and poor actionability
- prefer removal over noisy weak inclusion
Notes
- This skill defines the cross-agent swarm-mode behavior model. Runtime adapters
(.claude, .agents) add execution-specific command wiring and agent notes.
- It does not permanently change project behavior.
1---2name: swarm-33description: Cross-agent swarm-mode behavior model — a higher-rigor workflow using parallel investigation, independent reviewer validation, and critic challenge, plus the mandatory implementation closeout gate. Runtime adapters (.claude, .agents) add execution-specific notes and command wiring.4metadata:5 source: https://skillmd.com/skills/zaxbyhub/swarm-36 audience: swarm-plugin7---89## Goal10Turn the host agent into a swarm-like orchestrator that prioritizes complete,11evidence-backed results over elapsed time, token count, or dispatch count.1213## What this mode changes14When enabled, the agent should:15- use parallel subagents aggressively for disjoint exploration, codebase mapping, and specialist review16- separate candidate generation from validation17- use independent reviewer and critic contexts that are explicitly skeptical and suspicious18- avoid letting implementation and verification happen in the same context when verification quality would benefit from separation19- keep quality as the only metric that matters20- treat time pressure as nonexistent21- preserve normal host-agent strengths: parallel subagents, scoped exploration, and fast synthesis22- spend the deepest validation effort where it materially reduces ship risk,23 without using time, token, or dispatch cost to waive a required gate2425## Quality policy26Code quality and pre-ship defect detection are paramount.27Elapsed time, token count, dispatch count, and perceived repository simplicity28are never reasons to weaken a required workflow step. Parallelism is used to29reduce wall-clock latency without reducing coverage or independence.3031That means:32- parallelize breadth aggressively33- validate in depth selectively based on risk34- run every reviewer or critic loop required by the active workflow; optional35 extra scrutiny may still be risk-targeted36- spend the most time on correctness, security, edge cases, regressions, and claimed-vs-actual mismatches37- keep low-risk nits cheap3839Only explicitly optional workflow steps may be skipped. A required step remains40required even when the architect predicts that it will find nothing.41If a workflow step prevents real bugs from shipping, keep it even if it costs time.4243## Default triage model44Use this default escalation ladder for exploration, candidate findings, and read-only work:451. Parallel exploration and mapping for breadth462. Parallel specialist review for disjoint concerns473. Independent reviewer validation for findings that are high-risk, ambiguous, cross-file, or likely false-positive-prone484. Critic challenge only for reviewer-confirmed high-impact findings or when confidence is still not high enough4950Do not use this risk ladder to weaken the mandatory implementation closeout gate below. Any task that edits code, tests, docs, package metadata, release notes, or skill files must still complete the implementation reviewer and final critic gates on the latest diff and evidence.5152High-risk work includes:53- auth, authz, permissions, identity, session handling54- payments, billing, data mutation, destructive actions55- dependency changes, install scripts, lockfile changes56- public API changes, schema changes, migrations57- concurrency, retries, state machines, caching, queueing58- security-sensitive parsing, file access, subprocesses, secrets5960Lower-risk read-only or answer-only work can use a lighter path if evidence is strong:61- answering a question about existing code or docs62- summarizing an already-reviewed diff without editing it63- reading logs or test output and explaining the likely cause64- checking whether a file or command exists without changing the worktree6566## Mandatory implementation closeout gate6768For any swarm task that edits code, tests, docs, package metadata, release notes, or skill files, do not declare completion until all of these are true:69701. Objective validation has run and the commands/results are recorded.712. A fresh independent implementation reviewer has reviewed the actual current diff and validation evidence.723. A separate critic has challenged the reviewer-approved current diff and evidence.734. Every `NEEDS_REVISION`, `REJECTED`, or `BLOCKED` reviewer/critic item was fixed with code, docs, or evidence and then re-reviewed.745. The latest edit is older than the latest reviewer approval and critic approval.756. Reviewer and critic verdicts are recorded in durable task artifacts. For issue-tracer work, use `08b-implementation-review.md` and `09-final-critic.md`; for other changed-work tasks, create or update task-local review artifacts unless the repo forbids artifacts.7677Explorer findings, plan critics, passing tests, and self-review do not satisfy the implementation reviewer gate. If subagent delegation is available and the user/session has authorized swarm work, fallback self-review is not allowed. If no independent context is available, disclose that limitation explicitly and do not imply full swarm validation.7879Any edit after reviewer or critic approval invalidates that approval. Re-run the affected reviewer/critic gate before final synthesis.8081## Enablement steps821. Create the appropriate session directory if it does not exist.832. Create or overwrite the session swarm-mode contract file with the exact content below.843. Confirm that swarm mode is now enabled for this session.854. For the user's next complex task, follow the swarm-mode contract automatically unless the user disables it.8687The session contract file is written to a runtime-specific session dir. Use the path that matches the host runtime:8889| Runtime | Session contract path |90|---|---|91| OpenCode | `.zcode/session/swarm-mode.md` |92| Claude Code | `.claude/session/swarm-mode.md` |93| Codex | `.codex/session/swarm-mode.md` |9495Write this exact file:9697```md98# Swarm Mode Contract99100Swarm mode is enabled for this session.101102## Core principles103- Quality is the only success metric.104- There is no time pressure.105- There is no reward for finishing in fewer passes.106- Large tasks require more disciplined verification, not less.107- Use parallel subagents whenever scopes are disjoint and doing so does not reduce quality.108- Keep breadth, validation, and final challenge in separate contexts when possible.109110## Role model111- Explorer role: fast, broad, cheap, suspicious mapper and candidate generator112- Reviewer role: independent validator of candidate findings, hyper-critical and skeptical113- Critic role: final challenger of reviewer-confirmed findings, hyper-suspicious and willing to overturn weak claims114- Main thread: architect/orchestrator that assigns scopes, persists state, and synthesizes only validated outputs115116## Hard rules117- Explorer findings are candidate findings, not final findings.118- Candidate findings should be validated by an independent reviewer context before being treated as confirmed whenever the task is important enough to justify it.119- Reviewer should default to DISPROVED or UNVERIFIED unless the finding is actually supported by code evidence and, when relevant, runtime-aware verification.120- Critic should challenge reviewer-confirmed findings in small batches.121- For any task that edits code, tests, docs, package metadata, release notes, or skill files, final completion requires an independent implementation reviewer approval and a separate critic approval on the latest diff and evidence.122- Passing tests, explorer output, plan critique, and self-review do not satisfy the final implementation reviewer or critic gates when independent subagents are available.123- Any edit after reviewer or critic approval invalidates that approval; re-run the affected gate.124- A `NEEDS_REVISION`, `REJECTED`, or `BLOCKED` verdict blocks final completion until fixed and re-reviewed.125- If quality and speed conflict, quality wins.126- Do not batch more aggressively or skip validation because the repo is large.127- Premature completion is a failure state.128129## Parallelism policy130Use parallel subagents for:131- repository mapping132- subsystem investigation133- test analysis134- security review135- performance review136- dependency review137- docs/release drift review138- candidate-finding validation when clusters are disjoint139- changed-area impact analysis140- implementation planning across disjoint modules141142Do not parallelize tasks that edit the same files unless the workflow explicitly isolates them.143Parallelism is the default speed lever.144Use it aggressively wherever scopes are disjoint.145Serial work is for synthesis, conflict-prone edits, and final high-confidence validation.146147## Default execution pattern for complex tasks1481. Explore and map in parallel.1492. Build a plan.1503. Implement in scoped units.1514. Validate with independent reviewer context.1525. Challenge changed-work completion with a separate critic context.1536. Synthesize only validated results.154155## Anti-rationalization rules156Ignore these thoughts:157- "This is probably fine"158- "The broad reviewer is good enough"159- "I can save time by merging validation stages"160- "This repo is too large to review this carefully"161- "I should move on because this is taking too long"162163If any of those appear, slow down and return to the workflow.164```165166## How to behave after activation167For subsequent complex tasks in this session:168- load the `orchestrating-subagents` skill for agent-type/model/effort tiering,169 fan-out limits, and subagent prompt contracts170- load the `durable-session-state` skill to persist plans, evidence, and171 reviewer/critic verdicts so gates survive long sessions and compaction172- spawn subagents in parallel for disjoint scopes173- use one or more reviewer subagents to validate findings from explorer subagents or to validate implementation quality174- use critic subagents only after reviewer validation, not as the primary false-positive filter175- synthesize outputs with explicit status labels such as candidate, confirmed, disproved, unverified, or pre-existing when useful176- keep the main context clean by pushing reading-heavy work into subagents177178## Quota-degradation coverage179180If a quota or provider limit blocks a lane, retry within the applicable workflow budget. Track each assigned file with its coverage status and evidence. Reassign unresolved files when capacity returns, and disclose remaining gaps in the final coverage report.181182## Wave accounting183184Keep a per-wave ledger of dispatched, settled, retried, and unresolved lane IDs. Record each retry under the same obligation.185186## Suggested subagent prompts187When you need an explorer-style subagent, tell it:188- map the assigned scope quickly189- find candidate issues only190- be broad and suspicious191- return exact file/line references192- do not present findings as final truth193194When you need a reviewer-style subagent, tell it:195- validate candidate findings from another subagent196- be hyper-critical and default to disbelief197- actively look for mitigating context that disproves each candidate198- use runtime-aware validation when safe and needed199- classify each item as CONFIRMED, DISPROVED, UNVERIFIED, or PRE_EXISTING200201When you need a critic-style subagent, tell it:202- challenge reviewer-confirmed findings in small batches203- look for overclaimed severity, weak evidence, missing sibling-file checks, and poor actionability204- prefer removal over noisy weak inclusion205206## Notes207- This skill defines the cross-agent swarm-mode behavior model. Runtime adapters208 (.claude, .agents) add execution-specific command wiring and agent notes.209- It does not permanently change project behavior.