opencodekit 0.7.0 → 0.8.0
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 +60 -21
- package/dist/template/.opencode/command/analyze-project.md +9 -9
- package/dist/template/.opencode/command/create.md +9 -4
- package/dist/template/.opencode/command/finish.md +12 -17
- package/dist/template/.opencode/command/fix-ci.md +10 -9
- package/dist/template/.opencode/command/fix-types.md +4 -11
- package/dist/template/.opencode/command/handoff.md +6 -6
- package/dist/template/.opencode/command/implement.md +11 -11
- package/dist/template/.opencode/command/import-plan.md +25 -14
- package/dist/template/.opencode/command/integration-test.md +1 -1
- package/dist/template/.opencode/command/issue.md +10 -9
- package/dist/template/.opencode/command/new-feature.md +4 -6
- package/dist/template/.opencode/command/plan.md +3 -5
- package/dist/template/.opencode/command/pr.md +2 -4
- package/dist/template/.opencode/command/research-and-implement.md +1 -1
- package/dist/template/.opencode/command/research.md +3 -5
- package/dist/template/.opencode/command/resume.md +2 -2
- package/dist/template/.opencode/command/revert-feature.md +5 -7
- package/dist/template/.opencode/command/status.md +4 -4
- package/dist/template/.opencode/dcp.jsonc +20 -2
- package/dist/template/.opencode/opencode.json +19 -12
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/beads.ts +667 -0
- package/dist/template/.opencode/plugin/compaction.ts +80 -0
- package/dist/template/.opencode/skill/beads/SKILL.md +419 -0
- package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +218 -0
- package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +130 -0
- package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +180 -0
- package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +222 -0
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compaction Plugin - Customizes session compaction for context continuity
|
|
5
|
+
*
|
|
6
|
+
* This plugin injects additional context into the compaction process,
|
|
7
|
+
* including beads state and memory file references.
|
|
8
|
+
*/
|
|
9
|
+
export const CompactionPlugin: Plugin = async (ctx) => {
|
|
10
|
+
const { $, directory } = ctx;
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
"experimental.session.compacting": async (input, output) => {
|
|
14
|
+
// Inject beads state if available
|
|
15
|
+
let beadsContext = "";
|
|
16
|
+
try {
|
|
17
|
+
const result =
|
|
18
|
+
await $`cd ${directory} && bd list --status in_progress --json 2>/dev/null`.quiet();
|
|
19
|
+
if (result.stdout) {
|
|
20
|
+
const inProgress = JSON.parse(result.stdout.toString());
|
|
21
|
+
if (inProgress.length > 0) {
|
|
22
|
+
beadsContext = `\n## Active Beads\n${inProgress.map((b: { id: string; title: string }) => `- ${b.id}: ${b.title}`).join("\n")}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
// Beads not available, skip
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Inject custom context
|
|
30
|
+
output.context.push(`## Session Context
|
|
31
|
+
${beadsContext}
|
|
32
|
+
## Memory Files to Check
|
|
33
|
+
- .opencode/memory/project/gotchas.md - Non-obvious behaviors discovered
|
|
34
|
+
- .opencode/memory/project/commands.md - Build/test commands learned
|
|
35
|
+
- .opencode/memory/project/conventions.md - Code patterns observed
|
|
36
|
+
|
|
37
|
+
## Persistence Rules
|
|
38
|
+
- PRESERVE: Bead IDs, todo items, file paths, line numbers, user constraints
|
|
39
|
+
- DROP: Failed attempts, superseded info, verbose tool outputs, exploration dead-ends
|
|
40
|
+
- Include enough context that a new session can continue seamlessly`);
|
|
41
|
+
|
|
42
|
+
// Replace the entire compaction prompt for more control
|
|
43
|
+
output.prompt = `You are summarizing a coding session for context continuity.
|
|
44
|
+
|
|
45
|
+
## Output Structure
|
|
46
|
+
|
|
47
|
+
Use these sections:
|
|
48
|
+
|
|
49
|
+
### COMPLETED
|
|
50
|
+
- What was done (with file paths)
|
|
51
|
+
- Bead IDs closed and why
|
|
52
|
+
|
|
53
|
+
### IN PROGRESS
|
|
54
|
+
- Current task and bead ID (if any)
|
|
55
|
+
- Files being modified (exact paths)
|
|
56
|
+
- Current todo state (preserve TodoWrite items)
|
|
57
|
+
|
|
58
|
+
### NEXT
|
|
59
|
+
- What needs to be done next
|
|
60
|
+
- Blockers or pending decisions
|
|
61
|
+
|
|
62
|
+
### CONSTRAINTS
|
|
63
|
+
- User preferences that must persist
|
|
64
|
+
- Rules or requirements stated by user
|
|
65
|
+
- Technical decisions and rationale
|
|
66
|
+
|
|
67
|
+
### PERSIST TO MEMORY
|
|
68
|
+
- Gotchas discovered → suggest for project/gotchas.md
|
|
69
|
+
- Commands learned → suggest for project/commands.md
|
|
70
|
+
- Patterns observed → suggest for project/conventions.md
|
|
71
|
+
|
|
72
|
+
## Rules
|
|
73
|
+
|
|
74
|
+
- PRESERVE: Bead IDs, todo items, file paths, line numbers, user constraints
|
|
75
|
+
- DROP: Failed attempts, superseded info, verbose tool outputs, exploration dead-ends
|
|
76
|
+
- Be concise but complete - this summary replaces the full conversation
|
|
77
|
+
- Include enough context that a new session can continue seamlessly`;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: beads
|
|
3
|
+
description: >
|
|
4
|
+
Multi-agent task coordination using Beads Village plugin tools. Use when work spans multiple
|
|
5
|
+
sessions, has dependencies, needs file locking, or requires agent coordination. Covers
|
|
6
|
+
claim/reserve/done cycle, dependency management, and session protocols.
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
license: MIT
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Beads Workflow - Multi-Agent Task Coordination
|
|
12
|
+
|
|
13
|
+
Graph-based task tracker with file locking for multi-agent coordination. Persists across sessions.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
**Beads plugin tools** (`bd_*`) replace MCP beads-village with native tools for lower token overhead.
|
|
18
|
+
|
|
19
|
+
**Key Distinction**:
|
|
20
|
+
|
|
21
|
+
- **bd\_\* tools**: Multi-session work, dependencies, file locking, agent coordination
|
|
22
|
+
- **TodoWrite**: Single-session tasks, linear execution, conversation-scoped
|
|
23
|
+
|
|
24
|
+
**When to Use bd\_\* vs TodoWrite**:
|
|
25
|
+
|
|
26
|
+
- "Will I need this context in 2 weeks?" → **YES** = bd\_\*
|
|
27
|
+
- "Does this have blockers/dependencies?" → **YES** = bd\_\*
|
|
28
|
+
- "Multiple agents editing same codebase?" → **YES** = bd\_\*
|
|
29
|
+
- "Will this be done in this session?" → **YES** = TodoWrite
|
|
30
|
+
|
|
31
|
+
**Decision Rule**: If resuming in 2 weeks would be hard without beads, use beads.
|
|
32
|
+
|
|
33
|
+
## Session Start Protocol
|
|
34
|
+
|
|
35
|
+
**Every session, follow these steps:**
|
|
36
|
+
|
|
37
|
+
### Step 1: Initialize
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
bd_init({ team: "project", role: "fe" });
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Joins workspace, enables role-based task filtering. Roles: fe, be, mobile, devops, qa.
|
|
44
|
+
|
|
45
|
+
### Step 2: Check Health (Weekly)
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
bd_doctor();
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Repairs database issues. Run at start of week or after sync problems.
|
|
52
|
+
|
|
53
|
+
### Step 3: Find Ready Work
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
bd_claim();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Returns highest priority task with no blockers, marks it in_progress.
|
|
60
|
+
|
|
61
|
+
If no tasks returned, check all open work:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
bd_ls({ status: "open" });
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 4: Get Full Context
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
bd_show({ id: "task-abc" });
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Shows full description, dependencies, notes, history.
|
|
74
|
+
|
|
75
|
+
### Step 5: Reserve Files Before Editing
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
bd_reserve({ paths: ["src/auth.ts", "src/types.ts"] });
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Critical**: Always reserve before editing. Prevents conflicts with other agents.
|
|
82
|
+
|
|
83
|
+
Check existing locks first:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
bd_reservations();
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 6: Add Notes as You Work
|
|
90
|
+
|
|
91
|
+
Use `bd_show` output's notes field. Write notes as if explaining to a future agent with zero conversation context.
|
|
92
|
+
|
|
93
|
+
**Note Format** (best practice):
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
COMPLETED: Specific deliverables (e.g., "implemented JWT refresh endpoint")
|
|
97
|
+
IN PROGRESS: Current state + next immediate step
|
|
98
|
+
BLOCKERS: What's preventing progress
|
|
99
|
+
KEY DECISIONS: Important context or user guidance
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Step 7: Complete and Restart
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
bd_done({ id: "task-abc", msg: "Implemented auth with JWT tokens" });
|
|
106
|
+
// RESTART SESSION - fresh context
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Always restart session after `bd_done()`. One task per session.
|
|
110
|
+
|
|
111
|
+
## Task Creation
|
|
112
|
+
|
|
113
|
+
### When to Create Tasks
|
|
114
|
+
|
|
115
|
+
Create tasks when:
|
|
116
|
+
|
|
117
|
+
- User mentions tracking work across sessions
|
|
118
|
+
- User says "we should fix/build/add X"
|
|
119
|
+
- Work has dependencies or blockers
|
|
120
|
+
- Discovered work while implementing (>2 min effort)
|
|
121
|
+
|
|
122
|
+
### Basic Task Creation
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
bd_add({
|
|
126
|
+
title: "Fix authentication bug",
|
|
127
|
+
pri: 0, // 0=critical, 1=high, 2=normal, 3=low, 4=backlog
|
|
128
|
+
type: "bug", // task, bug, feature, epic, chore
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### With Description and Tags
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
bd_add({
|
|
136
|
+
title: "Implement OAuth",
|
|
137
|
+
desc: "Add OAuth2 support for Google, GitHub. Use passport.js.",
|
|
138
|
+
pri: 1,
|
|
139
|
+
type: "feature",
|
|
140
|
+
tags: ["be", "security"], // Role tags for assignment
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Epic with Children
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
// Create parent epic
|
|
148
|
+
bd_add({ title: "Epic: OAuth Implementation", pri: 0, type: "epic" });
|
|
149
|
+
// Returns: { id: "oauth-abc" }
|
|
150
|
+
|
|
151
|
+
// Create child tasks with parent
|
|
152
|
+
bd_add({ title: "Research OAuth providers", pri: 1, parent: "oauth-abc" });
|
|
153
|
+
bd_add({ title: "Implement auth endpoints", pri: 1, parent: "oauth-abc" });
|
|
154
|
+
bd_add({ title: "Add frontend login UI", pri: 2, parent: "oauth-abc" });
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## File Reservation
|
|
158
|
+
|
|
159
|
+
### Reserve Before Edit
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
bd_reserve({
|
|
163
|
+
paths: ["src/auth.ts", "src/middleware/jwt.ts"],
|
|
164
|
+
reason: "Implementing auth feature",
|
|
165
|
+
ttl: 600, // seconds until expiry (default)
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Returns**:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"granted": ["src/auth.ts"],
|
|
174
|
+
"conflicts": [{ "path": "src/middleware/jwt.ts", "holder": "agent-xyz" }]
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Check Active Locks
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
bd_reservations();
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Shows all locks across workspace with agent IDs and expiry times.
|
|
185
|
+
|
|
186
|
+
### Handle Conflicts
|
|
187
|
+
|
|
188
|
+
If file reserved by another agent:
|
|
189
|
+
|
|
190
|
+
1. **Can wait** → Work on different files first
|
|
191
|
+
2. **Urgent** → Message the agent:
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
bd_msg({
|
|
195
|
+
subj: "Need src/middleware/jwt.ts",
|
|
196
|
+
body: "Working on auth, can you release?",
|
|
197
|
+
to: "agent-xyz",
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
3. **Alternative** → Refactor to avoid that file
|
|
202
|
+
|
|
203
|
+
### Release Early
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
bd_release({ paths: ["src/auth.ts"] }); // Specific files
|
|
207
|
+
bd_release(); // All your reservations
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Note: `bd_done()` auto-releases all your reservations.
|
|
211
|
+
|
|
212
|
+
## Messaging
|
|
213
|
+
|
|
214
|
+
### Send Message
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
bd_msg({
|
|
218
|
+
subj: "API Ready",
|
|
219
|
+
body: "Auth endpoints deployed to staging",
|
|
220
|
+
to: "all", // or specific agent ID
|
|
221
|
+
importance: "high", // low, normal, high
|
|
222
|
+
});
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Team Broadcast
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
bd_msg({
|
|
229
|
+
subj: "Breaking Change",
|
|
230
|
+
body: "User schema updated, run migrations",
|
|
231
|
+
to: "all",
|
|
232
|
+
global: true, // Cross-workspace
|
|
233
|
+
});
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Check Inbox
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
bd_inbox({ unread: true, n: 10 });
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Status and Analysis
|
|
243
|
+
|
|
244
|
+
### Workspace Overview
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
bd_status({ include_agents: true });
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Shows ready tasks, in-progress count, active locks, agent info.
|
|
251
|
+
|
|
252
|
+
### Find Bottlenecks
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
bd_insights();
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Returns blocked tasks, high-priority keystones, dependency analysis.
|
|
259
|
+
|
|
260
|
+
### Priority Recommendations
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
bd_priority({ limit: 5 });
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Suggests what to work on next based on priority and dependencies.
|
|
267
|
+
|
|
268
|
+
### Execution Plan
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
bd_plan();
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Groups ready tasks by priority into parallel execution tracks.
|
|
275
|
+
|
|
276
|
+
## Git Sync
|
|
277
|
+
|
|
278
|
+
### Manual Sync
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
bd_sync();
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Commits `.beads/` changes, pulls from remote, pushes local commits.
|
|
285
|
+
|
|
286
|
+
**Use when**: End of session, before handoff, after major progress.
|
|
287
|
+
|
|
288
|
+
### Cleanup Old Issues
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
bd_cleanup({ days: 7 });
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Removes closed issues older than N days. Run weekly.
|
|
295
|
+
|
|
296
|
+
## Error Handling
|
|
297
|
+
|
|
298
|
+
### Common Issues
|
|
299
|
+
|
|
300
|
+
**"Call bd_init() first"**
|
|
301
|
+
|
|
302
|
+
- Always call `bd_init()` at session start
|
|
303
|
+
|
|
304
|
+
**File conflicts**
|
|
305
|
+
|
|
306
|
+
- Check `bd_reservations()` before editing
|
|
307
|
+
- Message holder or work on other files
|
|
308
|
+
|
|
309
|
+
**No ready tasks**
|
|
310
|
+
|
|
311
|
+
- Run `bd_ls({ status: "open" })` to see all tasks
|
|
312
|
+
- Some may be blocked - check dependencies
|
|
313
|
+
|
|
314
|
+
**Sync failures**
|
|
315
|
+
|
|
316
|
+
- Run `bd_doctor()` to repair database
|
|
317
|
+
- Check git remote access
|
|
318
|
+
|
|
319
|
+
## Examples
|
|
320
|
+
|
|
321
|
+
### Example 1: Standard Session
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
// 1. Join and claim
|
|
325
|
+
bd_init({ team: "project", role: "fe" });
|
|
326
|
+
const task = bd_claim();
|
|
327
|
+
// { id: "auth-123", t: "Implement login form", p: 1 }
|
|
328
|
+
|
|
329
|
+
// 2. Get context
|
|
330
|
+
bd_show({ id: "auth-123" });
|
|
331
|
+
|
|
332
|
+
// 3. Reserve files
|
|
333
|
+
bd_reserve({ paths: ["src/components/Login.tsx", "src/hooks/useAuth.ts"] });
|
|
334
|
+
|
|
335
|
+
// 4. Do the work...
|
|
336
|
+
// [implementation]
|
|
337
|
+
|
|
338
|
+
// 5. Complete
|
|
339
|
+
bd_done({
|
|
340
|
+
id: "auth-123",
|
|
341
|
+
msg: "Login form with validation, hooks for auth state",
|
|
342
|
+
});
|
|
343
|
+
// RESTART SESSION
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Example 2: Discovered Work
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
// Working on task, found more work
|
|
350
|
+
bd_add({
|
|
351
|
+
title: "Fix edge case in validation",
|
|
352
|
+
desc: "Empty strings bypass email check - discovered while implementing login",
|
|
353
|
+
pri: 1,
|
|
354
|
+
type: "bug",
|
|
355
|
+
});
|
|
356
|
+
// Continue current task, new task tracked for later
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Example 3: Blocked Work
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
// API is down, can't continue
|
|
363
|
+
bd_release(); // Free files for others
|
|
364
|
+
|
|
365
|
+
// Message team
|
|
366
|
+
bd_msg({
|
|
367
|
+
subj: "Blocked: API 503",
|
|
368
|
+
body: "Auth endpoint returning 503, switching tasks",
|
|
369
|
+
to: "all",
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
// Claim different task
|
|
373
|
+
const newTask = bd_claim();
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Example 4: Multi-Agent Coordination
|
|
377
|
+
|
|
378
|
+
```typescript
|
|
379
|
+
// Agent A (backend)
|
|
380
|
+
bd_init({ team: "project", role: "be" });
|
|
381
|
+
bd_reserve({ paths: ["src/api/auth.ts"] });
|
|
382
|
+
// ... implements API ...
|
|
383
|
+
bd_msg({ subj: "Auth API Ready", to: "all" });
|
|
384
|
+
bd_done({ id: "api-task", msg: "Auth endpoints complete" });
|
|
385
|
+
|
|
386
|
+
// Agent B (frontend) - sees message
|
|
387
|
+
bd_inbox({ unread: true });
|
|
388
|
+
// { msgs: [{ subj: "Auth API Ready", from: "agent-a" }] }
|
|
389
|
+
bd_claim(); // Gets frontend task that was waiting on API
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## Rules
|
|
393
|
+
|
|
394
|
+
1. **Always `bd_init()` first** - Required before any other bd\_\* tool
|
|
395
|
+
2. **Reserve before edit** - Prevents conflicts with other agents
|
|
396
|
+
3. **One task per session** - Restart after `bd_done()`
|
|
397
|
+
4. **Write notes for future agents** - Assume zero conversation context
|
|
398
|
+
5. **Use `bd_msg(to="all")`** - For team-wide announcements
|
|
399
|
+
6. **Sync regularly** - `bd_sync()` at session end
|
|
400
|
+
|
|
401
|
+
## Quick Reference
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
SESSION START:
|
|
405
|
+
bd_init() → bd_claim() → bd_show() → bd_reserve()
|
|
406
|
+
|
|
407
|
+
DURING WORK:
|
|
408
|
+
bd_reserve() additional files
|
|
409
|
+
bd_add() for discovered work (>2min)
|
|
410
|
+
bd_msg() to coordinate
|
|
411
|
+
|
|
412
|
+
SESSION END:
|
|
413
|
+
bd_done() → RESTART SESSION
|
|
414
|
+
|
|
415
|
+
MAINTENANCE:
|
|
416
|
+
bd_doctor() - weekly health check
|
|
417
|
+
bd_cleanup() - remove old issues
|
|
418
|
+
bd_sync() - git sync
|
|
419
|
+
```
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Boundaries: When to Use bd\_\* vs TodoWrite
|
|
2
|
+
|
|
3
|
+
Decision criteria for choosing between beads tools and TodoWrite.
|
|
4
|
+
|
|
5
|
+
## The Core Question
|
|
6
|
+
|
|
7
|
+
**"Could I resume this work after 2 weeks away?"**
|
|
8
|
+
|
|
9
|
+
- If beads would help you resume → **use bd\_\***
|
|
10
|
+
- If markdown skim would suffice → **TodoWrite is fine**
|
|
11
|
+
|
|
12
|
+
## Decision Matrix
|
|
13
|
+
|
|
14
|
+
### Use bd\_\* for:
|
|
15
|
+
|
|
16
|
+
**Multi-Session Work**
|
|
17
|
+
|
|
18
|
+
- Strategic document development
|
|
19
|
+
- Feature implementation across sessions
|
|
20
|
+
- Bug investigation over time
|
|
21
|
+
- Architecture design iterations
|
|
22
|
+
|
|
23
|
+
**Complex Dependencies**
|
|
24
|
+
|
|
25
|
+
- OAuth integration requiring DB, endpoints, frontend
|
|
26
|
+
- Research with parallel investigation threads
|
|
27
|
+
- Refactoring with dependencies between areas
|
|
28
|
+
- Migration requiring sequential steps
|
|
29
|
+
|
|
30
|
+
**Knowledge Work**
|
|
31
|
+
|
|
32
|
+
- Architecture decisions requiring research
|
|
33
|
+
- API design with multiple options
|
|
34
|
+
- Performance optimization experiments
|
|
35
|
+
- Documentation requiring system understanding
|
|
36
|
+
|
|
37
|
+
**Side Quests**
|
|
38
|
+
|
|
39
|
+
- Found better pattern during feature work
|
|
40
|
+
- Noticed architectural issue while debugging
|
|
41
|
+
- Identified improvement during code review
|
|
42
|
+
- Edge case requiring research during tests
|
|
43
|
+
|
|
44
|
+
**Multi-Agent Coordination**
|
|
45
|
+
|
|
46
|
+
- Multiple agents editing same codebase
|
|
47
|
+
- File locking needed
|
|
48
|
+
- Cross-team communication
|
|
49
|
+
|
|
50
|
+
### Use TodoWrite for:
|
|
51
|
+
|
|
52
|
+
**Single-Session Tasks**
|
|
53
|
+
|
|
54
|
+
- Implementing single function from spec
|
|
55
|
+
- Fixing bug with known root cause
|
|
56
|
+
- Adding unit tests for existing code
|
|
57
|
+
- Updating documentation
|
|
58
|
+
|
|
59
|
+
**Linear Execution**
|
|
60
|
+
|
|
61
|
+
- Database migration with clear sequence
|
|
62
|
+
- Deployment checklist
|
|
63
|
+
- Code style cleanup
|
|
64
|
+
- Dependency updates
|
|
65
|
+
|
|
66
|
+
**Immediate Context**
|
|
67
|
+
|
|
68
|
+
- User provides complete spec
|
|
69
|
+
- Bug report with reproduction and fix
|
|
70
|
+
- Refactoring with clear before/after
|
|
71
|
+
- Config changes from preferences
|
|
72
|
+
|
|
73
|
+
**Simple Tracking**
|
|
74
|
+
|
|
75
|
+
- Breaking down implementation
|
|
76
|
+
- Showing validation progress
|
|
77
|
+
- Demonstrating systematic approach
|
|
78
|
+
|
|
79
|
+
## Detailed Comparison
|
|
80
|
+
|
|
81
|
+
| Aspect | bd\_\* | TodoWrite |
|
|
82
|
+
| ---------------- | --------------------------------- | ---------------------- |
|
|
83
|
+
| **Persistence** | Git-backed, survives compaction | Session-only |
|
|
84
|
+
| **Dependencies** | Graph-based, auto ready detection | Manual |
|
|
85
|
+
| **File Locking** | Yes, prevents conflicts | No |
|
|
86
|
+
| **Multi-Agent** | Yes, coordination tools | No |
|
|
87
|
+
| **Visibility** | Background structure | Visible in chat |
|
|
88
|
+
| **Best for** | Complex, multi-session | Simple, single-session |
|
|
89
|
+
|
|
90
|
+
## Integration Patterns
|
|
91
|
+
|
|
92
|
+
### Pattern 1: bd\_\* as Strategic, TodoWrite as Tactical
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
bd task: "Implement user authentication" (epic)
|
|
96
|
+
├─ Child: "Create login endpoint"
|
|
97
|
+
├─ Child: "Add JWT validation" ← Currently working
|
|
98
|
+
└─ Child: "Implement logout"
|
|
99
|
+
|
|
100
|
+
TodoWrite (for JWT validation):
|
|
101
|
+
- [ ] Install JWT library
|
|
102
|
+
- [ ] Create validation middleware
|
|
103
|
+
- [ ] Add tests for expiry
|
|
104
|
+
- [ ] Update docs
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Pattern 2: TodoWrite as Working Copy
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
Session start:
|
|
111
|
+
- bd_claim() gets "Add JWT validation"
|
|
112
|
+
- Extract acceptance criteria into TodoWrite
|
|
113
|
+
- Work through TodoWrite items
|
|
114
|
+
- Update bd notes as you learn
|
|
115
|
+
- bd_done() when TodoWrite complete
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Pattern 3: Transition Mid-Session
|
|
119
|
+
|
|
120
|
+
**From TodoWrite to bd\_\*:**
|
|
121
|
+
|
|
122
|
+
Trigger signals:
|
|
123
|
+
|
|
124
|
+
- Discovering blockers or dependencies
|
|
125
|
+
- Work won't complete this session
|
|
126
|
+
- Finding side quests
|
|
127
|
+
- Need to pause and resume later
|
|
128
|
+
|
|
129
|
+
**How to transition:**
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
1. bd_add() with current TodoWrite content
|
|
133
|
+
2. Note: "Discovered multi-session work"
|
|
134
|
+
3. Add dependencies as discovered
|
|
135
|
+
4. Keep TodoWrite for current session
|
|
136
|
+
5. Update bd notes before session ends
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Common Mistakes
|
|
140
|
+
|
|
141
|
+
### Mistake 1: TodoWrite for Multi-Session Work
|
|
142
|
+
|
|
143
|
+
**What happens:**
|
|
144
|
+
|
|
145
|
+
- Next session, forget what was done
|
|
146
|
+
- Scroll history to reconstruct
|
|
147
|
+
- Lose design decisions
|
|
148
|
+
- Duplicate work
|
|
149
|
+
|
|
150
|
+
**Solution:** Use bd\_\* instead.
|
|
151
|
+
|
|
152
|
+
### Mistake 2: bd\_\* for Simple Linear Tasks
|
|
153
|
+
|
|
154
|
+
**What happens:**
|
|
155
|
+
|
|
156
|
+
- Overhead not justified
|
|
157
|
+
- User can't see progress
|
|
158
|
+
- Extra tool use for no benefit
|
|
159
|
+
|
|
160
|
+
**Solution:** Use TodoWrite.
|
|
161
|
+
|
|
162
|
+
### Mistake 3: Not Transitioning When Complexity Emerges
|
|
163
|
+
|
|
164
|
+
**What happens:**
|
|
165
|
+
|
|
166
|
+
- Start with TodoWrite
|
|
167
|
+
- Discover blockers mid-way
|
|
168
|
+
- Keep using TodoWrite despite poor fit
|
|
169
|
+
- Lose context when session ends
|
|
170
|
+
|
|
171
|
+
**Solution:** Transition to bd\_\* when complexity appears.
|
|
172
|
+
|
|
173
|
+
### Mistake 4: Creating Too Many bd Issues
|
|
174
|
+
|
|
175
|
+
**What happens:**
|
|
176
|
+
|
|
177
|
+
- Every tiny task gets an issue
|
|
178
|
+
- Database cluttered
|
|
179
|
+
- Hard to find meaningful work
|
|
180
|
+
|
|
181
|
+
**Solution:** Use 2-week test. Would bd help after 2 weeks? If no, skip.
|
|
182
|
+
|
|
183
|
+
## The Transition Point
|
|
184
|
+
|
|
185
|
+
**Transition signals:**
|
|
186
|
+
|
|
187
|
+
- "This is taking longer than expected"
|
|
188
|
+
- "I've discovered a blocker"
|
|
189
|
+
- "This needs more research"
|
|
190
|
+
- "I should investigate X first"
|
|
191
|
+
- "User might not continue today"
|
|
192
|
+
- "Found three related issues"
|
|
193
|
+
|
|
194
|
+
When you notice these: Create bd issue, preserve context.
|
|
195
|
+
|
|
196
|
+
## Summary Heuristics
|
|
197
|
+
|
|
198
|
+
**Time horizon:**
|
|
199
|
+
|
|
200
|
+
- Same session → TodoWrite
|
|
201
|
+
- Multiple sessions → bd\_\*
|
|
202
|
+
|
|
203
|
+
**Dependency structure:**
|
|
204
|
+
|
|
205
|
+
- Linear steps → TodoWrite
|
|
206
|
+
- Blockers/prerequisites → bd\_\*
|
|
207
|
+
|
|
208
|
+
**Scope clarity:**
|
|
209
|
+
|
|
210
|
+
- Well-defined → TodoWrite
|
|
211
|
+
- Exploratory → bd\_\*
|
|
212
|
+
|
|
213
|
+
**Multi-agent:**
|
|
214
|
+
|
|
215
|
+
- Single agent → Either
|
|
216
|
+
- Multiple agents → bd\_\*
|
|
217
|
+
|
|
218
|
+
**When in doubt:** Use the 2-week test.
|