opencodekit 0.12.1 → 0.12.3
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 +40 -417
- package/dist/template/.opencode/agent/build.md +53 -0
- package/dist/template/.opencode/agent/explore.md +6 -6
- package/dist/template/.opencode/agent/planner.md +0 -1
- package/dist/template/.opencode/agent/rush.md +38 -0
- package/dist/template/.opencode/command/accessibility-check.md +1 -1
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/commit.md +1 -1
- package/dist/template/.opencode/command/create.md +68 -441
- package/dist/template/.opencode/command/finish.md +82 -252
- package/dist/template/.opencode/command/fix-ci.md +52 -247
- package/dist/template/.opencode/command/fix-types.md +33 -293
- package/dist/template/.opencode/command/fix-ui.md +49 -234
- package/dist/template/.opencode/command/fix.md +57 -194
- package/dist/template/.opencode/command/handoff.md +66 -243
- package/dist/template/.opencode/command/implement.md +67 -231
- package/dist/template/.opencode/command/issue.md +42 -190
- package/dist/template/.opencode/command/new-feature.md +1 -1
- package/dist/template/.opencode/command/plan.md +86 -442
- package/dist/template/.opencode/command/pr.md +3 -1
- package/dist/template/.opencode/command/research-and-implement.md +69 -370
- package/dist/template/.opencode/command/research-ui.md +1 -1
- package/dist/template/.opencode/command/research.md +72 -197
- package/dist/template/.opencode/command/resume.md +70 -438
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/command/status.md +11 -11
- package/dist/template/.opencode/command/triage.md +23 -18
- package/dist/template/.opencode/dcp.jsonc +16 -33
- package/dist/template/.opencode/memory/project/commands.md +176 -5
- package/dist/template/.opencode/memory/project/conventions.md +104 -5
- package/dist/template/.opencode/memory/project/gotchas.md +128 -9
- package/dist/template/.opencode/opencode.json +511 -523
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/beads.ts +181 -16
- package/dist/template/.opencode/skill/beads/SKILL.md +15 -0
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +94 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +107 -0
- package/dist/template/.opencode/skill/session-management/SKILL.md +111 -0
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +115 -0
- package/package.json +1 -1
- package/dist/template/.opencode/tool/lsp.ts +0 -786
|
@@ -17,7 +17,7 @@ Analyze open tasks and optimize prioritization using dependency graph analysis,
|
|
|
17
17
|
## Phase 1: Initialize Beads Connection
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
bd_init({
|
|
20
|
+
bd_init({ team: "project", role: "build" });
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Phase 2: Gather Workspace State
|
|
@@ -27,7 +27,7 @@ Run in parallel:
|
|
|
27
27
|
```typescript
|
|
28
28
|
bd_status({ include_agents: true });
|
|
29
29
|
bd_ls({ status: "open", limit: 50, offset: 0 });
|
|
30
|
-
bd_reservations(
|
|
30
|
+
bd_reservations();
|
|
31
31
|
bd_inbox({ n: 10, unread: true, global: true });
|
|
32
32
|
|
|
33
33
|
// Search for past discussions on recurring issues
|
|
@@ -199,14 +199,14 @@ AGENT WORKLOAD
|
|
|
199
199
|
━━━━━━━━━━━━━━
|
|
200
200
|
Agent │ Active │ Completed │ Load
|
|
201
201
|
──────────┼────────┼───────────┼──────
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
build-1 │ 2 │ 8 │ HIGH
|
|
203
|
+
build-2 │ 1 │ 12 │ MEDIUM
|
|
204
|
+
review │ 0 │ 5 │ LOW
|
|
205
205
|
|
|
206
206
|
RECOMMENDATIONS
|
|
207
207
|
━━━━━━━━━━━━━━━
|
|
208
|
-
1. 🔴 URGENT: bd-abc12 is blocking 4 tasks - assign to
|
|
209
|
-
2. 🟡 REBALANCE:
|
|
208
|
+
1. 🔴 URGENT: bd-abc12 is blocking 4 tasks - assign to build agent
|
|
209
|
+
2. 🟡 REBALANCE: build-1 has high load - redistribute to review agent
|
|
210
210
|
3. 🟢 PARALLEL: Start Track A and B simultaneously
|
|
211
211
|
4. ⚠️ STALE: bd-old99 has no activity for 7 days - review or close
|
|
212
212
|
|
|
@@ -221,12 +221,13 @@ If `--auto-assign` flag:
|
|
|
221
221
|
|
|
222
222
|
```typescript
|
|
223
223
|
const assignmentRules = {
|
|
224
|
-
//
|
|
225
|
-
"frontend|ui|css|react|vue": "
|
|
226
|
-
"backend|api|database|server": "
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
|
|
224
|
+
// All implementation work goes to build agents
|
|
225
|
+
"frontend|ui|css|react|vue": "build",
|
|
226
|
+
"backend|api|database|server": "build",
|
|
227
|
+
"deploy|ci|docker|infra": "build",
|
|
228
|
+
"mobile|ios|android|react-native": "build",
|
|
229
|
+
// Review/QA work goes to review agent
|
|
230
|
+
"test|qa|e2e|integration": "review",
|
|
230
231
|
};
|
|
231
232
|
|
|
232
233
|
// Load balancing: prefer agent with lowest active count
|
|
@@ -253,12 +254,12 @@ for (const task of readyTasks.filter((t) => !t.assignee && t.priority <= 2)) {
|
|
|
253
254
|
AUTO-ASSIGNMENTS
|
|
254
255
|
━━━━━━━━━━━━━━━━
|
|
255
256
|
|
|
256
|
-
✓ bd-abc12 →
|
|
257
|
-
✓ bd-def34 →
|
|
258
|
-
✓ bd-ghi56 →
|
|
257
|
+
✓ bd-abc12 → build (detected: backend, API)
|
|
258
|
+
✓ bd-def34 → build (detected: frontend, React)
|
|
259
|
+
✓ bd-ghi56 → build (detected: infrastructure)
|
|
259
260
|
|
|
260
261
|
Skipped:
|
|
261
|
-
- bd-xyz99: Already assigned to
|
|
262
|
+
- bd-xyz99: Already assigned to review agent
|
|
262
263
|
- bd-old88: No matching role detected (manual assignment needed)
|
|
263
264
|
```
|
|
264
265
|
|
|
@@ -293,7 +294,11 @@ console.log("3. Review individually");
|
|
|
293
294
|
## Phase 9: Sync and Notify
|
|
294
295
|
|
|
295
296
|
```typescript
|
|
296
|
-
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
bd_sync({ reason: "Sync triage changes" });
|
|
297
302
|
|
|
298
303
|
// Broadcast triage summary if significant changes
|
|
299
304
|
if (assignmentsMade > 0 || priorityChanges > 0) {
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
// Enable or disable the plugin
|
|
3
2
|
"enabled": true,
|
|
4
|
-
// Enable debug logging to ~/.config/opencode/logs/dcp/
|
|
5
3
|
"debug": false,
|
|
6
|
-
//
|
|
4
|
+
// "minimal" shows prune activity without noise; "off" if you want silence
|
|
7
5
|
"pruneNotification": "off",
|
|
8
|
-
// Protect from pruning for <turns> message turns
|
|
9
6
|
"turnProtection": {
|
|
10
7
|
"enabled": true,
|
|
11
|
-
|
|
8
|
+
// 3 turns = faster cleanup while still protecting recent context
|
|
9
|
+
"turns": 3
|
|
12
10
|
},
|
|
13
|
-
// LLM-driven context pruning tools
|
|
14
11
|
"tools": {
|
|
15
|
-
// Shared settings for all prune tools
|
|
16
12
|
"settings": {
|
|
17
|
-
// Nudge the LLM to use prune tools (every <nudgeFrequency> tool results)
|
|
18
13
|
"nudgeEnabled": true,
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
// Nudge every 8 tool calls (slightly more aggressive than default 10)
|
|
15
|
+
"nudgeFrequency": 8,
|
|
16
|
+
// Protect state-modifying and critical workflow tools
|
|
21
17
|
"protectedTools": [
|
|
22
18
|
"write",
|
|
23
19
|
"edit",
|
|
24
20
|
"memory-read",
|
|
25
21
|
"memory-update",
|
|
22
|
+
"memory-search",
|
|
26
23
|
"observation",
|
|
27
24
|
"skill",
|
|
28
|
-
"
|
|
25
|
+
"skill_mcp",
|
|
29
26
|
"lsp_lsp_rename",
|
|
27
|
+
"lsp_lsp_find_references",
|
|
28
|
+
"lsp_lsp_goto_definition",
|
|
30
29
|
"lsp_lsp_code_actions",
|
|
31
30
|
"lsp_lsp_code_action_apply",
|
|
32
31
|
"lsp_lsp_organize_imports",
|
|
@@ -35,49 +34,33 @@
|
|
|
35
34
|
"bd_done",
|
|
36
35
|
"bd_show",
|
|
37
36
|
"bd_reserve",
|
|
38
|
-
"bd_reservations"
|
|
37
|
+
"bd_reservations",
|
|
38
|
+
"bd_sync"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
|
-
// Removes tool content from context without preservation (for completed tasks or noise)
|
|
42
41
|
"discard": {
|
|
43
42
|
"enabled": true
|
|
44
43
|
},
|
|
45
|
-
// Distills key findings into preserved knowledge before removing raw content
|
|
46
44
|
"extract": {
|
|
47
45
|
"enabled": true,
|
|
48
|
-
// Show distillation content as an ignored message notification
|
|
49
46
|
"showDistillation": false
|
|
50
47
|
}
|
|
51
48
|
},
|
|
52
|
-
// Automatic pruning strategies
|
|
53
49
|
"strategies": {
|
|
54
|
-
//
|
|
50
|
+
// Dedup = zero LLM cost, high impact - always enable
|
|
55
51
|
"deduplication": {
|
|
56
52
|
"enabled": true,
|
|
57
|
-
// Additional tools to protect from pruning
|
|
58
53
|
"protectedTools": []
|
|
59
54
|
},
|
|
60
|
-
//
|
|
55
|
+
// Supersede writes = zero cost, removes redundant write inputs after read
|
|
61
56
|
"supersedeWrites": {
|
|
62
57
|
"enabled": true
|
|
63
58
|
},
|
|
64
|
-
//
|
|
59
|
+
// Purge error inputs after 3 turns
|
|
65
60
|
"purgeErrors": {
|
|
66
61
|
"enabled": true,
|
|
67
|
-
|
|
68
|
-
"turns": 4,
|
|
69
|
-
// Additional tools to protect from pruning
|
|
62
|
+
"turns": 3,
|
|
70
63
|
"protectedTools": []
|
|
71
|
-
},
|
|
72
|
-
// (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle
|
|
73
|
-
"onIdle": {
|
|
74
|
-
"enabled": false,
|
|
75
|
-
// Additional tools to protect from pruning
|
|
76
|
-
"protectedTools": [],
|
|
77
|
-
// Show toast notifications when model selection fails
|
|
78
|
-
"showModelErrorToasts": true,
|
|
79
|
-
// When true, fallback models are not permitted
|
|
80
|
-
"strictModelSelection": false
|
|
81
64
|
}
|
|
82
65
|
}
|
|
83
66
|
}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
purpose: Build, test, lint, deploy commands discovered for this project
|
|
3
|
-
updated:
|
|
3
|
+
updated: 2025-01-05
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Project Commands
|
|
7
7
|
|
|
8
8
|
## Build
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
```bash
|
|
11
|
+
npm run type-check # TypeScript type checking only (no emit)
|
|
12
|
+
```
|
|
11
13
|
|
|
12
14
|
## Test
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
```bash
|
|
17
|
+
pytest tests/ -v # Run all Python tests
|
|
18
|
+
pytest tests/test_specific.py -v # Run single test file
|
|
19
|
+
pytest tests/ --cov=. --cov-report=html # Coverage report
|
|
20
|
+
```
|
|
15
21
|
|
|
16
22
|
## Lint
|
|
17
23
|
|
|
@@ -21,6 +27,171 @@ updated: 2024-12-21
|
|
|
21
27
|
|
|
22
28
|
<!-- Deployment commands if applicable -->
|
|
23
29
|
|
|
24
|
-
##
|
|
30
|
+
## OpenCode Configuration
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
### Environment Variables
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
OPENCODE_EXPERIMENTAL=true # Enable experimental features (LSP, batch)
|
|
36
|
+
OPENCODE_EXPERIMENTAL_LSP_TOOL=true # Enable built-in LSP navigation tool
|
|
37
|
+
OPENCODE_DISABLE_LSP_DOWNLOAD=true # Skip auto-downloading LSP servers
|
|
38
|
+
OPENCODE_DISABLE_AUTOCOMPACT=true # Disable automatic session compaction
|
|
39
|
+
OPENCODE_DISABLE_PRUNE=true # Disable DCP pruning
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Configuration File Priorities
|
|
43
|
+
|
|
44
|
+
1. Global: `~/.config/opencode/opencode.json` or `dcp.jsonc`
|
|
45
|
+
2. Config Dir: `$OPENCODE_CONFIG_DIR/opencode.json`
|
|
46
|
+
3. Project: `.opencode/opencode.json` (highest priority)
|
|
47
|
+
|
|
48
|
+
### DCP Nudge Tuning
|
|
49
|
+
|
|
50
|
+
```jsonc
|
|
51
|
+
// Lower nudgeFrequency = more aggressive pruning suggestions
|
|
52
|
+
"nudgeFrequency": 8 // LLM nudged every 8 tool calls (default: 10)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Beads CLI (Core)
|
|
56
|
+
|
|
57
|
+
The `bd` command is your issue tracker. JSONL is source of truth, SQLite is cache.
|
|
58
|
+
|
|
59
|
+
### Essential Commands
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bd ready # Unblocked tasks (use this to find work)
|
|
63
|
+
bd list --status=open # All open issues
|
|
64
|
+
bd show <id> # Full details
|
|
65
|
+
bd create "Title" -t task -p 2 # Create (type: task/bug/feature/epic, priority: 0-4)
|
|
66
|
+
bd update <id> --status in_progress # Claim work
|
|
67
|
+
bd close <id> --reason "Done" # Complete
|
|
68
|
+
bd sync # Export/commit/push (always run at session end)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Dependencies
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
bd dep add <child> <parent> --type blocks # Child blocked until parent closes
|
|
75
|
+
bd dep tree <id> # Visualize dependency chain
|
|
76
|
+
bd blocked # Show all blocked issues
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Coordination
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bd list --status in_progress # See what's claimed by others
|
|
83
|
+
git pull && bd import # Get latest from team
|
|
84
|
+
bd sync # Push your changes
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Priority Levels
|
|
88
|
+
|
|
89
|
+
- **P0** - Critical (security, data loss)
|
|
90
|
+
- **P1** - High (major features, important bugs)
|
|
91
|
+
- **P2** - Medium (default)
|
|
92
|
+
- **P3** - Low
|
|
93
|
+
- **P4** - Backlog
|
|
94
|
+
|
|
95
|
+
### Sandbox Mode
|
|
96
|
+
|
|
97
|
+
If running in restricted environment (Claude Code, etc.):
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
bd --sandbox ready
|
|
101
|
+
# Or: bd --no-daemon --no-auto-flush --no-auto-import list
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Beads Plugin Tools (For OpenCode Agents)
|
|
105
|
+
|
|
106
|
+
This project's plugin (`.opencode/plugin/beads.ts`) provides typed tools that wrap the CLI.
|
|
107
|
+
|
|
108
|
+
### Session Lifecycle
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
bd_init({ role: "build" }); // Join workspace - MUST call first
|
|
112
|
+
bd_claim(); // Get next ready task, mark in_progress
|
|
113
|
+
bd_reserve({ paths: ["src/foo.ts"] }); // Lock files before editing
|
|
114
|
+
// ... do work ...
|
|
115
|
+
bd_done({ id: "bd-xxx", msg: "Done" }); // Close + release locks + sync
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Task Management
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
bd_add({ title: "Task", pri: 2, type: "task" }); // Create issue
|
|
122
|
+
bd_show({ id: "bd-xxx" }); // Get full details
|
|
123
|
+
bd_ls({ status: "open", limit: 10 }); // List issues
|
|
124
|
+
bd_ready(); // Ready-to-work tasks
|
|
125
|
+
bd_update({ id: "bd-xxx", status: "in_progress" }); // Update issue
|
|
126
|
+
bd_search({ query: "auth" }); // Search issues
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### File Locking (Plugin-Only)
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
bd_reserve({ paths: ["src/a.ts", "src/b.ts"], ttl: 600 }); // Lock files
|
|
133
|
+
bd_reservations(); // List active locks
|
|
134
|
+
bd_release({ paths: ["src/a.ts"] }); // Release specific
|
|
135
|
+
bd_release(); // Release all
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Messaging (Plugin-Only)
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
bd_msg({ subj: "Done", to: "all", global: true }); // Broadcast
|
|
142
|
+
bd_inbox({ n: 5, unread: true }); // Check messages
|
|
143
|
+
bd_ack({ ids: ["msg-abc", "msg-def"] }); // Mark messages as read
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Agent Coordination (Plugin-Only)
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
bd_whois(); // See all agents and their current work
|
|
150
|
+
bd_whois({ agent: "build-abc" }); // Lookup specific agent
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Maintenance
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
bd_sync(); // Sync with git
|
|
157
|
+
bd_status({ include_agents: true }); // Workspace overview
|
|
158
|
+
bd_doctor(); // Check database health
|
|
159
|
+
bd_cleanup({ days: 7 }); // Remove old closed issues
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Beads Workflow
|
|
163
|
+
|
|
164
|
+
### Start Work
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
bd ready # Find unblocked task
|
|
168
|
+
bd update bd-xxx --status in_progress # Claim it
|
|
169
|
+
git checkout -b bd-xxx # Create branch
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### During Work
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
git commit -m "WIP: bd-xxx - [progress]" # Checkpoint commits
|
|
176
|
+
bd sync # Sync beads state
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### End Session
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
git add -A && git commit -m "bd-xxx: [summary]"
|
|
183
|
+
bd close bd-xxx --reason "Completed: [what]"
|
|
184
|
+
bd sync
|
|
185
|
+
git push
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Handoff (If Not Finishing)
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
git commit -m "WIP: bd-xxx - [where stopped]"
|
|
192
|
+
# Create handoff in .beads/artifacts/bd-xxx/handoffs/
|
|
193
|
+
bd sync
|
|
194
|
+
git push
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Resume later with: `/resume bd-xxx`
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
purpose: Code patterns, commit style, PR process, team conventions
|
|
3
|
-
updated:
|
|
3
|
+
updated: 2025-01-05
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Project Conventions
|
|
7
7
|
|
|
8
8
|
## Code Style
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- **TypeScript**: ES2022, ESNext modules, strict disabled, forceConsistentCasing
|
|
11
|
+
- **Python**: 3.10+, type hints required, dataclasses for config, pathlib for paths
|
|
12
|
+
- **Imports**: Group stdlib, third-party, local imports
|
|
13
|
+
- **Naming**: PascalCase classes, snake_case functions/variables, UPPER_CASE constants
|
|
11
14
|
|
|
12
15
|
## Commit Messages
|
|
13
16
|
|
|
@@ -17,10 +20,106 @@ updated: 2024-12-21
|
|
|
17
20
|
|
|
18
21
|
<!-- Review requirements, CI checks, merge strategy -->
|
|
19
22
|
|
|
20
|
-
## Patterns
|
|
23
|
+
## OpenCode Configuration Patterns (v1.1.2+)
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
### Permission Structure Best Practice
|
|
26
|
+
|
|
27
|
+
```jsonc
|
|
28
|
+
{
|
|
29
|
+
"permission": {
|
|
30
|
+
"bash": {
|
|
31
|
+
"*": "allow", // 1. Base rule first (catch-all)
|
|
32
|
+
"git status*": "allow", // 2. Safe operations whitelisted
|
|
33
|
+
"git diff*": "allow",
|
|
34
|
+
"npm *": "allow",
|
|
35
|
+
"rm*": "deny", // 3. Dangerous operations denied
|
|
36
|
+
"sudo*": "deny",
|
|
37
|
+
},
|
|
38
|
+
"read": {
|
|
39
|
+
".env": "deny", // 4. Protect secrets
|
|
40
|
+
".env.example": "allow", // But allow examples
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### LSP Tool Strategy
|
|
47
|
+
|
|
48
|
+
**This project uses built-in experimental LSP** (`experimental.lsp: true`).
|
|
49
|
+
|
|
50
|
+
| Tool | Purpose |
|
|
51
|
+
| --------------------------- | ---------------------------- |
|
|
52
|
+
| `lsp_lsp_hover` | Type info and docs at cursor |
|
|
53
|
+
| `lsp_lsp_goto_definition` | Jump to symbol definition |
|
|
54
|
+
| `lsp_lsp_find_references` | Find all usages |
|
|
55
|
+
| `lsp_lsp_rename` | Rename across codebase |
|
|
56
|
+
| `lsp_lsp_code_actions` | Get available refactorings |
|
|
57
|
+
| `lsp_lsp_code_action_apply` | Apply a code action |
|
|
58
|
+
| `lsp_lsp_diagnostics` | Get errors/warnings |
|
|
59
|
+
| `lsp_lsp_document_symbols` | File outline |
|
|
60
|
+
| `lsp_lsp_workspace_symbols` | Search symbols |
|
|
61
|
+
| `lsp_lsp_organize_imports` | Clean up imports |
|
|
62
|
+
|
|
63
|
+
### DCP Configuration Tiers
|
|
64
|
+
|
|
65
|
+
| Tier | Strategies | nudgeFrequency | turnProtection | Use When |
|
|
66
|
+
| ---------------- | ------------------ | -------------- | -------------- | ---------------------------- |
|
|
67
|
+
| **Aggressive** | All enabled | 8 | 3 | Long sessions, context-heavy |
|
|
68
|
+
| **Conservative** | Deduplication only | 12+ | 6+ | Safety-first, debugging |
|
|
69
|
+
| **Balanced** | All enabled | 10 | 4 | Default, general use |
|
|
70
|
+
|
|
71
|
+
### Protected Tools Pattern
|
|
72
|
+
|
|
73
|
+
Always protect these tools from auto-pruning:
|
|
74
|
+
|
|
75
|
+
```jsonc
|
|
76
|
+
"protectedTools": [
|
|
77
|
+
// State-modifying
|
|
78
|
+
"write", "edit", "skill_mcp", "bd_sync",
|
|
79
|
+
// Metadata
|
|
80
|
+
"memory-search", "memory-update", "observation", "todowrite", "todoread",
|
|
81
|
+
// Task management
|
|
82
|
+
"task", "batch",
|
|
83
|
+
// LSP (if using plugin)
|
|
84
|
+
"lsp_lsp_find_references", "lsp_lsp_goto_definition"
|
|
85
|
+
]
|
|
86
|
+
```
|
|
23
87
|
|
|
24
88
|
## Patterns to Avoid
|
|
25
89
|
|
|
26
|
-
|
|
90
|
+
### Anti-Pattern: Mixing LSP Systems
|
|
91
|
+
|
|
92
|
+
```jsonc
|
|
93
|
+
// DON'T: Causes tool duplication and naming confusion
|
|
94
|
+
{
|
|
95
|
+
"experimental": { "lsp": true }, // Built-in: lsp_lsp_*
|
|
96
|
+
// AND .opencode/tool/lsp.ts // Custom: lsp_*
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// DO: Use built-in only (recommended for this project)
|
|
100
|
+
{
|
|
101
|
+
"experimental": { "lsp": true }
|
|
102
|
+
}
|
|
103
|
+
// Delete any custom .opencode/tool/lsp.ts
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Anti-Pattern: Over-Restrictive Permissions
|
|
107
|
+
|
|
108
|
+
```jsonc
|
|
109
|
+
// DON'T: Blocks legitimate workflow
|
|
110
|
+
{
|
|
111
|
+
"bash": { "git *": "ask" } // Every git command asks
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// DO: Whitelist safe, ask dangerous
|
|
115
|
+
{
|
|
116
|
+
"bash": {
|
|
117
|
+
"git status*": "allow",
|
|
118
|
+
"git diff*": "allow",
|
|
119
|
+
"git log*": "allow",
|
|
120
|
+
"git commit*": "ask",
|
|
121
|
+
"git push*": "ask",
|
|
122
|
+
"git reset*": "ask"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
@@ -1,26 +1,145 @@
|
|
|
1
1
|
---
|
|
2
2
|
purpose: Footguns, edge cases, and "don't forget this" warnings
|
|
3
|
-
updated:
|
|
3
|
+
updated: 2025-01-05
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Project Gotchas
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Configuration Quirks
|
|
9
|
+
|
|
10
|
+
### DCP v1.1.3 Schema Breaking Changes
|
|
11
|
+
|
|
12
|
+
1. **Legacy `strategies.onIdle` removed**: v1.1.2+ no longer supports this field
|
|
13
|
+
- Error: `Unknown keys: strategies.onIdle`
|
|
14
|
+
- Fix: Remove the entire `onIdle` block from `dcp.jsonc`
|
|
15
|
+
|
|
16
|
+
2. **Permission model changed**: v1.1.1+ deprecated legacy `tools: { write: true }` boolean syntax
|
|
17
|
+
- Old: Global `tools: {}` with booleans
|
|
18
|
+
- New: `permission: {}` with `"allow"` / `"ask"` / `"deny"` actions
|
|
19
|
+
- Both still work for backwards compatibility, but new syntax preferred
|
|
20
|
+
|
|
21
|
+
### OpenCode v1.1.2 New Features
|
|
9
22
|
|
|
10
|
-
|
|
23
|
+
- `compaction.auto` and `compaction.prune` are NEW - enable both for long sessions
|
|
24
|
+
- `experimental.continue_loop_on_deny` - controls agent behavior after permission denial
|
|
25
|
+
- `cargo-fmt` formatter support added for Rust projects
|
|
11
26
|
|
|
12
27
|
## Non-Obvious Dependencies
|
|
13
28
|
|
|
14
|
-
|
|
29
|
+
### LSP Tool Naming Convention
|
|
15
30
|
|
|
16
|
-
|
|
31
|
+
- OpenCode built-in LSP uses `lsp_lsp_*` prefix (e.g., `lsp_lsp_rename`, `lsp_lsp_hover`)
|
|
32
|
+
- Requires `experimental.lsp: true` in opencode.json
|
|
33
|
+
- **This project uses built-in LSP** (custom plugin removed for simplicity)
|
|
34
|
+
- Custom plugins would use `lsp_*` prefix - avoid mixing both
|
|
35
|
+
|
|
36
|
+
### Protected Tools in DCP
|
|
37
|
+
|
|
38
|
+
v1.1.3 recognizes more tool variants. Ensure these are protected:
|
|
17
39
|
|
|
18
|
-
|
|
40
|
+
- `lsp_lsp_find_references`, `lsp_lsp_goto_definition` (plugin-specific naming)
|
|
41
|
+
- `memory-search`, `skill_mcp`, `bd_sync` (often forgotten)
|
|
19
42
|
|
|
20
43
|
## Time Wasters
|
|
21
44
|
|
|
22
|
-
|
|
45
|
+
### Debugging DCP Errors
|
|
46
|
+
|
|
47
|
+
If DCP plugin throws "Unknown keys" errors:
|
|
48
|
+
|
|
49
|
+
1. Check OpenCode version (`opencode --version`)
|
|
50
|
+
2. Compare against [DCP schema](https://github.com/opencode/dcp) for your version
|
|
51
|
+
3. Remove deprecated fields - don't try to "fix" them
|
|
52
|
+
|
|
53
|
+
### Permission Debugging
|
|
54
|
+
|
|
55
|
+
If tools are unexpectedly blocked:
|
|
56
|
+
|
|
57
|
+
1. Check global config: `~/.config/opencode/opencode.json`
|
|
58
|
+
2. Check project config: `.opencode/opencode.json`
|
|
59
|
+
3. Project config takes precedence
|
|
60
|
+
4. Use `"*": "ask"` as base rule to debug which pattern is matching
|
|
61
|
+
|
|
62
|
+
## Beads Gotchas
|
|
63
|
+
|
|
64
|
+
### Core Beads CLI vs This Project's Plugin
|
|
65
|
+
|
|
66
|
+
**Core beads CLI** (`bd`) is the upstream tool from steveyegge/beads.
|
|
67
|
+
|
|
68
|
+
**This project's plugin** (`.opencode/plugin/beads.ts`) wraps the CLI and adds:
|
|
69
|
+
|
|
70
|
+
- `bd_done()` - closes task + releases locks + syncs in one call
|
|
71
|
+
- `bd_reserve()` / `bd_release()` - atomic file locking via mkdir
|
|
72
|
+
- `bd_claim()` - finds ready task + marks in_progress
|
|
73
|
+
- `bd_msg()` / `bd_inbox()` / `bd_ack()` - agent-to-agent messaging
|
|
74
|
+
- `bd_whois()` - agent directory lookup (who's working on what)
|
|
75
|
+
- Agent state (current task, reserved files, agent ID)
|
|
76
|
+
|
|
77
|
+
### Which To Use
|
|
78
|
+
|
|
79
|
+
| Context | Use |
|
|
80
|
+
| -------------------- | ----------------------- |
|
|
81
|
+
| OpenCode agents | Plugin tools (`bd_*()`) |
|
|
82
|
+
| Shell scripts, CI/CD | CLI (`bd`) |
|
|
83
|
+
| Human terminal | CLI (`bd`) |
|
|
84
|
+
|
|
85
|
+
### Plugin Tools (Preferred for Agents)
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
bd_init({ role: "build" }); // Join workspace
|
|
89
|
+
bd_claim(); // Get next ready task
|
|
90
|
+
bd_reserve({ paths: ["src/foo.ts"] }); // Lock files
|
|
91
|
+
// ... do work ...
|
|
92
|
+
bd_done({ id: "bd-xxx", msg: "Done" }); // Close + release + sync
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### CLI Commands (For Scripts/Humans)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
bd create "Task title" -t task -p 2 # Create
|
|
99
|
+
bd update bd-xxx --status in_progress # Claim
|
|
100
|
+
bd close bd-xxx --reason "Done" # Complete
|
|
101
|
+
bd sync # Push to git
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Hash-Based IDs Prevent Collisions
|
|
105
|
+
|
|
106
|
+
Beads uses hash IDs (`bd-a3f8`) not sequential IDs (`bd-1`, `bd-2`). This eliminates merge conflicts when multiple agents create issues on different branches.
|
|
107
|
+
|
|
108
|
+
Don't assume sequential IDs. Always use `bd show` to get exact IDs.
|
|
109
|
+
|
|
110
|
+
### `bd ready` Is Your Friend
|
|
111
|
+
|
|
112
|
+
`bd ready` shows tasks with NO unresolved blockers. Use it to find work instead of `bd list`.
|
|
113
|
+
|
|
114
|
+
### Dependencies Block Work
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
bd dep add bd-child bd-parent --type blocks
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Now `bd-child` won't appear in `bd ready` until `bd-parent` closes. Check `bd blocked` to see what's waiting.
|
|
121
|
+
|
|
122
|
+
### Git Is The Coordination Layer
|
|
123
|
+
|
|
124
|
+
No central server. Agents coordinate via:
|
|
125
|
+
|
|
126
|
+
1. Issue status (in_progress = claimed)
|
|
127
|
+
2. Git branches
|
|
128
|
+
3. `bd sync` to push/pull changes
|
|
129
|
+
|
|
130
|
+
### Sandbox Environments (Claude Code, etc.)
|
|
131
|
+
|
|
132
|
+
Daemon can't be killed by sandbox. Use:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
bd --sandbox ready
|
|
136
|
+
# Or: bd --no-daemon --no-auto-flush --no-auto-import list
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 30-Second Debounce
|
|
23
140
|
|
|
24
|
-
|
|
141
|
+
Rapid operations get batched into single JSONL flush after 30s. Force immediate sync:
|
|
25
142
|
|
|
26
|
-
|
|
143
|
+
```bash
|
|
144
|
+
bd sync
|
|
145
|
+
```
|