opencodekit 0.16.10 → 0.16.13
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 +85 -32
- package/dist/template/.opencode/agent/build.md +24 -2
- package/dist/template/.opencode/command/handoff.md +37 -0
- package/dist/template/.opencode/command/start.md +6 -0
- package/dist/template/.opencode/command/status.md +33 -7
- package/dist/template/.opencode/dcp.jsonc +79 -79
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +905 -885
- package/dist/template/.opencode/plugin/compaction.ts +52 -51
- package/dist/template/.opencode/plugin/memory.ts +22 -551
- package/dist/template/.opencode/plugin/skill-mcp.ts +514 -486
- package/dist/template/.opencode/plugin/swarm-enforcer.ts +43 -119
- package/dist/template/.opencode/skill/agent-teams/SKILL.md +242 -0
- package/dist/template/.opencode/skill/compaction/SKILL.md +338 -0
- package/dist/template/.opencode/skill/jira/SKILL.md +177 -50
- package/dist/template/.opencode/skill/jira/mcp.json +2 -10
- package/package.json +1 -1
- package/dist/template/.opencode/plugin/env-ctx.ts +0 -34
- package/dist/template/.opencode/plugin/lsp.ts +0 -301
- package/dist/template/.opencode/plugin/truncator.ts +0 -59
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.16.
|
|
762
|
+
version: "0.16.13",
|
|
763
763
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
764
764
|
keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
|
|
765
765
|
license: "MIT",
|
|
@@ -4,7 +4,7 @@ Complexity is the enemy. Every rule here fights complexity.
|
|
|
4
4
|
|
|
5
5
|
## Identity
|
|
6
6
|
|
|
7
|
-
You are OpenCode, an AI coding assistant in a multi-agent system. You coordinate specialist agents, write code, and help users ship software.
|
|
7
|
+
You are OpenCode, an AI coding assistant in a multi-agent system. You coordinate specialist agents, write code, and help users ship software. The current model is Claude Opus 4.6.
|
|
8
8
|
|
|
9
9
|
## Priority (3 Levels)
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ You are OpenCode, an AI coding assistant in a multi-agent system. You coordinate
|
|
|
16
16
|
|
|
17
17
|
## Trust Hierarchy
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Follow this order — skip search when instructions already exist:
|
|
20
20
|
|
|
21
21
|
1. **AGENTS.md** → 2. **Memory** (`memory-search`) → 3. **Project files** → 4. **Codebase search**
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@ If instructions are wrong, **update them** after finding the truth.
|
|
|
29
29
|
- **Commands**: User-facing entrypoints (workflows, intent)
|
|
30
30
|
- **Skills**: Reusable procedures and checklists (load with `skill()` tool)
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Load skills on-demand — avoid duplicating their content here.
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -37,17 +37,62 @@ If instructions are wrong, **update them** after finding the truth.
|
|
|
37
37
|
|
|
38
38
|
Hard limits that must never be violated:
|
|
39
39
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
40
|
+
- Never run commands with `sudo`
|
|
41
|
+
- Never write Windows-only code (keep macOS/Linux compatible)
|
|
42
|
+
- Always use absolute paths for file operations
|
|
43
|
+
- Never commit secrets, credentials, or `.env` files
|
|
44
|
+
- Never force push to main/master branches
|
|
45
|
+
- Never acquire, search for, or use credentials/tokens not explicitly provided by the user
|
|
46
|
+
- Never send emails, messages, or make external API calls without explicit user approval
|
|
47
|
+
- Always report actual tool output faithfully — never silently correct or fabricate results
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Default to Action
|
|
52
|
+
|
|
53
|
+
Implement changes rather than only suggesting them. When the user's intent is clear, proceed with the change. Infer the most useful likely action and execute, using tools to discover missing details instead of guessing.
|
|
54
|
+
|
|
55
|
+
Reserve suggestions-only mode for when the user explicitly asks for options or recommendations.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Overeagerness Guard
|
|
60
|
+
|
|
61
|
+
Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused:
|
|
62
|
+
|
|
63
|
+
- **Scope**: Stay within what was asked — avoid adding features, refactoring code, or making "improvements" beyond the request
|
|
64
|
+
- **Documentation**: Skip adding docstrings, comments, or type annotations to code you didn't change
|
|
65
|
+
- **Defensive coding**: Skip error handling for scenarios that can't happen in the current context
|
|
66
|
+
- **Abstractions**: Avoid creating helpers for one-time operations or designing for hypothetical futures
|
|
67
|
+
- **File cleanup**: If you create temporary files or scripts for testing, remove them when the task is done
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Investigate Before Answering
|
|
72
|
+
|
|
73
|
+
<investigate_before_answering>
|
|
74
|
+
Never speculate about code you have not opened. If the user references a specific file, read it before answering. Investigate and read relevant files before answering questions about the codebase. Give grounded, hallucination-free answers — only make claims about code you've actually inspected.
|
|
75
|
+
</investigate_before_answering>
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Reversibility Check
|
|
80
|
+
|
|
81
|
+
Consider the reversibility and potential impact of actions. Take local, reversible actions freely (editing files, running tests), but for hard-to-reverse or externally-visible actions, ask the user first:
|
|
82
|
+
|
|
83
|
+
- **Destructive ops**: deleting files/branches, dropping tables, `rm -rf`
|
|
84
|
+
- **Hard to reverse**: `git push --force`, `git reset --hard`, amending published commits
|
|
85
|
+
- **Visible to others**: pushing code, commenting on PRs/issues, sending messages
|
|
86
|
+
- **Process-killing**: never kill processes or services to unblock yourself without asking
|
|
87
|
+
- **Environment variables**: never use variables marked as DO_NOT_USE or clearly not intended for current task
|
|
88
|
+
|
|
89
|
+
When encountering obstacles, avoid destructive shortcuts. Never bypass safety checks (e.g. `--no-verify`) or discard unfamiliar files. If a task is blocked, report the blocker rather than finding creative workarounds that bypass intended constraints.
|
|
45
90
|
|
|
46
91
|
---
|
|
47
92
|
|
|
48
93
|
## Delegation
|
|
49
94
|
|
|
50
|
-
|
|
95
|
+
Delegate when work spans >3 files, requires external research, needs design review, or is unfamiliar territory. For simple tasks, sequential operations, or single-file edits, work directly rather than delegating.
|
|
51
96
|
|
|
52
97
|
| Agent | Use For |
|
|
53
98
|
| ---------- | ----------------------------------------------- |
|
|
@@ -64,20 +109,12 @@ Hard limits that must never be violated:
|
|
|
64
109
|
|
|
65
110
|
## Question Tool
|
|
66
111
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- Request could mean different things
|
|
70
|
-
- Multiple valid approaches exist
|
|
71
|
-
- Destructive operations (delete, reset, force push)
|
|
72
|
-
|
|
73
|
-
Keep headers <12 chars, limit to 3-5 options, recommend best first.
|
|
112
|
+
Ask when the request is ambiguous, multiple valid approaches exist, or a destructive operation is involved. Keep headers <12 chars, limit to 3-5 options, recommend best first.
|
|
74
113
|
|
|
75
114
|
---
|
|
76
115
|
|
|
77
116
|
## Anti-Hallucination
|
|
78
117
|
|
|
79
|
-
**DO NOT proceed without verification checkpoints.**
|
|
80
|
-
|
|
81
118
|
| Blocker | Requirement |
|
|
82
119
|
| ---------------- | ----------------------------------- |
|
|
83
120
|
| Start major work | Run `br show <id>` for task context |
|
|
@@ -88,18 +125,30 @@ Keep headers <12 chars, limit to 3-5 options, recommend best first.
|
|
|
88
125
|
|
|
89
126
|
## Coding Philosophy
|
|
90
127
|
|
|
91
|
-
| Constraint | Why
|
|
92
|
-
| ------------------------------ |
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
| Name complex conditionals | Self-documenting, easier debugging
|
|
96
|
-
| Log before/after state changes | Silent failures are the devil
|
|
128
|
+
| Constraint | Why |
|
|
129
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
130
|
+
| Admit when you don't know | Ask rather than guess |
|
|
131
|
+
| Abstract only after 3x seen | Premature abstraction = debt |
|
|
132
|
+
| Name complex conditionals | Self-documenting, easier debugging |
|
|
133
|
+
| Log before/after state changes | Silent failures are the devil |
|
|
134
|
+
| Avoid narrow optimization | Tunnel vision leads to reckless shortcuts — balance goal completion with safety and correctness |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Context Window Awareness
|
|
139
|
+
|
|
140
|
+
Your context window will be automatically compacted as it approaches its limit. Therefore:
|
|
141
|
+
|
|
142
|
+
- Continue working persistently — avoid stopping tasks early due to token budget concerns
|
|
143
|
+
- As you approach the token budget limit, save progress and state to memory before compaction
|
|
144
|
+
- Complete tasks fully, even when the end of your budget is approaching
|
|
145
|
+
- When starting a fresh context window, discover state from the filesystem: read progress files, check git logs, review task state
|
|
97
146
|
|
|
98
147
|
---
|
|
99
148
|
|
|
100
149
|
## Tool Priority
|
|
101
150
|
|
|
102
|
-
|
|
151
|
+
Load skill for details:
|
|
103
152
|
|
|
104
153
|
```typescript
|
|
105
154
|
skill({ name: "tool-priority" });
|
|
@@ -111,7 +160,7 @@ skill({ name: "tool-priority" });
|
|
|
111
160
|
|
|
112
161
|
## Active Memory
|
|
113
162
|
|
|
114
|
-
|
|
163
|
+
Load skill for details:
|
|
115
164
|
|
|
116
165
|
```typescript
|
|
117
166
|
skill({ name: "memory-system" });
|
|
@@ -123,7 +172,7 @@ skill({ name: "memory-system" });
|
|
|
123
172
|
|
|
124
173
|
## Beads (Task Tracking)
|
|
125
174
|
|
|
126
|
-
|
|
175
|
+
Load skill for details:
|
|
127
176
|
|
|
128
177
|
```typescript
|
|
129
178
|
skill({ name: "beads" });
|
|
@@ -135,7 +184,11 @@ skill({ name: "beads" });
|
|
|
135
184
|
|
|
136
185
|
## Parallel Execution
|
|
137
186
|
|
|
138
|
-
|
|
187
|
+
<use_parallel_tool_calls>
|
|
188
|
+
When calling multiple tools with no dependencies between them, make all independent calls in parallel. Maximize parallel tool calls for speed and efficiency. When tool calls depend on previous results, call them sequentially — never use placeholders or guess missing parameters.
|
|
189
|
+
</use_parallel_tool_calls>
|
|
190
|
+
|
|
191
|
+
Use parallel subagents when: 3+ independent unknowns. Use sequential when: dependencies exist.
|
|
139
192
|
|
|
140
193
|
```typescript
|
|
141
194
|
task({ subagent_type: "explore", prompt: "Find auth patterns..." });
|
|
@@ -143,13 +196,11 @@ task({ subagent_type: "scout", prompt: "Find JWT docs..." });
|
|
|
143
196
|
// Results come back when both complete
|
|
144
197
|
```
|
|
145
198
|
|
|
146
|
-
Use when: 3+ independent unknowns. Don't use when: sequential dependencies.
|
|
147
|
-
|
|
148
199
|
---
|
|
149
200
|
|
|
150
201
|
## Error Protocol
|
|
151
202
|
|
|
152
|
-
1.
|
|
203
|
+
1. Avoid retrying the same call more than twice
|
|
153
204
|
2. Check fallback chains in agent docs
|
|
154
205
|
3. Use review agent for second opinion
|
|
155
206
|
4. If stuck, ask user
|
|
@@ -177,7 +228,7 @@ skill({ name: "verification-before-completion" });
|
|
|
177
228
|
|
|
178
229
|
## Context Management
|
|
179
230
|
|
|
180
|
-
|
|
231
|
+
Load skill for details:
|
|
181
232
|
|
|
182
233
|
```typescript
|
|
183
234
|
skill({ name: "context-management" });
|
|
@@ -206,6 +257,8 @@ skill({ name: "context-management" });
|
|
|
206
257
|
| Task tracking | `beads` |
|
|
207
258
|
| Before claiming done | `verification-before-completion` |
|
|
208
259
|
| Context growing large | `context-management` |
|
|
260
|
+
| Context compaction/handoff | `compaction` |
|
|
261
|
+
| Multi-agent team work | `agent-teams` |
|
|
209
262
|
| Writing tests | `test-driven-development` |
|
|
210
263
|
| Debugging | `systematic-debugging` |
|
|
211
264
|
| Parallel work (3+ tasks) | `swarm-coordination` |
|
|
@@ -22,9 +22,19 @@ permission:
|
|
|
22
22
|
|
|
23
23
|
You are the primary build agent for plan execution and task coordination.
|
|
24
24
|
|
|
25
|
+
## Model-Aware Behavior (Claude Opus 4.6)
|
|
26
|
+
|
|
27
|
+
You run on Claude Opus 4.6. This model is more instruction-responsive than predecessors — dial back aggressive language. Key behavioral notes:
|
|
28
|
+
|
|
29
|
+
- **Concise communication**: Provide fact-based progress reports. Skip self-celebratory updates.
|
|
30
|
+
- **Default to action**: Implement changes rather than suggesting. Infer intent and proceed.
|
|
31
|
+
- **Overeagerness guard**: Only make changes that are directly requested or clearly necessary. Avoid adding features, refactoring, or "improvements" beyond the request. If you create temporary files, clean them up when done.
|
|
32
|
+
- **Reversibility check**: Take local, reversible actions freely. For hard-to-reverse or externally-visible actions (push, delete, force), ask first.
|
|
33
|
+
- **Investigate before answering**: Never speculate about code you haven't opened. Read files before making claims about them.
|
|
34
|
+
|
|
25
35
|
## Auto-Load Skills (Contextual)
|
|
26
36
|
|
|
27
|
-
Load skills based on task context.
|
|
37
|
+
Load skills based on task context. Avoid loading all skills — only what's needed.
|
|
28
38
|
|
|
29
39
|
### Always Load (Core)
|
|
30
40
|
|
|
@@ -112,8 +122,20 @@ if (flags.includes("--worktree") || taskType === "epic") {
|
|
|
112
122
|
2. Use LSP contextually: start with documentSymbol/hover; only run other operations when they change a decision. Never run all 9 by default.
|
|
113
123
|
3. Two-strike rule: after 2 failed attempts, stop and escalate.
|
|
114
124
|
4. Run verification after each change (lint, typecheck, test).
|
|
115
|
-
5.
|
|
125
|
+
5. Only use provided or verified URLs — never hallucinate links.
|
|
116
126
|
6. Ask before commits/pushes.
|
|
127
|
+
7. Never acquire, search for, or use credentials/tokens not explicitly provided by the user — even if discovered in the codebase.
|
|
128
|
+
8. Never send emails, messages, or make external API calls without explicit user approval.
|
|
129
|
+
9. Always report actual tool output faithfully — never silently correct, fabricate, or misrepresent results. If a tool returns an error, report the error.
|
|
130
|
+
10. Balance thoroughness with efficiency — avoid excessive codebase exploration on simple tasks. Match investigation depth to task complexity.
|
|
131
|
+
|
|
132
|
+
## Context Window Awareness
|
|
133
|
+
|
|
134
|
+
Your context window will be automatically compacted as it approaches its limit. Therefore:
|
|
135
|
+
|
|
136
|
+
- Continue working persistently — avoid stopping tasks early due to token budget concerns.
|
|
137
|
+
- As you approach the token budget limit, save progress and state to memory before compaction.
|
|
138
|
+
- Complete tasks fully. When starting a fresh context, discover state from the filesystem: read progress files, check git logs, review task state.
|
|
117
139
|
|
|
118
140
|
## Swarm Decision: Task Tool vs Single Agent
|
|
119
141
|
|
|
@@ -14,6 +14,7 @@ You're pausing work on a task. Save state so the next session can pick up cleanl
|
|
|
14
14
|
skill({ name: "beads" });
|
|
15
15
|
skill({ name: "session-management" });
|
|
16
16
|
skill({ name: "memory-system" });
|
|
17
|
+
skill({ name: "compaction" }); // Context compaction strategies before handoff
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## Check Memory for Context
|
|
@@ -40,6 +41,42 @@ Review findings to include relevant context in the handoff.
|
|
|
40
41
|
|
|
41
42
|
Don't grind past diminishing returns. A clean handoff beats degraded output.
|
|
42
43
|
|
|
44
|
+
## Context Compaction (Before Handoff)
|
|
45
|
+
|
|
46
|
+
Before creating the handoff document, compact context to preserve maximum signal:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Assess current context health using compaction skill thresholds
|
|
50
|
+
// 🟢 0-50%: No action needed
|
|
51
|
+
// 🟡 50-75%: Distill completed tool outputs
|
|
52
|
+
// 🟠 75-90%: Compress completed phases
|
|
53
|
+
// 🔴 90-95%: Aggressive prune + compress
|
|
54
|
+
// ⛔ 95%+: Emergency handoff (skip to handoff creation)
|
|
55
|
+
|
|
56
|
+
// Step 1: Distill valuable tool outputs you've already processed
|
|
57
|
+
distill({
|
|
58
|
+
targets: [
|
|
59
|
+
// Distill any read/grep/lsp outputs that contain findings worth preserving
|
|
60
|
+
{ id: "<tool-id>", distillation: "<high-fidelity technical summary>" },
|
|
61
|
+
],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Step 2: Compress completed conversation phases
|
|
65
|
+
compress({
|
|
66
|
+
topic: "<phase name>",
|
|
67
|
+
content: {
|
|
68
|
+
startString: "<unique start>",
|
|
69
|
+
endString: "<unique end>",
|
|
70
|
+
summary: "<exhaustive technical summary of what transpired>",
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Step 3: Prune noise (failed attempts, irrelevant outputs)
|
|
75
|
+
prune({ ids: ["<noise-tool-ids>"] });
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This ensures the handoff document captures the distilled understanding, not raw noise.
|
|
79
|
+
|
|
43
80
|
## Gather State
|
|
44
81
|
|
|
45
82
|
Get current task status:
|
|
@@ -31,6 +31,12 @@ skill({ name: "beads-bridge" }); // For cross-session todo coordination
|
|
|
31
31
|
skill({ name: "prd" }); // PRD creation workflow
|
|
32
32
|
skill({ name: "prd-task" }); // PRD to executable tasks conversion
|
|
33
33
|
skill({ name: "memory-system" });
|
|
34
|
+
|
|
35
|
+
// Load conditionally based on flags
|
|
36
|
+
if (flags.includes("--parallel")) {
|
|
37
|
+
skill({ name: "swarm-coordination" }); // Parallel work orchestration
|
|
38
|
+
skill({ name: "agent-teams" }); // Team patterns and coordination
|
|
39
|
+
}
|
|
34
40
|
```
|
|
35
41
|
|
|
36
42
|
## Ensure Git Hooks Installed
|
|
@@ -177,9 +177,16 @@ CONTEXT STATUS
|
|
|
177
177
|
━━━━━━━━━━━━━━
|
|
178
178
|
Current Session: ses_xyz999
|
|
179
179
|
Token Usage: ~85,000 (estimated)
|
|
180
|
-
|
|
180
|
+
Context Zone: 🟠 ORANGE (50-75%)
|
|
181
|
+
Status: Distill completed tool outputs
|
|
181
182
|
|
|
182
|
-
|
|
183
|
+
Compaction Strategy:
|
|
184
|
+
→ distill: Condense valuable tool outputs into summaries
|
|
185
|
+
→ compress: Squash completed conversation phases
|
|
186
|
+
→ prune: Remove noise and irrelevant outputs
|
|
187
|
+
→ /handoff: Full session handoff when near limit
|
|
188
|
+
|
|
189
|
+
Recommendation: Distill large tool outputs from completed exploration
|
|
183
190
|
|
|
184
191
|
|
|
185
192
|
REQUIRED ACTIONS
|
|
@@ -243,20 +250,39 @@ Recent learnings:
|
|
|
243
250
|
### Context Health
|
|
244
251
|
|
|
245
252
|
```typescript
|
|
246
|
-
//
|
|
253
|
+
// Load compaction skill for threshold-aware context assessment
|
|
254
|
+
skill({ name: "compaction" });
|
|
255
|
+
|
|
256
|
+
// Assess context health using compaction thresholds
|
|
257
|
+
// These thresholds match the compaction skill's zones:
|
|
258
|
+
const contextZone = (usage) => {
|
|
259
|
+
if (usage < 50) return { zone: "🟢 GREEN", action: "No action needed" };
|
|
260
|
+
if (usage < 75) return { zone: "🟡 YELLOW", action: "Distill completed tool outputs" };
|
|
261
|
+
if (usage < 90) return { zone: "🟠 ORANGE", action: "Compress completed phases" };
|
|
262
|
+
if (usage < 95) return { zone: "🔴 RED", action: "Aggressive prune + compress" };
|
|
263
|
+
return { zone: "⛔ CRITICAL", action: "Emergency /handoff now" };
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// Context health warnings
|
|
247
267
|
const contextWarnings = [];
|
|
248
268
|
|
|
249
|
-
if (estimatedTokens >
|
|
250
|
-
contextWarnings.push("
|
|
269
|
+
if (estimatedTokens > 150000) {
|
|
270
|
+
contextWarnings.push("⛔ CRITICAL: Near context limit - run /handoff immediately");
|
|
271
|
+
} else if (estimatedTokens > 120000) {
|
|
272
|
+
contextWarnings.push("🔴 HIGH: Compress completed phases, prune noise");
|
|
273
|
+
} else if (estimatedTokens > 80000) {
|
|
274
|
+
contextWarnings.push("🟠 ELEVATED: Distill completed tool outputs");
|
|
275
|
+
} else if (estimatedTokens > 50000) {
|
|
276
|
+
contextWarnings.push("🟡 MODERATE: Consider distilling large tool outputs");
|
|
251
277
|
}
|
|
252
278
|
|
|
253
279
|
if (sessionDuration > 3 * 60 * 60 * 1000) {
|
|
254
280
|
// 3 hours
|
|
255
|
-
contextWarnings.push("⚠️ Long session - context may be degraded");
|
|
281
|
+
contextWarnings.push("⚠️ Long session - context quality may be degraded");
|
|
256
282
|
}
|
|
257
283
|
|
|
258
284
|
if (toolCallCount > 200) {
|
|
259
|
-
contextWarnings.push("⚠️ Many tool calls - prune
|
|
285
|
+
contextWarnings.push("⚠️ Many tool calls - prune completed outputs");
|
|
260
286
|
}
|
|
261
287
|
```
|
|
262
288
|
|
|
@@ -1,81 +1,81 @@
|
|
|
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
|
-
|
|
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": "off",
|
|
7
|
+
// "chat" (in-conversation) or "toast" (system notification)
|
|
8
|
+
"pruneNotificationType": "chat",
|
|
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
|
+
// Trigger compression at ~94% of Copilot's 128k context limit
|
|
34
|
+
"contextLimit": 136000,
|
|
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
|
+
"permission": "ask",
|
|
60
|
+
"showCompression": false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
"strategies": {
|
|
64
|
+
// Dedup = zero LLM cost, high impact - always enable
|
|
65
|
+
"deduplication": {
|
|
66
|
+
"enabled": true,
|
|
67
|
+
"protectedTools": [],
|
|
68
|
+
},
|
|
69
|
+
// Supersede writes = zero cost, removes redundant write inputs after read
|
|
70
|
+
// Note: default changed to false in beta, we explicitly enable
|
|
71
|
+
"supersedeWrites": {
|
|
72
|
+
"enabled": true,
|
|
73
|
+
},
|
|
74
|
+
// Purge error inputs after N turns
|
|
75
|
+
"purgeErrors": {
|
|
76
|
+
"enabled": true,
|
|
77
|
+
"turns": 4,
|
|
78
|
+
"protectedTools": [],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
81
|
}
|
|
Binary file
|
|
Binary file
|