Claude-skill-registry beads-agent-village
Set up and orchestrate multi-agent workflows using Beads (shared issue tracking/memory) and MCP Agent Mail (agent messaging). Use when coordinating multiple agents, setting up agent villages, tracking work across agent sessions, or implementing swarm workflows.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/beads-agent-village" ~/.claude/skills/majiayu000-claude-skill-registry-beads-agent-village && rm -rf "$T"
skills/data/beads-agent-village/SKILL.mdBeads + Agent Mail: Multi-Agent Workflows
Beads provides shared memory and issue tracking for agents. MCP Agent Mail provides agent-to-agent messaging. Together they create an "Agent Village" where agents can coordinate autonomously.
Quick Start
1. Initialize Beads in Your Project
# Install Beads go install github.com/steveyegge/beads/cmd/bd@latest # Initialize in your project bd init # Run doctor to set up git hooks and configuration bd doctor --fix
2. Configure Your Agent
Add to your
CLAUDE.md or AGENTS.md:
## Issue Tracking Use Beads (`bd`) for all work tracking. Run `bd quickstart` to get started. - File issues for any work taking longer than 2 minutes - Check `bd ready --json` to find unblocked work - Update issue status as you work - File discovered bugs/issues immediately rather than ignoring them
3. Set Up Agent Mail (Optional)
For multi-agent coordination, add MCP Agent Mail:
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/mcp_agent_mail/main/scripts/install.sh" | bash -s -- --yes
Core Beads Commands
| Command | Purpose |
|---|---|
| Initialize Beads in a project |
| Diagnose and fix issues, run migrations |
| List unblocked work items ready for execution |
| Remove issues older than N days |
| Sync database and push to git |
| Upgrade Beads to latest version |
Best Practices
Keep the Database Small
Run
bd cleanup every few days. Keep under 200-500 issues for best performance:
bd cleanup --days 2 bd sync
Use Short Issue Prefixes
Configure a 2-3 character prefix for readability:
# Examples: bd-, vc-, wy-, ef- bd config prefix my-
Plan Outside, Execute Inside
- Create your plan using your preferred planning tool
- Iterate and refine the plan up to 5 times with the agent
- Ask the agent to file Beads epics and issues from the plan, focusing on:
- Dependencies between tasks
- Detailed designs
- Potential parallelization
- Iterate and refine the Beads epics up to 5 times
- Execute by having agents work through
itemsbd ready
The agent will say "I don't think we can do much better than this" when iteration is complete.
Restart Agents Frequently
- Tackle one issue per agent session
- Kill the process after completing each issue
- Beads maintains context between sessions
- Saves money and improves model performance
File Issues Liberally
Agents should file issues for:
- Any work taking > 2 minutes
- Discovered bugs (even if "unrelated") - use
to link to parent issue--discovered-from - Code review findings
- Technical debt noticed during work
When doing code reviews, tell agents to file beads as they go - this produces more actionable findings.
# Link a discovered bug to the issue you were working on bd create --title "Fix null check in auth" --discovered-from ISSUE-123
Multi-Agent Coordination
Agent Village Setup
Two approaches for multi-agent work:
Git Worktree Model (Recommended):
- Each agent works in its own git worktree/branch
- No file locking needed
- Use Agent Mail for coordination
- Merge work via git
Single Folder Model:
- All agents share one folder
- Use Agent Mail's file reservation system
- Agents negotiate file access via messaging
Agent Mail Integration
With Beads + Agent Mail, agents can:
- Share memory (Beads issues as shared state)
- Send messages to coordinate
- Self-organize leadership and task splitting
- Work autonomously with minimal setup
Just tell agents: "Go sort it out amongst yourselves" - they will:
- Quickly decide on a leader
- Split up the work
- Coordinate via messaging
- Track progress in Beads
Work Claiming
Agents claim work by setting status and assignee:
# Check what's available (filter by assignee if needed) bd ready --json bd ready --json --assignee=agent1 # Claim an issue bd update ISSUE-123 --status in_progress --assignee agent1 # Other agents can see what's claimed bd list --status in_progress
Multiple agents on different machines can query the same Beads database via git.
Troubleshooting
Merge Conflicts
Beads conflicts happen during rebases/merges. Ask your agent to:
- Clean up broken rebases
- Resolve conflicts intelligently
- Run
after resolutionbd doctor --fix
Large Database Issues
If
issues.jsonl exceeds ~25k tokens:
- Run
bd cleanup --days 2 - Issues remain in git history for reference
- Keep working set small for agent file reading
Daily Maintenance
Run daily:
bd doctor bd upgrade # weekly
Example Workflow
# Morning: Check what's ready bd ready --json # Claim an issue bd update ISSUE-123 --status in_progress --assignee agent1 # During work: file discovered issues with link to parent bd create --title "Fix flaky test in auth module" --discovered-from ISSUE-123 # Complete work bd update ISSUE-123 --status done bd sync # End of session: cleanup bd cleanup --days 2
Beads Viewer (bv)
A terminal UI for visualizing Beads issues and dependencies.
Installation
One-line installer:
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/beads_viewer/main/install.sh?$(date +%s)" | bash
Or build from source (requires Go 1.21+):
git clone https://github.com/Dicklesworthstone/beads_viewer.git cd beads_viewer go install ./cmd/bv
Usage
Navigate to any Beads-initialized project and run:
bv
The viewer automatically discovers
.beads/beads.jsonl in your current directory.
Key Navigation
| Key | Action |
|---|---|
/ | Navigate items |
| Fuzzy search |
| Kanban board view |
| Insights dashboard |
| Dependency graph |
| History (commit correlation) |
| Show all keyboard shortcuts |
| Built-in tutorial |
| Quit |
Custom Directory
For monorepos or non-standard layouts:
BEADS_DIR=/path/to/shared/beads bv
Using Beads Viewer with Agents
bv is a graph-aware triage engine for Beads projects. Instead of parsing JSONL or hallucinating graph traversal, use robot flags for deterministic, dependency-aware outputs with precomputed metrics (PageRank, betweenness, critical path, cycles, HITS, eigenvector, k-core).
Scope boundary: bv handles what to work on (triage, priority, planning). For agent-to-agent coordination (messaging, work claiming, file reservations), use MCP Agent Mail.
CRITICAL: Use ONLY
flags. Bare --robot-*
launches an interactive TUI that blocks your session.bv
The Workflow: Start With Triage
is your single entry point. It returns everything you need in one call:bv --robot-triage
: at-a-glance counts + top 3 picksquick_ref
: ranked actionable items with scores, reasons, unblock inforecommendations
: low-effort high-impact itemsquick_wins
: items that unblock the most downstream workblockers_to_clear
: status/type/priority distributions, graph metricsproject_health
: copy-paste shell commands for next stepscommands
bv --robot-triage # THE MEGA-COMMAND: start here bv --robot-next # Minimal: just the single top pick + claim command
Planning Commands
| Command | Returns |
|---|---|
| Parallel execution tracks with lists |
| Priority misalignment detection with confidence |
Graph Analysis
| Command | Returns |
|---|---|
| Full metrics: PageRank, betweenness, HITS, eigenvector, critical path, cycles, k-core, articulation points, slack |
| Per-label health: (healthy/warning/critical), , , |
| Cross-label dependency: , , |
| Attention-ranked labels by: (pagerank × staleness × block_impact) / velocity |
History & Change Tracking
| Command | Returns |
|---|---|
| Bead-to-commit correlations: , (per-bead events/commits/milestones), |
| Changes since ref: new/closed/modified issues, cycles introduced/resolved |
Other Robot Commands
| Command | Returns |
|---|---|
| Sprint burndown, scope changes, at-risk items |
| ETA predictions with dependency-aware scheduling |
| Stale issues, blocking cascades, priority mismatches |
| Hygiene: duplicates, missing deps, label suggestions, cycle breaks |
| Dependency graph export |
| Self-contained interactive HTML visualization |
Scoping & Filtering
bv --robot-plan --label backend # Scope to label's subgraph bv --robot-insights --as-of HEAD~30 # Historical point-in-time bv --recipe actionable --robot-plan # Pre-filter: ready to work (no blockers) bv --recipe high-impact --robot-triage # Pre-filter: top PageRank scores bv --robot-triage --robot-triage-by-track # Group by parallel work streams bv --robot-triage --robot-triage-by-label # Group by domain
Understanding Robot Output
All robot JSON includes:
— Fingerprint of source beads.jsonl (verify consistency across calls)data_hash
— Per-metric state:status
+ elapsed mscomputed|approx|timeout|skipped
/as_of
— Present when usingas_of_commit
; contains ref and resolved SHA--as-of
Two-phase analysis:
- Phase 1 (instant): degree, topo sort, density — always available immediately
- Phase 2 (async, 500ms timeout): PageRank, betweenness, HITS, eigenvector, cycles — check
flagsstatus
For large graphs (>500 nodes): Some metrics may be approximated or skipped. Always check
status.
jq Quick Reference
bv --robot-triage | jq '.quick_ref' # At-a-glance summary bv --robot-triage | jq '.recommendations[0]' # Top recommendation bv --robot-plan | jq '.plan.summary.highest_impact' # Best unblock target bv --robot-insights | jq '.status' # Check metric readiness bv --robot-insights | jq '.Cycles' # Circular deps (must fix!) bv --robot-label-health | jq '.results.labels[] | select(.health_level == "critical")'
Performance: Phase 1 instant, Phase 2 async (500ms timeout). Prefer
--robot-plan over --robot-insights when speed matters. Results cached by data hash.
Use bv instead of parsing beads.jsonl—it computes PageRank, critical paths, cycles, and parallel tracks deterministically.