opencodekit 0.16.4 → 0.16.6
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 +106 -384
- package/dist/template/.opencode/README.md +170 -104
- package/dist/template/.opencode/agent/build.md +39 -32
- package/dist/template/.opencode/agent/explore.md +2 -0
- package/dist/template/.opencode/agent/review.md +3 -0
- package/dist/template/.opencode/agent/scout.md +22 -11
- package/dist/template/.opencode/command/create.md +164 -106
- package/dist/template/.opencode/command/design.md +5 -1
- package/dist/template/.opencode/command/handoff.md +6 -4
- package/dist/template/.opencode/command/init.md +1 -1
- package/dist/template/.opencode/command/plan.md +26 -23
- package/dist/template/.opencode/command/research.md +13 -6
- package/dist/template/.opencode/command/resume.md +8 -6
- package/dist/template/.opencode/command/ship.md +1 -1
- package/dist/template/.opencode/command/start.md +30 -25
- package/dist/template/.opencode/command/status.md +9 -42
- package/dist/template/.opencode/command/verify.md +11 -11
- package/dist/template/.opencode/memory/README.md +67 -37
- package/dist/template/.opencode/memory/_templates/prd.md +102 -18
- package/dist/template/.opencode/memory/project/gotchas.md +31 -0
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +0 -10
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/skill/beads/SKILL.md +164 -380
- package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +23 -22
- package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +23 -29
- package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +5 -8
- package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +43 -39
- package/dist/template/.opencode/skill/beads-bridge/SKILL.md +80 -53
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +19 -5
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +30 -63
- package/dist/template/.opencode/skill/context-management/SKILL.md +115 -0
- package/dist/template/.opencode/skill/deep-research/SKILL.md +4 -4
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +305 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +3 -3
- package/dist/template/.opencode/skill/prd/SKILL.md +47 -122
- package/dist/template/.opencode/skill/prd-task/SKILL.md +48 -4
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +120 -24
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +79 -61
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +31 -22
- package/dist/template/.opencode/tool/context7.ts +183 -0
- package/dist/template/.opencode/tool/memory-admin.ts +445 -0
- package/dist/template/.opencode/tool/swarm.ts +572 -0
- package/package.json +1 -1
- package/dist/template/.opencode/memory/_templates/spec.md +0 -66
- package/dist/template/.opencode/tool/beads-sync.ts +0 -657
- package/dist/template/.opencode/tool/context7-query-docs.ts +0 -89
- package/dist/template/.opencode/tool/context7-resolve-library-id.ts +0 -113
- package/dist/template/.opencode/tool/memory-maintain.ts +0 -167
- package/dist/template/.opencode/tool/memory-migrate.ts +0 -319
- package/dist/template/.opencode/tool/swarm-delegate.ts +0 -180
- package/dist/template/.opencode/tool/swarm-monitor.ts +0 -388
- package/dist/template/.opencode/tool/swarm-plan.ts +0 -697
|
@@ -37,18 +37,102 @@ opencode
|
|
|
37
37
|
├── .env.example # Environment variables template (COPY TO .env)
|
|
38
38
|
├── README.md # This file
|
|
39
39
|
├── opencode.json # OpenCode configuration
|
|
40
|
+
├── dcp.jsonc # DCP plugin configuration (context pruning)
|
|
40
41
|
├── AGENTS.md # Global agent rules
|
|
41
42
|
│
|
|
42
|
-
├── agent/ # Custom agents (
|
|
43
|
-
├── command/ # Custom commands (
|
|
44
|
-
├── skill/ # Domain expertise (
|
|
45
|
-
├── tool/ # Custom MCP tools (memory-*, observation)
|
|
46
|
-
├── plugin/ # Background plugins (
|
|
43
|
+
├── agent/ # Custom agents (9 total)
|
|
44
|
+
├── command/ # Custom commands (14 workflows)
|
|
45
|
+
├── skill/ # Domain expertise (10 skills)
|
|
46
|
+
├── tool/ # Custom MCP tools (memory-*, observation, swarm-*)
|
|
47
|
+
├── plugin/ # Background plugins (memory, sessions, lsp, truncator)
|
|
47
48
|
└── memory/ # Persistent context
|
|
48
49
|
```
|
|
49
50
|
|
|
50
51
|
---
|
|
51
52
|
|
|
53
|
+
## Context Management: DCP Plugin (Beta)
|
|
54
|
+
|
|
55
|
+
This kit uses **Dynamic Context Pruning (DCP)** plugin for intelligent context management.
|
|
56
|
+
|
|
57
|
+
### Why DCP?
|
|
58
|
+
|
|
59
|
+
- **AI-driven pruning**: `prune`, `distill`, and `compress` tools let the AI decide what to remove
|
|
60
|
+
- **Zero-cost strategies**: Deduplication, supersede writes, and error purging run automatically
|
|
61
|
+
- **Turn protection**: Prevents premature pruning of recent tool outputs
|
|
62
|
+
- **File protection**: Critical config files are never auto-pruned
|
|
63
|
+
|
|
64
|
+
### Configuration
|
|
65
|
+
|
|
66
|
+
DCP is configured via `.opencode/dcp.jsonc`:
|
|
67
|
+
|
|
68
|
+
```jsonc
|
|
69
|
+
{
|
|
70
|
+
"enabled": true,
|
|
71
|
+
"pruneNotification": "off", // "minimal" or "detailed" for visibility
|
|
72
|
+
"turnProtection": {
|
|
73
|
+
"enabled": true,
|
|
74
|
+
"turns": 4, // Protect tool outputs for 4 turns
|
|
75
|
+
},
|
|
76
|
+
"tools": {
|
|
77
|
+
"prune": { "enabled": true }, // Remove noise without preservation
|
|
78
|
+
"distill": { "enabled": true }, // Extract key findings before removing
|
|
79
|
+
"compress": { "enabled": true }, // Collapse message ranges into summaries
|
|
80
|
+
},
|
|
81
|
+
"strategies": {
|
|
82
|
+
"deduplication": { "enabled": true }, // Remove duplicate reads
|
|
83
|
+
"supersedeWrites": { "enabled": true }, // Prune write inputs after read
|
|
84
|
+
"purgeErrors": { "enabled": true, "turns": 4 }, // Remove error inputs
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### DCP Commands
|
|
90
|
+
|
|
91
|
+
- `/dcp` - Show available DCP commands
|
|
92
|
+
- `/dcp context` - Token usage breakdown by category
|
|
93
|
+
- `/dcp stats` - Cumulative pruning statistics
|
|
94
|
+
- `/dcp sweep` - Prune all tools since last user message
|
|
95
|
+
- `/dcp sweep 10` - Prune last 10 tools
|
|
96
|
+
|
|
97
|
+
### How It Works With OpenCode's Built-in Compaction
|
|
98
|
+
|
|
99
|
+
OpenCode has internal compaction (not user-configurable via `opencode.json`):
|
|
100
|
+
|
|
101
|
+
- **Built-in prune**: FIFO removal when context exceeds thresholds
|
|
102
|
+
- **PRUNE_PROTECT = 40,000** tokens - Always keeps last 40K of tool outputs
|
|
103
|
+
- **PRUNE_MINIMUM = 20,000** tokens - Only prunes if >20K tokens can be saved
|
|
104
|
+
- **Protected tools**: `skill` outputs are never pruned
|
|
105
|
+
|
|
106
|
+
**DCP complements this** by adding AI-driven, strategic pruning on top:
|
|
107
|
+
|
|
108
|
+
| System | Role |
|
|
109
|
+
| --------------------- | ---------------------------------------- |
|
|
110
|
+
| **DCP tools** | Active management (AI decides what/when) |
|
|
111
|
+
| **OpenCode built-in** | Passive safety net (automatic FIFO) |
|
|
112
|
+
|
|
113
|
+
> **Note**: The `compaction` key is NOT in the official OpenCode config schema.
|
|
114
|
+
> Built-in compaction behavior is controlled internally, not via user config.
|
|
115
|
+
|
|
116
|
+
### Protected Files
|
|
117
|
+
|
|
118
|
+
These patterns are never auto-pruned (configured in `dcp.jsonc`):
|
|
119
|
+
|
|
120
|
+
- `**/.env*` - Environment files
|
|
121
|
+
- `**/AGENTS.md` - Agent rules
|
|
122
|
+
- `**/.opencode/**` - OpenCode config
|
|
123
|
+
- `**/.beads/**` - Task tracking
|
|
124
|
+
- `**/package.json`, `**/tsconfig.json`, `**/biome.json` - Project config
|
|
125
|
+
|
|
126
|
+
### Cache Hit Trade-off
|
|
127
|
+
|
|
128
|
+
DCP modifies message content before sending to LLMs, which affects prompt caching:
|
|
129
|
+
|
|
130
|
+
- ~65% cache hit rate with DCP vs ~85% without
|
|
131
|
+
- Token savings typically outweigh cache miss cost in long sessions
|
|
132
|
+
- **Best for**: GitHub Copilot, Google Antigravity (request-based pricing)
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
52
136
|
## Required Environment Variables
|
|
53
137
|
|
|
54
138
|
**Minimum setup (.opencode/.env):**
|
|
@@ -84,48 +168,51 @@ GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
|
|
|
84
168
|
|
|
85
169
|
---
|
|
86
170
|
|
|
87
|
-
## Agent System (
|
|
171
|
+
## Agent System (9 Custom Agents)
|
|
88
172
|
|
|
89
173
|
**Primary Agents:**
|
|
90
174
|
|
|
91
|
-
- **@build** - Main orchestrator (
|
|
92
|
-
- **@
|
|
175
|
+
- **@build** - Main orchestrator (Kimi K2.5) - handles 70% of work
|
|
176
|
+
- **@plan** - Architecture, multi-phase coordination
|
|
93
177
|
|
|
94
|
-
**Subagents:**
|
|
178
|
+
**Specialist Subagents:**
|
|
95
179
|
|
|
96
|
-
- **@
|
|
180
|
+
- **@general** - Fast subagent for small, well-defined tasks
|
|
181
|
+
- **@explore** - Fast codebase search specialist
|
|
97
182
|
- **@scout** - External research (library docs + GitHub patterns)
|
|
98
183
|
- **@review** - Code review + debugging + security audit
|
|
99
|
-
- **@vision** - UI/UX design: mockup, UI review, accessibility, aesthetics
|
|
100
|
-
|
|
101
|
-
**
|
|
102
|
-
|
|
103
|
-
- **@explore** - Fast codebase search
|
|
104
|
-
- **@general** - Simple tasks and fallback
|
|
184
|
+
- **@vision** - UI/UX design: mockup, UI review, accessibility, aesthetics
|
|
185
|
+
- **@looker** - Media extraction (images, PDFs, diagrams via OCR)
|
|
186
|
+
- **@painter** - Image generation and editing (mockups, icons, assets)
|
|
105
187
|
|
|
106
188
|
---
|
|
107
189
|
|
|
108
|
-
## Custom Commands (
|
|
190
|
+
## Custom Commands (14 workflows)
|
|
109
191
|
|
|
110
192
|
**Invoke with `/` prefix:**
|
|
111
193
|
|
|
112
|
-
- `/
|
|
194
|
+
- `/ship` - Ship code with verification
|
|
195
|
+
- `/plan` - Create execution plan
|
|
196
|
+
- `/start` - Start new work session
|
|
197
|
+
- `/resume` - Resume from handoff
|
|
198
|
+
- `/handoff` - Create session handoff
|
|
199
|
+
- `/status` - Check project status
|
|
113
200
|
- `/pr` - Create pull requests
|
|
114
|
-
- `/
|
|
115
|
-
- `/
|
|
116
|
-
- `/
|
|
117
|
-
- `/
|
|
201
|
+
- `/review-codebase` - Full codebase review
|
|
202
|
+
- `/research` - External research task
|
|
203
|
+
- `/design` - Thoughtful design with brainstorming
|
|
204
|
+
- `/ui-review` - UI/UX review
|
|
205
|
+
- `/create` - Create new component/feature
|
|
206
|
+
- `/init` - Initialize project
|
|
207
|
+
- `/verify` - Verify changes
|
|
118
208
|
|
|
119
209
|
**See:** `.opencode/command/` for all commands
|
|
120
210
|
|
|
121
211
|
---
|
|
122
212
|
|
|
123
|
-
## Skills System (
|
|
213
|
+
## Skills System (10 skills)
|
|
124
214
|
|
|
125
|
-
**Core:**
|
|
126
|
-
**Code:** requesting-code-review, receiving-code-review, root-cause-tracing, test-driven-development, testing-anti-patterns, condition-based-waiting, defense-in-depth, systematic-debugging
|
|
127
|
-
**UI/UX:** frontend-design, mockup-to-code, visual-analysis, ui-ux-research, accessibility-audit, design-system-audit
|
|
128
|
-
**Workflow:** gemini-large-context, subagent-driven-development, dispatching-parallel-agents, using-git-worktrees, sharing-skills, writing-skills, testing-skills-with-subagents
|
|
215
|
+
**Core:** beads-bridge, defense-in-depth, mockup-to-code, playwriter, resend, session-management, subagent-driven-development, vercel-deploy-claimable, verification-before-completion, writing-skills
|
|
129
216
|
|
|
130
217
|
**Note:** Skills load via native `skill()` tool. Commands auto-load relevant expertise.
|
|
131
218
|
|
|
@@ -138,80 +225,67 @@ Memory (Permanent) → Beads (Multi-session) → Git (Audit Trail)
|
|
|
138
225
|
.opencode/memory/ .beads/artifacts/ .git/
|
|
139
226
|
```
|
|
140
227
|
|
|
141
|
-
**Memory:** Permanent knowledge, decisions, learnings
|
|
142
|
-
**Beads:** Multi-session tasks with spec/research/plan/review artifacts
|
|
228
|
+
**Memory:** Permanent knowledge, decisions, learnings (SQLite + FTS5)
|
|
229
|
+
**Beads:** Multi-session tasks with spec/research/plan/review artifacts
|
|
143
230
|
**Git:** Automatic execution history
|
|
144
231
|
|
|
145
232
|
**See:** `AGENTS.md` for global rules and tool priority
|
|
146
233
|
|
|
147
234
|
---
|
|
148
235
|
|
|
149
|
-
## Active Plugins (Background)
|
|
150
|
-
|
|
151
|
-
Plugins run automatically in every session:
|
|
152
|
-
|
|
153
|
-
- **enforcer** - OS notification when session idles with incomplete TODOs
|
|
154
|
-
- **compactor** - Warns at 70%, 85%, 95% context usage - prevents rushed work
|
|
155
|
-
- **truncator** - Dynamic output truncation based on context remaining
|
|
156
|
-
|
|
157
|
-
**Compactor thresholds**:
|
|
158
|
-
|
|
159
|
-
- 70% - Gentle reminder, still plenty of room
|
|
160
|
-
- 85% - Consider pruning or summarizing
|
|
161
|
-
- 95% - Critical: prune immediately or start new session
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
236
|
## Custom Tools
|
|
166
237
|
|
|
238
|
+
### Memory Tools
|
|
239
|
+
|
|
167
240
|
- **memory-read** - Load previous context, templates
|
|
168
241
|
- **memory-update** - Save learnings, handoffs
|
|
169
|
-
- **memory-search** -
|
|
242
|
+
- **memory-search** - FTS5 full-text search across observations
|
|
243
|
+
- **memory-get** - Get full observation details by ID
|
|
244
|
+
- **memory-timeline** - Chronological context around anchor
|
|
245
|
+
- **memory-admin** - Database administration (maintenance, migration)
|
|
170
246
|
- **observation** - Create structured observations (decision, bugfix, feature, etc.)
|
|
171
247
|
|
|
172
|
-
|
|
248
|
+
### Swarm Tool
|
|
249
|
+
|
|
250
|
+
- **swarm** - Unified swarm coordination with operations:
|
|
251
|
+
- `plan`: Task analysis with Kimi K2.5 PARL patterns
|
|
252
|
+
- `delegate`: Create delegation packets for workers
|
|
253
|
+
- `monitor`: Progress tracking for parallel tasks
|
|
254
|
+
- `sync`: Beads ↔ OpenCode todos synchronization
|
|
173
255
|
|
|
174
|
-
###
|
|
256
|
+
### External Tools
|
|
257
|
+
|
|
258
|
+
- **context7** - Library documentation lookup (resolve + query operations)
|
|
259
|
+
- **grepsearch** - Search GitHub repos via grep.app
|
|
175
260
|
|
|
176
261
|
---
|
|
177
262
|
|
|
178
263
|
## MCP Services
|
|
179
264
|
|
|
180
|
-
**Enabled by default
|
|
265
|
+
**Enabled by default:**
|
|
181
266
|
|
|
182
267
|
1. **context7** - Up-to-date library documentation (37.6k+ libraries)
|
|
183
|
-
- Native
|
|
184
|
-
-
|
|
185
|
-
- Step 1: Resolve library name → `/libraryId`
|
|
268
|
+
- Native tool: `context7({ operation: "resolve"|"query" })`
|
|
269
|
+
- Step 1: Resolve library name → libraryId
|
|
186
270
|
- Step 2: Query docs with the libraryId
|
|
187
271
|
|
|
188
|
-
2. **
|
|
189
|
-
- Requires: EXA_API_KEY
|
|
190
|
-
- GitHub: https://github.com/exa-labs/exa-mcp-server
|
|
191
|
-
|
|
192
|
-
3. **grepsearch** - Search 1M+ public GitHub repositories via grep.app
|
|
272
|
+
2. **grepsearch** - Search 1M+ public GitHub repositories via grep.app
|
|
193
273
|
- Native tool: `grepsearch({ query: "...", language: [...] })`
|
|
194
274
|
- No API key needed (public service)
|
|
195
|
-
- Direct HTTP wrapper (no MCP overhead)
|
|
196
275
|
|
|
197
276
|
**Skill-Embedded MCP (load on-demand):**
|
|
198
277
|
|
|
199
|
-
|
|
278
|
+
3. **figma** - Extract Figma layouts and design tokens
|
|
200
279
|
- Requires: FIGMA_API_KEY
|
|
201
280
|
- Use: `skill({ name: "figma" })` then `skill_mcp()`
|
|
202
281
|
|
|
203
|
-
|
|
282
|
+
4. **playwright** - Browser automation for testing
|
|
204
283
|
- No API key needed
|
|
205
284
|
- Use: `skill({ name: "playwright" })` then `skill_mcp()`
|
|
206
285
|
|
|
207
|
-
|
|
208
|
-
- No API key needed
|
|
209
|
-
- Use: `skill({ name: "chrome-devtools" })` then `skill_mcp()`
|
|
210
|
-
|
|
211
|
-
7. **stitch** - Google Stitch AI-powered UI design generation
|
|
286
|
+
5. **stitch** - Google Stitch AI-powered UI design generation
|
|
212
287
|
- Requires: Google Cloud project with Stitch API enabled
|
|
213
|
-
-
|
|
214
|
-
- See: [Stitch MCP Setup](#stitch-mcp-setup) below
|
|
288
|
+
- Currently disabled in config (set `enabled: true` to activate)
|
|
215
289
|
|
|
216
290
|
---
|
|
217
291
|
|
|
@@ -261,14 +335,17 @@ GOOGLE_CLOUD_PROJECT=your-project-id
|
|
|
261
335
|
STITCH_ACCESS_TOKEN=$(gcloud auth print-access-token)
|
|
262
336
|
```
|
|
263
337
|
|
|
264
|
-
**Step 4:
|
|
338
|
+
**Step 4: Enable in Config**
|
|
265
339
|
|
|
266
|
-
|
|
340
|
+
Set `enabled: true` for stitch in `opencode.json`:
|
|
267
341
|
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
342
|
+
```jsonc
|
|
343
|
+
"mcp": {
|
|
344
|
+
"stitch": {
|
|
345
|
+
"enabled": true,
|
|
346
|
+
...
|
|
347
|
+
}
|
|
348
|
+
}
|
|
272
349
|
```
|
|
273
350
|
|
|
274
351
|
### Available Stitch Tools
|
|
@@ -282,19 +359,6 @@ stitch_create_project --title "My App"
|
|
|
282
359
|
| `stitch_get_screen` | Get screen details with HTML code |
|
|
283
360
|
| `stitch_generate_screen_from_text` | Generate UI from text prompt |
|
|
284
361
|
|
|
285
|
-
### Example Usage
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
# Create a new project
|
|
289
|
-
stitch_create_project --title "E-commerce App"
|
|
290
|
-
|
|
291
|
-
# Generate a login screen
|
|
292
|
-
stitch_generate_screen_from_text \
|
|
293
|
-
--projectId "PROJECT_ID" \
|
|
294
|
-
--prompt "Create a modern login page with email and password fields, social login buttons, and a forgot password link" \
|
|
295
|
-
--deviceType "MOBILE"
|
|
296
|
-
```
|
|
297
|
-
|
|
298
362
|
### Troubleshooting
|
|
299
363
|
|
|
300
364
|
**"Stitch API not enabled":**
|
|
@@ -311,19 +375,6 @@ export STITCH_ACCESS_TOKEN=$(gcloud auth print-access-token)
|
|
|
311
375
|
# Restart OpenCode
|
|
312
376
|
```
|
|
313
377
|
|
|
314
|
-
**"Project not set":**
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
gcloud config set project YOUR_PROJECT_ID
|
|
318
|
-
export GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
### Documentation
|
|
322
|
-
|
|
323
|
-
- [Google Stitch](https://stitch.withgoogle.com)
|
|
324
|
-
- [Stitch MCP Setup](https://stitch.withgoogle.com/docs/mcp/setup)
|
|
325
|
-
- [Google Cloud MCP Overview](https://docs.cloud.google.com/mcp/overview)
|
|
326
|
-
|
|
327
378
|
---
|
|
328
379
|
|
|
329
380
|
## Getting Started Examples
|
|
@@ -401,6 +452,13 @@ fi
|
|
|
401
452
|
- Use /fix to load systematic-debugging
|
|
402
453
|
- Check `.opencode/skill/` directory exists
|
|
403
454
|
|
|
455
|
+
**"Context growing too fast":**
|
|
456
|
+
|
|
457
|
+
- Run `/dcp context` to see token breakdown
|
|
458
|
+
- Run `/dcp sweep` to prune recent tool outputs
|
|
459
|
+
- Use `distill` tool to preserve key info while removing raw outputs
|
|
460
|
+
- DCP handles active pruning; OpenCode's built-in handles passive FIFO
|
|
461
|
+
|
|
404
462
|
---
|
|
405
463
|
|
|
406
464
|
## Best Practices
|
|
@@ -412,6 +470,13 @@ fi
|
|
|
412
470
|
- Never commit .env files
|
|
413
471
|
- Rotate API keys regularly
|
|
414
472
|
|
|
473
|
+
**Context Management (DCP):**
|
|
474
|
+
|
|
475
|
+
- Use `/dcp context` to monitor token usage
|
|
476
|
+
- Use `/dcp sweep` before starting new phases
|
|
477
|
+
- Let DCP handle active pruning (turn protection prevents premature removal)
|
|
478
|
+
- OpenCode's built-in compaction runs automatically as a safety net
|
|
479
|
+
|
|
415
480
|
**Memory:**
|
|
416
481
|
|
|
417
482
|
- Update memory after major phases
|
|
@@ -432,6 +497,7 @@ fi
|
|
|
432
497
|
## Resources
|
|
433
498
|
|
|
434
499
|
- **OpenCode Docs:** https://opencode.ai/docs
|
|
500
|
+
- **DCP Plugin:** https://github.com/Opencode-DCP/opencode-dynamic-context-pruning
|
|
435
501
|
- **Context7 API:** https://context7.com
|
|
436
502
|
- **Exa API:** https://exa.ai
|
|
437
503
|
- **Skills Documentation:** `.opencode/skill/`
|
|
@@ -439,8 +505,8 @@ fi
|
|
|
439
505
|
|
|
440
506
|
---
|
|
441
507
|
|
|
442
|
-
**OpenCodeKit v0.15.7**
|
|
443
|
-
**Architecture:** Two-Layer (Memory + Beads + Git)
|
|
444
|
-
**
|
|
445
|
-
**Package:** `npx opencodekit` to scaffold new projects
|
|
446
|
-
**Last Updated:**
|
|
508
|
+
**OpenCodeKit v0.15.7**
|
|
509
|
+
**Architecture:** Two-Layer (Memory + Beads + Git)
|
|
510
|
+
**Context Management:** DCP Plugin (Beta) - AI-driven pruning
|
|
511
|
+
**Package:** `npx opencodekit` to scaffold new projects
|
|
512
|
+
**Last Updated:** February 4, 2026
|
|
@@ -43,8 +43,12 @@ if (artifacts.includes("prd.md")) {
|
|
|
43
43
|
skill({ name: "prd-task" }); // PRD execution
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
if (
|
|
47
|
-
skill({ name: "prd" }); //
|
|
46
|
+
if (artifacts.includes("design.md") && !artifacts.includes("prd.md")) {
|
|
47
|
+
skill({ name: "prd" }); // Design done, need PRD
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!artifacts.includes("design.md") && !artifacts.includes("prd.md") && taskType === "feature") {
|
|
51
|
+
skill({ name: "development-lifecycle" }); // Full lifecycle for new features
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
if (artifacts.includes("plan.md")) {
|
|
@@ -87,19 +91,20 @@ if (flags.includes("--worktree") || taskType === "epic") {
|
|
|
87
91
|
|
|
88
92
|
### Skill Loading Decision Table
|
|
89
93
|
|
|
90
|
-
| Context
|
|
91
|
-
|
|
|
92
|
-
| **Always**
|
|
93
|
-
| **
|
|
94
|
-
| **
|
|
95
|
-
| **Has
|
|
96
|
-
| **
|
|
97
|
-
| **
|
|
98
|
-
| **
|
|
99
|
-
| **
|
|
100
|
-
| **
|
|
101
|
-
| **
|
|
102
|
-
| **
|
|
94
|
+
| Context | Skills to Load |
|
|
95
|
+
| ------------------------------ | -------------------------------------------------- |
|
|
96
|
+
| **Always** | `beads`, `verification-before-completion` |
|
|
97
|
+
| **New feature (no artifacts)** | `development-lifecycle` |
|
|
98
|
+
| **Has design.md only** | `prd` |
|
|
99
|
+
| **Has prd.md** | `prd-task` |
|
|
100
|
+
| **Has plan.md** | `executing-plans` |
|
|
101
|
+
| **3+ parallel tasks** | `swarm-coordination`, `beads-bridge` |
|
|
102
|
+
| **Bug fix** | `systematic-debugging`, `root-cause-tracing` |
|
|
103
|
+
| **Test work** | `test-driven-development`, `testing-anti-patterns` |
|
|
104
|
+
| **Frontend/UI** | `frontend-design`, `react-best-practices` |
|
|
105
|
+
| **Epic or --worktree** | `using-git-worktrees` |
|
|
106
|
+
| **Before claiming done** | `requesting-code-review` |
|
|
107
|
+
| **Finishing branch** | `finishing-a-development-branch` |
|
|
103
108
|
|
|
104
109
|
## Critical Constraints
|
|
105
110
|
|
|
@@ -151,11 +156,12 @@ When tasks have sequential dependencies or small scope:
|
|
|
151
156
|
|
|
152
157
|
## Planning Protocol
|
|
153
158
|
|
|
154
|
-
For complex tasks, use `swarm
|
|
159
|
+
For complex tasks, use the `swarm` tool to analyze:
|
|
155
160
|
|
|
156
161
|
```typescript
|
|
157
|
-
const analysis = await
|
|
158
|
-
operation: "
|
|
162
|
+
const analysis = await swarm({
|
|
163
|
+
operation: "plan",
|
|
164
|
+
action: "analyze",
|
|
159
165
|
task: "<user's request>",
|
|
160
166
|
files: "<detected files>",
|
|
161
167
|
});
|
|
@@ -173,7 +179,8 @@ if (analysis.classification.recommended_agents > 1) {
|
|
|
173
179
|
For complex parallel work, create delegation packets:
|
|
174
180
|
|
|
175
181
|
```typescript
|
|
176
|
-
|
|
182
|
+
swarm({
|
|
183
|
+
operation: "delegate",
|
|
177
184
|
bead_id: "<bead-id>",
|
|
178
185
|
title: "<task-title>",
|
|
179
186
|
expected_outcome: "<measurable end state>",
|
|
@@ -211,8 +218,9 @@ For visibility during long-running swarms:
|
|
|
211
218
|
|
|
212
219
|
```typescript
|
|
213
220
|
// Update progress (optional - for visualization only)
|
|
214
|
-
await
|
|
215
|
-
operation: "
|
|
221
|
+
await swarm({
|
|
222
|
+
operation: "monitor",
|
|
223
|
+
action: "progress_update",
|
|
216
224
|
team_name: "<team-name>",
|
|
217
225
|
worker_id: "worker-1",
|
|
218
226
|
phase: "explore",
|
|
@@ -221,8 +229,9 @@ await swarm_monitor({
|
|
|
221
229
|
});
|
|
222
230
|
|
|
223
231
|
// Render progress UI
|
|
224
|
-
const ui = await
|
|
225
|
-
operation: "
|
|
232
|
+
const ui = await swarm({
|
|
233
|
+
operation: "monitor",
|
|
234
|
+
action: "render_block",
|
|
226
235
|
team_name: "<team-name>",
|
|
227
236
|
});
|
|
228
237
|
```
|
|
@@ -306,7 +315,7 @@ You are the primary build agent for plan execution and task coordination. You ex
|
|
|
306
315
|
|
|
307
316
|
### Phase 1: Analysis
|
|
308
317
|
|
|
309
|
-
1. Analyze task with `swarm
|
|
318
|
+
1. Analyze task with `swarm` tool if complex
|
|
310
319
|
2. Identify parallel vs sequential tasks
|
|
311
320
|
3. Create delegation packets if needed
|
|
312
321
|
|
|
@@ -329,8 +338,8 @@ You are the primary build agent for plan execution and task coordination. You ex
|
|
|
329
338
|
DECIDE: Sequential (< 3 tasks) OR Parallel (3+ independent tasks)
|
|
330
339
|
|
|
331
340
|
PARALLEL FLOW:
|
|
332
|
-
1.
|
|
333
|
-
2.
|
|
341
|
+
1. swarm({ operation: "plan", action: "analyze" }) → Get recommendations
|
|
342
|
+
2. swarm({ operation: "delegate", ... }) → Create packets (optional)
|
|
334
343
|
3. Task({ subagent_type: "...", prompt: "..." }) → Spawn workers
|
|
335
344
|
4. Wait for results (automatic)
|
|
336
345
|
5. Synthesize and verify
|
|
@@ -342,9 +351,7 @@ SINGLE FLOW:
|
|
|
342
351
|
|
|
343
352
|
## Tools Reference
|
|
344
353
|
|
|
345
|
-
| Tool
|
|
346
|
-
|
|
|
347
|
-
| **Task**
|
|
348
|
-
| **swarm
|
|
349
|
-
| **swarm-delegate** | Create delegation packets | Complex parallel work |
|
|
350
|
-
| **swarm-monitor** | Progress visualization | Optional, for long-running swarms |
|
|
354
|
+
| Tool | Purpose | When to Use |
|
|
355
|
+
| --------- | ----------------------------------- | -------------------------- |
|
|
356
|
+
| **Task** | Spawn parallel subagents | 3+ independent tasks |
|
|
357
|
+
| **swarm** | Task analysis, delegation, progress | Parallel work coordination |
|
|
@@ -9,6 +9,7 @@ tools:
|
|
|
9
9
|
bash: false
|
|
10
10
|
todowrite: false
|
|
11
11
|
memory-update: false
|
|
12
|
+
observation: false
|
|
12
13
|
question: false
|
|
13
14
|
---
|
|
14
15
|
|
|
@@ -144,6 +145,7 @@ READ-ONLY: Search, read, analyze. NEVER modify files.
|
|
|
144
145
|
NO GENERIC GREP: Use LSP first, grep for specifics only.
|
|
145
146
|
ALL PATHS ABSOLUTE: Never return relative paths.
|
|
146
147
|
CITE EVERYTHING: file:line references required.
|
|
148
|
+
NO MEMORY WRITES: Report findings to leader; leader saves observations.
|
|
147
149
|
|
|
148
150
|
Quick: 1-3 files, immediate return
|
|
149
151
|
Medium: 3-5 files, trace usage with LSP
|
|
@@ -3,6 +3,11 @@ description: External research specialist for library docs, GitHub patterns, and
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
temperature: 1.0
|
|
5
5
|
steps: 30
|
|
6
|
+
tools:
|
|
7
|
+
memory-update: false
|
|
8
|
+
observation: false
|
|
9
|
+
todowrite: false
|
|
10
|
+
question: false
|
|
6
11
|
permission:
|
|
7
12
|
write:
|
|
8
13
|
"*": deny
|
|
@@ -17,7 +22,6 @@ permission:
|
|
|
17
22
|
"git commit*": deny
|
|
18
23
|
"git reset*": deny
|
|
19
24
|
"npm publish*": deny
|
|
20
|
-
question: deny
|
|
21
25
|
---
|
|
22
26
|
|
|
23
27
|
# Scout Agent
|
|
@@ -104,7 +108,7 @@ Run 2-3 tool calls in parallel.
|
|
|
104
108
|
grepsearch({ query: "<pattern 1>" }); // No language filter = search all
|
|
105
109
|
grepsearch({ query: "<pattern 2>", language: "<relevant lang>" });
|
|
106
110
|
codesearch({ query: "<API usage>", tokensNum: 5000 });
|
|
107
|
-
|
|
111
|
+
context7({ operation: "query", libraryId: "<id>", topic: "<feature>" });
|
|
108
112
|
```
|
|
109
113
|
|
|
110
114
|
**Language selection:** Match the language to what you're researching:
|
|
@@ -152,7 +156,11 @@ skill({ name: "v1-run" });
|
|
|
152
156
|
|
|
153
157
|
```typescript
|
|
154
158
|
// Comprehensive health check (use this first)
|
|
155
|
-
skill_mcp({
|
|
159
|
+
skill_mcp({
|
|
160
|
+
skill_name: "v1-run",
|
|
161
|
+
tool_name: "get_package_health",
|
|
162
|
+
arguments: '{"name": "zod"}',
|
|
163
|
+
});
|
|
156
164
|
```
|
|
157
165
|
|
|
158
166
|
Returns: version, vulnerabilities, health score (0-100), downloads, TypeScript support, maintenance status, AI recommendation.
|
|
@@ -194,7 +202,8 @@ Use to access up-to-date library documentation (37.6k+ libraries).
|
|
|
194
202
|
**Step 1: Resolve Library ID**
|
|
195
203
|
|
|
196
204
|
```typescript
|
|
197
|
-
|
|
205
|
+
context7({
|
|
206
|
+
operation: "resolve",
|
|
198
207
|
libraryName: "react", // Required - package/library name
|
|
199
208
|
query?: "hooks composition", // Optional - search context
|
|
200
209
|
limit?: 5 // Optional - max results (default: 5)
|
|
@@ -206,7 +215,8 @@ Returns library IDs like `/facebook/react`, `/nodejs/node`, etc.
|
|
|
206
215
|
**Step 2: Query Documentation**
|
|
207
216
|
|
|
208
217
|
```typescript
|
|
209
|
-
|
|
218
|
+
context7({
|
|
219
|
+
operation: "query",
|
|
210
220
|
libraryId: "/facebook/react", // From resolve step
|
|
211
221
|
topic: "useState hook", // What you want to know
|
|
212
222
|
maxTokens?: 8000 // Optional - response size
|
|
@@ -232,19 +242,20 @@ context7_query_docs({
|
|
|
232
242
|
|
|
233
243
|
```typescript
|
|
234
244
|
// Find React docs
|
|
235
|
-
const reactId =
|
|
236
|
-
|
|
245
|
+
const reactId = context7({ operation: "resolve", libraryName: "react" });
|
|
246
|
+
context7({ operation: "query", libraryId: reactId, topic: "useEffect cleanup" });
|
|
237
247
|
|
|
238
248
|
// Find TypeScript docs
|
|
239
|
-
const tsId =
|
|
249
|
+
const tsId = context7({
|
|
250
|
+
operation: "resolve",
|
|
240
251
|
libraryName: "typescript",
|
|
241
252
|
query: "types",
|
|
242
253
|
});
|
|
243
|
-
|
|
254
|
+
context7({ operation: "query", libraryId: tsId, topic: "generic types" });
|
|
244
255
|
|
|
245
256
|
// Find Node.js docs
|
|
246
|
-
const nodeId =
|
|
247
|
-
|
|
257
|
+
const nodeId = context7({ operation: "resolve", libraryName: "nodejs" });
|
|
258
|
+
context7({ operation: "query", libraryId: nodeId, topic: "streams API" });
|
|
248
259
|
```
|
|
249
260
|
|
|
250
261
|
### Failure Handling
|