add-bead
免费Capture free-text work as a tracked Beads issue. Use when the user runs /add-bead or wants to quickly file a Beads issue.
中文简介正在准备中。当前显示原文说明。
Explore the codebase and produce an implementation plan. Use when the user runs /plan or wants a plan before building.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Explores the codebase and produces a structured implementation plan. Optionally materializes Beads tasks.
/plan add user settings page
/plan T-42 # Plan for an existing task
/plan refactor auth module --tasks # Also create Beads tasks from the plan
Before any code exploration, load the relevant knowledge files:
cat knowledge/_shared.yaml
cat knowledge/repos/<repo>.yaml 2>/dev/null || echo "no knowledge file for <repo>" # For each affected repo
A repo has a knowledge file only after /add-repo or /sync-knowledge has been run for it;
knowledge/repos/ is empty in a fresh checkout, and the harness itself has none.
If a knowledge file is missing or stale (>50 commits behind HEAD):
If the user input is only one to four sentences with no Beads task id and no detailed spec:
.claude/agents/planner.md and adopt the Planner role before deep exploration.plans/drafts/<slug>-product-spec.md.If the user already provided a detailed spec or bd show task context, skip this step.
Search for existing implementations before planning anything new:
# Hooks
grep -rE "^export function use" src/ --include="*.ts" --include="*.tsx" -l
# Types and interfaces
grep -rE "^export (interface|type)" src/ --include="*.ts" -l
# Components
grep -rE "^export (default|function|const)" src/components/ --include="*.tsx" -l
# Utilities
grep -rE "^export (function|const|class)" src/utils/ --include="*.ts" -l
Note any existing implementations relevant to the plan.
Use an Explore subagent (or explore directly) to map the codebase:
For small scope (single feature area):
For large scope (cross-cutting concern):
Goal: understand the codebase well enough to write a complete, accurate plan with real file paths and function names.
Write to plans/drafts/<TASK-ID>.md (create plans/drafts/ if needed).
If no task ID: use a slug from the description.
# Plan: <TASK-ID> — <title>
Generated: <date>
Repo: <repo>
## Summary
<~100 tokens: what is being built, why, and the approach in plain language>
## Existing Code to Reuse
- `src/hooks/useAuth.ts` — auth state hook, extend it for settings
- `src/types/user.ts` — UserProfile type already has the needed fields
## Implementation Steps
1. Add settings schema to `src/types/user.ts`
- Extend `UserProfile` with `settings: UserSettings`
- Define `UserSettings` interface
2. Create `src/api/settings.ts`
- `getSettings(userId: string): Promise<UserSettings>`
- `updateSettings(userId: string, patch: Partial<UserSettings>): Promise<void>`
3. Create `src/hooks/useUserSettings.ts`
- Wraps `getSettings` / `updateSettings`
- Returns `{ settings, loading, error, update }`
4. Create `src/components/UserSettingsPage.tsx`
- Form bound to `useUserSettings`
- Save/cancel buttons, loading state, error display
5. Add route in `src/App.tsx`
- `/settings` → `<UserSettingsPage />`
## Files to Modify
| File | Change |
|------|--------|
| `src/types/user.ts` | Add UserSettings interface |
| `src/App.tsx` | Add /settings route |
## Files to Create
| File | Purpose |
|------|---------|
| `src/api/settings.ts` | Settings API calls |
| `src/hooks/useUserSettings.ts` | Settings state hook |
| `src/components/UserSettingsPage.tsx` | Settings UI |
| `src/api/settings.test.ts` | API unit tests |
| `src/hooks/useUserSettings.test.ts` | Hook unit tests |
## Test Strategy
- Unit: `useUserSettings` — loading state, error state, successful update
- Unit: `settings.ts` API — mock fetch, verify request format
- Integration: settings page saves and persists across page refresh
- Edge: empty settings object, network error, validation failure
## Validation Commands
\`\`\`bash
bun run typecheck
bun test src/api/settings.test.ts
bun test src/hooks/useUserSettings.test.ts
\`\`\`
## Estimated Scope
- Files: 5 new, 2 modified
- Complexity: Medium
- Estimated time: 90 minutes
## Interfaces (if this plan produces shared APIs)
\`\`\`typescript
export function useUserSettings(userId: string): {
settings: UserSettings | null;
loading: boolean;
error: Error | null;
update: (patch: Partial<UserSettings>) => Promise<void>;
}
\`\`\`
Output a summary to the user:
Plan ready: plans/drafts/<TASK-ID>.md
Summary: <2-sentence description>
Scope: <n> files (<n> new, <n> modified), ~<n> minutes
Complexity: Low | Medium | High
Key decisions:
- <decision 1 and why>
- <decision 2 and why>
--tasks flag only)If --tasks was passed:
For each implementation step in the plan:
bd create \
--type task \
--title "[<repo>] <step description>" \
--priority <value> \
--acceptance "<acceptance criterion from the step>"
Pick <value> with .claude/skills/beads-priority-assignment/SKILL.md (critical-path or high-risk steps → high / critical; later optional steps → medium / low).
Add sequential dependencies (step 2 requires step 1):
bd dep add <step-2-id> <step-1-id> # the later step first, the earlier step second
If there are 4+ tasks: create a parent feature:
bd create --type feature --title "<overall feature title>" --priority <value>
# then add parent relationship to each task
Use the same skill for the parent feature priority (often medium unless the plan is release-blocking).
Report: "Created N Beads tasks. Run /go to start work."
After loading knowledge files, check commit distance:
git log --oneline knowledge/repos/<repo>.yaml -- | head -1
git rev-list --count HEAD # compare against knowledge file's last commit
If >50 commits behind: ⚠ knowledge/<repo>.yaml is stale (>50 commits). Run /sync-knowledge <repo>.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Capture free-text work as a tracked Beads issue. Use when the user runs /add-bead or wants to quickly file a Beads issue.
中文简介正在准备中。当前显示原文说明。
Register a new sub-repo in the knowledge base.
中文简介正在准备中。当前显示原文说明。
Add focused Bun unit tests for mission-critical behavior and edge cases — not blanket coverage.
中文简介正在准备中。当前显示原文说明。
Answer questions about the codebase from knowledge files. Use when the user runs /ask or asks a domain/knowledge question about the repos.
中文简介正在准备中。当前显示原文说明。
Meta-skill for creating Agent Forge skills under .claude/skills/ with SKILL.md, optional references/ and scripts/, and Bun scaffolds. Use when the user wants to add or author a skill, scaffold a new skill folder, or align skill docs with harness conventions (JSON script output, Beads for tasks).
中文简介正在准备中。当前显示原文说明。
Choose Beads issue priority (P0–P4, numeric, or named) from urgency, impact, and risk when creating or triaging work.
中文简介正在准备中。当前显示原文说明。