
swarm
Dispatch a batch of tasks to subagents in parallel with bounded concurrency. Returns a summary object with {total, completed, failed, results[]} — iterate .results for per-task output.
- Installs
- 98
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/langchain-ai/deepagents --skill swarm- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads swarm automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Swarm
Fan out a list of tasks to subagents with bounded concurrency, collect results, and return a compact summary.
Loading
The REPL's eval tool supports ES module imports from @/skills/*.
Use await import("@/skills/swarm") to load this skill — the REPL
installs a custom module loader that resolves those paths against the
skills backend. Do not inline index.ts into your eval body.
Importing is the supported, tested path; copying the source is an
anti-pattern that duplicates logic and drifts on skill updates.
When to use
You have many independent tasks (e.g. "summarize each of these 20 files", "classify each of these 50 tickets", "research these 15 topics") and want them to run concurrently rather than sequentially.
Usage
runSwarm(...) returns a summary object, not an array. Destructure
.results for the per-task output — the summary itself is not iterable.
const { runSwarm } = await import("@/skills/swarm");
const { results, completed, failed } = await runSwarm({
tasks: [
{ description: "Summarize /notes/alpha.md" },
{ description: "Summarize /notes/beta.md" },
{ description: "Summarize /notes/gamma.md" },
],
concurrency: 3, // optional, defaults to 5, capped at 10
subagentType: "general-purpose", // optional; per-task override wins
});
console.log(`${completed} ok, ${failed} failed`);
for (const r of results) {
console.log(r.id, r.status, r.output ?? r.error);
}
Contract
The runSwarm(opts) function accepts:
tasks(required): an array of{ description: string, subagentType?: string }.concurrency(optional, default5, capped at10): max parallel subagent invocations.subagentType(optional, default"general-purpose"): the default subagent to dispatch each task to. A task's ownsubagentTypetakes precedence.
Returns a summary object:
{
total: number; // tasks.length
completed: number; // subagents that returned a result
failed: number; // subagents that threw
results: { // one entry per task, in input order
id: number; // 0-indexed position in `tasks`
status: "completed" | "failed";
output?: string; // on success — subagent's final message
error?: string; // on failure — error message
}[];
}
Design notes
- Dispatch goes through
tools.task, which the REPL's PTC layer exposes for us. The skill does not register any subagent itself — it's a fan-out pattern on top of what the agent already has. - Failures are caught per-task: one failed subagent does not abort
the swarm. Check the
failedcount and the per-taskstatus. - Concurrency is bounded with a semaphore-style pool rather than
Promise.allon everything. For 100 tasks withconcurrency=5, this keeps memory and tool-call rate predictable.
FAQ
What does the swarm skill do?
Dispatch a batch of tasks to subagents in parallel with bounded concurrency. Returns a summary object with {total, completed, failed, results[]} — iterate .results for per-task output.
How do I install swarm?
Run npx skills add https://github.com/langchain-ai/deepagents --skill swarm in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/swarm/ (personal) or .claude/skills/swarm/ (project).
Which AI agents can use swarm?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is swarm safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains swarm?
It is published by langchain-ai in langchain-ai/deepagents, and it is an official skill from the maker of the technology it covers. It has 98 recorded installs.
More from langchain-ai/deepagents
langgraph-docs
langchain-ai/deepagents
Fetches and references LangGraph Python documentation to build stateful agents, create multi-agent workflows, and implement human-in-the-loop patterns. Use when the user asks about LangGraph, graph agents, state machines, agent orchestration, LangGraph API, or needs LangGraph implementation guidance.
web-research
langchain-ai/deepagents
Searches multiple web sources, synthesizes findings, and produces cited research reports using delegated subagents. Use when the user asks to research a topic online, search the web, look something up, find current information, compare options, or produce a research report.
social-media
langchain-ai/deepagents
Drafts engaging social media posts, writes hooks, suggests hashtags, creates thread structures, and generates companion images. Use when the user asks to write a LinkedIn post, tweet, Twitter/X thread, social media caption, social post, or repurpose content for social platforms.
arxiv-search
langchain-ai/deepagents
Searches arXiv for preprints and academic papers, retrieves abstracts, and filters by topic. Use when the user asks to find research papers, search arXiv, look up preprints, find academic articles in physics, math, CS, biology, statistics, or related fields.
blog-post
langchain-ai/deepagents
Writes and structures long-form blog posts, creates tutorial outlines, and optimizes content for SEO with cover image generation. Use when the user asks to write a blog post, article, how-to guide, tutorial, technical writeup, thought leadership piece, or long-form content.
skill-creator
langchain-ai/deepagents
Guide for creating effective skills that extend agent capabilities with specialized knowledge, workflows, or tool integrations. Use this skill when the user asks to: (1) create a new skill, (2) make a skill, (3) build a skill, (4) set up a skill, (5) initialize a skill, (6) scaffold a skill, (7) update or modify an existing skill, (8) validate a skill, (9) learn about skill structure, (10) understand how skills work, or (11) get guidance on skill design patterns. Trigger on phrases like "create a skill", "new skill", "make a skill", "skill for X", "how do I create a skill", or "help me build a skill".
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available