swarm
複雑なコーディング作業を、複数のAIエージェントが連携して自律的に実行し、レビューを挟みながら進めることで、大規模な機能追加やリファクタリングなどを効率的に行うSkill。
📜 元の英語説明(参考)
Autonomous multi-agent workflow system for complex coding tasks. Use when the user requests non-trivial changes that would benefit from autonomous execution with built-in review gates. Ideal for refactoring modules, adding major features, migrating codebases, adding comprehensive test coverage, or any multi-step development task that can run autonomously. NOT for simple fixes, typos, or single-file changes.
🇯🇵 日本人クリエイター向け解説
複雑なコーディング作業を、複数のAIエージェントが連携して自律的に実行し、レビューを挟みながら進めることで、大規模な機能追加やリファクタリングなどを効率的に行うSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o swarm.zip https://jpskill.com/download/19738.zip && unzip -o swarm.zip && rm swarm.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19738.zip -OutFile "$d\swarm.zip"; Expand-Archive "$d\swarm.zip" -DestinationPath $d -Force; ri "$d\swarm.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
swarm.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
swarmフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 4
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] swarm
Swarm: 自律型マルチエージェントワークフロー
調整された計画に基づいて複数のエージェントが連携し、複雑なコーディングタスクを自律的に実行します。
仕組み
- インタビュー — ユーザーから要件とコンテキストを収集します。
- 計画 — チェックボックスとレビューゲートを含む構造化された Markdown 計画を作成します。
- 実行 — 自律型エージェントを生成し、計画に基づいて作業させます。
- 完了 — エージェントは
.doneファイルで完了を通知します。
ワークフロー
ステップ1:ユーザーへのインタビュー
このスキルが呼び出されたら、効果的な計画を作成するために必要な情報を収集します。
必要な情報:
- 目標: 「完了」とはどのような状態ですか?(具体的かつ測定可能にしてください)
- コンテキスト: どのようなファイル/ディレクトリが関係していますか?主な制約は何ですか?
- テスト戦略: 成功を検証するコマンドは何ですか?(例:
npm test,pytest) - 計画の場所: 計画ファイルはどこに作成すべきですか?
インタビューの質問:
このタスクの自律型ワークフローを設定するお手伝いをします。
効果的な計画を作成するために、以下のことを理解する必要があります。
1. 具体的な目標は何ですか?「完了」とはどのような状態ですか?
2. どのようなファイルやディレクトリが関係していますか?
3. エージェントが実行すべきテストや検証コマンドは何ですか?
4. 計画ファイルはどこに作成すべきですか?(例: PLAN.md, AUTH_REFACTOR.md)
必要に応じて、スコープ、制約、または成功基準を明確にするための追加の質問をしてください。
ステップ2:計画の作成
assets/PLAN_TEMPLATE.md のテンプレートを開始点として使用し、ユーザーの要件に基づいてカスタマイズします。
計画の構造:
## Goal— 完了基準を定義する一文## Context— コードベースの構造、主要ファイル、制約## Plan— 各ステップにチェックボックスが付いたフェーズ## Agent Roles— レビューゲート(Reviewer, Simplifier, Tester, Gatekeeper)## Rules— エージェントの行動制約## Log— イテレーション間のエージェントのコミュニケーションスペース
重要なコンポーネント:
-
チェックボックス — すべてのステップはチェック可能でなければなりません。散文は避けてください。
-
レビューゲート — 定期的に視点変更を強制します。
- Reviewer (5回目のイテレーションごと): 目標に対する進捗を新鮮な目で確認します。
- Simplifier (最終フェーズ前): 過剰な設計を特定します。
- Tester (最終フェーズ前): テストを作成し、実行します。
- Gatekeeper (.done 前): 完了前の必須チェックリストです。
-
Gatekeeper チェックリスト — 以下を含める必要があります。
- 出力付きで実行するコマンド(
npm test,git diff --stat) - 証拠付きの明示的なはい/いいえの質問
- 理由付きのGO/NO-GO決定
- 出力付きで実行するコマンド(
-
Log セクション — エージェントはここに作業を追記します。フォーマット:
### Iteration N — YYYY-MM-DD HH:MM **Role:** [Worker / Reviewer / Simplifier / Tester / Gatekeeper] **What I did:** ... **Current state:** ... **Next agent should:** ...
計画ファイルの作成:
[FILENAME] に計画を作成しました。構造は次のとおりです。
- [フェーズの概要]
- [主要なレビューゲートに注目]
- [ゲートキーパーチェックリストを強調]
エージェントはこれを自律的に実行します。開始しますか?
ステップ3:自律型エージェントによる実行
計画が作成され、ユーザーが承認したら、swarm スクリプトを実行します。
実行メカニズム: swarm.sh スクリプトは、ループ内でヘッドレスエージェントプロセスを生成します。デフォルトでは、Codex CLI をフルオートモード(codex exec --full-auto)で使用します。--claude を使用して Claude CLI に切り替えることもできます。各イテレーションでは、イテレーション番号と計画ファイルのパスを指定してエージェントを実行します。計画ファイルは、イテレーション間の共有状態として機能します。エージェントは、.done ファイルを作成することで完了を通知します。
swarm の実行:
run_in_background: true を指定して Bash ツールを使用し、swarm を開始します。
Bash(run_in_background=true):
./path/to/swarm.sh .context/PLAN.md
これにより task_id が返されます。ユーザーに swarm が開始されることを伝え、TaskOutput を使用して完了を待ちます。
TaskOutput(task_id=<id>, block=true, timeout=600000)
これにより、ポーリングでトークンを消費することなく、swarm が完了するまで(最大10分間)ブロックされます。swarm は通常、2〜10回のイテレーションで完了します。
重要: swarm スクリプトは、ヘッドレスエージェントのために Codex には --full-auto を(または Claude には --dangerously-skip-permissions を)使用します。これは、エージェントがファイルを自律的に編集するために必要です。
ユーザーに伝えること:
swarm を開始します。エージェントは計画に基づいて自律的に作業します。
計画ファイルを監視することで進捗をモニターできます。
tail -f .context/PLAN.md
swarm は以下のことを行います。
- ステップを実行し、チェックを入れます。
- 各イテレーション後に進捗をログに記録します。
- 定期的にレビューゲートを実行します。
- 完了前にゲートキーパーチェックリストを完了します。
- すべての基準が満たされたら .done を作成します。
完了したらお知らせします。
利用可能なフラグ:
--codex: Codex CLI をフルオートモードで使用します(デフォルト)--claude: Codex の代わりに Claude CLI を使用します--verbose/-v: 各イテレーション後にタイミングとログセクションを表示します--dry-run/-n: 実行せずに何が実行されるかをプレビューします--help/-h: 使用法情報を表示します
ステップ4:完了の報告
TaskOutput が返されたとき:
.doneファイルが存在するか(成功)、または最大イテレーションに達したか(介入が必要)を確認します。- 計画ファイルの最後の約30行を読み、最終的な Log エントリを確認します。
- ユーザーに報告します。
成功時:
swarm が完了しました!
概要:
- [数値] 回のイテレーションが実行されました
- ゲートキーパー検証: [合格]
エージェントからの最終チェック:
- テスト: [ログからのステータス]
- 変更点: [ログからの git diff の概要]
コードはレビューの準備ができています。[PLAN_FILE] で完全な実行ログを確認してください。
最大イテレーション到達時(.done ファイルなし):
swarm は完了せずに最大イテレーションに達しました。
エージェントからの最終ステータス:
[最終ログエントリからの概要]
以下のいずれかを希望されますか?
1. swarm を再開してさらにイテレーションを実行する
2. 計画を確認し、ブロッカーを特定する
3. 引き継いで手動で完了する
NO-GO 決定時:
エージェントは完了しましたが、問題が特定されました。
[ゲートキーパーログからの問題リスト]
以下のいずれかを希望されますか?
1. これらの問題に対処するために別のイテレーションを生成する
2. 問題を手動で確認し、修正する
3. 計画を調整して再開する
計画の品質ガイドライン
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Swarm: Autonomous Multi-Agent Workflows
Execute complex coding tasks autonomously using multiple agents working from a coordinated plan.
How It Works
- Interview — Gather requirements and context from user
- Plan — Create structured markdown plan with checkboxes and review gates
- Execute — Spawn autonomous agents to work on the plan
- Complete — Agents signal completion with
.donefiles
Workflow
Step 1: Interview the User
When this skill is invoked, gather the information needed to create an effective plan:
Required information:
- Goal: What does "done" look like? (Be specific and measurable)
- Context: What files/directories are involved? Key constraints?
- Test strategy: What commands verify success? (e.g.,
npm test,pytest) - Plan location: Where should the plan file be created?
Interview questions:
I'll help you set up an autonomous workflow for this task.
To create an effective plan, I need to understand:
1. What's the specific goal? What does "done" look like?
2. What files or directories are involved?
3. What tests or verification commands should agents run?
4. Where should I create the plan file? (e.g., PLAN.md, AUTH_REFACTOR.md)
Ask follow-up questions as needed to clarify scope, constraints, or success criteria.
Step 2: Create the Plan
Use the template at assets/PLAN_TEMPLATE.md as a starting point. Customize it based on the user's requirements.
Plan structure:
## Goal— One sentence defining completion criteria## Context— Codebase structure, key files, constraints## Plan— Phases with checkboxes for each step## Agent Roles— Review gates (Reviewer, Simplifier, Tester, Gatekeeper)## Rules— Behavioral constraints for agents## Log— Communication space for agents across iterations
Critical components:
-
Checkboxes — Every step must be checkable. Avoid prose.
-
Review Gates — Force perspective shifts at intervals:
- Reviewer (every 5th iteration): Fresh eyes on progress vs goal
- Simplifier (before final phase): Identify overengineering
- Tester (before final phase): Write and run tests
- Gatekeeper (before .done): Mandatory checklist before completion
-
Gatekeeper Checklist — Must include:
- Commands to run with output (
npm test,git diff --stat) - Explicit yes/no questions with evidence
- GO/NO-GO decision with reasoning
- Commands to run with output (
-
Log Section — Agents append work here. Format:
### Iteration N — YYYY-MM-DD HH:MM **Role:** [Worker / Reviewer / Simplifier / Tester / Gatekeeper] **What I did:** ... **Current state:** ... **Next agent should:** ...
Write the plan file:
I've created the plan at [FILENAME]. Here's the structure:
- [Summarize the phases]
- [Note key review gates]
- [Highlight gatekeeper checklist]
The agents will work through this autonomously. Ready to start?
Step 3: Execute with Autonomous Agents
Once the plan is written and user approves, run the swarm script.
Execution mechanism: The swarm.sh script spawns headless agent processes in a loop. By default, it uses Codex CLI in full-auto mode (codex exec --full-auto). You can use --claude to switch to Claude CLI. Each iteration runs the agent with the iteration number and plan file path. The plan file serves as shared state between iterations. Agents signal completion by creating a .done file.
Running the swarm:
Use the Bash tool with run_in_background: true to start the swarm:
Bash(run_in_background=true):
./path/to/swarm.sh .context/PLAN.md
This returns a task_id. Tell the user the swarm is starting, then use TaskOutput to wait for completion:
TaskOutput(task_id=<id>, block=true, timeout=600000)
This blocks until the swarm finishes (up to 10 minutes) without burning tokens on polling. The swarm typically completes in 2-10 iterations.
Important: The swarm script uses --full-auto for Codex (or --dangerously-skip-permissions for Claude) for headless agents. This is required for agents to edit files autonomously.
Tell the user:
Starting the swarm. Agents will work autonomously on the plan.
You can monitor progress by watching the plan file:
tail -f .context/PLAN.md
The swarm will:
- Execute steps and check them off
- Log progress after each iteration
- Run review gates at intervals
- Complete the Gatekeeper checklist before finishing
- Create .done when all criteria are met
I'll let you know when it's complete.
Available flags:
--codex: Use Codex CLI in full-auto mode (default)--claude: Use Claude CLI instead of Codex--verbose/-v: Show timing and log section after each iteration--dry-run/-n: Preview what would run without executing--help/-h: Show usage information
Step 4: Report Completion
When TaskOutput returns:
- Check if
.donefile exists (success) or max iterations reached (needs intervention) - Read the last ~30 lines of the plan file to see the final Log entry
- Report to user:
On success:
The swarm has completed!
Summary:
- [Number] iterations executed
- Gatekeeper verification: [Passed]
Final checks from agents:
- Tests: [status from log]
- Changes: [git diff summary from log]
The code is ready for your review. Check [PLAN_FILE] for the full execution log.
On max iterations (no .done file):
The swarm reached max iterations without completing.
Last status from agents:
[Summary from final log entry]
Would you like me to:
1. Resume the swarm for more iterations
2. Review the plan and identify blockers
3. Take over and complete manually
On NO-GO decision:
The agents completed but identified issues:
[List issues from Gatekeeper log]
Would you like me to:
1. Spawn another iteration to address these
2. Review and fix the issues manually
3. Adjust the plan and restart
Plan Quality Guidelines
Good Plans Have:
✅ Specific goal: "Convert auth/ to async/await, tests pass, >80% coverage" ❌ Vague goal: "Improve the auth system"
✅ Discrete checkboxes: "- [ ] Convert tokens.js to async/await" ❌ Prose paragraphs: "The agent should convert files to async/await..."
✅ Mandatory review gates: Reviewer every 5th iteration, Gatekeeper before .done ❌ No review: Just implementation steps, agents tunnel-vision
✅ Explicit Gatekeeper checks: "Run npm test and paste output"
❌ Fuzzy completion: "When it works, mark it done"
✅ Log section: Agents append progress, communicate across iterations ❌ No log: Agents have no memory, repeat work
Example Plan
See assets/PLAN_TEMPLATE.md for a complete template.
When to Use This Skill
Use for:
- Refactoring modules or subsystems
- Adding authentication/authorization
- Migrating from X to Y (callbacks→async, REST→GraphQL)
- Adding comprehensive test coverage
- Multi-file feature implementations
- Codebase modernization tasks
Don't use for:
- Single-file changes
- Typo fixes
- Simple CRUD additions
- Exploratory "understand the codebase" tasks
- Tasks that need frequent user input
Tips
Start with clear goals. The more specific the Goal section, the better agents can self-correct.
Trust the review gates. They prevent tunnel vision. Don't skip them to save iterations.
Gatekeeper is critical. Agents are optimistic and will complete early. Gatekeeper forces verification.
Watch the Log. If agents repeat the same work 3+ times, the plan needs clarification.
Git commits as checkpoints. Add to Rules: "Commit after each phase." Creates restore points.
Resources
assets/PLAN_TEMPLATE.md
Template for creating autonomous workflow plans. Copy and customize based on user requirements.
assets/swarm.sh
Bash script that runs the iteration loop. Usage:
./swarm.sh [OPTIONS] PLAN_FILE.md
Options:
--codex: Use Codex CLI in full-auto mode (default)--claude: Use Claude CLI instead of Codex-n, --dry-run: Show what would happen without running agents-v, --verbose: Print timing and log section after each iteration-h, --help: Show help message
Set MAX_ITERATIONS env var to override default (20).
assets/test_swarm.sh
Test script for swarm.sh. Run to verify the script works:
./test_swarm.sh 同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (8,898 bytes)
- 📎 assets/PLAN_TEMPLATE.md (2,552 bytes)
- 📎 assets/swarm.sh (5,580 bytes)
- 📎 assets/test_swarm.sh (4,224 bytes)