opencodekit 0.14.6 → 0.15.1
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/README.md +2 -2
- package/dist/index.js +435 -57
- package/dist/template/.opencode/.env.example +1 -0
- package/dist/template/.opencode/AGENTS.md +13 -24
- package/dist/template/.opencode/README.md +8 -119
- package/dist/template/.opencode/agent/explore.md +2 -3
- package/dist/template/.opencode/agent/general.md +56 -0
- package/dist/template/.opencode/agent/plan.md +54 -0
- package/dist/template/.opencode/agent/scout.md +15 -5
- package/dist/template/.opencode/command/analyze-project.md +2 -2
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/design-audit.md +4 -5
- package/dist/template/.opencode/command/design.md +4 -13
- package/dist/template/.opencode/command/generate-pattern.md +2 -9
- package/dist/template/.opencode/command/implement.md +4 -4
- package/dist/template/.opencode/command/init.md +1 -1
- package/dist/template/.opencode/command/new-feature.md +2 -3
- package/dist/template/.opencode/command/plan.md +1 -1
- package/dist/template/.opencode/command/pr.md +0 -1
- package/dist/template/.opencode/command/research.md +20 -6
- package/dist/template/.opencode/command/restore-image.md +1 -9
- package/dist/template/.opencode/command/revert-feature.md +1 -1
- package/dist/template/.opencode/command/review-codebase.md +4 -4
- package/dist/template/.opencode/command/status.md +1 -2
- package/dist/template/.opencode/command/summarize.md +1 -2
- package/dist/template/.opencode/command/triage.md +4 -32
- package/dist/template/.opencode/dcp.jsonc +68 -68
- package/dist/template/.opencode/memory/_templates/README.md +35 -0
- package/dist/template/.opencode/memory/_templates/project/architecture.md +60 -0
- package/dist/template/.opencode/memory/_templates/project/commands.md +72 -0
- package/dist/template/.opencode/memory/_templates/project/conventions.md +68 -0
- package/dist/template/.opencode/memory/_templates/project/gotchas.md +41 -0
- package/dist/template/.opencode/memory/beads-workflow.md +30 -29
- package/dist/template/.opencode/memory/project/architecture.md +31 -50
- package/dist/template/.opencode/memory/project/commands.md +41 -22
- package/dist/template/.opencode/memory/project/conventions.md +39 -177
- package/dist/template/.opencode/memory/project/gotchas.md +21 -177
- package/dist/template/.opencode/memory/user.example.md +5 -0
- package/dist/template/.opencode/opencode.json +628 -579
- package/dist/template/.opencode/package.json +18 -21
- package/dist/template/.opencode/plugin/compaction.ts +79 -85
- package/dist/template/.opencode/plugin/env-ctx.ts +19 -19
- package/dist/template/.opencode/plugin/lib/notify.ts +41 -45
- package/dist/template/.opencode/plugin/lsp.ts +197 -200
- package/dist/template/.opencode/plugin/memory.ts +14 -112
- package/dist/template/.opencode/plugin/package.json +5 -5
- package/dist/template/.opencode/plugin/sessions.ts +1 -1
- package/dist/template/.opencode/plugin/skill-mcp.ts +486 -521
- package/dist/template/.opencode/plugin/truncator.ts +47 -50
- package/dist/template/.opencode/plugin/tsconfig.json +14 -14
- package/dist/template/.opencode/skill/chrome-devtools/mcp.json +17 -17
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +17 -12
- package/dist/template/.opencode/skill/condition-based-waiting/example.ts +63 -69
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +14 -8
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +14 -3
- package/dist/template/.opencode/skill/playwright/mcp.json +14 -14
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +21 -8
- package/dist/template/.opencode/skill/requesting-code-review/review.md +14 -0
- package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +18 -4
- package/dist/template/.opencode/skill/source-code-research/SKILL.md +9 -7
- package/dist/template/.opencode/skill/test-driven-development/SKILL.md +49 -32
- package/dist/template/.opencode/skill/testing-anti-patterns/SKILL.md +40 -22
- package/dist/template/.opencode/skill/testing-skills-with-subagents/SKILL.md +46 -26
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +117 -44
- package/dist/template/.opencode/skill/v0/SKILL.md +1 -7
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +27 -19
- package/dist/template/.opencode/skill/writing-skills/anthropic-best-practices.md +171 -148
- package/dist/template/.opencode/skill/writing-skills/persuasion-principles.md +39 -6
- package/dist/template/.opencode/tool/memory-read.ts +44 -56
- package/dist/template/.opencode/tool/memory-search.ts +8 -291
- package/dist/template/.opencode/tool/memory-update.ts +47 -51
- package/dist/template/.opencode/tool/observation.ts +6 -180
- package/dist/template/.opencode/tsconfig.json +19 -19
- package/package.json +19 -15
- package/dist/template/.opencode/.background-tasks.json +0 -114
- package/dist/template/.opencode/.ralph-state.json +0 -12
- package/dist/template/.opencode/agent/build.md +0 -327
- package/dist/template/.opencode/agent/ninja.md +0 -351
- package/dist/template/.opencode/agent/planner.md +0 -281
- package/dist/template/.opencode/agent/rush.md +0 -223
- package/dist/template/.opencode/memory/handoffs/README.md +0 -83
- package/dist/template/.opencode/memory/observations/.gitkeep +0 -0
- package/dist/template/.opencode/memory/observations/2026-01-09-pattern-ampcode-mcp-json-includetools-pattern.md +0 -42
- package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/0-0d25ba80-ba3b-4209-9046-b45d6093b4da.txn +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/1.manifest +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/data/1111100101010101011010004a9ef34df6b29f36a9a53a2892.lance +0 -0
- package/dist/template/.opencode/tool/ast-grep.ts +0 -245
- package/dist/template/.opencode/tool/background.ts +0 -509
- package/dist/template/.opencode/tool/bd-inbox.ts +0 -110
- package/dist/template/.opencode/tool/bd-msg.ts +0 -62
- package/dist/template/.opencode/tool/bd-release.ts +0 -71
- package/dist/template/.opencode/tool/bd-reserve.ts +0 -121
- package/dist/template/.opencode/tool/memory-embed.ts +0 -183
- package/dist/template/.opencode/tool/memory-index.ts +0 -769
- package/dist/template/.opencode/tool/repo-map.ts +0 -451
|
@@ -11,6 +11,7 @@ export OPENCODE_DISABLE_PRUNE=0 # Disable potentially buggy pruning
|
|
|
11
11
|
export OPENCODE_EXPERIMENTAL_TURN_SUMMARY=1
|
|
12
12
|
export OPENCODE_ENABLE_EXPERIMENTAL_MODELS=1
|
|
13
13
|
export OPENCODE_EXPERIMENTAL_EXA=1
|
|
14
|
+
export OPENCODE_EXPERIMENTAL_OXFMT=1
|
|
14
15
|
|
|
15
16
|
# =============================================================================
|
|
16
17
|
# MCP SERVICES (Remote APIs)
|
|
@@ -14,9 +14,10 @@ Everything else is guidelines, not laws.
|
|
|
14
14
|
|
|
15
15
|
**Rule**: Before any complex tool call, ask: "Can a specialist agent do this better?"
|
|
16
16
|
|
|
17
|
+
- **Fast Tasks** → @general (small, well-defined, ≤3 files)
|
|
17
18
|
- **Search/Docs** → @explore / @scout
|
|
18
19
|
- **Review/Debug** → @review
|
|
19
|
-
- **Plan/Design** → @
|
|
20
|
+
- **Plan/Design** → @plan / @vision
|
|
20
21
|
- **Media Extraction** → @looker (images, PDFs, diagrams needing OCR/parsing)
|
|
21
22
|
|
|
22
23
|
If yes → Delegate. If no → Execute directly.
|
|
@@ -99,8 +100,8 @@ question({
|
|
|
99
100
|
- `prepareCallHierarchy` - Get call hierarchy item at position
|
|
100
101
|
- `incomingCalls` - Find what calls this function
|
|
101
102
|
- `outgoingCalls` - Find what this function calls
|
|
102
|
-
2. **Memory**: `memory-search` (Check past learnings)
|
|
103
|
-
3. **Structure**: `
|
|
103
|
+
2. **Memory**: `memory-search` (Check past learnings)
|
|
104
|
+
3. **Structure**: `lsp` (Find symbols, definitions, references)
|
|
104
105
|
4. **Search**: `grep` (Find text/TODOs)
|
|
105
106
|
5. **Files**: `glob` (Find files)
|
|
106
107
|
|
|
@@ -122,40 +123,28 @@ Violations: `read → edit` or `grep → edit` without LSP = WRONG.
|
|
|
122
123
|
|
|
123
124
|
## Beads (Task Tracking)
|
|
124
125
|
|
|
125
|
-
**Leader Only**: `build` and `
|
|
126
|
+
**Leader Only**: `build` and `plan` agents own the DB. Subagents read-only.
|
|
126
127
|
|
|
127
128
|
- **Start**: `bd ready` → `bd update <id> --status in_progress`
|
|
128
|
-
- **Work**: `bd
|
|
129
|
+
- **Work**: `bd update <id> --status in_progress` → Edit
|
|
129
130
|
- **Finish**: `bd close <id> --reason "..."` → `bd sync` → **RESTART SESSION**
|
|
130
131
|
|
|
131
132
|
## Parallel Execution
|
|
132
133
|
|
|
133
|
-
**Rule**: Fire research subagents in
|
|
134
|
+
**Rule**: Fire research subagents in parallel, continue working, collect when needed.
|
|
134
135
|
|
|
135
|
-
For complex tasks with multiple unknowns, don't wait for sequential research. Launch parallel
|
|
136
|
-
|
|
137
|
-
**Allowed agents for background delegation:**
|
|
138
|
-
|
|
139
|
-
- **Subagents**: explore, scout, review, planner, vision, looker (stateless workers)
|
|
140
|
-
- **Primary**: rush (autonomous execution)
|
|
141
|
-
- **NOT allowed**: build (build is the orchestrator that uses this tool)
|
|
136
|
+
For complex tasks with multiple unknowns, don't wait for sequential research. Launch parallel tasks using the built-in `task` tool:
|
|
142
137
|
|
|
143
138
|
```typescript
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
// Parallel Task tool calls (recommended)
|
|
140
|
+
task({ subagent_type: "explore", prompt: "Find auth patterns..." }); // → runs in parallel
|
|
141
|
+
task({ subagent_type: "scout", prompt: "Find JWT docs..." }); // → runs in parallel
|
|
147
142
|
|
|
148
143
|
// Continue with implementation work immediately...
|
|
149
|
-
|
|
150
|
-
// Collect results when needed
|
|
151
|
-
background_output({ taskId: "bg_123_abc" });
|
|
152
|
-
background_output({ taskId: "bg_456_def" });
|
|
153
|
-
|
|
154
|
-
// Cleanup at session end
|
|
155
|
-
background_cancel({ all: true });
|
|
144
|
+
// Results come back in same message (no manual collection needed)
|
|
156
145
|
```
|
|
157
146
|
|
|
158
|
-
**When to use
|
|
147
|
+
**When to use parallel execution:**
|
|
159
148
|
|
|
160
149
|
- Multiple independent research questions
|
|
161
150
|
- Complex tasks touching unfamiliar code
|
|
@@ -42,7 +42,7 @@ opencode
|
|
|
42
42
|
├── agent/ # Custom agents (5 total)
|
|
43
43
|
├── command/ # Custom commands (26 workflows)
|
|
44
44
|
├── skill/ # Domain expertise (27 skills)
|
|
45
|
-
├── tool/ # Custom MCP tools (memory-*, observation
|
|
45
|
+
├── tool/ # Custom MCP tools (memory-*, observation)
|
|
46
46
|
├── plugin/ # Background plugins (enforcer, compactor, truncator)
|
|
47
47
|
└── memory/ # Persistent context
|
|
48
48
|
```
|
|
@@ -84,11 +84,11 @@ GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
|
|
|
84
84
|
**Primary Agents:**
|
|
85
85
|
|
|
86
86
|
- **@build** - Main orchestrator (Claude Opus 4.5) - handles 70% of work
|
|
87
|
-
- **@
|
|
87
|
+
- **@general** - Fast subagent for small, well-defined tasks
|
|
88
88
|
|
|
89
89
|
**Subagents:**
|
|
90
90
|
|
|
91
|
-
- **@
|
|
91
|
+
- **@plan** - Architecture, multi-phase coordination
|
|
92
92
|
- **@scout** - External research (library docs + GitHub patterns)
|
|
93
93
|
- **@review** - Code review + debugging + security audit
|
|
94
94
|
- **@vision** - UI/UX design: mockup, UI review, accessibility, aesthetics, visual
|
|
@@ -161,124 +161,13 @@ Plugins run automatically in every session:
|
|
|
161
161
|
|
|
162
162
|
- **memory-read** - Load previous context, templates
|
|
163
163
|
- **memory-update** - Save learnings, handoffs
|
|
164
|
-
- **memory-search** - Search across all memory files (keyword
|
|
165
|
-
- **
|
|
166
|
-
- **memory-embed** - Generate embeddings using Ollama
|
|
167
|
-
- **observation** - Create structured observations (auto-embedded)
|
|
168
|
-
- **ast-grep** - Semantic code search/replace (AST-based)
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Semantic Memory Setup (Ollama)
|
|
173
|
-
|
|
174
|
-
Semantic search requires Ollama running locally. Zero API keys needed.
|
|
175
|
-
|
|
176
|
-
**Model:** `qwen3-embedding:0.6b` (639MB)
|
|
177
|
-
|
|
178
|
-
- State-of-the-art quality (MTEB #1 for 8B version)
|
|
179
|
-
- Code-aware (optimized for code retrieval)
|
|
180
|
-
- Multilingual (100+ languages including Vietnamese)
|
|
181
|
-
- 32K context, 1024 dimensions
|
|
182
|
-
|
|
183
|
-
### Installation
|
|
184
|
-
|
|
185
|
-
**macOS:**
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
brew install ollama
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**Linux:**
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
curl -fsSL https://ollama.com/install.sh | sh
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**Windows:**
|
|
198
|
-
|
|
199
|
-
1. Download from https://ollama.com/download/windows
|
|
200
|
-
2. Run the installer
|
|
201
|
-
3. Ollama runs as a background service automatically
|
|
202
|
-
|
|
203
|
-
### Setup
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
# Start Ollama (macOS/Linux - if not running as service)
|
|
207
|
-
ollama serve
|
|
208
|
-
|
|
209
|
-
# Pull embedding model (one-time, ~639MB)
|
|
210
|
-
ollama pull qwen3-embedding:0.6b
|
|
211
|
-
|
|
212
|
-
# Verify
|
|
213
|
-
ollama list # Should show qwen3-embedding:0.6b
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
**Linux:**
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
curl -fsSL https://ollama.com/install.sh | sh
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**Windows:**
|
|
223
|
-
|
|
224
|
-
1. Download from https://ollama.com/download/windows
|
|
225
|
-
2. Run the installer
|
|
226
|
-
3. Ollama runs as a background service automatically
|
|
227
|
-
|
|
228
|
-
### Setup
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Start Ollama (macOS/Linux - if not running as service)
|
|
232
|
-
ollama serve
|
|
233
|
-
|
|
234
|
-
# Pull embedding model (one-time, ~274MB)
|
|
235
|
-
ollama pull nomic-embed-text
|
|
236
|
-
|
|
237
|
-
# Verify
|
|
238
|
-
ollama list # Should show nomic-embed-text
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### Custom Host (Optional)
|
|
242
|
-
|
|
243
|
-
If Ollama runs on a different machine:
|
|
244
|
-
|
|
245
|
-
```bash
|
|
246
|
-
export OLLAMA_HOST=http://192.168.1.100:11434
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### Usage
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
# Rebuild vector index (after adding new observations)
|
|
253
|
-
memory-index action=rebuild
|
|
254
|
-
|
|
255
|
-
# Search with semantic similarity
|
|
256
|
-
memory-search query="authentication patterns" mode=semantic
|
|
257
|
-
|
|
258
|
-
# Hybrid search (keyword + semantic)
|
|
259
|
-
memory-search query="auth" mode=hybrid
|
|
260
|
-
```
|
|
164
|
+
- **memory-search** - Search across all memory files (keyword-based)
|
|
165
|
+
- **observation** - Create structured observations (decision, bugfix, feature, etc.)
|
|
261
166
|
|
|
262
167
|
---
|
|
263
168
|
|
|
264
169
|
### AST-Grep Usage
|
|
265
170
|
|
|
266
|
-
Semantic code operations - smarter than regex:
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
# Search patterns
|
|
270
|
-
ast-grep pattern="console.log($$$)" # Find all console.log
|
|
271
|
-
ast-grep pattern="async function $NAME($$$) { $$$ }" # Find async functions
|
|
272
|
-
ast-grep pattern="const [$S, $SET] = useState($$$)" # Find React hooks
|
|
273
|
-
|
|
274
|
-
# Replace (dry run by default)
|
|
275
|
-
ast-grep pattern="oldFunc($$$)" rewrite="newFunc($$$)" dryRun=true
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
**Pattern syntax**: `$NAME` = single node, `$$$` = zero or more nodes
|
|
279
|
-
|
|
280
|
-
**Requires**: `brew install ast-grep` or `cargo install ast-grep --locked`
|
|
281
|
-
|
|
282
171
|
---
|
|
283
172
|
|
|
284
173
|
## MCP Services
|
|
@@ -335,8 +224,8 @@ Result: Comprehensive research doc
|
|
|
335
224
|
|
|
336
225
|
```
|
|
337
226
|
User: "Build auth system"
|
|
338
|
-
@build → @
|
|
339
|
-
@
|
|
227
|
+
@build → @plan (4 phases)
|
|
228
|
+
@plan → @review (security audit)
|
|
340
229
|
Result: Secure auth with tests
|
|
341
230
|
```
|
|
342
231
|
|
|
@@ -409,7 +298,7 @@ fi
|
|
|
409
298
|
**Delegation:**
|
|
410
299
|
|
|
411
300
|
- Use @build for 70% of work
|
|
412
|
-
- Delegate to @
|
|
301
|
+
- Delegate to @plan for 3+ phases
|
|
413
302
|
- Use @review before deployment (code review + security)
|
|
414
303
|
- Use @scout for library docs + GitHub patterns
|
|
415
304
|
- Use @explore for codebase search
|
|
@@ -41,7 +41,6 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
41
41
|
- Finding files using glob patterns
|
|
42
42
|
- Searching code with regex patterns
|
|
43
43
|
- Reading and analyzing file contents
|
|
44
|
-
- Semantic code search with AST-Grep
|
|
45
44
|
- Understanding symbol types and definitions with LSP
|
|
46
45
|
|
|
47
46
|
## Navigation Strategy
|
|
@@ -64,8 +63,8 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
64
63
|
|
|
65
64
|
## Thoroughness Levels
|
|
66
65
|
|
|
67
|
-
**Quick**: Single
|
|
66
|
+
**Quick**: Single grep, lsp_lsp_workspace_symbols, or glob. Read 1-3 files. Return immediately.
|
|
68
67
|
|
|
69
|
-
**Medium**:
|
|
68
|
+
**Medium**: grep + LSP verification. Check 2-3 naming conventions. Read 3-5 files. Use `lsp_lsp_find_references` to trace usage.
|
|
70
69
|
|
|
71
70
|
**Very Thorough**: Comprehensive search across multiple terms and locations. Use `lsp_lsp_find_references` to build dependency map. Report with file:line references.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: General-purpose subagent for fast, well-defined tasks; delegates complexity to specialists.
|
|
3
|
+
mode: subagent
|
|
4
|
+
temperature: 0.1
|
|
5
|
+
permission:
|
|
6
|
+
bash:
|
|
7
|
+
"*": allow
|
|
8
|
+
"git push*": ask
|
|
9
|
+
"rm -rf*": deny
|
|
10
|
+
"sudo*": deny
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# General Agent
|
|
14
|
+
|
|
15
|
+
Fast subagent for small, clear tasks. Delegate complexity quickly.
|
|
16
|
+
|
|
17
|
+
<system-reminder>
|
|
18
|
+
# General Mode - System Reminder
|
|
19
|
+
|
|
20
|
+
You are the general subagent. Move fast, avoid risk.
|
|
21
|
+
|
|
22
|
+
## Critical Constraints
|
|
23
|
+
|
|
24
|
+
1. Read before edit; never edit unseen code.
|
|
25
|
+
2. Two-strike rule: after 2 failed attempts, stop and escalate.
|
|
26
|
+
3. Bail on complexity: 4+ files, architecture decisions, unclear specs → delegate.
|
|
27
|
+
4. No hallucinated URLs; only use provided or verified links.
|
|
28
|
+
5. Ask before commits/pushes.
|
|
29
|
+
|
|
30
|
+
## Intent Gate
|
|
31
|
+
|
|
32
|
+
- Specialist fit? Use explore/scout/review/plan/vision/looker when better.
|
|
33
|
+
- Scope small and clear (≤3 files, no refactors)? Otherwise delegate.
|
|
34
|
+
- Need clarification? One focused question; if more, escalate.
|
|
35
|
+
|
|
36
|
+
## Bail Triggers
|
|
37
|
+
|
|
38
|
+
- Scope creep or cross-cutting changes
|
|
39
|
+
- Research-heavy tasks
|
|
40
|
+
- Two failed attempts
|
|
41
|
+
- Architecture pattern choices
|
|
42
|
+
- Legacy/edge-case minefields
|
|
43
|
+
|
|
44
|
+
## Guidelines
|
|
45
|
+
|
|
46
|
+
- Match existing style; change only what’s requested.
|
|
47
|
+
- Prefer minimal, surgical edits; avoid unrelated refactors.
|
|
48
|
+
- Run a quick sanity check (lint/typecheck or LSP diagnostics) after edits.
|
|
49
|
+
- Use `file:line` references in summaries; no emojis unless asked.
|
|
50
|
+
|
|
51
|
+
## Progress Updates
|
|
52
|
+
|
|
53
|
+
- Keep brief preambles (8–12 words) during multi-step changes.
|
|
54
|
+
- Examples: “Found issue; patching helper now.” / “Config updated; running lint.”
|
|
55
|
+
|
|
56
|
+
</system-reminder>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Primary planning agent for architecture and multi-phase execution; produces actionable plans with gated steps.
|
|
3
|
+
mode: primary
|
|
4
|
+
temperature: 0.2
|
|
5
|
+
permission:
|
|
6
|
+
write:
|
|
7
|
+
"*": deny
|
|
8
|
+
".beads/artifacts/*/*.md": allow
|
|
9
|
+
edit:
|
|
10
|
+
"*": deny
|
|
11
|
+
".beads/artifacts/*/*.md": allow
|
|
12
|
+
bash:
|
|
13
|
+
"*": allow
|
|
14
|
+
"rm*": deny
|
|
15
|
+
"git push*": deny
|
|
16
|
+
"git commit*": deny
|
|
17
|
+
"git reset*": deny
|
|
18
|
+
"npm publish*": deny
|
|
19
|
+
question: allow
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Plan Agent
|
|
23
|
+
|
|
24
|
+
<system-reminder>
|
|
25
|
+
# Plan Mode - System Reminder
|
|
26
|
+
|
|
27
|
+
You are the primary planning agent. Stay read-focused; only edit planning artifacts in `.beads/artifacts/<bead_id>/` when needed.
|
|
28
|
+
|
|
29
|
+
## Critical Constraints
|
|
30
|
+
|
|
31
|
+
1. No code edits outside planning docs. Read-first, no destructive commands.
|
|
32
|
+
2. Two-strike rule: after two failed attempts to get clarity, escalate.
|
|
33
|
+
3. Bail on complexity outside planning scope; delegate execution to @build, research to @explore/@scout.
|
|
34
|
+
4. No hallucinated URLs; only use provided or verified links.
|
|
35
|
+
5. Ask before commits/pushes.
|
|
36
|
+
|
|
37
|
+
## When to Plan vs Execute
|
|
38
|
+
|
|
39
|
+
- Plan when work spans multiple phases, has dependencies, or needs coordination.
|
|
40
|
+
- Skip planning for trivial single-step fixes; delegate directly to @build.
|
|
41
|
+
|
|
42
|
+
## Planning Workflow
|
|
43
|
+
|
|
44
|
+
- Phase 1: Understand request; launch minimal @explore/@scout in parallel when scope is unclear.
|
|
45
|
+
- Phase 2: Draft approach with phases, owners, and validation gates.
|
|
46
|
+
- Phase 3: Synthesize into a concise plan with deliverables and risks.
|
|
47
|
+
- End with a clarifying question if options exist, otherwise present the plan and ask "Ready to proceed?"
|
|
48
|
+
|
|
49
|
+
## Output Expectations
|
|
50
|
+
|
|
51
|
+
- Provide phase breakdown, critical files to touch, validation steps, and agent assignments.
|
|
52
|
+
- Surface risks, edge cases, and acceptance criteria.
|
|
53
|
+
- Keep progress updates brief (8–12 words) during research.
|
|
54
|
+
</system-reminder>
|
|
@@ -3,11 +3,21 @@ description: External research specialist for library docs, GitHub patterns, and
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
temperature: 0.3
|
|
5
5
|
maxSteps: 30
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
permission:
|
|
7
|
+
write:
|
|
8
|
+
"*": deny
|
|
9
|
+
".beads/artifacts/*/*.md": allow
|
|
10
|
+
edit:
|
|
11
|
+
"*": deny
|
|
12
|
+
".beads/artifacts/*/*.md": allow
|
|
13
|
+
bash:
|
|
14
|
+
"*": allow
|
|
15
|
+
"rm*": deny
|
|
16
|
+
"git push*": deny
|
|
17
|
+
"git commit*": deny
|
|
18
|
+
"git reset*": deny
|
|
19
|
+
"npm publish*": deny
|
|
20
|
+
question: deny
|
|
11
21
|
---
|
|
12
22
|
|
|
13
23
|
# Scout Agent
|
|
@@ -82,8 +82,8 @@ Task({
|
|
|
82
82
|
|
|
83
83
|
**Fallback:** If Task tool fails or network is unavailable, use local tools:
|
|
84
84
|
|
|
85
|
-
- `repo-map` for architecture analysis
|
|
86
85
|
- `memory-search` for existing project knowledge
|
|
86
|
+
- Use `glob` + `read` to explore structure
|
|
87
87
|
- Skip external research phases
|
|
88
88
|
|
|
89
89
|
---
|
|
@@ -210,7 +210,7 @@ Integrate findings from Phase 2 subagents into the report:
|
|
|
210
210
|
If subagents failed in Phase 2, use fallback data:
|
|
211
211
|
|
|
212
212
|
- Check `memory-read({ file: "project/architecture" })` for cached architecture
|
|
213
|
-
- Use `
|
|
213
|
+
- Use `glob` + `read` to explore structure
|
|
214
214
|
- Skip best practices comparison (mark as "N/A - offline mode")
|
|
215
215
|
|
|
216
216
|
---
|
|
@@ -107,11 +107,11 @@ Analyze all images and extract:
|
|
|
107
107
|
|
|
108
108
|
### For Codebase
|
|
109
109
|
|
|
110
|
-
Search for hardcoded values using
|
|
110
|
+
Search for hardcoded values using grep:
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
grep({ pattern: "color:", include: "*.{css,scss,tsx,jsx}" });
|
|
114
|
+
grep({ pattern: "background:", include: "*.{css,scss,tsx,jsx}" });
|
|
115
115
|
grep({ pattern: "#[0-9a-fA-F]{3,8}", include: "*.{css,scss,tsx,jsx}" });
|
|
116
116
|
grep({ pattern: "rgb\\(", include: "*.{css,scss,tsx,jsx}" });
|
|
117
117
|
grep({ pattern: "hsl\\(", include: "*.{css,scss,tsx,jsx}" });
|
|
@@ -121,8 +121,7 @@ grep({ pattern: "[0-9]+rem", include: "*.{css,scss,tsx,jsx}" });
|
|
|
121
121
|
|
|
122
122
|
grep({ pattern: "font-size:", include: "*.css" });
|
|
123
123
|
grep({ pattern: "fontSize:", include: "*.{tsx,jsx}" });
|
|
124
|
-
|
|
125
|
-
ast - grep({ pattern: 'className="$$$"' }); // then analyze for arbitrary values like [16px]
|
|
124
|
+
grep({ pattern: "className=", include: "*.{tsx,jsx}" }); // then analyze for arbitrary values
|
|
126
125
|
```
|
|
127
126
|
|
|
128
127
|
---
|
|
@@ -356,12 +356,10 @@ const buttonVariants = cva(
|
|
|
356
356
|
variants: {
|
|
357
357
|
variant: {
|
|
358
358
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
359
|
-
secondary:
|
|
360
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
359
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
361
360
|
outline: "border border-input bg-background hover:bg-accent",
|
|
362
361
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
363
|
-
destructive:
|
|
364
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
362
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
365
363
|
},
|
|
366
364
|
size: {
|
|
367
365
|
sm: "h-8 px-3 text-sm",
|
|
@@ -377,17 +375,10 @@ const buttonVariants = cva(
|
|
|
377
375
|
);
|
|
378
376
|
|
|
379
377
|
interface ButtonProps
|
|
380
|
-
extends
|
|
381
|
-
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
382
|
-
VariantProps<typeof buttonVariants> {}
|
|
378
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {}
|
|
383
379
|
|
|
384
380
|
export function Button({ className, variant, size, ...props }: ButtonProps) {
|
|
385
|
-
return (
|
|
386
|
-
<button
|
|
387
|
-
className={cn(buttonVariants({ variant, size }), className)}
|
|
388
|
-
{...props}
|
|
389
|
-
/>
|
|
390
|
-
);
|
|
381
|
+
return <button className={cn(buttonVariants({ variant, size }), className)} {...props} />;
|
|
391
382
|
}
|
|
392
383
|
```
|
|
393
384
|
|
|
@@ -195,20 +195,13 @@ Use `--colors=<preset>` or specify hex values:
|
|
|
195
195
|
/* With overlay for text readability */
|
|
196
196
|
.pattern-overlay {
|
|
197
197
|
background:
|
|
198
|
-
linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
|
|
199
|
-
url("pattern-512.png");
|
|
198
|
+
linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url("pattern-512.png");
|
|
200
199
|
background-repeat: repeat;
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
/* CSS-only alternative (if simple enough) */
|
|
204
203
|
.pattern-css {
|
|
205
|
-
background: repeating-linear-gradient(
|
|
206
|
-
45deg,
|
|
207
|
-
#f0f0f0,
|
|
208
|
-
#f0f0f0 10px,
|
|
209
|
-
#ffffff 10px,
|
|
210
|
-
#ffffff 20px
|
|
211
|
-
);
|
|
204
|
+
background: repeating-linear-gradient(45deg, #f0f0f0, #f0f0f0 10px, #ffffff 10px, #ffffff 20px);
|
|
212
205
|
}
|
|
213
206
|
```
|
|
214
207
|
|
|
@@ -64,7 +64,7 @@ bd ready --json | grep -q "$ARGUMENTS"
|
|
|
64
64
|
// Fire all READY subtasks in parallel using Task tool
|
|
65
65
|
// Multiple Task calls in one message run simultaneously
|
|
66
66
|
Task({
|
|
67
|
-
subagent_type: "
|
|
67
|
+
subagent_type: "general",
|
|
68
68
|
description: "Execute subtask 1",
|
|
69
69
|
prompt: `Execute bd-subtask1: [Subtask description]
|
|
70
70
|
|
|
@@ -78,7 +78,7 @@ Task({
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
Task({
|
|
81
|
-
subagent_type: "
|
|
81
|
+
subagent_type: "general",
|
|
82
82
|
description: "Execute subtask 2",
|
|
83
83
|
prompt: `Execute bd-subtask2: [Subtask description]
|
|
84
84
|
...same pattern...`,
|
|
@@ -201,7 +201,7 @@ Task({
|
|
|
201
201
|
subagent_type: "explore",
|
|
202
202
|
description: "Find codebase patterns",
|
|
203
203
|
prompt: `For implementing $ARGUMENTS, find:
|
|
204
|
-
1. Similar patterns in this codebase (grep
|
|
204
|
+
1. Similar patterns in this codebase (grep)
|
|
205
205
|
2. Related test files and testing patterns
|
|
206
206
|
3. Configuration or setup requirements
|
|
207
207
|
Return: File paths, code patterns, test approach`,
|
|
@@ -232,7 +232,7 @@ Task({
|
|
|
232
232
|
| `explore`| Codebase search, patterns | Read, grep, glob | Edit, bd sync |
|
|
233
233
|
| `scout` | External docs, best practices | Fetch, search | Edit, bd sync |
|
|
234
234
|
| `review` | Code review, debugging | Read, analyze | Edit, bd sync |
|
|
235
|
-
| `
|
|
235
|
+
| `plan` | Architecture, decomposition | Read, plan | Edit, bd sync |
|
|
236
236
|
|
|
237
237
|
**You (build agent) are the leader:**
|
|
238
238
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Create a new feature with discovery, spec, plan, and sub-tasks
|
|
3
3
|
argument-hint: "<feature-name> [--priority=<0-4>] [--type=<type>] [--worktree] [--quick]"
|
|
4
|
-
agent:
|
|
4
|
+
agent: plan
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# New Feature: $ARGUMENTS
|
|
@@ -153,8 +153,7 @@ question({
|
|
|
153
153
|
questions: [
|
|
154
154
|
{
|
|
155
155
|
header: "Approve",
|
|
156
|
-
question:
|
|
157
|
-
"Should I proceed with creating the specification for $ARGUMENTS?",
|
|
156
|
+
question: "Should I proceed with creating the specification for $ARGUMENTS?",
|
|
158
157
|
options: [
|
|
159
158
|
{
|
|
160
159
|
label: "Yes, proceed",
|
|
@@ -23,7 +23,21 @@ First, understand the codebase structure:
|
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
25
|
// Quick overview of relevant directories
|
|
26
|
-
|
|
26
|
+
lsp_lsp_document_symbols({ filePath: "src/index.ts", line: 1, character: 1 });
|
|
27
|
+
|
|
28
|
+
// Find files by pattern
|
|
29
|
+
glob({ pattern: "src/**/*.ts" });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Deep Dive
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Find similar patterns
|
|
36
|
+
grep({ pattern: "<text pattern>", include: "*.ts" });
|
|
37
|
+
|
|
38
|
+
// Understand types
|
|
39
|
+
lsp_lsp_hover({ filePath: "<file>", line: N, character: N });
|
|
40
|
+
lsp_lsp_find_references({ filePath: "<file>", line: N, character: N });
|
|
27
41
|
```
|
|
28
42
|
|
|
29
43
|
This helps identify relevant directories and files before diving deeper.
|
|
@@ -88,17 +102,17 @@ If memory search fails (Ollama not running), continue to external sources.
|
|
|
88
102
|
|
|
89
103
|
### Internal Codebase - Get Quick Overview
|
|
90
104
|
|
|
91
|
-
First,
|
|
105
|
+
First, understand codebase structure:
|
|
92
106
|
|
|
93
107
|
```typescript
|
|
94
108
|
// Quick overview of relevant directories
|
|
95
|
-
|
|
109
|
+
glob({ pattern: "src/**/*.ts" });
|
|
96
110
|
|
|
97
|
-
//
|
|
98
|
-
|
|
111
|
+
// Check file structure
|
|
112
|
+
lsp_lsp_document_symbols({ filePath: "src/index.ts", line: 1, character: 1 });
|
|
99
113
|
```
|
|
100
114
|
|
|
101
|
-
**Use
|
|
115
|
+
**Use these tools when:**
|
|
102
116
|
|
|
103
117
|
- Starting research on a new area of the codebase
|
|
104
118
|
- Need to understand file organization before diving deep
|
|
@@ -19,15 +19,7 @@ const parseInput = (input: string) => {
|
|
|
19
19
|
const imagePath = parts[0];
|
|
20
20
|
const mode = parts[1] || "enhance";
|
|
21
21
|
|
|
22
|
-
const validModes = [
|
|
23
|
-
"enhance",
|
|
24
|
-
"upscale",
|
|
25
|
-
"restore",
|
|
26
|
-
"denoise",
|
|
27
|
-
"colorize",
|
|
28
|
-
"sharpen",
|
|
29
|
-
"deblur",
|
|
30
|
-
];
|
|
22
|
+
const validModes = ["enhance", "upscale", "restore", "denoise", "colorize", "sharpen", "deblur"];
|
|
31
23
|
|
|
32
24
|
if (!validModes.includes(mode)) {
|
|
33
25
|
console.warn(`Unknown mode: ${mode}. Using 'enhance' as default.`);
|