beads-task-tracker
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBeads Task Tracker
Beads 任务跟踪工具
Overview
概述
Beads is a git-versioned, dependency-aware issue tracker designed specifically for AI coding agents. It solves the "amnesia problem" where agents lose context between sessions by providing a persistent, queryable task database that agents can use to orient themselves, find ready work, and track dependencies across long-horizon projects.
Use Beads when:
- Working on projects with multiple interconnected tasks
- Tasks span multiple agent sessions (>10 minutes)
- Need to track what work is blocked vs. ready
- Discovering new work during implementation that should be captured
- Multiple agents or machines are working on the same codebase
- Want to avoid the "markdown plan swamp" where plans become stale and disorganized
Beads是一款专为AI编码Agent设计的、基于Git版本控制的依赖感知型问题跟踪工具。它解决了Agent在不同会话间丢失上下文的“失忆问题”,通过提供一个持久化、可查询的任务数据库,帮助Agent定位自身工作方向、找到可执行任务,并在长期项目中跟踪任务依赖关系。
以下场景适合使用Beads:
- 处理包含多个相互关联任务的项目
- 任务跨多个Agent会话(超过10分钟)
- 需要跟踪哪些工作处于阻塞状态、哪些可以立即开始
- 在实施过程中发现需要记录的新工作
- 多个Agent或机器在同一代码库上工作
- 希望避免“Markdown计划泥潭”——即计划变得过时且混乱的情况
Installation Check
安装检查
Before using Beads, verify the command is installed:
bdbash
bd versionIf not installed, install via:
bash
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bashPost-installation PATH setup:
After installation, if is not found in your PATH, add the Go bin directory to your shell profile:
bdFor zsh (most macOS systems), add to :
~/.zshrcbash
export PATH="$PATH:$HOME/go/bin"For bash, add to or :
~/.bashrc~/.bash_profilebash
export PATH="$PATH:$HOME/go/bin"Then reload your shell:
bash
source ~/.zshrc # or source ~/.bashrcAlternatively, you can use the full path until PATH is configured.
/Users/[username]/go/bin/bd使用Beads之前,请验证命令是否已安装:
bdbash
bd version如果未安装,可通过以下命令安装:
bash
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash安装后PATH配置:
安装完成后,如果在PATH中找不到,请将Go的bin目录添加到你的shell配置文件中:
bd对于zsh(大多数macOS系统),添加到:
~/.zshrcbash
export PATH="$PATH:$HOME/go/bin"对于bash,添加到或:
~/.bashrc~/.bash_profilebash
export PATH="$PATH:$HOME/go/bin"然后重新加载shell:
bash
source ~/.zshrc # 或 source ~/.bashrc或者,在PATH配置完成前,你可以使用完整路径来执行命令。
/Users/[username]/go/bin/bdWorkflow Overview
工作流概述
1. Project Initialization
1. 项目初始化
Initialize Beads in a project directory (only needed once per project):
bash
bd initThis creates a directory with:
.beads/- - Git-versioned source of truth
issues.jsonl - - Local SQLite cache (gitignored)
*.db
在项目目录中初始化Beads(每个项目只需执行一次):
bash
bd init此命令会创建一个目录,包含:
.beads/- - 基于Git版本控制的事实数据源
issues.jsonl - - 本地SQLite缓存(已被Git忽略)
*.db
2. Creating Work
2. 创建任务
Create issues when starting new work or discovering tasks during implementation:
Basic creation:
bash
bd create "Task title" -d "Description" -p 1 -t task --jsonIssue types:
- - Standard work item (default)
task - - New functionality
feature - - Defect to fix
bug - - Large body of work (parent to multiple tasks)
epic - - Maintenance work
chore
Priority levels (0-4):
- - Critical/blocking
0 - - High priority
1 - - Medium priority (default)
2 - - Low priority
3 - - Nice to have
4
Creating from markdown file:
bash
bd create -f plan.md --jsonFormat: creates new issue, with optional sections , , ,
## Issue Title### Priority### Type### Description### DependenciesAdd labels for organization:
bash
bd create "Add auth" -l "backend,security,p1" --json在开始新工作或实施过程中发现任务时,创建问题:
基础创建方式:
bash
bd create "任务标题" -d "描述内容" -p 1 -t task --json问题类型:
- - 标准工作项(默认类型)
task - - 新功能
feature - - 需要修复的缺陷
bug - - 大型工作模块(可包含多个子任务)
epic - - 维护性工作
chore
优先级等级(0-4):
- - 关键/阻塞级
0 - - 高优先级
1 - - 中优先级(默认)
2 - - 低优先级
3 - - 可选优化
4
从Markdown文件创建:
bash
bd create -f plan.md --json格式说明:会创建新问题,可附带可选章节、、、
## 问题标题### Priority### Type### Description### Dependencies添加标签用于分类:
bash
bd create "添加认证功能" -l "backend,security,p1" --json3. Managing Dependencies
3. 管理依赖关系
Link related work to establish ordering and track blockers:
Add dependency:
bash
undefined关联相关工作以建立任务顺序并跟踪阻塞项:
添加依赖:
bash
undefinedFormat: bd dep add <dependent> <blocker>
格式:bd dep add <依赖项> <阻塞项>
bd dep add bd-5 bd-3 # bd-5 depends on bd-3 completing first
**Dependency types:**
- `blocks` (default) - Hard blocker; dependent cannot start until blocker closes
- `parent-child` - Hierarchical relationship (child depends on parent)
```bash
bd dep add bd-task bd-epic --type parent-child- - Issue found during work on another issue
discovered-frombashbd dep add bd-new bd-current --type discovered-from - - Soft connection; issues are related but not blocking
related
Visualize dependencies:
bash
bd dep tree bd-42 --jsonDetect cycles:
bash
bd dep cycles --jsonCycles break ready work detection and must be resolved.
bd dep add bd-5 bd-3 # bd-5 需在 bd-3 完成后才能开始
**依赖类型:**
- `blocks`(默认)- 硬阻塞;依赖项必须等待阻塞项完成才能开始
- `parent-child` - 层级关系(子任务依赖父任务)
```bash
bd dep add bd-task bd-epic --type parent-child- - 在处理其他问题时发现的新问题
discovered-frombashbd dep add bd-new bd-current --type discovered-from - - 软关联;问题相关但无阻塞关系
related
可视化依赖关系:
bash
bd dep tree bd-42 --json检测循环依赖:
bash
bd dep cycles --json循环依赖会破坏可执行任务的检测,必须解决。
4. Finding Ready Work
4. 查找可执行任务
Query for actionable work with no open blockers:
bash
undefined查询无未解决阻塞的可执行工作:
bash
undefinedAll ready work
所有可执行任务
bd ready --json
bd ready --json
Filter by priority
按优先级过滤
bd ready --priority 1 --json
bd ready --priority 1 --json
Filter by labels
按标签过滤
bd ready --label backend --json
bd ready --label backend --json
Limit results
限制结果数量
bd ready --limit 5 --json
undefinedbd ready --limit 5 --json
undefinedFinding Recent/Latest Tasks
查找最近/最新任务
IMPORTANT: When starting a session, always check for the latest/highest-numbered tasks first, as these typically represent the most recent work and current priorities.
View recent tasks sorted by ID (descending):
bash
undefined重要提示: 开始会话时,务必先查看编号最高的最新任务,因为它们通常代表最近的工作和当前优先级。
按ID降序查看最近任务:
bash
undefinedList all open tasks, sorted by ID number (highest/newest first)
列出所有未完成任务,按ID编号降序排列(最新的在前)
bd list --status open --json | jq -r '.[] | .id' | sort -t'-' -k3 -n -r | head -20
bd list --status open --json | jq -r '.[] | .id' | sort -t'-' -k3 -n -r | head -20
Show full details of highest-numbered tasks
显示编号最高的任务的完整详情
bd list --status open --json | jq 'sort_by(.id | sub(".*-"; "") | tonumber) | reverse | .[0:10]'
bd list --status open --json | jq 'sort_by(.id | sub(".*-"; "") | tonumber) | reverse | .[0:10]'
Find tasks in a specific number range (e.g., 120-150)
查找特定编号范围的任务(例如120-150)
bd list --json | jq '[.[] | select(.id | test("Twilio-Aldea-1[2-5][0-9]"))] | sort_by(.id | sub(".*-"; "") | tonumber) | reverse | .[] | {id, title, status, priority}'
**Example workflow at session start:**
```bashbd list --json | jq '[.[] | select(.id | test("Twilio-Aldea-1[2-5][0-9]"))] | sort_by(.id | sub(".*-"; "") | tonumber) | reverse | .[] | {id, title, status, priority}'
**会话开始时的示例工作流:**
```bash1. First, check what the highest task numbers are
1. 首先,查看当前最高任务编号
HIGHEST=$(bd list --json | jq -r '.[].id' | grep -oE '[0-9]+$' | sort -n | tail -1)
echo "Highest task number: $HIGHEST"
HIGHEST=$(bd list --json | jq -r '.[].id' | grep -oE '[0-9]+$' | sort -n | tail -1)
echo "最高任务编号: $HIGHEST"
2. View tasks in the recent range (e.g., last 30 tasks)
2. 查看最近范围内的任务(例如最近30个任务)
RANGE_START=$((HIGHEST - 30))
bd list --json | jq --arg start "$RANGE_START" '[.[] | select(.id | test(".-([0-9]+)$") and (.id | match(".-([0-9]+)$").captures[0].string | tonumber) >= ($start | tonumber))] | sort_by(.id | sub(".*-"; "") | tonumber) | reverse'
RANGE_START=$((HIGHEST - 30))
bd list --json | jq --arg start "$RANGE_START" '[.[] | select(.id | test(".-([0-9]+)$") and (.id | match(".-([0-9]+)$").captures[0].string | tonumber) >= ($start | tonumber))] | sort_by(.id | sub(".*-"; "") | tonumber) | reverse'
3. Find ready work among recent tasks
3. 在最近任务中查找可执行工作
bd ready --json | jq -r '.[] | .id' | sort -t'-' -k3 -n -r | head -10
**Why check recent tasks first:**
- Most recent work is usually the current focus
- Recent tasks often have the freshest context
- Prevents overlooking newly-created high-priority work
- Helps identify what was worked on most recently
**At session start, always:**
1. Check the highest task numbers to understand the current work range
2. List recent tasks (highest 20-30 IDs) to see current focus areas
3. Run `bd ready --json` to find unblocked work, prioritizing recent tasks
4. Choose highest-priority ready issue (preferring recent tasks when priorities are equal)
5. Update status to `in_progress` before starting workbd ready --json | jq -r '.[] | .id' | sort -t'-' -k3 -n -r | head -10
**为什么要先查看最近任务:**
- 最近的工作通常是当前的焦点
- 最近的任务通常包含最新的上下文信息
- 避免忽略新创建的高优先级工作
- 帮助了解最近正在处理的内容
**会话开始时,请务必:**
1. 查看最高任务编号以了解当前工作范围
2. 列出最近任务(编号最高的20-30个)以查看当前重点领域
3. 运行`bd ready --json`查找未阻塞任务,优先考虑最近的任务
4. 选择优先级最高的可执行问题(优先级相同时优先选择最近任务)
5. 开始工作前将状态更新为`in_progress`5. Working and Updating
5. 工作与任务更新
Update issue status as work progresses:
Start work:
bash
bd update bd-42 --status in_progress --jsonValid statuses:
- - Not started
open - - Currently being worked on
in_progress - - Completed
closed
Update other fields:
bash
bd update bd-42 --priority 0 --json
bd update bd-42 --assignee alice --jsonClose completed work:
bash
bd close bd-42 --reason "Implementation complete, tests passing" --json随着工作推进,更新问题状态:
开始工作:
bash
bd update bd-42 --status in_progress --json有效状态:
- - 未开始
open - - 正在处理中
in_progress - - 已完成
closed
更新其他字段:
bash
bd update bd-42 --priority 0 --json
bd update bd-42 --assignee alice --json关闭已完成的工作:
bash
bd close bd-42 --reason "实现完成,测试通过" --json6. Discovery During Work
6. 工作中发现新任务
When discovering new work during implementation:
bash
undefined在实施过程中发现新工作时:
bash
undefined1. Create the discovered issue
1. 创建新发现的问题
NEW_ID=$(bd create "Fix discovered bug in auth" -t bug -p 1 --json | jq -r '.id')
NEW_ID=$(bd create "修复认证模块中发现的bug" -t bug -p 1 --json | jq -r '.id')
2. Link back to parent work
2. 将其与父任务关联
bd dep add $NEW_ID bd-current --type discovered-from --json
bd dep add $NEW_ID bd-current --type discovered-from --json
3. Decide: handle now or defer?
3. 决定:立即处理还是延后?
If blocking current work: switch to new issue
如果当前工作被阻塞:切换到新任务
If not blocking: continue current work, new issue will show in bd ready
如果未被阻塞:继续当前工作,新任务会在bd ready中显示
undefinedundefined7. Querying and Inspection
7. 查询与检查
List issues with filters:
bash
bd list --status open --json
bd list --priority 1 --json
bd list --label backend,urgent --json # AND: must have ALL
bd list --label-any frontend,backend --json # OR: at least oneShow full issue details:
bash
bd show bd-42 --jsonView blocked issues:
bash
bd blocked --jsonProject statistics:
bash
bd stats --json带过滤条件的问题列表:
bash
bd list --status open --json
bd list --priority 1 --json
bd list --label backend,urgent --json # 逻辑与:必须包含所有标签
bd list --label-any frontend,backend --json # 逻辑或:至少包含一个标签查看问题完整详情:
bash
bd show bd-42 --json查看被阻塞的问题:
bash
bd blocked --json项目统计信息:
bash
bd stats --jsonJSON Output Parsing
JSON输出解析
Always use flag for programmatic access. Parse with :
--jsonjqbash
undefined对于程序化访问,请始终使用标志。可使用进行解析:
--jsonjqbash
undefinedGet first ready issue
获取第一个可执行任务
ISSUE=$(bd ready --json | jq -r '.[0]')
ISSUE_ID=$(echo "$ISSUE" | jq -r '.id')
ISSUE_TITLE=$(echo "$ISSUE" | jq -r '.title')
ISSUE=$(bd ready --json | jq -r '.[0]')
ISSUE_ID=$(echo "$ISSUE" | jq -r '.id')
ISSUE_TITLE=$(echo "$ISSUE" | jq -r '.title')
Check if any ready work exists
检查是否存在可执行任务
READY_COUNT=$(bd ready --json | jq 'length')
if [ "$READY_COUNT" -eq 0 ]; then
echo "No ready work. Check blocked issues:"
bd blocked --json
fi
READY_COUNT=$(bd ready --json | jq 'length')
if [ "$READY_COUNT" -eq 0 ]; then
echo "无可用可执行任务。查看被阻塞的问题:"
bd blocked --json
fi
Get highest task number and list recent tasks
获取最高任务编号并列出最近任务
HIGHEST=$(bd list --json | jq -r 'max_by(.id | sub(".-"; "") | tonumber) | .id | sub(".-"; "")')
echo "Highest task: #$HIGHEST"
bd list --json | jq --arg num "$HIGHEST" '[.[] | select((.id | sub(".-"; "") | tonumber) >= (($num | tonumber) - 20))] | sort_by(.id | sub(".-"; "") | tonumber) | reverse | .[] | {id, title, status, priority}'
undefinedHIGHEST=$(bd list --json | jq -r 'max_by(.id | sub(".-"; "") | tonumber) | .id | sub(".-"; "")')
echo "最高任务编号: #$HIGHEST"
bd list --json | jq --arg num "$HIGHEST" '[.[] | select((.id | sub(".-"; "") | tonumber) >= (($num | tonumber) - 20))] | sort_by(.id | sub(".-"; "") | tonumber) | reverse | .[] | {id, title, status, priority}'
undefinedBest Practices
最佳实践
DO:
- Initialize Beads at project start ()
bd init - Create issues for discovered work instead of informal notes
- Use dependencies to model task relationships
- Query at session start to orient yourself
bd ready - Close issues with descriptive reasons
- Use labels to categorize work (e.g., ,
backend,frontend)urgent - Commit to git (auto-exported after changes)
.beads/issues.jsonl
DON'T:
- Create circular dependencies (use to detect)
bd dep cycles - Skip updating status (stale statuses confuse ready work detection)
- Forget to link discovered work back to parent issues
- Use markdown files for task tracking when Beads is available
- Ignore blocked issues indefinitely (reassess dependencies)
建议:
- 在项目开始时初始化Beads()
bd init - 为发现的新工作创建问题,而非使用非正式笔记
- 使用依赖关系来建模任务间的关联
- 会话开始时查询以明确工作方向
bd ready - 关闭问题时添加描述性的原因
- 使用标签对工作进行分类(例如、
backend、frontend)urgent - 将提交到Git(更改后会自动导出)
.beads/issues.jsonl
不建议:
- 创建循环依赖(使用检测)
bd dep cycles - 跳过状态更新(过期状态会干扰可执行任务的检测)
- 忘记将发现的新工作与父任务关联
- 在Beads可用时仍使用Markdown文件进行任务跟踪
- 无限期忽略被阻塞的问题(重新评估依赖关系)
Multi-Session Workflow Pattern
多会话工作流模式
Session 1 - Starting fresh:
bash
undefined会话1 - 首次启动:
bash
undefined1. Check for ready work
1. 查看可执行任务
bd ready --json
bd ready --json
2. If no ready work, check what's blocked
2. 如果无可用可执行任务,查看被阻塞的任务
bd blocked --json
bd blocked --json
3. Start working on highest-priority ready issue
3. 开始处理优先级最高的可执行任务
bd update bd-5 --status in_progress --json
bd update bd-5 --status in_progress --json
4. During work, discover new issue
4. 工作中发现新问题
bd create "Fix validation bug" -t bug -p 0 --json
bd dep add bd-new bd-5 --type discovered-from --json
bd create "修复验证模块bug" -t bug -p 0 --json
bd dep add bd-new bd-5 --type discovered-from --json
5. Complete original work
5. 完成原任务
bd close bd-5 --reason "Feature implemented" --json
**Session 2 - Agent resumes (different session, possibly different day):**
```bashbd close bd-5 --reason "功能实现完成" --json
**会话2 - Agent恢复工作(不同会话,可能间隔数天):**
```bash1. Check ready work (newly created bd-new is now ready)
1. 查看可执行任务(新创建的bd-new现在已可用)
bd ready --json
bd ready --json
2. See discovered issue from previous session
2. 看到上一会话中发现的问题
3. Continue work seamlessly without context loss
3. 无缝继续工作,无上下文丢失
bd update bd-new --status in_progress --json
undefinedbd update bd-new --status in_progress --json
undefinedQuick Reference
快速参考
See for a comprehensive command cheat sheet.
references/quick-reference.mdFor workflow patterns and advanced usage, see .
references/workflow-patterns.md完整的命令速查表请查看。
references/quick-reference.md关于工作流模式和高级用法,请查看。
references/workflow-patterns.mdBuilt-in Help
内置帮助
Beads includes an interactive quickstart guide:
bash
bd quickstartRun this to see comprehensive examples and workflows.
Beads包含交互式快速入门指南:
bash
bd quickstart运行此命令可查看全面的示例和工作流。
Integration with Project Documentation
与项目文档集成
Add to or :
AGENTS.mdCLAUDE.mdmarkdown
undefined将以下内容添加到或:
AGENTS.mdCLAUDE.mdmarkdown
undefinedTask Tracking with Beads
使用Beads进行任务跟踪
We track implementation work using Beads (), a dependency-aware issue tracker. Use to see unblocked work, to add tasks, and to claim work. Run for full documentation.
bdbd ready --jsonbd createbd update <id> --status in_progressbd quickstartundefined我们使用Beads()这款依赖感知型问题跟踪工具来管理实施工作。使用查看未阻塞任务,使用添加任务,使用认领工作。运行获取完整文档。
bdbd ready --jsonbd createbd update <id> --status in_progressbd quickstartundefinedResources
资源
This skill includes reference documentation to support effective Beads usage:
此技能包含参考文档以支持高效使用Beads:
references/
references/
- - Command cheat sheet organized by category
quick-reference.md - - Common patterns and best practices for agent workflows
workflow-patterns.md
- - 按类别组织的命令速查表
quick-reference.md - - Agent工作流的常见模式和最佳实践
workflow-patterns.md