$npx -y skills add Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations --skill agent-swarm-workflowJeffrey 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.
| 1 | # Agent Swarm Workflow — Parallel Implementation |
| 2 | |
| 3 | > **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. |
| 4 | > |
| 5 | > The swarm is distributed, robust, and self-organizing through Agent Mail and Beads. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Prerequisites |
| 10 | |
| 11 | Before starting a swarm: |
| 12 | |
| 13 | 1. **Comprehensive plan** created (see `planning-workflow` skill) |
| 14 | 2. **Polished beads** ready (see `beads-workflow` skill) |
| 15 | 3. **AGENTS.md** configured with all tool blurbs |
| 16 | 4. **Agent Mail server** running (`am` or `~/projects/mcp_agent_mail/scripts/run_server_with_token.sh`) |
| 17 | 5. **NTM** available for session management |
| 18 | |
| 19 | --- |
| 20 | |
| 21 | ## The Swarm Architecture |
| 22 | |
| 23 | ``` |
| 24 | ┌─────────────────────────────────────────────────────────────┐ |
| 25 | │ BEADS │ |
| 26 | │ (Task graph with dependencies, priorities, status) │ |
| 27 | └─────────────────────────────────────────────────────────────┘ |
| 28 | │ |
| 29 | ┌─────────┴─────────┐ |
| 30 | ▼ ▼ |
| 31 | ┌─────────────────────────────┐ ┌─────────────────────────┐ |
| 32 | │ BV │ │ AGENT MAIL │ |
| 33 | │ (What to work on) │ │ (Coordination layer) │ |
| 34 | └─────────────────────────────┘ └─────────────────────────┘ |
| 35 | │ │ |
| 36 | └──────────────┬─────────────┘ |
| 37 | ▼ |
| 38 | ┌─────────────────────────────────────────────────────────────┐ |
| 39 | │ NTM + AGENTS │ |
| 40 | │ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │ |
| 41 | │ │ CC │ │ CC │ │ Cod │ │ Gmi │ │ CC │ │ Cod │ │ |
| 42 | │ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ │ |
| 43 | └─────────────────────────────────────────────────────────────┘ |
| 44 | ``` |
| 45 | |
| 46 | --- |
| 47 | |
| 48 | ## Starting the Swarm |
| 49 | |
| 50 | ### Using NTM (Named Tmux Manager) |
| 51 | |
| 52 | ```bash |
| 53 | # Spawn a swarm with multiple agents |
| 54 | ntm spawn myproject --cc=3 --cod=2 --agy=1 |
| 55 | |
| 56 | # Send initial prompt to all Claude Code agents |
| 57 | ntm send myproject --cc "$(cat initial_prompt.txt)" |
| 58 | |
| 59 | # Or send to all agents |
| 60 | ntm send myproject --all "$(cat initial_prompt.txt)" |
| 61 | ``` |
| 62 | |
| 63 | ### Manual Setup |
| 64 | |
| 65 | Create tmux sessions/panes for each agent in your project folder. |
| 66 | |
| 67 | --- |
| 68 | |
| 69 | ## THE EXACT PROMPT — Initial Agent Marching Orders |
| 70 | |
| 71 | Give each agent this EXACT prompt to start: |
| 72 | |
| 73 | ``` |
| 74 | 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. |
| 75 | |
| 76 | 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. |
| 77 | |
| 78 | 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. |
| 79 | |
| 80 | 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. |
| 81 | ``` |
| 82 | |
| 83 | --- |
| 84 | |
| 85 | ## The Implementation Loop |
| 86 | |
| 87 | ### THE EXACT PROMPT — Move to Next Bead |
| 88 | |
| 89 | Once agents complete a bead, use this prompt to keep them moving: |
| 90 | |
| 91 | ``` |
| 92 | 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. |
| 93 | ``` |
| 94 | |
| 95 | ### THE EXACT PROMPT — Self-Review After Bead Completion |
| 96 | |
| 97 | Have agents review their work before moving on: |
| 98 | |
| 99 | ``` |
| 100 | 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. |
| 101 | ``` |
| 102 | |
| 103 | **Keep running this until they stop finding bugs.** |
| 104 | |
| 105 | --- |
| 106 | |
| 107 | ## Handling Context Compaction |
| 108 | |
| 109 | ### THE EXACT PROMPT — Post-Compaction |
| 110 | |
| 111 | When an agent does a compaction, |