Agent skill

Swarm

by softspark in softspark/ai-toolkit

Runs tasks via Map-Reduce, Consensus, or Relay swarms. An agent skill from softspark/ai-toolkit.

Apache-2.0Auto-check: notesAgent Workflows

Install Swarm

skills CLI
$ npx skills add softspark/ai-toolkit --skill swarm -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install softspark/ai-toolkit swarm --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/app/skills/swarm .claude/skills/swarm && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
swarm
GitHub stars
179
Token cost
~1.9k tokens
SKILL.md length
711 words
Files
1
Skills in repo
112
Repo updated
First seen
Licence
Apache-2.0

At a glance

Runs tasks via Map-Reduce, Consensus, or Relay swarms. An agent skill from softspark/ai-toolkit.

  • Works in 5 steps: Collect all agent outputs into a uniform… → De-duplicate identical findings across… → Synthesize unique insights into one report → …
  • Tasks that involve Subagents
  • SKILL.md covers MANDATORY: You MUST use the…, Modes, File Ownership Rules (CRITICAL) and Agent Tool Call Format, plus 3 more sections
  • Calls git

What it does

Swarm is an agent skill from softspark/ai-toolkit. Runs tasks via Map-Reduce, Consensus, or Relay swarms. Triggers: swarm, map-reduce, consensus swarm, relay swarm, parallel agents.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Subagents and Git worktrees. The repository describes itself as: Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Antigravity, Codex CLI… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Subagents
  • Tasks that involve Git worktrees

Example prompts

  • “/swarm”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, Write, Edit, Glob, Grep, Agent, TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskList, TaskUpdate, TaskGet, TaskOutput, TaskStop

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Collect all agent outputs into a uniform format (JSON or Markdown sections)
  2. De-duplicate identical findings across agents
  3. Synthesize unique insights into one report
  4. For Consensus mode: assess each proposal against shared evidence and acceptance criteria; investigate conflicting findings and record…
  5. Generate final swarm report

What it can do on your machine

Read from SKILL.md and the folder at commit d64db2b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Write
    • Edit
    • Glob
    • Grep
    • Agent
    • TeamCreate
    • TeamDelete
    • SendMessage

    …and 6 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Swarm loads about 1.9k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 711 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Write, Edit, Glob, Grep, Agent, TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskLis

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from softspark/ai-toolkit at commit d64db2b, republished under its Apache-2.0 licence (© softspark). 711 words, ~1,878 tokens.

Download SKILL.mdSave it as .claude/skills/swarm/SKILL.md (or your agent's skills folder).
name
swarm
description
Runs tasks via Map-Reduce, Consensus, or Relay swarms. Triggers: swarm, map-reduce, consensus swarm, relay swarm, parallel agents.
allowed-tools
Bash, Read, Write, Edit, Glob, Grep, Agent, TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskList, TaskUpdate, TaskGet, TaskOutput, TaskStop
user-invocable
true
effort
high
argument-hint
[map-reduce|consensus|relay] [--with-kb] [--worktree] [task]
context
fork
agent
orchestrator
model
opus

/swarm - Parallel Agent Swarm

$ARGUMENTS

<!-- CLAUDE_CODE_ONLY_START -->

Only in Claude Code, apply the model-routing-patterns skill when choosing executors or creating agent definitions. Delegate to codex:codex-rescue only when its plugin is installed, enabled and callable in this session. Otherwise use the installed native agents and their configured models. A context without the Agent tool returns the dispatch decision to its supervisor; it does not invent a tool or bypass the client. Preserve explicit user choices and verify actual completion before accepting a delegated result.

<!-- CLAUDE_CODE_ONLY_END -->

MANDATORY: You MUST use the Agent tool

When delegation is available, decompose the task and invoke agents via parallel Agent tool calls for independent work. If the runtime has no delegation support, use the current session and explicitly report single-agent execution. Never present simulated agents as a real swarm.

Modes

Map-Reduce (default)

Split task into N independent sub-tasks. Launch ALL agents in a single response (parallel execution).

# Single response with N Agent tool calls:
Agent(subagent_type="...", prompt="sub-task 1 — own files: path/a/")
Agent(subagent_type="...", prompt="sub-task 2 — own files: path/b/")
Agent(subagent_type="...", prompt="sub-task N — own files: path/n/")

After all complete: aggregate results (see Aggregation section below), produce synthesis report.

Consensus

Same problem, 3 independent agents from different angles. Launch all 3 in a single response.

Agent(subagent_type="backend-specialist",      prompt="[problem] — approach from data layer angle. Output: solution + confidence 0.0–1.0")
Agent(subagent_type="tech-lead",               prompt="[problem] — approach from architecture angle. Output: solution + confidence 0.0–1.0")
Agent(subagent_type="performance-optimizer",   prompt="[problem] — approach from performance angle. Output: solution + confidence 0.0–1.0")

After all complete: compare evidence and acceptance criteria, record dissent, and validate the proposed result. Self-reported confidence is advisory; it is not a calibrated probability and must not decide the winner on its own.

Relay

Sequential chain — each agent depends on the previous output. Launch one at a time, wait for completion before next.

# Round 1
Agent(subagent_type="tech-lead", prompt="Design the API spec. Output to docs/api-spec.md")
# Wait for completion

# Round 2
Agent(subagent_type="backend-specialist", prompt="Implement based on docs/api-spec.md. Own files: src/")
# Wait for completion

# Round 3
Agent(subagent_type="test-engineer", prompt="Write tests for src/. Own files: tests/")

File Ownership Rules (CRITICAL)

Each agent MUST own distinct file paths. No overlapping paths. No exceptions.

Agent Tool Call Format

Agent(
  subagent_type="<agent-name>",
  description="<3-5 word summary>",
  prompt="<full task description including: original request, specific sub-task, owned files, success criteria>"
)

Aggregation (after all agents complete)

  1. Collect all agent outputs into a uniform format (JSON or Markdown sections)
  2. De-duplicate identical findings across agents
  3. Synthesize unique insights into one report
  4. For Consensus mode: assess each proposal against shared evidence and acceptance criteria; investigate conflicting findings and record dissent. Confidence scores alone cannot choose the result.
  5. Generate final swarm report
File ownership during aggregation

When agents touch overlapping paths despite ownership rules: do NOT auto-merge. Escalate to user citing which two agents touched the same hunk. Use --worktree mode to prevent this proactively (see below).

KB-First Mode (--with-kb)

When $ARGUMENTS contains --with-kb, every spawned agent MUST receive KB context grounded in the project knowledge base.

Required pre-flight (run BEFORE spawning agents)
  1. Call mcp__rag-mcp__smart_query with the original task as query. Use use_multi_hop=true if the task spans 2+ concepts.
  2. Capture results[*].kb_id, title, content, and source_documents_used.
  3. Build a [KB CONTEXT] block (max 10 entries, pruned to top scores).
Per-agent prompt template (mandatory under --with-kb)
[KB CONTEXT — from rag-mcp smart_query, ground all decisions in these]
- {kb_id}: {title}
  {content excerpt, ≤300 chars}
- ...

[YOUR SUB-TASK]
{specific sub-task, owned files, success criteria}

[RULES]
- Cite KB entries as [PATH: kb_id] when you rely on them.
- If KB is silent on a decision, state that explicitly — do NOT invent.
- After producing your output, call mcp__rag-mcp__verify_answer with your answer + the cited kb_ids; include the verdict in your final report.
Show full SKILL.md (295 more words)Show less
Aggregation under --with-kb

The synthesis step MUST include a ## KB Coverage section listing which kb_ids were actually cited and any agent that returned verdict: unsupported.

When to skip --with-kb
  • Pure code-mechanical tasks (rename, format, dependency bump) — KB adds noise.
  • Tasks already scoped to one file with no cross-cutting concerns.

Isolated Worktrees Mode (--worktree)

When $ARGUMENTS contains --worktree, every spawned agent in Map-Reduce mode runs in its own git worktree on a throwaway branch. Aggregation merges or copies the changes back into the lead workspace.

Why
  • Agents touching adjacent files (same module, different functions) can race.
  • Writing to disjoint paths is not enough — file-locking, formatter cache, IDE indexers, and .git/index.lock all leak.
  • Worktrees give each agent a real filesystem-level boundary plus a named branch for review.
How (mandatory under --worktree)

Pass isolation: "worktree" to every Agent call:

Agent(
  subagent_type="...",
  description="...",
  prompt="...",
  isolation="worktree"
)

The Agent tool returns the worktree path and branch name on completion. Empty worktrees are auto-cleaned by the runtime when the agent made no changes — you don't have to.

Aggregation under --worktree

After all agents return:

  1. List the returned (path, branch) pairs.
  2. For each non-empty result: cd <main repo> && git merge --no-ff <branch> (or cherry-pick the commits if the agent didn't commit).
  3. If any merge conflicts → escalate, do NOT auto-resolve. Cite which two agents touched the same hunk.
  4. After successful merge → delete the worktree: git worktree remove <path> and the throwaway branch.
When --worktree is mandatory (not optional)
  • Map-Reduce with N≥3 agents touching the same module tree
  • Any task that runs the project formatter or codegen
  • Any task that mutates lockfiles, migrations, or generated artifacts
When to skip --worktree
  • Consensus mode — agents return analysis text, not file changes.
  • Relay mode — sequential by design, next agent reads prior agent's commit.
  • Single-agent fallback or KB-only research swarms.

© softspark, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in app/skills/swarm of softspark/ai-toolkit.

Open the folder on GitHubat commit d64db2b

Compare with similar skills

Swarm next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Swarm compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swarm this skillsoftspark/ai-toolkit179—~1.9kAutomated safety check: NotesApache-2.0
ClawTeam Multi-Agent Swarmwin4r/ClawTeam-OpenClaw1.5k1 repos~2.9kAutomated safety check: PassMIT
Agent Deckasheshgoplani/agent-deck1k—~1.7kAutomated safety check: PassMIT
Clawteamwin4r/ClawTeam-OpenClaw1.5k—~3.1kAutomated safety check: PassMIT
Puppetmaster Agent Orchestrationprofessorpalmer/Puppetmaster467—~3.2kAutomated safety check: PassMIT
Badstephenleo/bmad-autonomous-development107—~7.7kAutomated safety check: PassMIT

Similar skills

  • ClawTeam Multi-Agent Swarm

    win4r/ClawTeam-OpenClaw

    Launches a swarm of specialist Hermes agents in git-worktree-isolated tmux windows with a kanban board and file-based inboxes, using built-in templates like hedge-fund and code-review.

    1.5k GitHub starsUsed in 1 repo~2.9k tokens
    Agent WorkflowsAuto-check passed
  • Agent Deck

    asheshgoplani/agent-deck

    agent-deck, the terminal session manager for AI coding agents.

    1k GitHub stars~1.7k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Clawteam

    win4r/ClawTeam-OpenClaw

    Multi-agent swarm orchestration. An agent skill from win4r/ClawTeam-OpenClaw.

    1.5k GitHub stars~3.1k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Puppetmaster Agent Orchestration

    professorpalmer/Puppetmaster

    Operates and supervises Puppetmaster, a multi-agent orchestrator, through its MCP tools or CLI, picking the right verb for edits, reviews, audits and long-running jobs.

    467 GitHub stars~3.2k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Bad

    stephenleo/bmad-autonomous-development

    BMad Autonomous Development — orchestrates parallel story implementation pipelines.

    107 GitHub stars~7.7k tokensUpdated 5 mo ago
    Agent WorkflowsAuto-check passed
  • Weave

    entropyvortex/meta-llm-charter

    Parallel strand orchestration — decompose a task into 3+ independently scoped strands, fan out real subagents (worktree-isolated when they write files), and coordinate through a session file and…

    249 GitHub stars~2.9k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed

More from softspark/ai-toolkit

All 112 skills in this repo
  • Prepare Test Env

    softspark/ai-toolkit

    Prepare or verify a project QA environment with source identity, readiness, browser access, evidence paths and owned cleanup.

    179 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check: notes
  • A11y Validate

    softspark/ai-toolkit

    Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~3.8k tokensUpdated 2 days ago
    Auto-check: notes
  • Analyze

    softspark/ai-toolkit

    Analyzes code quality, complexity, patterns across codebase.

    179 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed
  • Autonomous Dev

    softspark/ai-toolkit

    Drives a brief, specification, issue or existing PR through implementation, review, tests and QA to a ready PR.

    179 GitHub stars~2.6k tokensUpdated 2 days ago
    Auto-check: notes
  • Brand Voice

    softspark/ai-toolkit

    Direct technical voice for docs, README, user-facing text. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • CI

    softspark/ai-toolkit

    Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI).

    179 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check: notes

Categories

Questions about Swarm

What does Swarm do?

Runs tasks via Map-Reduce, Consensus, or Relay swarms. An agent skill from softspark/ai-toolkit. Swarm is an agent skill from softspark/ai-toolkit. Runs tasks via Map-Reduce, Consensus, or Relay swarms.

When should I use Swarm?

Swarm fits situations like: tasks that involve Subagents; tasks that involve Git worktrees.

How do I install Swarm in Claude Code?

Run `npx skills add softspark/ai-toolkit --skill swarm -a claude-code`. Or copy the skill folder (app/skills/swarm in softspark/ai-toolkit) into .claude/skills/swarm in your project. Claude Code loads it when a task matches its description.

How do I install Swarm in Codex?

Run `npx skills add softspark/ai-toolkit --skill swarm -a codex`. Or copy the skill folder (app/skills/swarm in softspark/ai-toolkit) into .agents/skills/swarm in your project. Codex loads it when a task matches its description.

Can I use Swarm in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add softspark/ai-toolkit --skill swarm -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/swarm, .gemini/skills/swarm, .github/skills/swarm and .opencode/skills/swarm in your project.

What does Swarm need to run?

Going by SKILL.md and its folder, Swarm needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: Bash, Read, Write, Edit, Glob, Grep, Agent, TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskList, TaskUpdate, TaskGet, TaskOutput, TaskStop.

Does Swarm access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Swarm safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Swarm use?

Swarm is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Swarm use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Swarm?

Skills that share tags, products or a category with Swarm: ClawTeam Multi-Agent Swarm (win4r/ClawTeam-OpenClaw, 1.5k stars), Agent Deck (asheshgoplani/agent-deck, 1k stars), Clawteam (win4r/ClawTeam-OpenClaw, 1.5k stars) and Puppetmaster Agent Orchestration (professorpalmer/Puppetmaster, 467 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swarm?

softspark (a GitHub user) maintains it in softspark/ai-toolkit, which has 179 GitHub stars. The repository holds 112 skills in this directory. The repository was last updated on October 7, 2026.

Source: softspark/ai-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.