opencodekit 0.12.7 → 0.13.1
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/README.md +2 -2
- package/dist/index.js +2753 -508
- package/dist/template/.opencode/AGENTS.md +35 -128
- package/dist/template/.opencode/README.md +4 -3
- package/dist/template/.opencode/command/design.md +1 -0
- package/dist/template/.opencode/command/fix.md +28 -1
- package/dist/template/.opencode/command/implement.md +195 -39
- package/dist/template/.opencode/command/new-feature.md +229 -188
- package/dist/template/.opencode/command/plan.md +354 -82
- package/dist/template/.opencode/command/research.md +29 -6
- package/dist/template/.opencode/command/start.md +227 -0
- package/dist/template/.opencode/command/triage.md +66 -12
- package/dist/template/.opencode/memory/project/beads-workflow.md +510 -0
- package/dist/template/.opencode/memory/session-context.md +40 -0
- package/dist/template/.opencode/opencode.json +20 -5
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/compaction.ts +62 -18
- package/dist/template/.opencode/plugin/lib/notify.ts +2 -3
- package/dist/template/.opencode/plugin/sessions.ts +1 -1
- package/dist/template/.opencode/plugin/skill-mcp.ts +11 -12
- package/dist/template/.opencode/skill/beads/SKILL.md +44 -0
- package/dist/template/.opencode/skill/source-code-research/SKILL.md +537 -0
- package/dist/template/.opencode/tool/ast-grep.ts +3 -3
- package/dist/template/.opencode/tool/bd-inbox.ts +7 -6
- package/dist/template/.opencode/tool/bd-msg.ts +3 -3
- package/dist/template/.opencode/tool/bd-release.ts +2 -2
- package/dist/template/.opencode/tool/bd-reserve.ts +5 -4
- package/dist/template/.opencode/tool/memory-read.ts +2 -2
- package/dist/template/.opencode/tool/memory-search.ts +2 -2
- package/dist/template/.opencode/tool/memory-update.ts +11 -12
- package/dist/template/.opencode/tool/observation.ts +6 -6
- package/package.json +5 -2
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Complete beads workflow mapping for OpenCodeKit commands
|
|
3
|
+
updated: 2025-01-08
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Beads Workflow Best Practices
|
|
7
|
+
|
|
8
|
+
Based on Steve Yegge's best practices and official beads documentation.
|
|
9
|
+
|
|
10
|
+
## Core Principles
|
|
11
|
+
|
|
12
|
+
| Principle | Why | How |
|
|
13
|
+
| ------------------------ | -------------------------------- | ------------------------------------ |
|
|
14
|
+
| One task per session | Fresh context prevents confusion | Restart after `bd close` |
|
|
15
|
+
| Plan outside beads first | Better planning tools exist | Use `/brainstorm` → `/plan` → import |
|
|
16
|
+
| File lots of issues | Track any work >2 minutes | `bd create` liberally |
|
|
17
|
+
| "Land the plane" = PUSH | `bd sync` means git push | Always verify push succeeded |
|
|
18
|
+
| Keep DB small | Performance degrades >500 issues | `bd cleanup --days 7` weekly |
|
|
19
|
+
|
|
20
|
+
## Hierarchy Model: Epic → Task → Subtask
|
|
21
|
+
|
|
22
|
+
### Hierarchy Levels
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Epic (feature-level)
|
|
26
|
+
├── Task 1 (domain or phase)
|
|
27
|
+
│ ├── Subtask 1.1 (atomic work unit)
|
|
28
|
+
│ └── Subtask 1.2
|
|
29
|
+
├── Task 2 (blocked by Task 1)
|
|
30
|
+
│ └── Subtask 2.1
|
|
31
|
+
└── Task 3 (blocked by Task 2)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Level | Scope | Duration | Agent Work |
|
|
35
|
+
| ------- | ------------ | ---------- | ------------------------------------- |
|
|
36
|
+
| Epic | Full feature | Days-weeks | Coordinate, delegate, not implement |
|
|
37
|
+
| Task | Domain/phase | Hours-day | May implement or delegate to subtasks |
|
|
38
|
+
| Subtask | Atomic unit | 30min-2hrs | Implement directly |
|
|
39
|
+
|
|
40
|
+
### Size Estimation
|
|
41
|
+
|
|
42
|
+
| Size | Tool Calls | Hierarchy Level | Session Scope |
|
|
43
|
+
| ---- | ---------- | ------------------ | ----------------- |
|
|
44
|
+
| S | ~10 | Subtask | Quick fix |
|
|
45
|
+
| M | ~30 | Task | Single session |
|
|
46
|
+
| L | ~100 | Task with subtasks | Single session |
|
|
47
|
+
| XL | 100+ | Epic required | Multiple sessions |
|
|
48
|
+
|
|
49
|
+
### Creating Hierarchy
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Create epic
|
|
53
|
+
bd create "User Authentication" -t epic -p 2
|
|
54
|
+
# Returns: bd-epic
|
|
55
|
+
|
|
56
|
+
# Create tasks with dependencies
|
|
57
|
+
bd create "Setup database schema" -t task -p 2
|
|
58
|
+
bd dep add bd-xxx1 bd-epic
|
|
59
|
+
|
|
60
|
+
bd create "Implement API endpoints" -t task -p 2
|
|
61
|
+
bd dep add bd-xxx2 bd-epic
|
|
62
|
+
bd dep add bd-xxx2 bd-xxx1 --type blocks # Sequential
|
|
63
|
+
|
|
64
|
+
# Create subtasks for complex tasks
|
|
65
|
+
bd create "POST /api/users endpoint" -t subtask -p 2
|
|
66
|
+
bd dep add bd-xxx2.1 bd-xxx2
|
|
67
|
+
|
|
68
|
+
bd create "GET /api/users/:id endpoint" -t subtask -p 2
|
|
69
|
+
bd dep add bd-xxx2.2 bd-xxx2
|
|
70
|
+
bd dep add bd-xxx2.2 bd-xxx2.1 --type blocks # Sequential subtasks
|
|
71
|
+
|
|
72
|
+
# Verify hierarchy
|
|
73
|
+
bd dep tree bd-epic
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Git Worktree Integration
|
|
77
|
+
|
|
78
|
+
### When to Use Worktrees
|
|
79
|
+
|
|
80
|
+
| Scenario | Use Worktree | Why |
|
|
81
|
+
| ---------------------------- | ------------ | -------------------------- |
|
|
82
|
+
| Epic-level work | ✅ Yes | Multi-session isolation |
|
|
83
|
+
| Parallel feature development | ✅ Yes | No context switching |
|
|
84
|
+
| Long-running experiments | ✅ Yes | Keep main workspace clean |
|
|
85
|
+
| Single task (S/M) | ❌ No | Branch is sufficient |
|
|
86
|
+
| Hotfix/quick-build | ❌ No | Overkill for small changes |
|
|
87
|
+
|
|
88
|
+
### Worktree Setup
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Verify .gitignore
|
|
92
|
+
grep -q "^\.worktrees/$" .gitignore || echo ".worktrees/" >> .gitignore
|
|
93
|
+
|
|
94
|
+
# Create worktree for feature
|
|
95
|
+
git worktree add .worktrees/bd-xxx -b feature/auth
|
|
96
|
+
|
|
97
|
+
# Navigate and setup
|
|
98
|
+
cd .worktrees/bd-xxx
|
|
99
|
+
npm install # or project-specific setup
|
|
100
|
+
|
|
101
|
+
# Verify clean baseline
|
|
102
|
+
npm test
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Beads + Worktree Architecture
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
main-repo/
|
|
109
|
+
├── .beads/ ← Shared database (all worktrees use this)
|
|
110
|
+
├── .worktrees/
|
|
111
|
+
│ ├── feature-a/ ← Worktree 1
|
|
112
|
+
│ │ └── (working copy)
|
|
113
|
+
│ └── feature-b/ ← Worktree 2
|
|
114
|
+
│ └── (working copy)
|
|
115
|
+
└── src/ ← Main working copy
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Key insight:** `.beads/` is shared. All worktrees access the same database.
|
|
119
|
+
|
|
120
|
+
### Worktree Daemon Behavior
|
|
121
|
+
|
|
122
|
+
| Mode | Configuration | Use When |
|
|
123
|
+
| ----------- | -------------------------------------- | ------------------------ |
|
|
124
|
+
| Default | Daemon auto-disabled in worktrees | Most cases |
|
|
125
|
+
| Sync branch | `bd config set sync-branch beads-sync` | Full daemon in worktrees |
|
|
126
|
+
| External DB | `export BEADS_DIR=~/project/.beads` | Complete separation |
|
|
127
|
+
| Sandbox | `bd --sandbox` or `BEADS_NO_DAEMON=1` | Claude Code, containers |
|
|
128
|
+
|
|
129
|
+
### Worktree Cleanup
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# When feature complete
|
|
133
|
+
cd /main-repo
|
|
134
|
+
git worktree remove .worktrees/feature-a
|
|
135
|
+
|
|
136
|
+
# Or force if dirty
|
|
137
|
+
git worktree remove --force .worktrees/feature-a
|
|
138
|
+
|
|
139
|
+
# Clean orphaned worktrees
|
|
140
|
+
git worktree prune
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Subagent Delegation Patterns
|
|
144
|
+
|
|
145
|
+
### Agent Hierarchy
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Leader Agents (touch beads, sync, coordinate)
|
|
149
|
+
├── build - Primary implementation agent
|
|
150
|
+
└── rush - Fast-track implementation agent
|
|
151
|
+
|
|
152
|
+
Subagents (read-only, stateless workers)
|
|
153
|
+
├── explore - Codebase search, patterns
|
|
154
|
+
├── scout - External docs, best practices
|
|
155
|
+
├── planner - Architecture, decomposition
|
|
156
|
+
├── review - Code review, debugging
|
|
157
|
+
└── vision - UI/UX, visual analysis
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Delegation Rules
|
|
161
|
+
|
|
162
|
+
| Agent | Can Do | Cannot Do |
|
|
163
|
+
| --------- | -------------------------- | ---------------------- |
|
|
164
|
+
| `build` | All beads ops, `bd sync` | - |
|
|
165
|
+
| `rush` | All beads ops, `bd sync` | - |
|
|
166
|
+
| `explore` | Read, grep, glob, ast-grep | Edit, write, `bd sync` |
|
|
167
|
+
| `scout` | Fetch, search, Context7 | Edit, write, `bd sync` |
|
|
168
|
+
| `planner` | Read, create artifacts | Edit files, `bd sync` |
|
|
169
|
+
| `review` | Read, analyze, suggest | Edit files, `bd sync` |
|
|
170
|
+
| `vision` | Analyze images, mockups | All beads operations |
|
|
171
|
+
|
|
172
|
+
### Parallel Research Pattern
|
|
173
|
+
|
|
174
|
+
Fire subagents in parallel, continue working immediately:
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
// Launch both - don't wait
|
|
178
|
+
Task({
|
|
179
|
+
subagent_type: "explore",
|
|
180
|
+
prompt: `Find codebase patterns for [task]:
|
|
181
|
+
- Similar implementations
|
|
182
|
+
- Test patterns
|
|
183
|
+
- Affected files
|
|
184
|
+
Return: File paths, patterns, test approach`,
|
|
185
|
+
description: "Explore codebase",
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
Task({
|
|
189
|
+
subagent_type: "scout",
|
|
190
|
+
prompt: `Research best practices for [task]:
|
|
191
|
+
- Official documentation
|
|
192
|
+
- Common patterns
|
|
193
|
+
- Pitfalls to avoid
|
|
194
|
+
Return: Examples, warnings, recommendations`,
|
|
195
|
+
description: "Scout external docs",
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// Continue working immediately
|
|
199
|
+
// Collect results when needed
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### When to Delegate
|
|
203
|
+
|
|
204
|
+
| Situation | Delegate To | Why |
|
|
205
|
+
| ------------------------ | ----------- | -------------------------- |
|
|
206
|
+
| Need codebase patterns | `@explore` | Fast grep/glob/ast-grep |
|
|
207
|
+
| Need library docs | `@scout` | Context7, GitHub patterns |
|
|
208
|
+
| Complex planning | `@planner` | Structured decomposition |
|
|
209
|
+
| Code review before merge | `@review` | Fresh eyes, evidence-based |
|
|
210
|
+
| UI/mockup analysis | `@vision` | Visual expertise |
|
|
211
|
+
| Stuck on implementation | `@explore` | Fresh search perspective |
|
|
212
|
+
|
|
213
|
+
## Maintenance Schedule
|
|
214
|
+
|
|
215
|
+
| Task | Frequency | Command | Why |
|
|
216
|
+
| ------------ | -------------- | --------------------- | -------------------------------------- |
|
|
217
|
+
| Health check | Weekly | `bd doctor --fix` | Repairs orphaned issues, sync problems |
|
|
218
|
+
| Cleanup | Every few days | `bd cleanup --days 7` | Keep DB under 200-500 issues |
|
|
219
|
+
| Upgrade | Weekly | `bd upgrade` | Latest features and fixes |
|
|
220
|
+
| Git hooks | Once per repo | `bd hooks install` | Auto-sync on commit/merge/checkout |
|
|
221
|
+
|
|
222
|
+
## Command Configuration Best Practices
|
|
223
|
+
|
|
224
|
+
Based on [OpenCode Command Docs](https://opencode.ai/docs/commands/).
|
|
225
|
+
|
|
226
|
+
### Frontmatter Options
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
---
|
|
230
|
+
description: Short description shown in TUI command list
|
|
231
|
+
argument-hint: "<required> [optional] [--flag]"
|
|
232
|
+
agent: build | planner | scout | explore | review | vision
|
|
233
|
+
subtask: true # Run as subagent (doesn't pollute primary context)
|
|
234
|
+
model: gemini-2.5-pro # Override default model
|
|
235
|
+
---
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Prompt Syntax
|
|
239
|
+
|
|
240
|
+
| Syntax | Purpose | Example |
|
|
241
|
+
| ------------ | ------------------------ | ----------------------------- |
|
|
242
|
+
| `$ARGUMENTS` | All arguments as string | `/fix $ARGUMENTS` |
|
|
243
|
+
| `$1`, `$2` | Positional arguments | `/start $1` → `/start bd-abc` |
|
|
244
|
+
| `!`command`` | Inject shell output | `!`git status`` |
|
|
245
|
+
| `@filepath` | Include file content | `@src/config.ts` |
|
|
246
|
+
| `$SELECTION` | Current editor selection | For IDE integrations |
|
|
247
|
+
|
|
248
|
+
### When to Use `subtask: true`
|
|
249
|
+
|
|
250
|
+
**Use subtask for research/analysis** - prevents context pollution in primary agent:
|
|
251
|
+
|
|
252
|
+
| Command Type | `subtask: true`? | Why |
|
|
253
|
+
| ------------------------ | ---------------- | ------------------------------------ |
|
|
254
|
+
| Research/exploration | ✅ Yes | Heavy reads, doesn't need to persist |
|
|
255
|
+
| Code review/analysis | ✅ Yes | Analysis output, not implementation |
|
|
256
|
+
| UI/UX analysis | ✅ Yes | Design feedback, not code changes |
|
|
257
|
+
| Status/dashboard | ✅ Yes | Read-only information gathering |
|
|
258
|
+
| Implementation | ❌ No | Needs full context for edits |
|
|
259
|
+
| Lifecycle (start/finish) | ❌ No | Coordinates state, needs persistence |
|
|
260
|
+
| Generation (artifacts) | ❌ No | Creates files that need tracking |
|
|
261
|
+
|
|
262
|
+
### Commands by Category
|
|
263
|
+
|
|
264
|
+
#### Research Commands (`subtask: true`)
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
/research, /analyze-project, /review-codebase, /brainstorm,
|
|
268
|
+
/status, /summarize, /init, /ui-review, /accessibility-check,
|
|
269
|
+
/analyze-mockup, /design-audit, /research-ui, /design
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
#### Lifecycle Commands (NO subtask)
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
/triage, /start, /create, /new-feature, /issue, /plan,
|
|
276
|
+
/implement, /commit, /finish, /handoff, /resume, /pr, /fix
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### Generation Commands (NO subtask)
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
/generate-image, /generate-icon, /generate-diagram,
|
|
283
|
+
/generate-pattern, /generate-storyboard, /edit-image, /restore-image
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
#### Utility Commands (NO subtask)
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
/quick-build, /fix-ci, /fix-types, /fix-ui,
|
|
290
|
+
/revert-feature, /integration-test, /skill-create, /skill-optimize
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Command → Beads Mapping
|
|
294
|
+
|
|
295
|
+
### Lifecycle Commands (Touch Beads)
|
|
296
|
+
|
|
297
|
+
| Command | Agent | Beads Operations | When to Use |
|
|
298
|
+
| ---------------------------- | ------- | ------------------------------------------------------ | --------------------------- |
|
|
299
|
+
| `/triage` | build | `bd doctor`, `bd list`, `bd ready`, `bd cleanup` | Start of day, find work |
|
|
300
|
+
| `/triage --quick` | build | `bd ready`, `bd list --status=in_progress` | Fast check, what's next |
|
|
301
|
+
| `/start <id>` | build | `bd update --status in_progress`, `bd hooks install` | Claim a task |
|
|
302
|
+
| `/start <id> --worktree` | build | + Create git worktree | Isolated feature work |
|
|
303
|
+
| `/start <id> --research` | build | + Parallel subagent research | Complex task preparation |
|
|
304
|
+
| `/create` | build | `bd create`, `bd sync` | Create new tracked task |
|
|
305
|
+
| `/new-feature` | planner | `bd create` (epic + subtasks), `bd dep add`, `bd sync` | Complex feature with phases |
|
|
306
|
+
| `/new-feature --worktree` | planner | + Create git worktree for epic | Isolated feature branch |
|
|
307
|
+
| `/issue <num>` | build | `bd create`, `bd sync`, `gh issue comment` | Import GitHub issue |
|
|
308
|
+
| `/plan <id>` | planner | `bd create` (subtasks), `bd dep add`, `bd sync` | Break down task |
|
|
309
|
+
| `/plan <id> --create-beads` | planner | Create child beads after planning | Auto-hierarchy creation |
|
|
310
|
+
| `/implement <id>` | build | `bd update --status in_progress`, `bd sync` | Do the work |
|
|
311
|
+
| `/implement <id> --parallel` | build | + Aggressive subagent research | Complex implementation |
|
|
312
|
+
| `/commit [id]` | build | `bd sync` (if bead-id provided) | Commit with traceability |
|
|
313
|
+
| `/finish <id>` | build | `bd close`, `bd sync` | Complete task (asks first) |
|
|
314
|
+
| `/handoff <id>` | build | `bd sync` | Pause work, save context |
|
|
315
|
+
| `/resume <id>` | build | `bd update --status in_progress` | Continue previous work |
|
|
316
|
+
| `/pr <id>` | build | `bd-msg`, `bd sync` | Create pull request |
|
|
317
|
+
| `/fix` | build | `bd sync` (after user confirms commit) | Fix bugs with tracking |
|
|
318
|
+
| `/status` | explore | `bd status`, `bd list`, `bd-inbox`, `bd-release` | Dashboard view |
|
|
319
|
+
|
|
320
|
+
### Research Commands (Read-Only Beads)
|
|
321
|
+
|
|
322
|
+
| Command | Agent | Beads Operations | Notes |
|
|
323
|
+
| ------------------ | ------- | --------------------- | -------------------------- |
|
|
324
|
+
| `/research <id>` | scout | `bd show` (read-only) | NO `bd sync` - subagent |
|
|
325
|
+
| `/brainstorm` | planner | None | Pure planning, no tracking |
|
|
326
|
+
| `/analyze-project` | explore | None | Codebase exploration |
|
|
327
|
+
| `/summarize` | explore | None | Session/code summary |
|
|
328
|
+
| `/review-codebase` | review | None | Code review |
|
|
329
|
+
|
|
330
|
+
### Non-Beads Commands
|
|
331
|
+
|
|
332
|
+
| Command | Agent | Purpose |
|
|
333
|
+
| ---------------------- | ------- | ------------------------------ |
|
|
334
|
+
| `/quick-build` | build | Trivial fixes, no bead created |
|
|
335
|
+
| `/design` | planner | Architecture design |
|
|
336
|
+
| `/ui-review` | vision | UI/UX analysis |
|
|
337
|
+
| `/accessibility-check` | vision | A11y audit |
|
|
338
|
+
| `/fix-ci` | build | CI pipeline fixes |
|
|
339
|
+
| `/fix-types` | build | TypeScript errors |
|
|
340
|
+
|
|
341
|
+
## Workflow Patterns
|
|
342
|
+
|
|
343
|
+
### Pattern 1: Standard Task (S/M size)
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
/triage --quick # Find ready work
|
|
347
|
+
/start bd-xxx # Claim task, create branch
|
|
348
|
+
/implement bd-xxx # Do the work
|
|
349
|
+
/finish bd-xxx # Verify, commit (asks first), close
|
|
350
|
+
/pr bd-xxx # Create PR (asks first)
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Pattern 2: Complex Feature with Worktree (L/XL size)
|
|
354
|
+
|
|
355
|
+
```
|
|
356
|
+
/triage # Full triage with health check
|
|
357
|
+
/new-feature "Feature" --worktree # Creates epic + subtasks + worktree
|
|
358
|
+
cd .worktrees/bd-epic # Enter worktree
|
|
359
|
+
/start bd-xxx.1 # Start first task
|
|
360
|
+
/implement bd-xxx.1 # Implement
|
|
361
|
+
/finish bd-xxx.1 # Complete task
|
|
362
|
+
/start bd-xxx.2 # Next task (now unblocked)
|
|
363
|
+
/implement bd-xxx.2 # Continue...
|
|
364
|
+
/finish bd-xxx.2 # Complete
|
|
365
|
+
...
|
|
366
|
+
/finish bd-epic # Close epic when all tasks done
|
|
367
|
+
git worktree remove .worktrees/bd-epic # Cleanup worktree
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Pattern 3: Research-First with Subagent Delegation
|
|
371
|
+
|
|
372
|
+
```
|
|
373
|
+
/create "Complex task" # Create bead with spec
|
|
374
|
+
/start bd-xxx --research # Claim + parallel subagent research
|
|
375
|
+
/plan bd-xxx --create-beads # Design with auto-hierarchy
|
|
376
|
+
/implement bd-xxx.1 # Implement first subtask
|
|
377
|
+
/finish bd-xxx.1 # Complete subtask
|
|
378
|
+
/implement bd-xxx.2 --parallel # Next subtask with research
|
|
379
|
+
/finish bd-xxx.2 # Complete subtask
|
|
380
|
+
/finish bd-xxx # Close parent task
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Pattern 4: Bug Fix
|
|
384
|
+
|
|
385
|
+
```
|
|
386
|
+
/issue 123 # Import GitHub issue as bead
|
|
387
|
+
/start bd-xxx # Claim
|
|
388
|
+
/fix bd-xxx # Diagnose + fix (asks before commit)
|
|
389
|
+
/finish bd-xxx # Verify + close
|
|
390
|
+
/pr bd-xxx # Create PR
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Pattern 5: Session Handoff
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
/implement bd-xxx # Working on task...
|
|
397
|
+
# Context getting large or end of day
|
|
398
|
+
/handoff bd-xxx # Save progress, creates handoff.md
|
|
399
|
+
# New session
|
|
400
|
+
/resume bd-xxx # Load context, continue
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Pattern 6: Trivial Fix (No Bead)
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
/quick-build "fix typo" # Single file, <30 min, commits directly
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Pattern 7: Epic with Parallel Workstreams
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
/new-feature "Big Feature" --worktree
|
|
413
|
+
# Creates: bd-epic with bd-xxx1, bd-xxx2, bd-xxx3
|
|
414
|
+
|
|
415
|
+
# Agent 1 (main worktree)
|
|
416
|
+
/start bd-xxx1 --worktree
|
|
417
|
+
/implement bd-xxx1
|
|
418
|
+
/finish bd-xxx1
|
|
419
|
+
|
|
420
|
+
# Agent 2 (separate worktree - if independent)
|
|
421
|
+
/start bd-xxx2 --worktree
|
|
422
|
+
/implement bd-xxx2
|
|
423
|
+
/finish bd-xxx2
|
|
424
|
+
|
|
425
|
+
# Merge when all complete
|
|
426
|
+
/finish bd-epic
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
## Agent Boundaries
|
|
430
|
+
|
|
431
|
+
### Leader Agents (Touch Beads)
|
|
432
|
+
|
|
433
|
+
| Agent | Can Do | Cannot Do |
|
|
434
|
+
| ------- | ------------------------------- | --------- |
|
|
435
|
+
| `build` | All beads operations, `bd sync` | - |
|
|
436
|
+
| `rush` | All beads operations, `bd sync` | - |
|
|
437
|
+
|
|
438
|
+
### Subagents (Read-Only Beads)
|
|
439
|
+
|
|
440
|
+
| Agent | Can Do | Cannot Do |
|
|
441
|
+
| --------- | -------------------------------------- | --------------------- |
|
|
442
|
+
| `planner` | `bd show`, `bd list`, create artifacts | `bd sync`, `bd close` |
|
|
443
|
+
| `scout` | `bd show` (read context) | Any writes |
|
|
444
|
+
| `explore` | `bd show`, `bd list` | Any writes |
|
|
445
|
+
| `review` | `bd show` | Any writes |
|
|
446
|
+
| `vision` | None | All beads operations |
|
|
447
|
+
|
|
448
|
+
## File Locking (Multi-Agent)
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
// Before editing shared files
|
|
452
|
+
bd - reserve({ paths: ["src/auth.ts"], ttl: 600 });
|
|
453
|
+
|
|
454
|
+
// Do work...
|
|
455
|
+
|
|
456
|
+
// After completing edits
|
|
457
|
+
bd - release({ paths: ["src/auth.ts"] });
|
|
458
|
+
|
|
459
|
+
// Check active locks
|
|
460
|
+
bd - release({ _: true }); // No paths = list locks
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
## Commit Message Format
|
|
464
|
+
|
|
465
|
+
Always include bead ID for traceability:
|
|
466
|
+
|
|
467
|
+
```
|
|
468
|
+
feat(auth): add token refresh (bd-a1b2c3)
|
|
469
|
+
|
|
470
|
+
Implement automatic token refresh when access token expires.
|
|
471
|
+
|
|
472
|
+
Closes: bd-a1b2c3
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
## Session End Checklist
|
|
476
|
+
|
|
477
|
+
1. [ ] All work committed
|
|
478
|
+
2. [ ] `bd sync` run (pushes to git)
|
|
479
|
+
3. [ ] If incomplete: `/handoff <id>` created
|
|
480
|
+
4. [ ] If complete: `/finish <id>` run
|
|
481
|
+
5. [ ] No stale file locks (`bd-release({ _: true })`)
|
|
482
|
+
6. [ ] Worktrees cleaned up (if used)
|
|
483
|
+
|
|
484
|
+
## Troubleshooting
|
|
485
|
+
|
|
486
|
+
| Problem | Solution |
|
|
487
|
+
| ---------------------------- | --------------------------------------------------- |
|
|
488
|
+
| "bd command not found" | `npm install -g beads-village` |
|
|
489
|
+
| Orphaned issues | `bd doctor --fix` |
|
|
490
|
+
| DB too large | `bd cleanup --days 3` |
|
|
491
|
+
| Sync conflicts | `bd sync --force` (careful!) |
|
|
492
|
+
| Stale handoff | Check if rebase needed before `/resume` |
|
|
493
|
+
| Task not in `bd ready` | Check blockers: `bd show <id>` |
|
|
494
|
+
| "Branch already checked out" | `rm -rf .git/beads-worktrees && git worktree prune` |
|
|
495
|
+
| Daemon issues in worktree | `bd config set sync-branch beads-sync` |
|
|
496
|
+
| Sandbox environment | `bd --sandbox` or `BEADS_NO_DAEMON=1` |
|
|
497
|
+
|
|
498
|
+
## Anti-Patterns
|
|
499
|
+
|
|
500
|
+
| Don't | Why | Do Instead |
|
|
501
|
+
| -------------------------------------- | --------------------- | -------------------------------- |
|
|
502
|
+
| Skip `bd sync` at session end | Changes won't persist | Always sync before stopping |
|
|
503
|
+
| Create beads for trivial fixes | DB bloat | Use `/quick-build` |
|
|
504
|
+
| Work on blocked tasks | Wastes time | Use `bd ready` to find unblocked |
|
|
505
|
+
| Subagents running `bd sync` | Coordination issues | Only leader agents sync |
|
|
506
|
+
| Force through complex with quick-build | Technical debt | Proper `/create` workflow |
|
|
507
|
+
| Ignore `bd doctor` warnings | Corruption risk | Fix issues promptly |
|
|
508
|
+
| Skip worktree for XL features | Merge conflicts | Use `--worktree` flag |
|
|
509
|
+
| Implement epic directly | Too large | Work on subtasks instead |
|
|
510
|
+
| Wait for subagent results | Blocks progress | Fire parallel, continue working |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Session continuity state that survives compaction
|
|
3
|
+
updated: 2025-01-08
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Session Context
|
|
7
|
+
|
|
8
|
+
<!--
|
|
9
|
+
Agent-maintained via memory-update tool.
|
|
10
|
+
Update when: goal changes, key decision made, state shifts, uncertainty discovered.
|
|
11
|
+
After compaction: read this file, ask 1-3 targeted questions if gaps exist.
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
## Goal
|
|
15
|
+
|
|
16
|
+
<!-- What we're trying to achieve + success criteria -->
|
|
17
|
+
|
|
18
|
+
## Constraints
|
|
19
|
+
|
|
20
|
+
<!-- User-specified limits, discovered guardrails. Mark UNCONFIRMED if inferred -->
|
|
21
|
+
|
|
22
|
+
## Decisions
|
|
23
|
+
|
|
24
|
+
<!-- Key choices made this session with brief rationale -->
|
|
25
|
+
|
|
26
|
+
## State
|
|
27
|
+
|
|
28
|
+
- **Done**:
|
|
29
|
+
- **Now**:
|
|
30
|
+
- **Next**:
|
|
31
|
+
|
|
32
|
+
## Open Questions
|
|
33
|
+
|
|
34
|
+
<!-- Uncertainties - mark UNCONFIRMED if not verified -->
|
|
35
|
+
|
|
36
|
+
## Working Set
|
|
37
|
+
|
|
38
|
+
- **Files**:
|
|
39
|
+
- **Bead**:
|
|
40
|
+
- **Branch**:
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
"agent": {
|
|
4
4
|
"build": {
|
|
5
5
|
"description": "Primary development agent with full codebase access",
|
|
6
|
-
"model": "
|
|
6
|
+
"model": "proxypal/gemini-claude-opus-4-5-thinking"
|
|
7
7
|
},
|
|
8
8
|
"compaction": {
|
|
9
|
-
"description": "Session summarizer for context continuity across compactions"
|
|
10
|
-
"model": "opencode/minimax-m2.1-free"
|
|
9
|
+
"description": "Session summarizer for context continuity across compactions"
|
|
11
10
|
},
|
|
12
11
|
"explore": {
|
|
13
12
|
"description": "Fast codebase search specialist",
|
|
@@ -245,7 +244,15 @@
|
|
|
245
244
|
"context": 880964,
|
|
246
245
|
"output": 65536
|
|
247
246
|
},
|
|
248
|
-
"name": "Gemini 3 Flash Preview"
|
|
247
|
+
"name": "Gemini 3 Flash Preview",
|
|
248
|
+
"options": {
|
|
249
|
+
"generationConfig": {
|
|
250
|
+
"thinkingConfig": {
|
|
251
|
+
"thinkingLevel": "HIGH",
|
|
252
|
+
"includeThoughts": true
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
249
256
|
},
|
|
250
257
|
"gemini-3-pro-image-preview": {
|
|
251
258
|
"limit": {
|
|
@@ -259,7 +266,15 @@
|
|
|
259
266
|
"context": 880964,
|
|
260
267
|
"output": 65536
|
|
261
268
|
},
|
|
262
|
-
"name": "Gemini 3 Pro Preview"
|
|
269
|
+
"name": "Gemini 3 Pro Preview",
|
|
270
|
+
"options": {
|
|
271
|
+
"generationConfig": {
|
|
272
|
+
"thinkingConfig": {
|
|
273
|
+
"thinkingLevel": "HIGH",
|
|
274
|
+
"includeThoughts": true
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
263
278
|
},
|
|
264
279
|
"gemini-claude-opus-4-5-thinking": {
|
|
265
280
|
"limit": {
|