opencodekit 0.17.3 → 0.17.5
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/.version +1 -0
- package/dist/template/.opencode/AGENTS.md +42 -0
- package/dist/template/.opencode/agent/explore.md +8 -0
- package/dist/template/.opencode/agent/scout.md +8 -0
- package/dist/template/.opencode/command/create.md +23 -1
- package/dist/template/.opencode/command/plan.md +8 -0
- package/dist/template/.opencode/command/research.md +26 -0
- package/dist/template/.opencode/command/review-codebase.md +43 -1
- package/dist/template/.opencode/command/ship.md +26 -33
- package/dist/template/.opencode/command/start.md +15 -0
- package/dist/template/.opencode/command/status.md +23 -1
- package/dist/template/.opencode/command/verify.md +21 -0
- package/dist/template/.opencode/dcp.jsonc +81 -80
- package/dist/template/.opencode/memory/project/gotchas.md +37 -1
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +1054 -1054
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/sessions.ts +60 -0
- package/dist/template/.opencode/plugin/skill-mcp.ts +48 -0
- package/dist/template/.opencode/skill/context-management/SKILL.md +44 -10
- package/dist/template/.opencode/skill/obsidian/SKILL.md +182 -0
- package/dist/template/.opencode/skill/obsidian/mcp.json +22 -0
- package/dist/template/.opencode/skill/structured-edit/SKILL.md +168 -0
- package/dist/template/.opencode/tool/action-queue.ts +9 -4
- package/dist/template/.opencode/tool/memory-search.ts +12 -7
- package/dist/template/.opencode/tool/observation.ts +65 -4
- package/dist/template/.opencode/tool/swarm.ts +14 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -759,7 +759,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
759
759
|
// package.json
|
|
760
760
|
var package_default = {
|
|
761
761
|
name: "opencodekit",
|
|
762
|
-
version: "0.17.
|
|
762
|
+
version: "0.17.5",
|
|
763
763
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
764
764
|
keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
|
|
765
765
|
license: "MIT",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.17.5
|
|
@@ -132,6 +132,48 @@ For major tracked work:
|
|
|
132
132
|
- Use available tools to remove noise
|
|
133
133
|
- Persist important decisions and state to memory
|
|
134
134
|
|
|
135
|
+
### Token Budget
|
|
136
|
+
|
|
137
|
+
| Phase | Target | Action |
|
|
138
|
+
| ----------------- | ------- | ------------------------------------------ |
|
|
139
|
+
| Starting work | <50k | Load only essential AGENTS.md + task spec |
|
|
140
|
+
| Mid-task | 50-100k | Distill completed reads, keep active files |
|
|
141
|
+
| Approaching limit | >100k | Aggressive distill, prune remaining noise |
|
|
142
|
+
| Near capacity | >150k | Session restart with handoff |
|
|
143
|
+
|
|
144
|
+
### Tools
|
|
145
|
+
|
|
146
|
+
- `distill` — Extract key info from tool outputs, then remove raw output (preferred)
|
|
147
|
+
- `prune` — Remove tool outputs entirely (noise only, no preservation)
|
|
148
|
+
|
|
149
|
+
### Rules
|
|
150
|
+
|
|
151
|
+
1. **Distill at turn START** — not end (you know what's needed)
|
|
152
|
+
2. **Batch operations** — accumulate candidates before acting
|
|
153
|
+
3. **Protected content** — AGENTS.md, .opencode/, .beads/, config files
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Edit Protocol
|
|
158
|
+
|
|
159
|
+
`str_replace` failures are the #1 source of LLM coding failures. Use structured edits:
|
|
160
|
+
|
|
161
|
+
1. **LOCATE** — Use LSP tools (goToDefinition, findReferences) to find exact positions
|
|
162
|
+
2. **READ** — Get fresh file content around target (offset: line-10, limit: 30)
|
|
163
|
+
3. **VERIFY** — Confirm expected content exists before editing
|
|
164
|
+
4. **EDIT** — Include 2-3 unique context lines before/after
|
|
165
|
+
5. **CONFIRM** — Read back to verify edit succeeded
|
|
166
|
+
|
|
167
|
+
### File Size Guidance
|
|
168
|
+
|
|
169
|
+
| Size | Strategy |
|
|
170
|
+
| ------------- | --------------------------------- |
|
|
171
|
+
| < 100 lines | Full rewrite often easier |
|
|
172
|
+
| 100-400 lines | Structured edit with good context |
|
|
173
|
+
| > 400 lines | Strongly prefer structured edits |
|
|
174
|
+
|
|
175
|
+
**Use the `structured-edit` skill for complex edits.**
|
|
176
|
+
|
|
135
177
|
---
|
|
136
178
|
|
|
137
179
|
## Output Style
|
|
@@ -35,6 +35,14 @@ Find relevant files, symbols, and usage paths quickly for the caller.
|
|
|
35
35
|
- Prefer semantic lookup (LSP) before broad text search when it improves precision
|
|
36
36
|
- Stop when you can answer with concrete evidence or when additional search only repeats confirmed paths
|
|
37
37
|
|
|
38
|
+
## Before You Explore
|
|
39
|
+
|
|
40
|
+
- **Be certain**: Only explore what's needed for the task at hand
|
|
41
|
+
- **Don't over-explore**: Stop when you have enough evidence to answer
|
|
42
|
+
- **Use LSP first**: Start with goToDefinition/findReferences before grep
|
|
43
|
+
- **Stay scoped**: Don't explore files outside the task scope
|
|
44
|
+
- **Cite evidence**: Every finding needs file:line reference
|
|
45
|
+
|
|
38
46
|
## Workflow
|
|
39
47
|
|
|
40
48
|
1. Discover candidate files with `glob` or `workspaceSymbol`
|
|
@@ -45,6 +45,14 @@ Find trustworthy external references quickly and return concise, cited guidance.
|
|
|
45
45
|
- Cite every non-trivial claim
|
|
46
46
|
- Prefer high-signal synthesis over long dumps
|
|
47
47
|
|
|
48
|
+
## Before You Scout
|
|
49
|
+
|
|
50
|
+
- **Verify memory first**: Always check memory-search before external research
|
|
51
|
+
- **Use source hierarchy**: Official docs > source code > maintainer articles > community posts
|
|
52
|
+
- **Don't over-research**: Stop when you have medium+ confidence
|
|
53
|
+
- **Cite everything**: Every claim needs a source
|
|
54
|
+
- **Synthesize don't dump**: Return recommendations, not raw facts
|
|
55
|
+
|
|
48
56
|
## Source Quality Hierarchy
|
|
49
57
|
|
|
50
58
|
Rank sources in this order:
|
|
@@ -26,7 +26,29 @@ skill({ name: "prd" }); // PRD template guidance
|
|
|
26
26
|
| `<description>` | required | What to build/fix (quoted string) |
|
|
27
27
|
| `--type` | auto-detected | Override: epic, feature, task, bug |
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
## Determine Input Type
|
|
30
|
+
|
|
31
|
+
| Input Type | Detection | Action |
|
|
32
|
+
| ----------- | -------------------- | ----------------------------- |
|
|
33
|
+
| Quoted text | `"description here"` | Create PRD from description |
|
|
34
|
+
| Short form | Simple string | Ask for more detail if needed |
|
|
35
|
+
| `--type` | Flag provided | Use provided type |
|
|
36
|
+
|
|
37
|
+
## Before You Create
|
|
38
|
+
|
|
39
|
+
- **Be certain**: Only create beads you're confident have clear scope
|
|
40
|
+
- **Don't over-spec**: If the description is vague, ask clarifying questions first
|
|
41
|
+
- **Check duplicates**: Always run Phase 1 duplicate check
|
|
42
|
+
- **No implementation**: This command creates specs only, don't write code
|
|
43
|
+
- **Verify PRD**: Before saving, verify all sections are filled (no placeholders)
|
|
44
|
+
|
|
45
|
+
## Available Tools
|
|
46
|
+
|
|
47
|
+
| Tool | Use When |
|
|
48
|
+
| --------- | -------------------------------------------- |
|
|
49
|
+
| `explore` | Finding patterns in codebase, affected files |
|
|
50
|
+
| `scout` | External research, best practices |
|
|
51
|
+
| `br` | Creating and managing beads |
|
|
30
52
|
|
|
31
53
|
## Phase 1: Duplicate Check
|
|
32
54
|
|
|
@@ -28,6 +28,14 @@ skill({ name: "writing-plans" }); // TDD plan format
|
|
|
28
28
|
| `<bead-id>` | required | The bead to plan |
|
|
29
29
|
| `--create-beads` | false | Create child beads for each phase |
|
|
30
30
|
|
|
31
|
+
## Before You Plan
|
|
32
|
+
|
|
33
|
+
- **Be certain**: Only create tasks you're confident about
|
|
34
|
+
- **Don't over-plan**: If the PRD is clear, trust it
|
|
35
|
+
- **Budget context**: Target ~50% context per execution
|
|
36
|
+
- **Split signals**: Create child beads for complex work
|
|
37
|
+
- **Vertical slices**: Each task should cover one feature end-to-end
|
|
38
|
+
|
|
31
39
|
## Phase 1: Guards
|
|
32
40
|
|
|
33
41
|
```bash
|
|
@@ -28,6 +28,32 @@ skill({ name: "deep-research" });
|
|
|
28
28
|
|
|
29
29
|
Default depth: ~30 tool calls for moderate exploration.
|
|
30
30
|
|
|
31
|
+
## Determine Input Type
|
|
32
|
+
|
|
33
|
+
| Input Type | Detection | Action |
|
|
34
|
+
| ---------- | --------------------------- | --------------------------------- |
|
|
35
|
+
| Bead ID | Matches `br-xxx` or numeric | Research within that bead context |
|
|
36
|
+
| Topic | String | Standalone research |
|
|
37
|
+
|
|
38
|
+
## Before You Research
|
|
39
|
+
|
|
40
|
+
- **Be certain**: Only research what you need for implementation
|
|
41
|
+
- **Don't over-research**: Stop when you have enough to proceed
|
|
42
|
+
- **Use source priority**: Codebase → Docs → Source → GitHub → Web
|
|
43
|
+
- **Verify confidence**: Medium+ confidence required before stopping
|
|
44
|
+
- **Document findings**: Write to research.md for beads, report for topics
|
|
45
|
+
|
|
46
|
+
## Available Tools
|
|
47
|
+
|
|
48
|
+
| Tool | Use When |
|
|
49
|
+
| ------------ | ------------------------------- |
|
|
50
|
+
| `explore` | Codebase patterns, LSP analysis |
|
|
51
|
+
| `scout` | External docs, best practices |
|
|
52
|
+
| `context7` | Official API references |
|
|
53
|
+
| `opensrc` | Package source code inspection |
|
|
54
|
+
| `codesearch` | Real-world usage examples |
|
|
55
|
+
| `grepsearch` | GitHub code search |
|
|
56
|
+
|
|
31
57
|
## Phase 1: Load Context
|
|
32
58
|
|
|
33
59
|
If argument is a bead ID:
|
|
@@ -13,7 +13,49 @@ skill({ name: "beads" });
|
|
|
13
13
|
skill({ name: "requesting-code-review" });
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Determine Input Type
|
|
17
|
+
|
|
18
|
+
| Input Type | Detection | Action |
|
|
19
|
+
| --------------------- | ---------------------------- | -------------------------- |
|
|
20
|
+
| No arguments | Default | Review uncommitted changes |
|
|
21
|
+
| Commit hash (40-char) | SHA pattern | `git show <hash>` |
|
|
22
|
+
| Branch name | String, not matching above | `git diff main...HEAD` |
|
|
23
|
+
| PR URL/number | Contains "github.com" or "#" | `gh pr diff` |
|
|
24
|
+
|
|
25
|
+
## Before You Review
|
|
26
|
+
|
|
27
|
+
- **Be certain**: Only flag issues you can verify with tools
|
|
28
|
+
- **Don't invent problems**: If an edge case isn't specified, don't flag it
|
|
29
|
+
- **Don't be a zealot about style**: Unless it violates project conventions, don't flag
|
|
30
|
+
- **Review the changes**: Don't review pre-existing code that wasn't modified
|
|
31
|
+
- **Investigate first**: If unsure, use explore/scout agents before flagging
|
|
32
|
+
|
|
33
|
+
## Available Tools
|
|
34
|
+
|
|
35
|
+
| Tool | Use When |
|
|
36
|
+
| ------------ | --------------------------------------- |
|
|
37
|
+
| `explore` | Finding patterns in codebase, prior art |
|
|
38
|
+
| `scout` | External research, best practices |
|
|
39
|
+
| `lsp` | Finding symbol definitions, references |
|
|
40
|
+
| `grep` | Finding code patterns |
|
|
41
|
+
| `codesearch` | Real-world usage examples |
|
|
42
|
+
|
|
43
|
+
## Phase 1: Gather Context
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
git status --short
|
|
47
|
+
git diff --cached # staged
|
|
48
|
+
git diff # unstaged
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For each changed file:
|
|
52
|
+
|
|
53
|
+
- Read the full file to understand context
|
|
54
|
+
- Don't rely on diff alone — code that looks wrong in isolation may be correct
|
|
55
|
+
|
|
56
|
+
If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
|
|
57
|
+
|
|
58
|
+
## Phase 2: Determine Scope
|
|
17
59
|
|
|
18
60
|
| Input | Scope | How to Get Code |
|
|
19
61
|
| ------------------------ | --------------------- | ------------------------- |
|
|
@@ -19,39 +19,32 @@ skill({ name: "beads" });
|
|
|
19
19
|
skill({ name: "verification-before-completion" });
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- STOP → report to user with: what found, proposed change, impact
|
|
49
|
-
|
|
50
|
-
**Rule Priority:**
|
|
51
|
-
|
|
52
|
-
1. Rule 4 applies → STOP (user decision required)
|
|
53
|
-
2. Rules 1-3 apply → Fix automatically, track deviation
|
|
54
|
-
3. Genuinely unsure → Treat as Rule 4 (ask)
|
|
22
|
+
## Determine Input Type
|
|
23
|
+
|
|
24
|
+
| Input Type | Detection | Action |
|
|
25
|
+
| ---------- | --------------------------- | -------------------------- |
|
|
26
|
+
| Bead ID | Matches `br-xxx` or numeric | Ship that bead |
|
|
27
|
+
| Path | File/directory path | Not supported for ship |
|
|
28
|
+
| `all` | Keyword | Ship all in_progress beads |
|
|
29
|
+
|
|
30
|
+
## Before You Ship
|
|
31
|
+
|
|
32
|
+
- **Be certain**: Only ship if all tasks pass verification
|
|
33
|
+
- **Don't skip gates**: Build, test, lint, typecheck are non-negotiable
|
|
34
|
+
- **Run the review**: Always spawn review agent before closing
|
|
35
|
+
- **Verify goals**: Tasks completing ≠ goals achieved (use goal-backward verification)
|
|
36
|
+
- **Commit before close**: Per-task commits required, don't ship without git history
|
|
37
|
+
- **Ask before closing**: Never close bead without user confirmation
|
|
38
|
+
|
|
39
|
+
## Available Tools
|
|
40
|
+
|
|
41
|
+
| Tool | Use When |
|
|
42
|
+
| --------- | ----------------------------------------- |
|
|
43
|
+
| `explore` | Finding patterns in codebase, prior art |
|
|
44
|
+
| `scout` | External research, best practices |
|
|
45
|
+
| `lsp` | Finding symbol definitions, references |
|
|
46
|
+
| `grep` | Finding code patterns |
|
|
47
|
+
| `task` | Spawning subagents for parallel execution |
|
|
55
48
|
|
|
56
49
|
## Phase 1: Guards
|
|
57
50
|
|
|
@@ -26,6 +26,21 @@ skill({ name: "prd-task" }); // PRD → executable tasks
|
|
|
26
26
|
| `<bead-id>` | required | The bead to start |
|
|
27
27
|
| `--worktree` | false | Create isolated git worktree |
|
|
28
28
|
|
|
29
|
+
## Determine Input Type
|
|
30
|
+
|
|
31
|
+
| Input Type | Detection | Action |
|
|
32
|
+
| ---------- | --------------------------- | ----------------------- |
|
|
33
|
+
| Bead ID | Matches `br-xxx` or numeric | Start that bead |
|
|
34
|
+
| Path | File/directory path | Not supported for start |
|
|
35
|
+
|
|
36
|
+
## Before You Start
|
|
37
|
+
|
|
38
|
+
- **Be certain**: Only start beads with valid PRD (check Phase 2)
|
|
39
|
+
- **Check workspace**: Don't start if uncommitted changes exist (Phase 1)
|
|
40
|
+
- **One task at a time**: Warn if other tasks in progress
|
|
41
|
+
- **Validate spec**: Verify prd.md exists and has real content
|
|
42
|
+
- **Ask about workspace**: Let user choose branch/worktree strategy
|
|
43
|
+
|
|
29
44
|
## Phase 1: Pre-flight
|
|
30
45
|
|
|
31
46
|
```bash
|
|
@@ -23,7 +23,29 @@ Quick project status dashboard. Runs read-only commands and reports state.
|
|
|
23
23
|
skill({ name: "beads" });
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## Determine Input Type
|
|
27
|
+
|
|
28
|
+
| Input Type | Detection | Action |
|
|
29
|
+
| ------------ | ------------- | ------------------- |
|
|
30
|
+
| No arguments | Default | Show full dashboard |
|
|
31
|
+
| `--git` | Flag provided | Git state only |
|
|
32
|
+
| `--sessions` | Flag provided | Sessions only |
|
|
33
|
+
|
|
34
|
+
## Before You Status
|
|
35
|
+
|
|
36
|
+
- **Be certain**: This is a read-only command, no changes are made
|
|
37
|
+
- **Use actual data**: Don't invent data, use real command output
|
|
38
|
+
- **No modifications**: Don't create beads or modify state from status
|
|
39
|
+
- **Single recommendation**: Only suggest ONE next action
|
|
40
|
+
|
|
41
|
+
## Available Tools
|
|
42
|
+
|
|
43
|
+
| Tool | Use When |
|
|
44
|
+
| --------------- | --------------------------------- |
|
|
45
|
+
| `br` | Task status and stats |
|
|
46
|
+
| `git` | Git state and history |
|
|
47
|
+
| `list_sessions` | Recent sessions |
|
|
48
|
+
| `action-queue` | Pending approvals and ready tasks |
|
|
27
49
|
|
|
28
50
|
## Phase 1: Gather State (Parallel)
|
|
29
51
|
|
|
@@ -23,6 +23,21 @@ skill({ name: "verification-before-completion" });
|
|
|
23
23
|
| `--quick` | false | Gates only, skip coherence check |
|
|
24
24
|
| `--fix` | false | Auto-fix lint/format issues |
|
|
25
25
|
|
|
26
|
+
## Determine Input Type
|
|
27
|
+
|
|
28
|
+
| Input Type | Detection | Action |
|
|
29
|
+
| ---------- | --------------------------- | ----------------------------------- |
|
|
30
|
+
| Bead ID | Matches `br-xxx` or numeric | Check implementation vs PRD in bead |
|
|
31
|
+
| Path | File/directory path | Verify that specific path |
|
|
32
|
+
| `all` | Keyword | Verify all in-progress work |
|
|
33
|
+
|
|
34
|
+
## Before You Verify
|
|
35
|
+
|
|
36
|
+
- **Be certain**: Only flag issues you can verify with tools
|
|
37
|
+
- **Don't invent problems**: If an edge case isn't in the PRD, don't flag it
|
|
38
|
+
- **Run the gates**: Build, test, lint, typecheck are non-negotiable
|
|
39
|
+
- **Use project conventions**: Check `package.json` scripts first
|
|
40
|
+
|
|
26
41
|
## Phase 1: Gather Context
|
|
27
42
|
|
|
28
43
|
```bash
|
|
@@ -32,6 +47,12 @@ ls .beads/artifacts/$ARGUMENTS/
|
|
|
32
47
|
|
|
33
48
|
Read the PRD and any other artifacts (plan.md, research.md, design.md).
|
|
34
49
|
|
|
50
|
+
**Verify guards:**
|
|
51
|
+
|
|
52
|
+
- [ ] Bead is `in_progress`
|
|
53
|
+
- [ ] `prd.md` exists
|
|
54
|
+
- [ ] You have read the full PRD
|
|
55
|
+
|
|
35
56
|
## Phase 2: Completeness
|
|
36
57
|
|
|
37
58
|
Extract all requirements/tasks from the PRD and verify each is implemented:
|
|
@@ -1,82 +1,83 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json",
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"debug": false,
|
|
5
|
+
// "minimal" shows prune activity without noise; "detailed" shows token counts
|
|
6
|
+
"pruneNotification": "detailed",
|
|
7
|
+
// "chat" (in-conversation) or "toast" (system notification)
|
|
8
|
+
"pruneNotificationType": "toast",
|
|
9
|
+
// Commands: /dcp context, /dcp stats, /dcp sweep
|
|
10
|
+
"commands": {
|
|
11
|
+
"enabled": true,
|
|
12
|
+
// Protect these from /dcp sweep
|
|
13
|
+
"protectedTools": ["observation", "memory-update", "memory-search"]
|
|
14
|
+
},
|
|
15
|
+
"turnProtection": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"turns": 4
|
|
18
|
+
},
|
|
19
|
+
// Protected file patterns - never auto-prune reads of these files
|
|
20
|
+
"protectedFilePatterns": [
|
|
21
|
+
"**/.env*",
|
|
22
|
+
"**/AGENTS.md",
|
|
23
|
+
"**/.opencode/**",
|
|
24
|
+
"**/.beads/**",
|
|
25
|
+
"**/package.json",
|
|
26
|
+
"**/tsconfig.json",
|
|
27
|
+
"**/biome.json"
|
|
28
|
+
],
|
|
29
|
+
"tools": {
|
|
30
|
+
"settings": {
|
|
31
|
+
"nudgeEnabled": true,
|
|
32
|
+
"nudgeFrequency": 10,
|
|
33
|
+
// v2.0.1: percentage support - 80% of model's context (most models = 128k)
|
|
34
|
+
"contextLimit": "80%",
|
|
35
|
+
// Protect state-modifying and critical workflow tools
|
|
36
|
+
// LSP excluded: ephemeral exploration, prune after understanding
|
|
37
|
+
"protectedTools": [
|
|
38
|
+
"write",
|
|
39
|
+
"edit",
|
|
40
|
+
"memory-update",
|
|
41
|
+
"observation",
|
|
42
|
+
"skill",
|
|
43
|
+
"skill_mcp",
|
|
44
|
+
"task",
|
|
45
|
+
"batch",
|
|
46
|
+
"todowrite",
|
|
47
|
+
"todoread"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
// v2.0.0: permission model - "allow", "ask", or "deny"
|
|
51
|
+
"prune": {
|
|
52
|
+
"permission": "allow"
|
|
53
|
+
},
|
|
54
|
+
"distill": {
|
|
55
|
+
"permission": "allow",
|
|
56
|
+
"showDistillation": false
|
|
57
|
+
},
|
|
58
|
+
"compress": {
|
|
59
|
+
// v2.1.1: compress can have boundary matching issues - use ask for safety
|
|
60
|
+
"permission": "ask",
|
|
61
|
+
"showCompression": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
// Auto strategies - TOP LEVEL, not under tools
|
|
65
|
+
"strategies": {
|
|
66
|
+
// Dedup = zero LLM cost, high impact - always enable
|
|
67
|
+
"deduplication": {
|
|
68
|
+
"enabled": true,
|
|
69
|
+
"protectedTools": []
|
|
70
|
+
},
|
|
71
|
+
// Supersede writes = zero cost, removes redundant write inputs after read
|
|
72
|
+
// Note: default changed to false in beta, we explicitly enable
|
|
73
|
+
"supersedeWrites": {
|
|
74
|
+
"enabled": true
|
|
75
|
+
},
|
|
76
|
+
// Purge error inputs after N turns
|
|
77
|
+
"purgeErrors": {
|
|
78
|
+
"enabled": true,
|
|
79
|
+
"turns": 4,
|
|
80
|
+
"protectedTools": []
|
|
81
|
+
}
|
|
82
|
+
}
|
|
82
83
|
}
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
purpose: Footguns, edge cases, and warnings discovered during development
|
|
3
|
-
updated: 2026-02-
|
|
3
|
+
updated: 2026-02-12
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Gotchas
|
|
7
7
|
|
|
8
8
|
Track unexpected behaviors, edge cases, and warnings here. Update when you hit something surprising.
|
|
9
9
|
|
|
10
|
+
## LLM Coding (Harness Problem)
|
|
11
|
+
|
|
12
|
+
The edit tool (`str_replace`) is the #1 source of failures in LLM coding. Models fail at reproducing content with exact whitespace/encoding, not at understanding tasks.
|
|
13
|
+
|
|
14
|
+
### Edit Tool Failures
|
|
15
|
+
|
|
16
|
+
- **Whitespace mismatch** — Tabs vs spaces, trailing spaces, line endings (CRLF vs LF)
|
|
17
|
+
- **Content changed** — File modified since last read
|
|
18
|
+
- **Multiple matches** — Same string appears twice, edit fails
|
|
19
|
+
- **Stale context** — Editing from memory instead of fresh read
|
|
20
|
+
|
|
21
|
+
### Mitigation Strategies
|
|
22
|
+
|
|
23
|
+
1. **Always read fresh** before editing — no assumptions
|
|
24
|
+
2. **Use LSP tools** to locate symbols precisely (goToDefinition, findReferences)
|
|
25
|
+
3. **Include unique context** — 2-3 lines before/after for uniqueness
|
|
26
|
+
4. **Prefer smaller files** — <400 lines reduces edit complexity
|
|
27
|
+
5. **Verify after edit** — read back to confirm success
|
|
28
|
+
|
|
29
|
+
### File Size Guidance
|
|
30
|
+
|
|
31
|
+
| Size | Strategy |
|
|
32
|
+
| ------------- | ------------------------------------------ |
|
|
33
|
+
| < 100 lines | Full rewrite often easier than str_replace |
|
|
34
|
+
| 100-400 lines | Structured edit with good context |
|
|
35
|
+
| > 400 lines | Strongly prefer structured edits |
|
|
36
|
+
|
|
37
|
+
**Use the `structured-edit` skill for reliable edits.**
|
|
38
|
+
|
|
39
|
+
### Context Hygiene
|
|
40
|
+
|
|
41
|
+
- Distill large tool outputs immediately after use
|
|
42
|
+
- Prune irrelevant reads before proceeding
|
|
43
|
+
- Token budget: <50k start → 50-100k mid → >150k restart session
|
|
44
|
+
- Subagent outputs can leak tokens — be aggressive about distilling
|
|
45
|
+
|
|
10
46
|
## OpenCode Config
|
|
11
47
|
|
|
12
48
|
- **`compaction` key invalid**: Not in official schema at opencode.ai/config.json. Remove if present.
|
|
Binary file
|
|
Binary file
|