opencodekit 0.12.1 → 0.12.2
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 +23 -23
- package/dist/template/.opencode/agent/explore.md +6 -6
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/fix-types.md +3 -3
- package/dist/template/.opencode/command/new-feature.md +1 -1
- package/dist/template/.opencode/command/research-ui.md +1 -1
- package/dist/template/.opencode/command/research.md +3 -3
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/dcp.jsonc +16 -33
- package/dist/template/.opencode/memory/project/commands.md +44 -5
- package/dist/template/.opencode/memory/project/conventions.md +104 -5
- package/dist/template/.opencode/memory/project/gotchas.md +43 -9
- package/dist/template/.opencode/opencode.json +511 -523
- package/dist/template/.opencode/package.json +1 -1
- package/package.json +1 -1
- package/dist/template/.opencode/tool/lsp.ts +0 -786
package/dist/index.js
CHANGED
|
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
750
750
|
// package.json
|
|
751
751
|
var package_default = {
|
|
752
752
|
name: "opencodekit",
|
|
753
|
-
version: "0.12.
|
|
753
|
+
version: "0.12.2",
|
|
754
754
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
755
755
|
type: "module",
|
|
756
756
|
repository: {
|
|
@@ -36,7 +36,7 @@ Codebase complexity is a primary difficulty knob. Context is how you pay it down
|
|
|
36
36
|
|
|
37
37
|
**Practical implications:**
|
|
38
38
|
|
|
39
|
-
- Prefer `
|
|
39
|
+
- Prefer `lsp_lsp_document_symbols` over reading entire files
|
|
40
40
|
- Read specific line ranges, not whole documents
|
|
41
41
|
- Navigate AGENTS.md hierarchy: root → subsystem → details (progressive disclosure)
|
|
42
42
|
- Prune context aggressively; completed work doesn't need to stay loaded
|
|
@@ -217,51 +217,51 @@ Ask yourself: **"Am I looking for code structure or just text?"**
|
|
|
217
217
|
|
|
218
218
|
**Use LSP tools when you need to:**
|
|
219
219
|
|
|
220
|
-
- Understand what a symbol is → `
|
|
221
|
-
- Jump to where something is defined → `
|
|
222
|
-
- Find all usages before refactoring → `
|
|
223
|
-
- Rename across the entire codebase → `
|
|
220
|
+
- Understand what a symbol is → `lsp_lsp_hover`
|
|
221
|
+
- Jump to where something is defined → `lsp_lsp_goto_definition`
|
|
222
|
+
- Find all usages before refactoring → `lsp_lsp_find_references`
|
|
223
|
+
- Rename across the entire codebase → `lsp_lsp_rename`
|
|
224
224
|
|
|
225
225
|
**Rule**: Always `read` before `edit` to verify content.
|
|
226
226
|
|
|
227
227
|
### LSP Tools (10 tools)
|
|
228
228
|
|
|
229
|
-
Semantic code intelligence via Language Server Protocol
|
|
229
|
+
Semantic code intelligence via Language Server Protocol. **Uses `lsp_lsp_*` prefix** (built-in experimental).
|
|
230
230
|
|
|
231
231
|
**Navigation & Understanding:**
|
|
232
232
|
|
|
233
|
-
- `
|
|
234
|
-
- `
|
|
235
|
-
- `
|
|
236
|
-
- `
|
|
237
|
-
- `
|
|
233
|
+
- `lsp_lsp_hover(filePath, line, character)` - Get type info and docs at cursor
|
|
234
|
+
- `lsp_lsp_goto_definition(filePath, line, character)` - Jump to where symbol is defined
|
|
235
|
+
- `lsp_lsp_find_references(filePath, line, character)` - Find all usages of a symbol
|
|
236
|
+
- `lsp_lsp_document_symbols(filePath)` - Get file outline (classes, functions, etc.)
|
|
237
|
+
- `lsp_lsp_workspace_symbols(query, filePath)` - Fuzzy search symbols across workspace
|
|
238
238
|
|
|
239
239
|
**Diagnostics:**
|
|
240
240
|
|
|
241
|
-
- `
|
|
241
|
+
- `lsp_lsp_diagnostics(filePath, severity?)` - Get errors/warnings from language server
|
|
242
242
|
|
|
243
243
|
**Refactoring:**
|
|
244
244
|
|
|
245
|
-
- `
|
|
246
|
-
- `
|
|
247
|
-
- `
|
|
248
|
-
- `
|
|
245
|
+
- `lsp_lsp_rename(filePath, line, character, newName)` - Rename symbol across codebase
|
|
246
|
+
- `lsp_lsp_code_actions(filePath, startLine, startChar, endLine, endChar)` - Get available refactorings
|
|
247
|
+
- `lsp_lsp_code_action_apply(...)` - Apply a specific code action
|
|
248
|
+
- `lsp_lsp_organize_imports(filePath)` - Clean up and sort imports
|
|
249
249
|
|
|
250
250
|
**When to use each tool:**
|
|
251
251
|
|
|
252
|
-
**"What type is this variable?"** → Use `
|
|
252
|
+
**"What type is this variable?"** → Use `lsp_lsp_hover` to see type signature without reading the entire definition file.
|
|
253
253
|
|
|
254
|
-
**"Where is this function defined?"** → Use `
|
|
254
|
+
**"Where is this function defined?"** → Use `lsp_lsp_goto_definition` to jump directly to source instead of grepping.
|
|
255
255
|
|
|
256
|
-
**"What uses this function?"** → Use `
|
|
256
|
+
**"What uses this function?"** → Use `lsp_lsp_find_references` before changing anything to see all call sites.
|
|
257
257
|
|
|
258
|
-
**"What's in this file?"** → Use `
|
|
258
|
+
**"What's in this file?"** → Use `lsp_lsp_document_symbols` for a quick outline without reading the entire file.
|
|
259
259
|
|
|
260
|
-
**"Where is UserService defined?"** → Use `
|
|
260
|
+
**"Where is UserService defined?"** → Use `lsp_lsp_workspace_symbols` to fuzzy search across all files.
|
|
261
261
|
|
|
262
|
-
**"Are there type errors?"** → Use `
|
|
262
|
+
**"Are there type errors?"** → Use `lsp_lsp_diagnostics` to check before running tests.
|
|
263
263
|
|
|
264
|
-
**"Rename this function safely"** → Use `
|
|
264
|
+
**"Rename this function safely"** → Use `lsp_lsp_rename` to update all references automatically.
|
|
265
265
|
|
|
266
266
|
**Caveat**: LSP tools modify files directly. Re-read files before further edits.
|
|
267
267
|
|
|
@@ -35,9 +35,9 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
35
35
|
|
|
36
36
|
**Progressive disclosure**: Start broad, narrow based on findings.
|
|
37
37
|
|
|
38
|
-
1. Use `
|
|
39
|
-
2. Use `
|
|
40
|
-
3. Use `
|
|
38
|
+
1. Use `lsp_lsp_workspace_symbols` or `lsp_lsp_document_symbols` to understand structure without reading whole files
|
|
39
|
+
2. Use `lsp_lsp_goto_definition` to jump directly to source instead of grepping
|
|
40
|
+
3. Use `lsp_lsp_find_references` to map usage before returning
|
|
41
41
|
4. Only `read` the specific lines that matter
|
|
42
42
|
|
|
43
43
|
**Avoid blind exploration**: Don't grep for generic terms. Use semantic tools first.
|
|
@@ -52,8 +52,8 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
52
52
|
|
|
53
53
|
## Thoroughness Levels
|
|
54
54
|
|
|
55
|
-
**Quick**: Single ast-grep,
|
|
55
|
+
**Quick**: Single ast-grep, lsp_lsp_workspace_symbols, or glob. Read 1-3 files. Return immediately.
|
|
56
56
|
|
|
57
|
-
**Medium**: AST-grep + LSP verification. Check 2-3 naming conventions. Read 3-5 files. Use `
|
|
57
|
+
**Medium**: AST-grep + LSP verification. Check 2-3 naming conventions. Read 3-5 files. Use `lsp_lsp_find_references` to trace usage.
|
|
58
58
|
|
|
59
|
-
**Very Thorough**: Comprehensive search across multiple terms and locations. Use `
|
|
59
|
+
**Very Thorough**: Comprehensive search across multiple terms and locations. Use `lsp_lsp_find_references` to build dependency map. Report with file:line references.
|
|
@@ -97,7 +97,7 @@ grep({ pattern: "[related concept]", include: "*.ts" });
|
|
|
97
97
|
ast - grep({ pattern: "[code pattern]" });
|
|
98
98
|
|
|
99
99
|
// Understand existing architecture
|
|
100
|
-
|
|
100
|
+
lsp_lsp_document_symbols({ filePath: "<relevant file>" });
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
For each promising idea, note:
|
|
@@ -78,14 +78,14 @@ Files affected: [N]
|
|
|
78
78
|
Get errors with full context:
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
|
-
|
|
81
|
+
lsp_lsp_diagnostics({ filePath: "<file>", severity: "error" });
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
For each file with errors:
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
lsp_lsp_hover({ filePath: "<file>", line: N, character: N }); // Understand types
|
|
88
|
+
lsp_lsp_goto_definition({ filePath: "<file>", line: N, character: N }); // Find source
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
## Phase 4: Categorize Errors
|
|
@@ -39,7 +39,7 @@ bd_ls({ status: "all", limit: 20, offset: 0 })
|
|
|
39
39
|
|
|
40
40
|
# Analyze codebase structure
|
|
41
41
|
glob pattern="src/**/*.{ts,tsx,py}"
|
|
42
|
-
|
|
42
|
+
lsp_lsp_workspace_symbols({ query: "[relevant-terms]" })
|
|
43
43
|
|
|
44
44
|
# Check recent changes in related areas
|
|
45
45
|
git log --oneline -10 -- src/[relevant-path]/
|
|
@@ -68,7 +68,7 @@ const parseTarget = (input: string) => {
|
|
|
68
68
|
glob({ pattern: `${path}/**/*.{tsx,jsx,css,scss,vue,svelte}` });
|
|
69
69
|
|
|
70
70
|
// Analyze component structure
|
|
71
|
-
|
|
71
|
+
lsp_lsp_document_symbols({ filePath: mainComponentFile });
|
|
72
72
|
|
|
73
73
|
// Search for styling patterns
|
|
74
74
|
ast_grep({ pattern: "className={$$$}", path });
|
|
@@ -88,9 +88,9 @@ Prioritize sources in this order:
|
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
90
|
// Semantic understanding
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
lsp_lsp_find_references({ filePath: "<file>", line: N, character: N });
|
|
92
|
+
lsp_lsp_hover({ filePath: "<file>", line: N, character: N });
|
|
93
|
+
lsp_lsp_document_symbols({ filePath: "<file>" });
|
|
94
94
|
|
|
95
95
|
// Pattern search
|
|
96
96
|
ast-grep({ pattern: "<code pattern>" });
|
|
@@ -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,39 @@ 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 Workflow
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bd ready # Show issues ready to work (no blockers)
|
|
59
|
+
bd list --status=open # All open issues
|
|
60
|
+
bd show <id> # Full issue details with dependencies
|
|
61
|
+
bd create --title="..." --type=task --priority=2
|
|
62
|
+
bd update <id> --status=in_progress
|
|
63
|
+
bd close <id> --reason="Completed"
|
|
64
|
+
bd sync # Commit and push changes
|
|
65
|
+
```
|
|
@@ -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,60 @@
|
|
|
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`
|
|
9
15
|
|
|
10
|
-
|
|
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
|
|
22
|
+
|
|
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
|
|
17
35
|
|
|
18
|
-
|
|
36
|
+
### Protected Tools in DCP
|
|
37
|
+
|
|
38
|
+
v1.1.3 recognizes more tool variants. Ensure these are protected:
|
|
39
|
+
|
|
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
|
|
23
54
|
|
|
24
|
-
|
|
55
|
+
If tools are unexpectedly blocked:
|
|
25
56
|
|
|
26
|
-
|
|
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
|