agent-swarm-workflow
Jeffrey Emanuel's multi-agent implementation workflow using NTM, Agent Mail, Beads, and BV. The execution phase that follows planning and bead creation. Includes exact prompts used.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o agent-swarm-workflow.zip https://jpskill.com/download/18637.zip && unzip -o agent-swarm-workflow.zip && rm agent-swarm-workflow.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18637.zip -OutFile "$d\agent-swarm-workflow.zip"; Expand-Archive "$d\agent-swarm-workflow.zip" -DestinationPath $d -Force; ri "$d\agent-swarm-workflow.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
agent-swarm-workflow.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
agent-swarm-workflowフォルダができる - 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
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Agent Swarm Workflow — 並列実装
コアな洞察: すべてのエージェントは代替可能であり、ジェネラリストです。彼らはすべて同じベースモデルを使用し、同じ AGENTS.md を読みます。単に「frontend agent」であると伝えても、フロントエンドが得意になるわけではありません。
スワームは分散型で、堅牢であり、Agent Mail と Beads を通じて自己組織化されます。
前提条件
スワームを開始する前に:
- 包括的な計画が作成されていること(
planning-workflowスキルを参照) - 洗練された beads が準備できていること(
beads-workflowスキルを参照) - AGENTS.md がすべてのツールの説明文で構成されていること
- Agent Mail サーバーが実行されていること(
amまたは~/projects/mcp_agent_mail/scripts/run_server_with_token.sh) - セッション管理に NTM が利用可能であること
スワームのアーキテクチャ
┌─────────────────────────────────────────────────────────────┐
│ BEADS │
│ (依存関係、優先度、ステータスを持つタスクグラフ) │
└─────────────────────────────────────────────────────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌─────────────────────────────┐ ┌─────────────────────────┐
│ BV │ │ AGENT MAIL │
│ (何に取り組むべきか) │ │ (連携レイヤー) │
└─────────────────────────────┘ └─────────────────────────┘
│ │
└──────────────┬─────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ NTM + AGENTS │
│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │ CC │ │ CC │ │ Cod │ │ Gmi │ │ CC │ │ Cod │ │
│ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ │
└─────────────────────────────────────────────────────────────┘
スワームの開始
NTM (Named Tmux Manager) の使用
# 複数のエージェントを持つスワームを生成
ntm spawn myproject --cc=3 --cod=2 --gmi=1
# すべての Claude Code エージェントに初期プロンプトを送信
ntm send myproject --cc "$(cat initial_prompt.txt)"
# または、すべてのエージェントに送信
ntm send myproject --all "$(cat initial_prompt.txt)"
手動設定
プロジェクトフォルダ内の各エージェントに対して tmux セッション/ペインを作成します。
正確なプロンプト — エージェントへの最初の指示
各エージェントにこの正確なプロンプトを与えて開始します。
まず、AGENTS dot md ファイルと README dot md ファイルのすべてを非常に注意深く読み、両方を完全に理解してください!次に、コード調査エージェントモードを使用して、プロジェクトのコード、技術アーキテクチャ、および目的を完全に理解します。次に、MCP Agent Mail に登録し、他のエージェントに自己紹介します。
エージェントメールを確認し、必要に応じて迅速に対応してください。次に、割り当てられた次の beads を綿密に進め、タスクを体系的かつ細心の注意を払って実行し、beads とエージェントメールメッセージを介して進捗状況を追跡します。
何も完了しない「コミュニケーションの煉獄」に陥らないでください。実行する必要のあるタスクを開始することに積極的ですが、その場合はメッセージを介して仲間のエージェントに通知し、beads を適切にマークしてください。
次に何をすべきかわからない場合は、AGENTS dot md に記載されている bv ツールを使用して、次に取り組むのに最適な beads の優先順位を付けます。有用に取り組むことができる次のものを選択して開始します。他のエージェントからのすべての通信要求を認識し、すべてのアクティブなエージェントとその名前を認識していることを確認してください。 ultrathink を使用してください。
実装ループ
正確なプロンプト — 次の Bead への移動
エージェントが bead を完了したら、このプロンプトを使用して移動を続けます。
AGENTS dot md を再読して、常に頭に入れておいてください。 ultrathink を使用してください。ロボットフラグ付きの bv を使用して(これに関する情報は AGENTS dot md を参照)、次に取り組むのに最も影響力のある bead を見つけてから開始します。 beads を適切にマークし、仲間のエージェントと通信することを忘れないでください。実際に今すぐ有用に実行できる次の bead を選択して、すぐにコーディングを開始します。作業内容を仲間のエージェントに伝え、作業中に beads を適切にマークします。また、受信したエージェントメールメッセージに返信します。
正確なプロンプト — Bead 完了後の自己レビュー
エージェントに、次の作業に進む前に自分の作業を確認させます。
素晴らしいです。次に、あなたが書いたすべての新しいコードと、あなたが修正した既存のコードを「新鮮な目」で注意深く読み返し、明らかなバグ、エラー、問題、課題、混乱などを非常に注意深く探してください。見つけたものを注意深く修正してください。 ultrathink を使用してください。
バグが見つからなくなるまでこれを実行し続けます。
コンテキスト圧縮の処理
正確なプロンプト — 圧縮後
エージェントが圧縮を実行したら、すぐに次のことを続けてください。
AGENTS dot md を再読して、常に頭に入れておいてください。 ultrathink を使用してください。
これにより、ツールとワークフローに関する重要なコンテキストが再確立されます。
品質レビュープロンプト
正確なプロンプト — クロスエージェントレビュー
定期的にエージェントに互いの作業を確認させます。
さて、仲間のエージェントが書いたコードのレビューに注意を向け、問題、バグ、エラー、問題、非効率性、セキュリティの問題、信頼性の問題などがないか確認し、第一原理分析を使用して根本的な原因を注意深く診断してから、必要に応じて修正または修正できますか?最新のコミットに限定せず、より広い範囲を網羅して、非常に深く掘り下げてください! ultrathink を使用してください。
正確なプロンプト — ランダムなコード探索
詳細な品質チェックの場合:
このプロジェクトのコードファイルをある程度ランダムに探索し、深く調査して理解し、関連するコードファイル(インポート元またはインポート先)を介してその機能と実行フローをトレースするコードファイルを選択します。
ワークフローのより大きなコンテキストにおけるコードの目的を理解したら、「
(原文はここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Agent Swarm Workflow — Parallel Implementation
Core Insight: Every agent is fungible and a generalist. They all use the same base model and read the same AGENTS.md. Simply telling one it's a "frontend agent" doesn't make it better at frontend.
The swarm is distributed, robust, and self-organizing through Agent Mail and Beads.
Prerequisites
Before starting a swarm:
- Comprehensive plan created (see
planning-workflowskill) - Polished beads ready (see
beads-workflowskill) - AGENTS.md configured with all tool blurbs
- Agent Mail server running (
amor~/projects/mcp_agent_mail/scripts/run_server_with_token.sh) - NTM available for session management
The Swarm Architecture
┌─────────────────────────────────────────────────────────────┐
│ BEADS │
│ (Task graph with dependencies, priorities, status) │
└─────────────────────────────────────────────────────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌─────────────────────────────┐ ┌─────────────────────────┐
│ BV │ │ AGENT MAIL │
│ (What to work on) │ │ (Coordination layer) │
└─────────────────────────────┘ └─────────────────────────┘
│ │
└──────────────┬─────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ NTM + AGENTS │
│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │ CC │ │ CC │ │ Cod │ │ Gmi │ │ CC │ │ Cod │ │
│ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ │
└─────────────────────────────────────────────────────────────┘
Starting the Swarm
Using NTM (Named Tmux Manager)
# Spawn a swarm with multiple agents
ntm spawn myproject --cc=3 --cod=2 --gmi=1
# Send initial prompt to all Claude Code agents
ntm send myproject --cc "$(cat initial_prompt.txt)"
# Or send to all agents
ntm send myproject --all "$(cat initial_prompt.txt)"
Manual Setup
Create tmux sessions/panes for each agent in your project folder.
THE EXACT PROMPT — Initial Agent Marching Orders
Give each agent this EXACT prompt to start:
First read ALL of the AGENTS dot md file and README dot md file super carefully and understand ALL of both! Then use your code investigation agent mode to fully understand the code, and technical architecture and purpose of the project. Then register with MCP Agent Mail and introduce yourself to the other agents.
Be sure to check your agent mail and to promptly respond if needed to any messages; then proceed meticulously with your next assigned beads, working on the tasks systematically and meticulously and tracking your progress via beads and agent mail messages.
Don't get stuck in "communication purgatory" where nothing is getting done; be proactive about starting tasks that need to be done, but inform your fellow agents via messages when you do so and mark beads appropriately.
When you're not sure what to do next, use the bv tool mentioned in AGENTS dot md to prioritize the best beads to work on next; pick the next one that you can usefully work on and get started. Make sure to acknowledge all communication requests from other agents and that you are aware of all active agents and their names. Use ultrathink.
The Implementation Loop
THE EXACT PROMPT — Move to Next Bead
Once agents complete a bead, use this prompt to keep them moving:
Reread AGENTS dot md so it's still fresh in your mind. Use ultrathink. Use bv with the robot flags (see AGENTS dot md for info on this) to find the most impactful bead(s) to work on next and then start on it. Remember to mark the beads appropriately and communicate with your fellow agents. Pick the next bead you can actually do usefully now and start coding on it immediately; communicate what you're working on to your fellow agents and mark beads appropriately as you work. And respond to any agent mail messages you've received.
THE EXACT PROMPT — Self-Review After Bead Completion
Have agents review their work before moving on:
Great, now I want you to carefully read over all of the new code you just wrote and other existing code you just modified with "fresh eyes" looking super carefully for any obvious bugs, errors, problems, issues, confusion, etc. Carefully fix anything you uncover. Use ultrathink.
Keep running this until they stop finding bugs.
Handling Context Compaction
THE EXACT PROMPT — Post-Compaction
When an agent does a compaction, immediately follow up with:
Reread AGENTS dot md so it's still fresh in your mind. Use ultrathink.
This re-establishes the critical context about tools and workflows.
Quality Review Prompts
THE EXACT PROMPT — Cross-Agent Review
Periodically have agents review each other's work:
Ok can you now turn your attention to reviewing the code written by your fellow agents and checking for any issues, bugs, errors, problems, inefficiencies, security problems, reliability issues, etc. and carefully diagnose their underlying root causes using first-principle analysis and then fix or revise them if necessary? Don't restrict yourself to the latest commits, cast a wider net and go super deep! Use ultrathink.
THE EXACT PROMPT — Random Code Exploration
For deep quality checks:
I want you to sort of randomly explore the code files in this project, choosing code files to deeply investigate and understand and trace their functionality and execution flows through the related code files which they import or which they are imported by.
Once you understand the purpose of the code in the larger context of the workflows, I want you to do a super careful, methodical, and critical check with "fresh eyes" to find any obvious bugs, problems, errors, issues, silly mistakes, etc. and then systematically and meticulously and intelligently correct them.
Be sure to comply with ALL rules in AGENTS dot md and ensure that any code you write or revise conforms to the best practice guides referenced in the AGENTS dot md file. Use ultrathink.
Committing Work
THE EXACT PROMPT — Commit Changes
Have agents commit logically grouped changes:
Now, based on your knowledge of the project, commit all changed files now in a series of logically connected groupings with super detailed commit messages for each and then push. Take your time to do it right. Don't edit the code at all. Don't commit obviously ephemeral files. Use ultrathink.
Post-Bead Completion Prompts
THE EXACT PROMPT — Add Test Coverage
Do we have full unit test coverage without using mocks/fake stuff? What about complete e2e integration test scripts with great, detailed logging? If not, then create a comprehensive and granular set of beads for all this with tasks, subtasks, and dependency structure overlaid with detailed comments.
THE EXACT PROMPT — UI/UX Scrutiny
Great, now I want you to super carefully scrutinize every aspect of the application workflow and implementation and look for things that just seem sub-optimal or even wrong/mistaken to you, things that could very obviously be improved from a user-friendliness and intuitiveness standpoint, places where our UI/UX could be improved and polished to be slicker, more visually appealing, and more premium feeling and just ultra high quality, like Stripe-level apps.
THE EXACT PROMPT — Deep UI/UX Enhancement
I still think there are strong opportunities to enhance the UI/UX look and feel and to make everything work better and be more intuitive, user-friendly, visually appealing, polished, slick, and world class in terms of following UI/UX best practices like those used by Stripe, don't you agree? And I want you to carefully consider desktop UI/UX and mobile UI/UX separately while doing this and hyper-optimize for both separately to play to the specifics of each modality. I'm looking for true world-class visual appeal, polish, slickness, etc. that makes people gasp at how stunning and perfect it is in every way. Use ultrathink.
Agent Mail Integration
How Agents Coordinate
Each agent:
- Registers with Agent Mail at session start
- Reserves files before editing (
file_reservation_paths) - Announces work via messages with bead ID in
thread_id - Checks inbox between tasks
- Releases reservations when done
File Reservation Pattern
# Before starting work on a bead
file_reservation_paths(
project_key="/path/to/project",
agent_name="GreenCastle",
paths=["src/auth/**/*.ts"],
ttl_seconds=3600,
exclusive=True,
reason="bd-123"
)
# After completing work
release_file_reservations(project_key, agent_name)
Communication Pattern
# Announce starting a bead
send_message(
project_key, agent_name,
to=["BlueLake", "RedMountain"], # Other active agents
subject="[bd-123] Starting auth module",
body_md="I'm taking bd-123. Reserved src/auth/**.",
thread_id="bd-123"
)
# Update on completion
send_message(
project_key, agent_name,
to=["BlueLake", "RedMountain"],
subject="[bd-123] Completed",
body_md="Auth module done and tested. Released file reservations.",
thread_id="bd-123"
)
Using BV for Task Selection
Key Commands
# THE MEGA-COMMAND: Start here
bv --robot-triage
# Just get the single top pick
bv --robot-next
# Get parallel execution tracks (for multi-agent)
bv --robot-plan
# Check for cycles (MUST FIX if found)
bv --robot-insights | jq '.Cycles'
# Find bottlenecks
bv --robot-insights | jq '.bottlenecks'
CRITICAL: Never run bare bv — it launches interactive TUI that blocks the session.
Quality Loops
Run Until Clean
Keep running these prompts in rounds until they consistently come back with no changes:
- Self-review — Agent reviews own code
- Cross-review — Agent reviews other agents' code
- Random exploration — Deep dive into random code paths
The Steady-State Signal
When all three types of reviews return clean (no bugs found, no changes made), the code is likely solid.
Complete Prompt Reference
Initial Marching Orders
First read ALL of the AGENTS dot md file and README dot md file super carefully and understand ALL of both! Then use your code investigation agent mode to fully understand the code, and technical architecture and purpose of the project. Then register with MCP Agent Mail and introduce yourself to the other agents.
Be sure to check your agent mail and to promptly respond if needed to any messages; then proceed meticulously with your next assigned beads, working on the tasks systematically and meticulously and tracking your progress via beads and agent mail messages.
Don't get stuck in "communication purgatory" where nothing is getting done; be proactive about starting tasks that need to be done, but inform your fellow agents via messages when you do so and mark beads appropriately.
When you're not sure what to do next, use the bv tool mentioned in AGENTS dot md to prioritize the best beads to work on next; pick the next one that you can usefully work on and get started. Make sure to acknowledge all communication requests from other agents and that you are aware of all active agents and their names. Use ultrathink.
Move to Next Bead
Reread AGENTS dot md so it's still fresh in your mind. Use ultrathink. Use bv with the robot flags (see AGENTS dot md for info on this) to find the most impactful bead(s) to work on next and then start on it. Remember to mark the beads appropriately and communicate with your fellow agents. Pick the next bead you can actually do usefully now and start coding on it immediately; communicate what you're working on to your fellow agents and mark beads appropriately as you work. And respond to any agent mail messages you've received.
Self-Review
Great, now I want you to carefully read over all of the new code you just wrote and other existing code you just modified with "fresh eyes" looking super carefully for any obvious bugs, errors, problems, issues, confusion, etc. Carefully fix anything you uncover. Use ultrathink.
Cross-Review
Ok can you now turn your attention to reviewing the code written by your fellow agents and checking for any issues, bugs, errors, problems, inefficiencies, security problems, reliability issues, etc. and carefully diagnose their underlying root causes using first-principle analysis and then fix or revise them if necessary? Don't restrict yourself to the latest commits, cast a wider net and go super deep! Use ultrathink.
Random Exploration
I want you to sort of randomly explore the code files in this project, choosing code files to deeply investigate and understand and trace their functionality and execution flows through the related code files which they import or which they are imported by.
Once you understand the purpose of the code in the larger context of the workflows, I want you to do a super careful, methodical, and critical check with "fresh eyes" to find any obvious bugs, problems, errors, issues, silly mistakes, etc. and then systematically and meticulously and intelligently correct them.
Be sure to comply with ALL rules in AGENTS dot md and ensure that any code you write or revises conforms to the best practice guides referenced in the AGENTS dot md file. Use ultrathink.
Post-Compaction
Reread AGENTS dot md so it's still fresh in your mind. Use ultrathink.
Commit Changes
Now, based on your knowledge of the project, commit all changed files now in a series of logically connected groupings with super detailed commit messages for each and then push. Take your time to do it right. Don't edit the code at all. Don't commit obviously ephemeral files. Use ultrathink.
Test Coverage
Do we have full unit test coverage without using mocks/fake stuff? What about complete e2e integration test scripts with great, detailed logging? If not, then create a comprehensive and granular set of beads for all this with tasks, subtasks, and dependency structure overlaid with detailed comments.
UI/UX Scrutiny
Great, now I want you to super carefully scrutinize every aspect of the application workflow and implementation and look for things that just seem sub-optimal or even wrong/mistaken to you, things that could very obviously be improved from a user-friendliness and intuitiveness standpoint, places where our UI/UX could be improved and polished to be slicker, more visually appealing, and more premium feeling and just ultra high quality, like Stripe-level apps.
Deep UI/UX Enhancement
I still think there are strong opportunities to enhance the UI/UX look and feel and to make everything work better and be more intuitive, user-friendly, visually appealing, polished, slick, and world class in terms of following UI/UX best practices like those used by Stripe, don't you agree? And I want you to carefully consider desktop UI/UX and mobile UI/UX separately while doing this and hyper-optimize for both separately to play to the specifics of each modality. I'm looking for true world-class visual appeal, polish, slickness, etc. that makes people gasp at how stunning and perfect it is in every way. Use ultrathink.
The Flywheel in Action
PLAN ──► BEADS ──► SWARM ──► REVIEW ──► COMMIT
│ │ │ │
│ │ └────┬────┘
│ │ │
│ └───── REPEAT ──┘
│ │
│ v2 PLAN ◄────────────┘
│ │
└──────────────┘
Each cycle improves:
- CASS remembers solutions
- CM distills patterns
- UBS catches more issues
- BV shows graph health
FAQ
Q: How do agents know what to work on?
A: They use bv --robot-triage or bv --robot-next to find the highest-impact ready bead.
Q: How do they avoid conflicts? A: File reservations in Agent Mail. Exclusive reservations block others; the pre-commit guard enforces it.
Q: What if an agent crashes or forgets? A: Every agent is fungible. Start a new session, read AGENTS.md, check bead status, continue.
Q: How many agents should I run? A: Depends on project complexity. Start with 3-6. More agents = faster but more coordination overhead.
Q: What model mix works best? A: Mix recommended. Try 3 Claude Code (Opus), 2 Codex (GPT 5.2), 1 Gemini. They have different strengths.
Q: Do agents need individual areas of expertise? A: No, every agent is fungible and a generalist. Simply telling one it's a frontend agent doesn't make it better at frontend.
Q: Is there traceability between git commit and bead? A: Yes, bv automatically does this analysis and links beads to relevant git commits by analyzing the stream of data and making logical deductions.