opencodekit 0.16.4 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +106 -384
- package/dist/template/.opencode/README.md +170 -104
- package/dist/template/.opencode/agent/build.md +39 -32
- package/dist/template/.opencode/agent/explore.md +2 -0
- package/dist/template/.opencode/agent/review.md +3 -0
- package/dist/template/.opencode/agent/scout.md +22 -11
- package/dist/template/.opencode/command/create.md +164 -106
- package/dist/template/.opencode/command/design.md +5 -1
- package/dist/template/.opencode/command/handoff.md +6 -4
- package/dist/template/.opencode/command/init.md +1 -1
- package/dist/template/.opencode/command/plan.md +26 -23
- package/dist/template/.opencode/command/research.md +13 -6
- package/dist/template/.opencode/command/resume.md +8 -6
- package/dist/template/.opencode/command/ship.md +1 -1
- package/dist/template/.opencode/command/start.md +30 -25
- package/dist/template/.opencode/command/status.md +9 -42
- package/dist/template/.opencode/command/verify.md +11 -11
- package/dist/template/.opencode/memory/README.md +67 -37
- package/dist/template/.opencode/memory/_templates/prd.md +102 -18
- package/dist/template/.opencode/memory/project/gotchas.md +31 -0
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +0 -10
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/skill/beads/SKILL.md +164 -380
- package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +23 -22
- package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +23 -29
- package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +5 -8
- package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +43 -39
- package/dist/template/.opencode/skill/beads-bridge/SKILL.md +80 -53
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +19 -5
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +30 -63
- package/dist/template/.opencode/skill/context-management/SKILL.md +115 -0
- package/dist/template/.opencode/skill/deep-research/SKILL.md +4 -4
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +305 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +3 -3
- package/dist/template/.opencode/skill/prd/SKILL.md +47 -122
- package/dist/template/.opencode/skill/prd-task/SKILL.md +48 -4
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +120 -24
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +79 -61
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +31 -22
- package/dist/template/.opencode/tool/context7.ts +183 -0
- package/dist/template/.opencode/tool/memory-admin.ts +445 -0
- package/dist/template/.opencode/tool/swarm.ts +572 -0
- package/package.json +1 -1
- package/dist/template/.opencode/memory/_templates/spec.md +0 -66
- package/dist/template/.opencode/tool/beads-sync.ts +0 -657
- package/dist/template/.opencode/tool/context7-query-docs.ts +0 -89
- package/dist/template/.opencode/tool/context7-resolve-library-id.ts +0 -113
- package/dist/template/.opencode/tool/memory-maintain.ts +0 -167
- package/dist/template/.opencode/tool/memory-migrate.ts +0 -319
- package/dist/template/.opencode/tool/swarm-delegate.ts +0 -180
- package/dist/template/.opencode/tool/swarm-monitor.ts +0 -388
- package/dist/template/.opencode/tool/swarm-plan.ts +0 -697
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: beads
|
|
3
3
|
description: >
|
|
4
|
-
Multi-agent task coordination using
|
|
4
|
+
Multi-agent task coordination using br (beads_rust) CLI. Use when work spans multiple
|
|
5
5
|
sessions, has dependencies, needs file locking, or requires agent coordination. Covers
|
|
6
6
|
claim/reserve/done cycle, dependency management, hierarchical decomposition, and session protocols.
|
|
7
|
-
version: "
|
|
7
|
+
version: "2.0.0"
|
|
8
8
|
license: MIT
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -12,35 +12,49 @@ license: MIT
|
|
|
12
12
|
|
|
13
13
|
Graph-based task tracker with file locking for multi-agent coordination. Persists across sessions.
|
|
14
14
|
|
|
15
|
+
**Note:** `br` (beads_rust) is non-invasive and never executes git commands. After `br sync --flush-only`, you must manually run `git add .beads/ && git commit`.
|
|
16
|
+
|
|
15
17
|
## Overview
|
|
16
18
|
|
|
17
|
-
**
|
|
19
|
+
**br (beads_rust) CLI** replaces the old `bd` (beads) CLI with a faster Rust implementation.
|
|
18
20
|
|
|
19
21
|
**Key Distinction**:
|
|
20
22
|
|
|
21
|
-
- **
|
|
23
|
+
- **br CLI**: Multi-session work, dependencies, file locking, agent coordination
|
|
22
24
|
- **TodoWrite**: Single-session tasks, linear execution, conversation-scoped
|
|
23
25
|
|
|
24
|
-
**When to Use
|
|
26
|
+
**When to Use br vs TodoWrite**:
|
|
25
27
|
|
|
26
|
-
- "Will I need this context in 2 weeks?" → **YES** =
|
|
27
|
-
- "Does this have blockers/dependencies?" → **YES** =
|
|
28
|
-
- "Multiple agents editing same codebase?" → **YES** =
|
|
28
|
+
- "Will I need this context in 2 weeks?" → **YES** = br
|
|
29
|
+
- "Does this have blockers/dependencies?" → **YES** = br
|
|
30
|
+
- "Multiple agents editing same codebase?" → **YES** = br
|
|
29
31
|
- "Will this be done in this session?" → **YES** = TodoWrite
|
|
30
32
|
|
|
31
33
|
**Decision Rule**: If resuming in 2 weeks would be hard without beads, use beads.
|
|
32
34
|
|
|
35
|
+
## Essential Commands
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
br ready # Show issues ready to work (no blockers)
|
|
39
|
+
br list --status open # All open issues
|
|
40
|
+
br show <id> # Full issue details with dependencies
|
|
41
|
+
br create --title "Fix bug" --type bug --priority 2 --description "Details here"
|
|
42
|
+
br update <id> --status in_progress
|
|
43
|
+
br close <id> --reason "Completed"
|
|
44
|
+
br sync --flush-only # Export to JSONL (then git add/commit manually)
|
|
45
|
+
```
|
|
46
|
+
|
|
33
47
|
## Hierarchical Structure: Epic → Task → Subtask
|
|
34
48
|
|
|
35
49
|
**Beads supports up to 3 levels of hierarchy using hierarchical IDs:**
|
|
36
50
|
|
|
37
51
|
```
|
|
38
|
-
|
|
39
|
-
├──
|
|
40
|
-
├──
|
|
41
|
-
│ ├──
|
|
42
|
-
│ └──
|
|
43
|
-
└──
|
|
52
|
+
br-a3f8 (Epic - parent feature)
|
|
53
|
+
├── br-a3f8.1 (Task - first child)
|
|
54
|
+
├── br-a3f8.2 (Task - second child)
|
|
55
|
+
│ ├── br-a3f8.2.1 (Subtask - child of .2)
|
|
56
|
+
│ └── br-a3f8.2.2 (Subtask - child of .2)
|
|
57
|
+
└── br-a3f8.3 (Task - third child)
|
|
44
58
|
```
|
|
45
59
|
|
|
46
60
|
### When to Decompose
|
|
@@ -56,38 +70,21 @@ bd-a3f8 (Epic - parent feature)
|
|
|
56
70
|
|
|
57
71
|
### Creating Hierarchical Beads
|
|
58
72
|
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
pri: 2,
|
|
75
|
-
parent: "bd-a3f8", // Links to epic
|
|
76
|
-
desc: "Create user and session tables",
|
|
77
|
-
tags: ["backend", "database"],
|
|
78
|
-
});
|
|
79
|
-
// Returns: { id: "bd-a3f8.1" } ← Hierarchical ID!
|
|
80
|
-
|
|
81
|
-
// Step 3: Create dependent tasks with `deps` parameter
|
|
82
|
-
const task2 = bd_add({
|
|
83
|
-
title: "OAuth integration",
|
|
84
|
-
type: "task",
|
|
85
|
-
pri: 2,
|
|
86
|
-
parent: "bd-a3f8",
|
|
87
|
-
deps: ["bd-a3f8.1"], // Blocked until .1 completes
|
|
88
|
-
tags: ["backend"],
|
|
89
|
-
});
|
|
90
|
-
// Returns: { id: "bd-a3f8.2" }
|
|
73
|
+
```bash
|
|
74
|
+
# Step 1: Create Epic (parent)
|
|
75
|
+
br create --title "User Authentication System" --type epic --priority 1 \
|
|
76
|
+
--description "Complete auth with OAuth, sessions, and protected routes"
|
|
77
|
+
# Returns: br-a3f8
|
|
78
|
+
|
|
79
|
+
# Step 2: Create child tasks with parent
|
|
80
|
+
br create --title "Database schema for auth" --type task --priority 2 \
|
|
81
|
+
--parent br-a3f8 --description "Create user and session tables"
|
|
82
|
+
# Returns: br-a3f8.1 ← Hierarchical ID!
|
|
83
|
+
|
|
84
|
+
# Step 3: Create dependent tasks
|
|
85
|
+
br create --title "OAuth integration" --type task --priority 2 \
|
|
86
|
+
--parent br-a3f8 --blocked-by br-a3f8.1
|
|
87
|
+
# Returns: br-a3f8.2
|
|
91
88
|
```
|
|
92
89
|
|
|
93
90
|
### Dependency Types
|
|
@@ -104,12 +101,12 @@ Beads supports four dependency types:
|
|
|
104
101
|
### Parallel Execution with Dependencies
|
|
105
102
|
|
|
106
103
|
```
|
|
107
|
-
|
|
104
|
+
br-a3f8.1 [Database] ──┬──> br-a3f8.2 [Backend] ──┐
|
|
108
105
|
(READY) │ │
|
|
109
106
|
│ ▼
|
|
110
|
-
└──>
|
|
107
|
+
└──> br-a3f8.3 [Frontend] br-a3f8.5 [Testing]
|
|
111
108
|
│ │ ▲
|
|
112
|
-
└──>
|
|
109
|
+
└──> br-a3f8.4 [Docs] ──────────┘
|
|
113
110
|
|
|
114
111
|
Parallel tracks:
|
|
115
112
|
• Agent 1 (backend): .1 → .2
|
|
@@ -117,97 +114,66 @@ Parallel tracks:
|
|
|
117
114
|
• Agent 3 (qa): wait for .2 and .3, then .5
|
|
118
115
|
```
|
|
119
116
|
|
|
120
|
-
**Key insight**: After
|
|
117
|
+
**Key insight**: After br-a3f8.1 completes, .2, .3, and .4 all become READY simultaneously. Multiple agents can claim them in parallel.
|
|
121
118
|
|
|
122
119
|
### Querying Hierarchy
|
|
123
120
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// Filter by parent prefix in results
|
|
121
|
+
```bash
|
|
122
|
+
# See all open issues
|
|
123
|
+
br list --status open
|
|
128
124
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
# See ready work (unblocked tasks)
|
|
126
|
+
br ready
|
|
127
|
+
# Returns tasks where all dependencies are closed
|
|
132
128
|
```
|
|
133
129
|
|
|
134
130
|
## Session Start Protocol
|
|
135
131
|
|
|
136
132
|
**Every session, follow these steps:**
|
|
137
133
|
|
|
138
|
-
### Step 1:
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
bd_init({ team: "project", role: "fe" });
|
|
142
|
-
````
|
|
143
|
-
|
|
144
|
-
Joins workspace, enables role-based task filtering. Roles: fe, be, mobile, devops, qa.
|
|
145
|
-
|
|
146
|
-
### Step 2: Check Health (Weekly)
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
bd_doctor();
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Repairs database issues. Run at start of week or after sync problems.
|
|
153
|
-
|
|
154
|
-
### Step 3: Find Ready Work
|
|
134
|
+
### Step 1: Find Ready Work
|
|
155
135
|
|
|
156
|
-
```
|
|
157
|
-
|
|
136
|
+
```bash
|
|
137
|
+
br ready
|
|
158
138
|
```
|
|
159
139
|
|
|
160
|
-
Returns highest priority task with no blockers
|
|
140
|
+
Returns highest priority task with no blockers.
|
|
161
141
|
|
|
162
142
|
If no tasks returned, check all open work:
|
|
163
143
|
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Step 4: Get Full Context
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
bd_show({ id: "task-abc" });
|
|
144
|
+
```bash
|
|
145
|
+
br list --status open
|
|
172
146
|
```
|
|
173
147
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
### Step 5: Reserve Files Before Editing
|
|
148
|
+
### Step 2: Claim Task
|
|
177
149
|
|
|
178
|
-
```
|
|
179
|
-
|
|
150
|
+
```bash
|
|
151
|
+
br update <id> --status in_progress
|
|
180
152
|
```
|
|
181
153
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
Check existing locks first:
|
|
154
|
+
### Step 3: Get Full Context
|
|
185
155
|
|
|
186
|
-
```
|
|
187
|
-
|
|
156
|
+
```bash
|
|
157
|
+
br show <id>
|
|
188
158
|
```
|
|
189
159
|
|
|
190
|
-
|
|
160
|
+
Shows full description, dependencies, notes, history.
|
|
191
161
|
|
|
192
|
-
|
|
162
|
+
### Step 4: Do the Work
|
|
193
163
|
|
|
194
|
-
|
|
164
|
+
Implement the task, adding notes as you learn.
|
|
195
165
|
|
|
196
|
-
|
|
197
|
-
COMPLETED: Specific deliverables (e.g., "implemented JWT refresh endpoint")
|
|
198
|
-
IN PROGRESS: Current state + next immediate step
|
|
199
|
-
BLOCKERS: What's preventing progress
|
|
200
|
-
KEY DECISIONS: Important context or user guidance
|
|
201
|
-
```
|
|
166
|
+
### Step 5: Complete and Sync
|
|
202
167
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
168
|
+
```bash
|
|
169
|
+
br close <id> --reason "Implemented auth with JWT tokens"
|
|
170
|
+
br sync --flush-only
|
|
171
|
+
git add .beads/
|
|
172
|
+
git commit -m "sync beads"
|
|
173
|
+
# RESTART SESSION - fresh context
|
|
208
174
|
```
|
|
209
175
|
|
|
210
|
-
Always restart session after
|
|
176
|
+
Always restart session after closing a task. One task per session.
|
|
211
177
|
|
|
212
178
|
## Task Creation
|
|
213
179
|
|
|
@@ -222,181 +188,54 @@ Create tasks when:
|
|
|
222
188
|
|
|
223
189
|
### Basic Task Creation
|
|
224
190
|
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
type: "bug", // task, bug, feature, epic, chore
|
|
230
|
-
});
|
|
191
|
+
```bash
|
|
192
|
+
br create --title "Fix authentication bug" --priority 0 --type bug
|
|
193
|
+
# Priority: 0=critical, 1=high, 2=normal, 3=low, 4=backlog
|
|
194
|
+
# Types: task, bug, feature, epic, chore
|
|
231
195
|
```
|
|
232
196
|
|
|
233
|
-
### With Description
|
|
197
|
+
### With Description
|
|
234
198
|
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
desc: "Add OAuth2 support for Google, GitHub. Use passport.js.",
|
|
239
|
-
pri: 1,
|
|
240
|
-
type: "feature",
|
|
241
|
-
tags: ["be", "security"], // Role tags for assignment
|
|
242
|
-
});
|
|
199
|
+
```bash
|
|
200
|
+
br create --title "Implement OAuth" --type feature --priority 1 \
|
|
201
|
+
--description "Add OAuth2 support for Google, GitHub. Use passport.js."
|
|
243
202
|
```
|
|
244
203
|
|
|
245
204
|
### Epic with Children
|
|
246
205
|
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
// Create child tasks with parent
|
|
253
|
-
bd_add({ title: "Research OAuth providers", pri: 1, parent: "oauth-abc" });
|
|
254
|
-
bd_add({ title: "Implement auth endpoints", pri: 1, parent: "oauth-abc" });
|
|
255
|
-
bd_add({ title: "Add frontend login UI", pri: 2, parent: "oauth-abc" });
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## File Reservation
|
|
259
|
-
|
|
260
|
-
### Reserve Before Edit
|
|
261
|
-
|
|
262
|
-
```typescript
|
|
263
|
-
bd_reserve({
|
|
264
|
-
paths: ["src/auth.ts", "src/middleware/jwt.ts"],
|
|
265
|
-
reason: "Implementing auth feature",
|
|
266
|
-
ttl: 600, // seconds until expiry (default)
|
|
267
|
-
});
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
**Returns**:
|
|
271
|
-
|
|
272
|
-
```json
|
|
273
|
-
{
|
|
274
|
-
"granted": ["src/auth.ts"],
|
|
275
|
-
"conflicts": [{ "path": "src/middleware/jwt.ts", "holder": "agent-xyz" }]
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Check Active Locks
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
bd_reservations();
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
Shows all locks across workspace with agent IDs and expiry times.
|
|
286
|
-
|
|
287
|
-
### Handle Conflicts
|
|
288
|
-
|
|
289
|
-
If file reserved by another agent:
|
|
290
|
-
|
|
291
|
-
1. **Can wait** → Work on different files first
|
|
292
|
-
2. **Urgent** → Message the agent:
|
|
293
|
-
|
|
294
|
-
```typescript
|
|
295
|
-
bd_msg({
|
|
296
|
-
subj: "Need src/middleware/jwt.ts",
|
|
297
|
-
body: "Working on auth, can you release?",
|
|
298
|
-
to: "agent-xyz",
|
|
299
|
-
});
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
3. **Alternative** → Refactor to avoid that file
|
|
303
|
-
|
|
304
|
-
### Release Early
|
|
305
|
-
|
|
306
|
-
```typescript
|
|
307
|
-
bd_release({ paths: ["src/auth.ts"] }); // Specific files
|
|
308
|
-
bd_release(); // All your reservations
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
Note: `bd_done()` auto-releases all your reservations.
|
|
312
|
-
|
|
313
|
-
## Messaging
|
|
314
|
-
|
|
315
|
-
### Send Message
|
|
316
|
-
|
|
317
|
-
```typescript
|
|
318
|
-
bd_msg({
|
|
319
|
-
subj: "API Ready",
|
|
320
|
-
body: "Auth endpoints deployed to staging",
|
|
321
|
-
to: "all", // or specific agent ID
|
|
322
|
-
importance: "high", // low, normal, high
|
|
323
|
-
});
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### Team Broadcast
|
|
327
|
-
|
|
328
|
-
```typescript
|
|
329
|
-
bd_msg({
|
|
330
|
-
subj: "Breaking Change",
|
|
331
|
-
body: "User schema updated, run migrations",
|
|
332
|
-
to: "all",
|
|
333
|
-
global: true, // Cross-workspace
|
|
334
|
-
});
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
### Check Inbox
|
|
338
|
-
|
|
339
|
-
```typescript
|
|
340
|
-
bd_inbox({ unread: true, n: 10 });
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
### Acknowledge Messages
|
|
344
|
-
|
|
345
|
-
```typescript
|
|
346
|
-
bd_ack({ ids: ["msg-abc", "msg-def"] }); // Mark as read
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
## Agent Coordination
|
|
350
|
-
|
|
351
|
-
### Who's Working on What
|
|
352
|
-
|
|
353
|
-
```typescript
|
|
354
|
-
bd_whois(); // All agents with their files and tasks
|
|
355
|
-
bd_whois({ agent: "build-abc" }); // Specific agent lookup
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
## Status and Analysis
|
|
359
|
-
|
|
360
|
-
### Workspace Overview
|
|
206
|
+
```bash
|
|
207
|
+
# Create parent epic
|
|
208
|
+
br create --title "Epic: OAuth Implementation" --priority 0 --type epic
|
|
209
|
+
# Returns: oauth-abc
|
|
361
210
|
|
|
362
|
-
|
|
363
|
-
|
|
211
|
+
# Create child tasks with parent
|
|
212
|
+
br create --title "Research OAuth providers" --priority 1 --parent oauth-abc
|
|
213
|
+
br create --title "Implement auth endpoints" --priority 1 --parent oauth-abc
|
|
214
|
+
br create --title "Add frontend login UI" --priority 2 --parent oauth-abc
|
|
364
215
|
```
|
|
365
216
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
### Find Blocked Work
|
|
369
|
-
|
|
370
|
-
```typescript
|
|
371
|
-
bd_blocked();
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
Returns tasks that have unresolved dependencies.
|
|
375
|
-
|
|
376
|
-
### View Dependencies
|
|
377
|
-
|
|
378
|
-
```typescript
|
|
379
|
-
bd_dep({ action: "tree", child: "<task-id>", type: "blocks" });
|
|
380
|
-
```
|
|
217
|
+
## Git Sync
|
|
381
218
|
|
|
382
|
-
|
|
219
|
+
### Manual Sync (Non-Invasive)
|
|
383
220
|
|
|
384
|
-
|
|
221
|
+
**Important:** `br` never executes git commands. You must manually commit changes.
|
|
385
222
|
|
|
386
|
-
|
|
223
|
+
```bash
|
|
224
|
+
# Export changes to JSONL
|
|
225
|
+
br sync --flush-only
|
|
387
226
|
|
|
388
|
-
|
|
389
|
-
|
|
227
|
+
# Then manually commit
|
|
228
|
+
git add .beads/
|
|
229
|
+
git commit -m "sync beads"
|
|
230
|
+
git push
|
|
390
231
|
```
|
|
391
232
|
|
|
392
|
-
Commits `.beads/` changes, pulls from remote, pushes local commits.
|
|
393
|
-
|
|
394
233
|
**Use when**: End of session, before handoff, after major progress.
|
|
395
234
|
|
|
396
235
|
### Cleanup Old Issues
|
|
397
236
|
|
|
398
|
-
```
|
|
399
|
-
|
|
237
|
+
```bash
|
|
238
|
+
br cleanup --days 7
|
|
400
239
|
```
|
|
401
240
|
|
|
402
241
|
Removes closed issues older than N days. Run weekly.
|
|
@@ -405,96 +244,60 @@ Removes closed issues older than N days. Run weekly.
|
|
|
405
244
|
|
|
406
245
|
### Common Issues
|
|
407
246
|
|
|
408
|
-
**"Call bd_init() first"**
|
|
409
|
-
|
|
410
|
-
- Always call `bd_init()` at session start
|
|
411
|
-
|
|
412
|
-
**File conflicts**
|
|
413
|
-
|
|
414
|
-
- Check `bd_reservations()` before editing
|
|
415
|
-
- Message holder or work on other files
|
|
416
|
-
|
|
417
247
|
**No ready tasks**
|
|
418
248
|
|
|
419
|
-
- Run `
|
|
420
|
-
- Some may be blocked - check dependencies
|
|
249
|
+
- Run `br list --status open` to see all tasks
|
|
250
|
+
- Some may be blocked - check dependencies with `br show <id>`
|
|
421
251
|
|
|
422
252
|
**Sync failures**
|
|
423
253
|
|
|
424
|
-
- Run `
|
|
254
|
+
- Run `br doctor` to repair database
|
|
425
255
|
- Check git remote access
|
|
426
256
|
|
|
427
257
|
## Examples
|
|
428
258
|
|
|
429
259
|
### Example 1: Standard Session
|
|
430
260
|
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
id: "auth-123",
|
|
449
|
-
msg: "Login form with validation, hooks for auth state",
|
|
450
|
-
});
|
|
451
|
-
// RESTART SESSION
|
|
261
|
+
```bash
|
|
262
|
+
# 1. Find and claim work
|
|
263
|
+
br ready
|
|
264
|
+
br update auth-123 --status in_progress
|
|
265
|
+
|
|
266
|
+
# 2. Get context
|
|
267
|
+
br show auth-123
|
|
268
|
+
|
|
269
|
+
# 3. Do the work...
|
|
270
|
+
# [implementation]
|
|
271
|
+
|
|
272
|
+
# 4. Complete and sync
|
|
273
|
+
br close auth-123 --reason "Login form with validation, hooks for auth state"
|
|
274
|
+
br sync --flush-only
|
|
275
|
+
git add .beads/
|
|
276
|
+
git commit -m "close auth-123"
|
|
277
|
+
# RESTART SESSION
|
|
452
278
|
```
|
|
453
279
|
|
|
454
280
|
### Example 2: Discovered Work
|
|
455
281
|
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
pri: 1,
|
|
462
|
-
type: "bug",
|
|
463
|
-
});
|
|
464
|
-
// Continue current task, new task tracked for later
|
|
282
|
+
```bash
|
|
283
|
+
# Working on task, found more work
|
|
284
|
+
br create --title "Fix edge case in validation" --type bug --priority 1 \
|
|
285
|
+
--description "Empty strings bypass email check - discovered while implementing login"
|
|
286
|
+
# Continue current task, new task tracked for later
|
|
465
287
|
```
|
|
466
288
|
|
|
467
|
-
### Example 3:
|
|
289
|
+
### Example 3: Creating Dependencies
|
|
468
290
|
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
// Message team
|
|
474
|
-
bd_msg({
|
|
475
|
-
subj: "Blocked: API 503",
|
|
476
|
-
body: "Auth endpoint returning 503, switching tasks",
|
|
477
|
-
to: "all",
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
// Claim different task
|
|
481
|
-
const newTask = bd_claim();
|
|
482
|
-
```
|
|
291
|
+
```bash
|
|
292
|
+
# Create tasks with dependencies
|
|
293
|
+
br create --title "Setup database" --type task --priority 1
|
|
294
|
+
# Returns: setup-db
|
|
483
295
|
|
|
484
|
-
|
|
296
|
+
br create --title "Implement API" --type task --priority 2 --blocked-by setup-db
|
|
297
|
+
# Returns: impl-api (blocked until setup-db closes)
|
|
485
298
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
bd_init({ team: "project", role: "be" });
|
|
489
|
-
bd_reserve({ paths: ["src/api/auth.ts"] });
|
|
490
|
-
// ... implements API ...
|
|
491
|
-
bd_msg({ subj: "Auth API Ready", to: "all" });
|
|
492
|
-
bd_done({ id: "api-task", msg: "Auth endpoints complete" });
|
|
493
|
-
|
|
494
|
-
// Agent B (frontend) - sees message
|
|
495
|
-
bd_inbox({ unread: true });
|
|
496
|
-
// { msgs: [{ subj: "Auth API Ready", from: "agent-a" }] }
|
|
497
|
-
bd_claim(); // Gets frontend task that was waiting on API
|
|
299
|
+
br create --title "Add tests" --type task --priority 2 --blocked-by impl-api
|
|
300
|
+
# Returns: add-tests
|
|
498
301
|
```
|
|
499
302
|
|
|
500
303
|
## Multi-Agent Coordination (Swarm Mode)
|
|
@@ -505,12 +308,12 @@ For parallel execution with multiple subagents, use the **beads-bridge** skill:
|
|
|
505
308
|
skill({ name: "beads-bridge" });
|
|
506
309
|
```
|
|
507
310
|
|
|
508
|
-
**beads-bridge** provides:
|
|
311
|
+
**beads-bridge** provides (via unified `swarm` tool):
|
|
509
312
|
|
|
510
|
-
- `
|
|
511
|
-
- `swarm
|
|
512
|
-
- `swarm
|
|
513
|
-
- `swarm
|
|
313
|
+
- `swarm({ operation: "sync" })` - Sync Beads tasks to OpenCode todos for subagent visibility
|
|
314
|
+
- `swarm({ operation: "monitor" })` - Real-time progress tracking and visualization
|
|
315
|
+
- `swarm({ operation: "plan" })` - Task classification and dependency analysis
|
|
316
|
+
- `swarm({ operation: "delegate" })` - Create delegation packets for workers
|
|
514
317
|
|
|
515
318
|
**When to use beads vs beads-bridge:**
|
|
516
319
|
|
|
@@ -518,36 +321,35 @@ skill({ name: "beads-bridge" });
|
|
|
518
321
|
| ------------------------------ | -------------------------------- |
|
|
519
322
|
| Single agent, linear work | `beads` skill only |
|
|
520
323
|
| Multiple agents in parallel | `beads-bridge` + `beads` |
|
|
521
|
-
| Need subagents to see tasks | `beads-bridge` (
|
|
522
|
-
| Track worker progress visually | `beads-bridge` (swarm
|
|
324
|
+
| Need subagents to see tasks | `beads-bridge` (swarm sync push) |
|
|
325
|
+
| Track worker progress visually | `beads-bridge` (swarm monitor) |
|
|
523
326
|
|
|
524
327
|
**Example swarm workflow:**
|
|
525
328
|
|
|
526
329
|
```typescript
|
|
527
330
|
// 1. Push beads to OpenCode todos (subagents can see via todoread)
|
|
528
|
-
|
|
331
|
+
swarm({ operation: "sync", action: "push" });
|
|
529
332
|
|
|
530
333
|
// 2. Spawn workers in parallel using Task tool
|
|
531
334
|
Task({ subagent_type: "general", description: "Worker 1", prompt: "..." });
|
|
532
335
|
Task({ subagent_type: "general", description: "Worker 2", prompt: "..." });
|
|
533
336
|
|
|
534
337
|
// 3. Monitor progress
|
|
535
|
-
|
|
338
|
+
swarm({ operation: "monitor", action: "render_block", team_name: "my-swarm" });
|
|
536
339
|
|
|
537
340
|
// 4. Pull completed work back to beads
|
|
538
|
-
|
|
341
|
+
swarm({ operation: "sync", action: "pull" });
|
|
539
342
|
```
|
|
540
343
|
|
|
541
344
|
## Rules
|
|
542
345
|
|
|
543
|
-
1. **
|
|
544
|
-
2. **
|
|
545
|
-
3. **One task per session** - Restart after `
|
|
546
|
-
4. **
|
|
547
|
-
5. **
|
|
548
|
-
6. **Sync regularly** - `bd_sync()` at session end
|
|
346
|
+
1. **Check `br ready` first** - Find unblocked work before starting
|
|
347
|
+
2. **Claim before editing** - `br update <id> --status in_progress`
|
|
348
|
+
3. **One task per session** - Restart after `br close`
|
|
349
|
+
4. **Always sync and commit** - `br sync --flush-only` then `git add .beads/ && git commit`
|
|
350
|
+
5. **Write notes for future agents** - Assume zero conversation context
|
|
549
351
|
|
|
550
|
-
## Best Practices
|
|
352
|
+
## Best Practices
|
|
551
353
|
|
|
552
354
|
### Daily/Weekly Maintenance
|
|
553
355
|
|
|
@@ -555,58 +357,40 @@ beads_sync({ operation: "pull" });
|
|
|
555
357
|
| ------------ | -------------- | --------------------- | ---------------------------------------------- |
|
|
556
358
|
| Health check | Weekly | `br doctor` | Repairs database issues, detects orphaned work |
|
|
557
359
|
| Cleanup | Every few days | `br cleanup --days 7` | Keep DB under 200-500 issues for performance |
|
|
558
|
-
| Upgrade | Weekly | `br upgrade` | Get latest features and fixes |
|
|
559
|
-
| Git hooks | Once per repo | `br hooks install` | Auto-sync on commit/merge/checkout |
|
|
560
360
|
|
|
561
361
|
### Key Principles
|
|
562
362
|
|
|
563
363
|
1. **Plan outside Beads first** - Use planning tools, then import tasks to beads
|
|
564
364
|
2. **One task per session, then restart** - Fresh context prevents confusion
|
|
565
365
|
3. **File lots of issues** - Any work >2 minutes should be tracked
|
|
566
|
-
4. **
|
|
567
|
-
5. **
|
|
568
|
-
6. **Include issue ID in commits** - `git commit -m "Fix bug (bd-abc)"`
|
|
366
|
+
4. **"Land the plane" = PUSH** - `br sync --flush-only` + git commit/push, not "ready when you are"
|
|
367
|
+
5. **Include issue ID in commits** - `git commit -m "Fix bug (br-abc)"`
|
|
569
368
|
|
|
570
369
|
### Database Health
|
|
571
370
|
|
|
572
371
|
```bash
|
|
573
372
|
# Check database size
|
|
574
|
-
br list --status
|
|
373
|
+
br list --status all --json | wc -l
|
|
575
374
|
|
|
576
375
|
# Target: under 200-500 issues
|
|
577
376
|
# If over, run cleanup more aggressively:
|
|
578
|
-
|
|
579
|
-
```
|
|
580
|
-
|
|
581
|
-
### Git Hooks (Essential)
|
|
582
|
-
|
|
583
|
-
```bash
|
|
584
|
-
bd hooks install
|
|
377
|
+
br cleanup --days 3
|
|
585
378
|
```
|
|
586
379
|
|
|
587
|
-
Installs hooks for:
|
|
588
|
-
|
|
589
|
-
- **pre-commit**: Sync before commit
|
|
590
|
-
- **post-merge**: Import changes after merge
|
|
591
|
-
- **pre-push**: Ensure sync before push
|
|
592
|
-
- **post-checkout**: Refresh after branch switch
|
|
593
|
-
|
|
594
380
|
## Quick Reference
|
|
595
381
|
|
|
596
382
|
```
|
|
597
383
|
SESSION START:
|
|
598
|
-
|
|
384
|
+
br ready → br update <id> --status in_progress → br show <id>
|
|
599
385
|
|
|
600
386
|
DURING WORK:
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
bd_msg() to coordinate
|
|
387
|
+
br create for discovered work (>2min)
|
|
388
|
+
br show <id> for context
|
|
604
389
|
|
|
605
390
|
SESSION END:
|
|
606
|
-
|
|
391
|
+
br close <id> --reason "..." → br sync --flush-only → git add .beads/ && git commit → RESTART SESSION
|
|
607
392
|
|
|
608
393
|
MAINTENANCE:
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
bd_sync() - git sync
|
|
394
|
+
br doctor - weekly health check
|
|
395
|
+
br cleanup --days 7 - remove old issues
|
|
612
396
|
```
|