|
| 1 | +--- |
| 2 | +name: beads-workflow |
| 3 | +description: >- |
| 4 | + Convert markdown plans into beads with dependencies using br CLI. Use when |
| 5 | + creating task graphs, polishing beads before implementation, or bridging |
| 6 | + planning to agent swarm execution. |
| 7 | +--- |
| 8 | + |
| 9 | +<!-- TOC: Quick Start | THE EXACT PROMPT | Polishing | br Commands | bd → br Migration | Quality Checklist | Troubleshooting | References --> |
| 10 | + |
| 11 | +# Beads Workflow — From Plan to Actionable Tasks |
| 12 | + |
| 13 | +> **Core Principle:** "Check your beads N times, implement once" — where N is as many as you can stomach. |
| 14 | +> |
| 15 | +> Beads are so detailed and polished that you can mechanically unleash a big swarm of agents to implement them, and it will come out just about perfectly. |
| 16 | +
|
| 17 | +## Quick Start |
| 18 | + |
| 19 | +```bash |
| 20 | +# 1. Initialize beads in project |
| 21 | +br init |
| 22 | + |
| 23 | +# 2. Convert plan to beads (see THE EXACT PROMPT below) |
| 24 | + |
| 25 | +# 3. Polish iteratively |
| 26 | +# Run polish prompt 6-9 times until steady-state |
| 27 | + |
| 28 | +# 4. Validate |
| 29 | +br dep cycles # Must be empty |
| 30 | +bv --robot-insights # Check graph health |
| 31 | + |
| 32 | +# 5. Begin implementation |
| 33 | +bv --robot-next # Get first bead |
| 34 | +``` |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## THE EXACT PROMPT — Plan to Beads Conversion |
| 39 | + |
| 40 | +``` |
| 41 | +OK so now read ALL of [YOUR_PLAN_FILE].md; please take ALL of that and elaborate on it and use it to create a comprehensive and granular set of beads for all this with tasks, subtasks, and dependency structure overlaid, with detailed comments so that the whole thing is totally self-contained and self-documenting (including relevant background, reasoning/justification, considerations, etc.-- anything we'd want our "future self" to know about the goals and intentions and thought process and how it serves the over-arching goals of the project.). The beads should be so detailed that we never need to consult back to the original markdown plan document. Remember to ONLY use the `br` tool to create and modify the beads and add the dependencies. Use ultrathink. |
| 42 | +``` |
| 43 | + |
| 44 | +### Shorter Version |
| 45 | + |
| 46 | +``` |
| 47 | +OK so please take ALL of that and elaborate on it more and then create a comprehensive and granular set of beads for all this with tasks, subtasks, and dependency structure overlaid, with detailed comments so that the whole thing is totally self-contained and self-documenting (including relevant background, reasoning/justification, considerations, etc.-- anything we'd want our "future self" to know about the goals and intentions and thought process and how it serves the over-arching goals of the project.) Use only the `br` tool to create and modify the beads and add the dependencies. Use ultrathink. |
| 48 | +``` |
| 49 | + |
| 50 | +### What This Creates |
| 51 | + |
| 52 | +- Tasks and subtasks with clear scope |
| 53 | +- Dependency links (what blocks what) |
| 54 | +- Detailed descriptions with background, reasoning, considerations |
| 55 | +- Self-contained (never need to consult original plan) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Polishing Beads |
| 60 | + |
| 61 | +### THE EXACT PROMPT — Polish (Standard) |
| 62 | + |
| 63 | +``` |
| 64 | +Reread AGENTS dot md so it's still fresh in your mind. Check over each bead super carefully-- are you sure it makes sense? Is it optimal? Could we change anything to make the system work better for users? If so, revise the beads. It's a lot easier and faster to operate in "plan space" before we start implementing these things! |
| 65 | +
|
| 66 | +DO NOT OVERSIMPLIFY THINGS! DO NOT LOSE ANY FEATURES OR FUNCTIONALITY! |
| 67 | +
|
| 68 | +Also, make sure that as part of these beads, we include comprehensive unit tests and e2e test scripts with great, detailed logging so we can be sure that everything is working perfectly after implementation. Remember to ONLY use the `br` tool to create and modify the beads and to add the dependencies to beads. Use ultrathink. |
| 69 | +``` |
| 70 | + |
| 71 | +### Polishing Protocol |
| 72 | + |
| 73 | +1. Run polish prompt |
| 74 | +2. Review changes |
| 75 | +3. Repeat until steady-state (typically 6-9 rounds) |
| 76 | +4. If it flatlines, start a fresh CC session |
| 77 | +5. Optionally have Codex/GPT 5.5 do a final round |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## Fresh Session Technique |
| 82 | + |
| 83 | +If polishing flatlines, start a new Claude Code session: |
| 84 | + |
| 85 | +### THE EXACT PROMPT — Re-establish Context |
| 86 | + |
| 87 | +``` |
| 88 | +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. Use ultrathink. |
| 89 | +``` |
| 90 | + |
| 91 | +### THE EXACT PROMPT — Then Review Beads |
| 92 | + |
| 93 | +``` |
| 94 | +We recently transformed a markdown plan file into a bunch of new beads. I want you to very carefully review and analyze these using `br` and `bv`. |
| 95 | +``` |
| 96 | + |
| 97 | +Then follow up with the standard polish prompt. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## br Commands |
| 102 | + |
| 103 | +### Issue Lifecycle |
| 104 | + |
| 105 | +```bash |
| 106 | +br init # Initialize workspace |
| 107 | +br create "Title" -t feature -p 1 # Create bead |
| 108 | +br update <id> --status in_progress |
| 109 | +br close <id> --reason "Done" |
| 110 | +br reopen <id> # If needed |
| 111 | +``` |
| 112 | + |
| 113 | +### Dependencies |
| 114 | + |
| 115 | +```bash |
| 116 | +br dep add br-child br-parent # child depends on parent |
| 117 | +br dep remove br-child br-parent |
| 118 | +br dep list <id> |
| 119 | +br dep tree <id> |
| 120 | +br dep cycles # MUST be empty! |
| 121 | +``` |
| 122 | + |
| 123 | +### Querying |
| 124 | + |
| 125 | +```bash |
| 126 | +br list # All beads |
| 127 | +br ready # Actionable (not blocked) |
| 128 | +br blocked # Blocked beads |
| 129 | +br search "authentication" |
| 130 | +br list --json # Machine-readable |
| 131 | +``` |
| 132 | + |
| 133 | +### Sync to Git |
| 134 | + |
| 135 | +```bash |
| 136 | +br sync --flush-only # Export DB → JSONL |
| 137 | +git add .beads/ && git commit -m "Update beads" |
| 138 | +``` |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## bd → br Migration (Docs) |
| 143 | + |
| 144 | +Use this when you see legacy `bd` references in AGENTS.md or docs. |
| 145 | + |
| 146 | +**Behavioral difference (only one):** |
| 147 | +- **`br sync` never runs git commands**. After `br sync --flush-only`, you must `git add .beads/` and `git commit` (and `git push`) yourself. |
| 148 | + |
| 149 | +**Transform checklist (order matters):** |
| 150 | +1. `bd` commands → `br` commands |
| 151 | +2. `bd sync` → `br sync --flush-only` + `git add .beads/` + `git commit` |
| 152 | +3. Do NOT assume issue IDs must change `bd-*` → `br-*` — the prefix is configurable (often remains `bd-*`). |
| 153 | +4. Remove daemon/auto-commit references |
| 154 | + |
| 155 | +**Verify:** |
| 156 | +```bash |
| 157 | +grep -c '`bd ' file.md # must be 0 |
| 158 | +grep -c 'bd sync' file.md # must be 0 |
| 159 | +grep -c 'br sync --flush-only' file.md # must be > 0 |
| 160 | +``` |
| 161 | + |
| 162 | +--- |
| 163 | + |
| 164 | +## BV Robot Mode |
| 165 | + |
| 166 | +**CRITICAL:** Never run bare `bv` — it launches interactive TUI. |
| 167 | + |
| 168 | +```bash |
| 169 | +bv --robot-triage # Full triage |
| 170 | +bv --robot-next # Single top pick |
| 171 | +bv --robot-plan # Parallel execution tracks |
| 172 | +bv --robot-insights | jq '.Cycles' # Check for cycles |
| 173 | +bv --robot-insights | jq '.bottlenecks' |
| 174 | +``` |
| 175 | + |
| 176 | +--- |
| 177 | + |
| 178 | +## Quality Checklist |
| 179 | + |
| 180 | +Before implementation, verify each bead: |
| 181 | + |
| 182 | +- [ ] **Self-contained** — Understandable without external context |
| 183 | +- [ ] **Clear scope** — One coherent piece of work |
| 184 | +- [ ] **Dependencies explicit** — Links to blocking/blocked beads |
| 185 | +- [ ] **Testable** — Clear success criteria |
| 186 | +- [ ] **Includes tests** — Unit and e2e tests in scope |
| 187 | +- [ ] **Preserves features** — Nothing from plan was lost |
| 188 | +- [ ] **Not oversimplified** — Complexity preserved where needed |
| 189 | +- [ ] **No cycles** — `br dep cycles` returns empty |
| 190 | + |
| 191 | +--- |
| 192 | + |
| 193 | +## Integration with Agent Mail |
| 194 | + |
| 195 | +Use bead ID as the coordination thread: |
| 196 | + |
| 197 | +```python |
| 198 | +# Reserve files for bead |
| 199 | +file_reservation_paths(..., reason="br-123") |
| 200 | + |
| 201 | +# Announce work in thread |
| 202 | +send_message(..., thread_id="br-123", subject="[br-123] Starting...") |
| 203 | + |
| 204 | +# Close bead when done |
| 205 | +br close br-123 --reason "Completed" |
| 206 | +release_file_reservations(...) |
| 207 | +``` |
| 208 | + |
| 209 | +--- |
| 210 | + |
| 211 | +## When Beads Are Ready |
| 212 | + |
| 213 | +Your beads are ready for implementation when: |
| 214 | + |
| 215 | +1. **Steady-state reached** — Multiple polish rounds yield minimal changes |
| 216 | +2. **Cross-model reviewed** — At least one alternative model reviewed |
| 217 | +3. **No cycles** — `br dep cycles` returns empty |
| 218 | +4. **Tests included** — Each feature has associated test beads |
| 219 | +5. **Dependencies clean** — Graph makes logical sense |
| 220 | + |
| 221 | +--- |
| 222 | + |
| 223 | +## References |
| 224 | + |
| 225 | +| Topic | Reference | |
| 226 | +|-------|-----------| |
| 227 | +| All prompts | [PROMPTS.md](references/PROMPTS.md) | |
| 228 | +| Bead structure | [BEAD-ANATOMY.md](references/BEAD-ANATOMY.md) | |
| 229 | +| Troubleshooting | [TROUBLESHOOTING.md](references/TROUBLESHOOTING.md) | |
| 230 | +| br command reference | See br --help or beads_rust README | |
| 231 | +| BV integration | See bv-graph-triage skill | |
| 232 | + |
| 233 | +--- |
| 234 | + |
| 235 | +## Troubleshooting |
| 236 | + |
| 237 | +### Worktree Error Fix |
| 238 | + |
| 239 | +If you get `failed to create worktree: 'main' is already checked out`: |
| 240 | + |
| 241 | +```bash |
| 242 | +git branch beads-sync main |
| 243 | +git push -u origin beads-sync |
| 244 | +br config set sync-branch beads-sync |
| 245 | +``` |
| 246 | + |
| 247 | +Always use a dedicated sync branch that you never check out directly. |
| 248 | + |
| 249 | +### Quick Health Check |
| 250 | + |
| 251 | +```bash |
| 252 | +br config list # All settings |
| 253 | +br dep cycles # Must be empty |
| 254 | +which br # Verify br is installed |
| 255 | +``` |
| 256 | + |
| 257 | +See [TROUBLESHOOTING.md](references/TROUBLESHOOTING.md) for full diagnostics. |
| 258 | + |
| 259 | +--- |
| 260 | + |
| 261 | +## Validation |
| 262 | + |
| 263 | +```bash |
| 264 | +# Check for cycles (must be empty) |
| 265 | +br dep cycles |
| 266 | + |
| 267 | +# Check graph health |
| 268 | +bv --robot-insights | jq '.Cycles' |
| 269 | + |
| 270 | +# Verify all beads have descriptions |
| 271 | +br list --json | jq '.issues[]? | select(.description == "")' |
| 272 | +``` |
0 commit comments