opencodekit 0.16.10 → 0.16.12

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 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.10",
762
+ version: "0.16.12",
763
763
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
764
764
  keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
765
765
  license: "MIT",
@@ -206,6 +206,8 @@ skill({ name: "context-management" });
206
206
  | Task tracking | `beads` |
207
207
  | Before claiming done | `verification-before-completion` |
208
208
  | Context growing large | `context-management` |
209
+ | Context compaction/handoff | `compaction` |
210
+ | Multi-agent team work | `agent-teams` |
209
211
  | Writing tests | `test-driven-development` |
210
212
  | Debugging | `systematic-debugging` |
211
213
  | Parallel work (3+ tasks) | `swarm-coordination` |
@@ -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
- Status: 🟡 Consider pruning soon
180
+ Context Zone: 🟠 ORANGE (50-75%)
181
+ Status: Distill completed tool outputs
181
182
 
182
- Recommendation: Prune completed tool outputs before next major task
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
- // Estimate current context usage
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 > 120000) {
250
- contextWarnings.push("⚠️ High token usage - consider new session");
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 old outputs");
285
+ contextWarnings.push("⚠️ Many tool calls - prune completed outputs");
260
286
  }
261
287
  ```
262
288
 
@@ -1,81 +1,81 @@
1
1
  {
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": 120000,
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
- }
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
  }