Skip to main content
skill CX Codex

swarm · zaxbyhub, opencode — Claude Code skill: what it does, how to install

Swarm mode for the agent: parallel exploration, an independent reviewer, a critic, and a closeout gate that blocks completion until the diff passes.

MIT ★ 539 updated 2026-10-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ZaxbyHub/opencode-swarm --skill swarm -a claude-code
Open on GitHub

What swarm does

Swarm mode makes the host agent an orchestrator. Breadth comes first, and quality is the only metric that counts. Exploration and codebase mapping fan out across parallel subagents, yet whatever they return stays a candidate finding until another context checks it.

Validation sits apart from generation. A reviewer reads candidates with a skeptical default and marks them DISPROVED or UNVERIFIED unless code backs them up; a critic then attacks what the reviewer already approved. Edits to code, tests or docs must clear the closeout gate: validation output recorded, a fresh reviewer on the current diff, a separate critic round. Every NEEDS_REVISION, REJECTED or BLOCKED item gets fixed and re-reviewed, and the verdicts go into task artifacts such as 08b-implementation-review.md and 09-final-critic.md.

Turning it on means writing a contract file into the session directory: .claude/session/swarm-mode.md on Claude, .codex/session/swarm-mode.md on Codex, .zcode/session/swarm-mode.md on OpenCode. Delegation carries the whole design. With no independent context available, the skill says to disclose that rather than pass self-review off as validation. Any edit made after an approval voids it, so the review loop runs again.

What it helps with

  • map a large codebase with parallel subagents
  • keep candidate findings apart from validated ones
  • gate a code change behind a fresh reviewer and a critic
  • catch regressions in auth, payments and migrations
  • record review verdicts in task artifacts

Example prompts for the agent

  • Turn on swarm for this session and write the contract to .claude/session/swarm-mode.md
  • Map this repo with parallel subagents and give every finding to an independent reviewer
  • Take this fix through the closeout gate: fresh reviewer on the diff, then a critic

How to install swarm

1Skills CLI (Vercel)

npx skills add ZaxbyHub/opencode-swarm --skill swarm -a claude-code

2Manually: put the files in place

~/.claude/skills/swarm/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/swarm/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about swarm

How do I install swarm in Claude Code?

Run npx skills add ZaxbyHub/opencode-swarm --skill swarm -a claude-code. The skill lands at ~/.claude/skills/swarm/SKILL.md.

What does swarm do?

It puts the agent into a higher-rigor workflow: parallel exploration, independent reviewer validation, critic challenge, and a gate that blocks completion until the latest diff clears review.

How is the critic different from the reviewer?

The reviewer validates candidate findings and defaults to DISPROVED or UNVERIFIED. The critic only gets reviewer-confirmed findings and tries to overturn them.

Source text

SKILL.md · MIT
---
name: swarm
description: 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.
metadata:
  audience: swarm-plugin
---

## 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:
1. Parallel exploration and mapping for breadth
2. Parallel specialist review for disjoint concerns
3. Independent reviewer validation for findings that are high-risk, ambiguous, cross-file, or likely false-positive-prone
4. 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:

1. Objective validation has run and the commands/results are recorded.
2. A fresh independent implementation reviewer has reviewed the actual current diff and validation evidence.
3. A separate critic has challenged the reviewer-approved current diff and evidence.
4. Every `NEEDS_REVISION`, `REJECTED`, or `BLOCKED` reviewer/critic item was fixed with code, docs, or evidence and then re-reviewed.
5. The latest edit is older than the latest reviewer approval and critic approval.
6. 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
1. Create the appropriate session directory if it does not exist.
2. Create or overwrite the session swarm-mode contract file with the exact content below.
3. Confirm that swarm mode is now enabled for this session.
4. 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:

```md
# 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

## 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.

© ZaxbyHub · MIT · ZaxbyHub/opencode-swarm

Similar skills

All skills for Agent setup: memory, context, orchestration →

swarm by other authors comes first.

swarm backnotprop A skill for Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI, and OpenCode that fans out N parallel subagents, drains their results, and returns a single consolidated report. Triggered by /swarm or the phrase "swarm this" in chat. CX Codex +1 10,300installs swarm langchain-ai swarm fans out independent items across subagents in parallel and aggregates the results. Useful for batch file reviews, labeling, and data extraction. CX Codex +1 9,700installs swarm ZaxbyHub Enables a rigorous swarm-style posture with parallel searches, visible plan updates, and dual review gates for code changes. CX Codex +1 ★ 539repo stars swarm ZaxbyHub Enables a multi-agent swarm workflow in the active session, running parallel subagents, independent review validation, and critic checks. CX Codex +1 ★ 539repo stars ce-work EveryInc ce-work — a skill for Claude Code, Codex, Cursor, and other coding platforms that takes a plan, specification, or work description and runs implementation from start to finish—writing code in phases, verifying each locally. CX Codex +1 3,900installs gitnexus-lfg abhigyanpatwari gitnexus-lfg runs the GitNexus engineering pipeline from initial planning to final review. Ideal when handling medium or large coding tasks that require an explicit sign-off checkpoint. CX Codex +1 244installs orchestrate Rohit Ghumare orchestrate coordinates multi-phase feature development with research, planning, gated implementation, and code review in Claude Code. CX Codex +1 ★ 2,966repo stars rpi boshu2 Drives an accepted change through code and verification to done. Triggers when asked to run or coordinate work using RPI. CX Codex +1 1,500installs gitnexus-pr-swarm-review abhigyanpatwari The gitnexus-pr-swarm-review skill splits a pull request review across seven subagents and assembles a production-readiness report. It is built for on-demand PR analysis. CX Codex +1 438installs Swarm Orchestration ruvnet Swarm Orchestration — a skill for managing agent swarms with parallel execution, dynamic topology, and automatic load balancing. Use when a single agent is not enough and you need to orchestrate specialists of different types. CX Codex +1 2,100installs

From the same set121

The whole set →
critic-gate The critic-gate skill sends a plan to a critic agent and blocks execution until approval is recorded. Use it to review a plan before implementation starts. CX Codex +1 ★ 539repo stars tech-debt-ci-review tech-debt-ci-review audits a repository for technical debt and CI stability: tests that prove nothing, flakes and brittle build steps that keep pull requests from going green. CX Codex +1 ★ 539repo stars deep-research deep-research runs a multi-step fact-checked research loop with live web search, parallel worker synthesis, and strict claim citation. CX Codex +1 ★ 539repo stars docs-specialist The docs-specialist subagent audits project docs against the code, then helps revise them. Use it to check a README, API reference, or tutorial set. CX Codex +1 ★ 539repo stars ai_slop_reviewer ai_slop_reviewer audits codebases for empty stubs, hallucinated dependencies, testing theater, and LLM-generated structural flaws before production release. CX Codex +1 ★ 539repo stars codebase-review-swarm The codebase-review-swarm skill audits a repository and ties each finding to source evidence. Use it for focused security, QA, accessibility, performance, or other review tracks. CX Codex +1 ★ 539repo stars specify Turns on SPECIFY mode: the agent checks which spec is effective in the repo, then writes .swarm/spec.md with requirements and success criteria. CX Codex +1 ★ 539repo stars ci-fixer ci-fixer is a Claude Code subagent that diagnoses and remediates GitHub Actions pipeline failures layer by layer in opencode-swarm. CX Codex +1 ★ 539repo stars

Project sponsors

Companies that keep this analytics open