# Instructions for AI Agents Working on Beads ## Project Overview This is **beads** (command: `bd`), an issue tracker designed for AI-supervised coding workflows. We dogfood our own tool! ## Human Setup vs Agent Usage **IMPORTANT:** If you need to initialize bd, use the `--quiet` flag: ```bash bd init --quiet # Non-interactive, auto-installs git hooks, no prompts ``` **Why `--quiet`?** Regular `bd init` has interactive prompts (git hooks) that confuse agents. The `--quiet` flag makes it fully non-interactive: - Automatically installs git hooks - No prompts for user input - Safe for agent-driven repo setup **If the human already initialized:** Just use bd normally with `bd create`, `bd ready`, `bd update`, `bd close`, etc. **If you see "database not found":** Run `bd init --quiet` yourself, or ask the human to run `bd init`. ## Issue Tracking We use bd (beads) for issue tracking instead of Markdown TODOs or external tools. ### MCP Server (Recommended) **RECOMMENDED**: Use the MCP (Model Context Protocol) server for the best experience! The beads MCP server provides native integration with Claude and other MCP-compatible AI assistants. **Installation:** ```bash # Install the MCP server pip install beads-mcp # Add to your MCP settings (e.g., Claude Desktop config) { "beads": { "command": "beads-mcp", "args": [] } } ``` **Benefits:** - Native function calls instead of shell commands - Automatic workspace detection - Better error handling and validation - Structured JSON responses - No need for `--json` flags **All bd commands are available as MCP functions** with the prefix `mcp__beads-*__`. For example: - `bd ready` → `mcp__beads__ready()` - `bd create` → `mcp__beads__create(title="...", priority=1)` - `bd update` → `mcp__beads__update(issue_id="bd-42", status="in_progress")` See `integrations/beads-mcp/README.md` for complete documentation. ### Multi-Repo Configuration (MCP Server) **RECOMMENDED: Use a single MCP server for all beads projects** - it automatically routes to per-project local daemons. **Setup (one-time):** ```bash # MCP config in ~/.config/amp/settings.json or Claude Desktop config: { "beads": { "command": "beads-mcp", "args": [] } } ``` **How it works (LSP model):** The single MCP server instance automatically: 1. Checks for local daemon socket (`.beads/bd.sock`) in your current workspace 2. Routes requests to the correct **per-project daemon** based on working directory 3. Auto-starts the local daemon if not running (with exponential backoff) 4. **Each project gets its own isolated daemon** serving only its database **Architecture:** ``` MCP Server (one instance) ↓ Per-Project Daemons (one per workspace) ↓ SQLite Databases (complete isolation) ``` **Why per-project daemons?** - ✅ Complete database isolation between projects - ✅ No cross-project pollution or git worktree conflicts - ✅ Simpler mental model: one project = one database = one daemon - ✅ Follows LSP (Language Server Protocol) architecture **Note:** The daemon **auto-starts automatically** when you run any `bd` command (v0.9.11+). To disable auto-start, set `BEADS_AUTO_START_DAEMON=false`. **Version Management:** bd automatically handles daemon version mismatches (v0.16.0+): - When you upgrade bd, old daemons are automatically detected and restarted - Version compatibility is checked on every connection - No manual intervention required after upgrades - Works transparently with MCP server and CLI - Use `bd daemons health` to check for version mismatches - Use `bd daemons killall` to force-restart all daemons if needed **Alternative (not recommended): Multiple MCP Server Instances** If you must use separate MCP servers: ```json { "beads-webapp": { "command": "beads-mcp", "env": { "BEADS_WORKING_DIR": "/Users/you/projects/webapp" } }, "beads-api": { "command": "beads-mcp", "env": { "BEADS_WORKING_DIR": "/Users/you/projects/api" } } } ``` ⚠️ **Problem**: AI may select the wrong MCP server for your workspace, causing commands to operate on the wrong database. ### CLI Quick Reference If you're not using the MCP server, here are the CLI commands: ```bash # Check database path and daemon status bd info --json # Find ready work (no blockers) bd ready --json # Create new issue bd create "Issue title" -t bug|feature|task -p 0-4 -d "Description" --json # Create with explicit ID (for parallel workers) bd create "Issue title" --id worker1-100 -p 1 --json # Create with labels bd create "Issue title" -t bug -p 1 -l bug,critical --json # Create multiple issues from markdown file bd create -f feature-plan.md --json # Create epic with hierarchical child tasks bd create "Auth System" -t epic -p 1 --json # Returns: bd-a3f8e9 bd create "Login UI" -p 1 --json # Auto-assigned: bd-a3f8e9.1 bd create "Backend validation" -p 1 --json # Auto-assigned: bd-a3f8e9.2 bd create "Tests" -p 1 --json # Auto-assigned: bd-a3f8e9.3 # Update one or more issues bd update [...] --status in_progress --json bd update [...] --priority 1 --json # Edit issue fields in $EDITOR (HUMANS ONLY - not for agents) bd edit # Edit description bd edit --title # Edit title bd edit --design # Edit design notes bd edit --notes # Edit notes bd edit --acceptance # Edit acceptance criteria # Link discovered work (old way) bd dep add --type discovered-from # Create and link in one command (new way) bd create "Issue title" -t bug -p 1 --deps discovered-from: --json # Label management (supports multiple IDs) bd label add [...]