AgentSkillsCN

beads

在工作跨越多个会话、存在依赖关系或阻塞因素,或者需要在对话压缩过程中保持上下文连续时使用。

SKILL.md
--- frontmatter
name: beads
description: Use when work spans multiple sessions, has dependencies or blockers, or needs context that survives conversation compaction

Beads — Persistent Task Memory

Overview

Git-backed issue tracker that survives conversation compaction. Provides persistent memory for multi-session work with dependencies.

CLI reference: Run bd prime for AI-optimized context. Run bd <command> --help for specific usage. Do not memorize commands — always check --help.

bd vs TodoWrite

bd (persistent)TodoWrite (ephemeral)
Multi-session workSingle-session tasks
Complex dependenciesLinear execution
Survives compactionConversation-scoped
Git-backed, team syncLocal to session

Decision test: "Will I need this context in 2 weeks?" YES = bd.

When to Use bd

  • Work spans multiple sessions or days
  • Tasks have dependencies or blockers
  • Need to survive conversation compaction
  • Collaboration with team (git sync)
  • Exploratory/research work with fuzzy boundaries

When to Use TodoWrite

  • Single-session linear tasks
  • Simple checklist for immediate work
  • All context is in current conversation

Session Protocol

  1. bd ready — Find unblocked work
  2. bd show <id> — Get full context
  3. bd update <id> --status in_progress — Claim work
  4. Work, adding notes as you go (critical for compaction survival)
  5. bd close <id> --reason "..." — Complete task
  6. Commit and push your code changes
    • Note: The pre-commit git hook automatically runs bd sync --flush-only and stages .beads/issues.jsonl, so manual bd sync is not needed before commits

Key Commands

ActionCommand
Find workbd ready
Create issuebd create "title" -p <priority>
Show detailsbd show <id>
Update fieldsbd update <id> --status/--title/--notes/--description
Add dependencybd dep add <issue> <depends-on>
Closebd close <id> --reason "..."
Manual syncbd sync --flush-only (rarely needed; pre-commit hook handles this)

Never use bd edit — it opens $EDITOR which agents cannot use. Use bd update with flags.

Acceptance Criteria Format

When creating beads for TDD execution (via beadcraft or executing-beads), use this format:

bash
bd create --title "..." --acceptance "Test: <path>:<FnName> | Cmd: <test_cmd> | Assert: <expected>"
FieldPurposeExample
Test:Test file and functioninternal/auth/auth_test.go:TestValidateToken
Cmd:Verification commandgo test ./internal/auth/... -run TestValidateToken -v
Assert:What "pass" looks likereturns valid=true for unexpired JWT

This format enables executing-beads to automatically parse and verify each bead's completion.

Advanced Features

Run bd prime for full details on:

  • Molecules (templates): bd mol --help
  • Chemistry (pour/wisp): bd pour, bd wisp
  • Agent beads: bd agent --help
  • Async gates: bd gate --help
  • Worktrees: bd worktree --help

Red Flags

  • Forgetting to commit and push changes (bead updates stay local)
  • Manually calling bd sync before commits (pre-commit hook handles this automatically)
  • Using bd edit (interactive editor, breaks agents)
  • Creating issues in production DB during testing (use BEADS_DB=/tmp/test.db)
  • Duplicating CLI docs in notes — point to bd prime instead