opencodekit 0.15.12 → 0.15.14

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.
Files changed (23) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +16 -4
  3. package/dist/template/.opencode/AGENTS.md +28 -3
  4. package/dist/template/.opencode/README.md +7 -4
  5. package/dist/template/.opencode/agent/scout.md +117 -27
  6. package/dist/template/.opencode/command/research-ui.md +1 -1
  7. package/dist/template/.opencode/command/research.md +56 -62
  8. package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +29 -0
  9. package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +21 -0
  10. package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +32 -0
  11. package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +42 -0
  12. package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +32 -0
  13. package/dist/template/.opencode/memory/research/opencode-mcp-bug-report.md +5 -2
  14. package/dist/template/.opencode/opencode.json +697 -812
  15. package/dist/template/.opencode/plans/1768385996691-silent-wizard.md +12 -2
  16. package/dist/template/.opencode/skill/deep-research/SKILL.md +385 -0
  17. package/dist/template/.opencode/skill/source-code-research/SKILL.md +8 -8
  18. package/dist/template/.opencode/skill/tool-priority/SKILL.md +8 -6
  19. package/dist/template/.opencode/tool/context7-query-docs.ts +89 -0
  20. package/dist/template/.opencode/tool/context7-resolve-library-id.ts +113 -0
  21. package/dist/template/.opencode/tool/grep-search.ts +135 -0
  22. package/dist/template/.opencode/tool/oracle.ts +240 -0
  23. package/package.json +16 -4
package/README.md CHANGED
@@ -80,8 +80,8 @@ Background Plugins:
80
80
  Supporting:
81
81
  • 30+ Skills (domain expertise loaded on-demand)
82
82
  • 26+ Commands (workflow shortcuts)
83
- • 3 MCP Services (context7, exa, gh_grep) + skill-embedded MCPs
84
- • Custom Tools (memory-*, observation, ast-grep, lsp-*)
83
+ • 3 MCP Services (context7, exa) + grep-search tool + skill-embedded MCPs
84
+ • Custom Tools (memory-*, observation, grep-search, lsp-*)
85
85
  • Beads task tracking (`bd` CLI for multi-session workflows)
86
86
  • Manual Handoffs (clean phase transitions)
87
87
  ```
@@ -223,9 +223,9 @@ You've successfully set up OpenCodeKit when:
223
223
  - ✅ Skills load on-demand (30+ skills)
224
224
  - ✅ Delegation is clear (build → specialized subagents)
225
225
  - ✅ `/handoff` creates portable bundles (.opencode/memory/handoffs/)
226
- - ✅ MCP services configured (context7, gh_grep + skill-embedded)
226
+ - ✅ Tools configured (context7, grep-search + skill-embedded MCP)
227
227
  - ✅ Background plugins active (enforcer, compactor, truncator)
228
- - ✅ Custom tools available (memory-_, observation, ast-grep, lsp-_)
228
+ - ✅ Custom tools available (memory-_, observation, grep-search, lsp-_)
229
229
  - ✅ Environment variables set (.opencode/.env with API keys)
230
230
 
231
231
  ---
package/dist/index.js CHANGED
@@ -750,9 +750,16 @@ var cac = (name = "") => new CAC(name);
750
750
  // package.json
751
751
  var package_default = {
752
752
  name: "opencodekit",
753
- version: "0.15.12",
753
+ version: "0.15.14",
754
754
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
755
- keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
755
+ keywords: [
756
+ "agents",
757
+ "cli",
758
+ "mcp",
759
+ "opencode",
760
+ "opencodekit",
761
+ "template"
762
+ ],
756
763
  license: "MIT",
757
764
  author: "OpenCodeKit",
758
765
  repository: {
@@ -762,7 +769,10 @@ var package_default = {
762
769
  bin: {
763
770
  ock: "dist/index.js"
764
771
  },
765
- files: ["dist", "README.md"],
772
+ files: [
773
+ "dist",
774
+ "README.md"
775
+ ],
766
776
  type: "module",
767
777
  publishConfig: {
768
778
  access: "public",
@@ -806,7 +816,9 @@ var package_default = {
806
816
  engines: {
807
817
  bun: ">=1.3.2"
808
818
  },
809
- trustedDependencies: ["@beads/bd"]
819
+ trustedDependencies: [
820
+ "@beads/bd"
821
+ ]
810
822
  };
811
823
 
812
824
  // src/commands/agent.ts
@@ -303,17 +303,42 @@ When tools fail or return unexpected results:
303
303
 
304
304
  1. **DO NOT** retry the same call more than twice
305
305
  2. Check fallback chains in agent documentation
306
- 3. If still stuck, ask user for guidance
307
- 4. Log failures using `observation` tool for future reference
306
+ 3. **Use Oracle for second opinion** on complex debugging
307
+ 4. If still stuck, ask user for guidance
308
+ 5. Log failures using `observation` tool for future reference
308
309
 
309
310
  ### Fallback Pattern
310
311
 
311
312
  ```
312
313
  Primary tool fails → Try alternative tool
313
- Alternative fails → Manual verification
314
+ Alternative fails → Oracle for second opinion
314
315
  Still stuck → Ask user
315
316
  ```
316
317
 
318
+ ### Oracle Tool
319
+
320
+ Use `oracle` to get a second opinion from a different AI model (gpt-5.2-codex by default) for complex reasoning tasks.
321
+
322
+ **When to use:**
323
+
324
+ - Validating architectural decisions before implementing
325
+ - Cross-checking debugging hypotheses after 2 failed attempts
326
+ - Getting alternative perspectives on tricky problems
327
+ - Breaking out of reasoning ruts or confirmation bias
328
+
329
+ **Modes:**
330
+
331
+ - `validate`: Check if reasoning is sound (default)
332
+ - `alternative`: Get completely different approaches
333
+ - `critique`: Stress-test ideas for weaknesses
334
+ - `brainstorm`: Expand and generate new possibilities
335
+
336
+ ```typescript
337
+ oracle({ question: "Is this the right approach?", context: "..." });
338
+ oracle({ question: "Why is this failing?", mode: "critique" });
339
+ oracle({ question: "What alternatives exist?", mode: "alternative" });
340
+ ```
341
+
317
342
  ---
318
343
 
319
344
  ## Complete Atomic Reference
@@ -180,16 +180,19 @@ Plugins run automatically in every session:
180
180
  **Enabled by default (3 total):**
181
181
 
182
182
  1. **context7** - Up-to-date library documentation (37.6k+ libraries)
183
- - Requires: CONTEXT7_API_KEY
184
- - GitHub: https://github.com/upstash/context7
183
+ - Native tools: `context7_resolve_library_id()` and `context7_query_docs()`
184
+ - Requires: CONTEXT7_API_KEY (optional - public libraries work without it)
185
+ - Step 1: Resolve library name → `/libraryId`
186
+ - Step 2: Query docs with the libraryId
185
187
 
186
188
  2. **exa** - Web search + code context (3.3k+ repos)
187
189
  - Requires: EXA_API_KEY
188
190
  - GitHub: https://github.com/exa-labs/exa-mcp-server
189
191
 
190
- 3. **gh_grep** - Search 1M+ public GitHub repositories
192
+ 3. **grep-search** - Search 1M+ public GitHub repositories via grep.app
193
+ - Native tool: `grep_search({ query: "...", language: [...] })`
191
194
  - No API key needed (public service)
192
- - GitHub: https://github.com/Shachlan/grep.app-mcp
195
+ - Direct HTTP wrapper (no MCP overhead)
193
196
 
194
197
  **Skill-Embedded MCP (load on-demand):**
195
198
 
@@ -93,41 +93,131 @@ Run 2-3 tool calls in parallel.
93
93
  **Triggers:** "how do others", "compare", "best practices", "production patterns"
94
94
  **Target:** Summary, 3-5 code examples, tradeoffs, recommendation
95
95
 
96
- 1. Search GitHub with gh_grep_searchGitHub (vary queries for different angles)
96
+ 1. Search GitHub with grep_search (vary queries for different angles)
97
97
  2. Compare 3-5 implementations from different repositories
98
98
  3. Synthesize common patterns
99
99
  4. Note tradeoffs and edge cases
100
100
 
101
+ ```typescript
102
+ // Run 4-6 external tool calls in parallel
103
+ // Adapt language filter based on research context
104
+ grep_search({ query: "<pattern 1>" }); // No language filter = search all
105
+ grep_search({ query: "<pattern 2>", language: "<relevant lang>" });
106
+ codesearch({ query: "<API usage>", tokensNum: 5000 });
107
+ context7_query_docs({ libraryId: "<id>", topic: "<feature>" });
108
+ ```
109
+
110
+ **Language selection:** Match the language to what you're researching:
111
+
112
+ - React/Next.js → `["TypeScript", "TSX", "JavaScript", "JSX"]`
113
+ - Python libs → `["Python"]`
114
+ - Rust crates → `["Rust"]`
115
+ - Go packages → `["Go"]`
116
+ - No filter → Search across all languages
117
+
118
+ **Note:** Scout does NOT analyze internal codebase. If internal analysis is needed, the leader agent should delegate to @explore separately.
119
+
101
120
  Run 4-6 tool calls in parallel.
102
121
 
103
122
  ## Permalink Protocol
104
123
 
105
124
  Every code reference must include a GitHub permalink. Never link to a branch or tag that can change.
106
125
 
107
- To construct a permalink: use `gh_grep_searchGitHub` to find code, then build the URL from the repository and file path returned. Format: `https://github.com/owner/repo/blob/<sha>/path/to/file#L10-L20`.
126
+ To construct a permalink: use `grep_search` to find code, then build the URL from the repository and file path returned. Format: `https://github.com/owner/repo/blob/<sha>/path/to/file#L10-L20`.
108
127
 
109
128
  ## Tool Priority (External Sources Only)
110
129
 
111
- | Priority | Tool | Use Case | Speed |
112
- | -------- | -------------------- | ----------------------------------------- | ------- |
113
- | 1 | memory-search | Past research findings | Instant |
114
- | 2 | context7 | Official library docs | Fast |
115
- | 3 | codesearch | Exa Code API for SDK/library patterns | Fast |
116
- | 4 | gh_grep_searchGitHub | Cross-repo GitHub code search (1M+ repos) | Medium |
117
- | 5 | webfetch | Specific doc URLs, READMEs, changelogs | Medium |
118
- | 6 | opensrc + LSP | Clone & analyze source code | Slow |
119
- | 7 | websearch | Tutorials, blog posts, recent news | Slow |
130
+ | Priority | Tool | Use Case | Speed |
131
+ | -------- | ------------- | ----------------------------------------- | ------- |
132
+ | 1 | memory-search | Past research findings | Instant |
133
+ | 2 | context7 | Official library docs | Fast |
134
+ | 3 | codesearch | Exa Code API for SDK/library patterns | Fast |
135
+ | 4 | grep_search | Cross-repo GitHub code search (1M+ repos) | Medium |
136
+ | 5 | webfetch | Specific doc URLs, READMEs, changelogs | Medium |
137
+ | 6 | opensrc + LSP | Clone & analyze source code | Slow |
138
+ | 7 | websearch | Tutorials, blog posts, recent news | Slow |
120
139
 
121
140
  **Rule:** Exhaust faster tools before slower ones. Run tools in parallel when independent.
122
141
 
123
- ## gh_grep_searchGitHub Tool
142
+ ## context7 Tools
143
+
144
+ Use to access up-to-date library documentation (37.6k+ libraries).
145
+
146
+ ### Two-Step Process
147
+
148
+ **Step 1: Resolve Library ID**
149
+
150
+ ```typescript
151
+ context7_resolve_library_id({
152
+ libraryName: "react", // Required - package/library name
153
+ query?: "hooks composition", // Optional - search context
154
+ limit?: 5 // Optional - max results (default: 5)
155
+ })
156
+ ```
157
+
158
+ Returns library IDs like `/facebook/react`, `/nodejs/node`, etc.
159
+
160
+ **Step 2: Query Documentation**
161
+
162
+ ```typescript
163
+ context7_query_docs({
164
+ libraryId: "/facebook/react", // From resolve step
165
+ topic: "useState hook", // What you want to know
166
+ maxTokens?: 8000 // Optional - response size
167
+ })
168
+ ```
169
+
170
+ ### Query Patterns
171
+
172
+ **Good queries (specific features):**
173
+
174
+ - `useState hook` - Find React useState documentation
175
+ - `async/await` - Node.js async patterns
176
+ - `type decorators` - TypeScript types and decorators
177
+ - `setup instructions` - Getting started guides
178
+
179
+ **Bad queries (too vague):**
180
+
181
+ - `react` - Too broad
182
+ - `best practices` - Not a feature
183
+ - `how to use` - Natural language
184
+
185
+ ### Examples
186
+
187
+ ```typescript
188
+ // Find React docs
189
+ const reactId = context7_resolve_library_id({ libraryName: "react" });
190
+ context7_query_docs({ libraryId: reactId, topic: "useEffect cleanup" });
191
+
192
+ // Find TypeScript docs
193
+ const tsId = context7_resolve_library_id({
194
+ libraryName: "typescript",
195
+ query: "types",
196
+ });
197
+ context7_query_docs({ libraryId: tsId, topic: "generic types" });
198
+
199
+ // Find Node.js docs
200
+ const nodeId = context7_resolve_library_id({ libraryName: "nodejs" });
201
+ context7_query_docs({ libraryId: nodeId, topic: "streams API" });
202
+ ```
203
+
204
+ ### Failure Handling
205
+
206
+ | Problem | Solution |
207
+ | ----------------- | ---------------------------------------------- |
208
+ | Library not found | Check exact name; try shorter/different names |
209
+ | No docs for topic | Broaden query - search parent concepts instead |
210
+ | Empty results | Try related terms or "API reference" |
211
+ | API error | Verify CONTEXT7_API_KEY is set (optional) |
212
+
213
+ ## grep_search Tool
124
214
 
125
215
  Use for cross-repository code search across 1M+ public GitHub repositories.
126
216
 
127
217
  ### Schema
128
218
 
129
219
  ```typescript
130
- gh_grep_searchGitHub({
220
+ grep_search({
131
221
  query: string, // Required - search pattern (literal code, not keywords)
132
222
  repo?: string, // Optional - filter to specific repo (e.g., "vercel/ai")
133
223
  language?: string[], // Optional - e.g., ["TypeScript", "TSX"]
@@ -157,22 +247,22 @@ gh_grep_searchGitHub({
157
247
 
158
248
  ```typescript
159
249
  // Basic repo search
160
- gh_grep_searchGitHub({ query: "batch_tool", repo: "anomalyco/opencode" });
250
+ grep_search({ query: "batch_tool", repo: "anomalyco/opencode" });
161
251
 
162
252
  // With language filter
163
- gh_grep_searchGitHub({
253
+ grep_search({
164
254
  query: "getServerSession",
165
255
  language: ["TypeScript", "TSX"],
166
256
  });
167
257
 
168
258
  // Regex pattern (multi-line)
169
- gh_grep_searchGitHub({
259
+ grep_search({
170
260
  query: "(?s)useEffect\\(\\(\\) => {.*removeEventListener",
171
261
  useRegexp: true,
172
262
  });
173
263
 
174
264
  // Path filter for specific files
175
- gh_grep_searchGitHub({
265
+ grep_search({
176
266
  query: "CORS(",
177
267
  language: ["Python"],
178
268
  matchCase: true,
@@ -184,7 +274,7 @@ gh_grep_searchGitHub({
184
274
  | Problem | Solution |
185
275
  | ---------------- | ------------------------------------------------ |
186
276
  | Empty results | Broaden query - search concepts, not exact names |
187
- | MCP server error | Fall back to `codesearch` or `websearch` |
277
+ | API error | Fall back to `codesearch` or `websearch` |
188
278
  | Rate limited | Reduce parallel calls, go sequential |
189
279
  | Too many results | Add `language` or `path` filters |
190
280
 
@@ -224,7 +314,7 @@ webfetch({
224
314
 
225
315
  ## Source Code Deep Dive
226
316
 
227
- When documentation is insufficient, analyze actual source code.
317
+ When documentation is insufficient, analyze actual **external library** source code.
228
318
 
229
319
  ### Step 1: Load the Skill
230
320
 
@@ -316,8 +406,8 @@ Structure your response as:
316
406
 
317
407
  ```
318
408
  context7 fails → try codesearch for patterns
319
- codesearch empty → try gh_grep_searchGitHub with broader query
320
- gh_grep_searchGitHub empty → webfetch specific doc URLs if known
409
+ codesearch empty → try grep_search with broader query
410
+ grep_search empty → webfetch specific doc URLs if known
321
411
  still stuck → opensrc clone + LSP analysis
322
412
  last resort → websearch for tutorials/blogs
323
413
  ```
@@ -327,10 +417,10 @@ last resort → websearch for tutorials/blogs
327
417
  **context7 doesn't find library:**
328
418
 
329
419
  1. Try `codesearch({ query: "<library> <function> example" })`
330
- 2. Try `gh_grep_searchGitHub({ query: "import.*from.*<library>", language: ["TypeScript"] })`
420
+ 2. Try `grep_search({ query: "import.*from.*<library>", language: ["TypeScript"] })`
331
421
  3. Clone with `npx opensrc <library>` and read source
332
422
 
333
- **gh_grep_searchGitHub returns nothing:**
423
+ **grep_search returns nothing:**
334
424
 
335
425
  - Broaden query: search concepts, not exact function names
336
426
  - Remove specific repo filter to search across all repos
@@ -339,9 +429,9 @@ last resort → websearch for tutorials/blogs
339
429
  - Search for error messages, config patterns, or import statements
340
430
  - Fall back to `codesearch` for conceptual queries
341
431
 
342
- **gh_grep_searchGitHub MCP error:**
432
+ **grep_search API error:**
343
433
 
344
- - MCP server at `mcp.grep.app` may be temporarily down
434
+ - The grep.app API may be temporarily unavailable
345
435
  - Fall back to `codesearch` for similar functionality
346
436
  - Use `opensrc` to clone specific repos and search locally
347
437
  - Try `websearch` as last resort
@@ -368,6 +458,6 @@ NO URL GUESSING: Only use URLs from tools or user input.
368
458
  CITE EVERYTHING: No claims without source links.
369
459
 
370
460
  Quick: context7 → codesearch → websearch (2-3 parallel calls)
371
- Deep: gh_grep (4-6 parallel calls) → compare 3-5 repos → synthesize
372
- Fallback: context7 → codesearch → gh_grep → webfetch → opensrc → websearch
461
+ Deep: grep_search (4-6 parallel calls) → compare 3-5 repos → synthesize
462
+ Fallback: context7 → codesearch → grep_search → webfetch → opensrc → websearch
373
463
  ```
@@ -212,7 +212,7 @@ context7_resolve_library_id({
212
212
  });
213
213
 
214
214
  // Real-world implementations
215
- gh_grep_searchGitHub({
215
+ grep_search({
216
216
  query: "[pattern to find]",
217
217
  language: ["TypeScript", "TSX"],
218
218
  path: "components/",
@@ -15,32 +15,55 @@ You're gathering information before implementation. Find answers, document findi
15
15
  - Default (~30 tool calls): Moderate exploration, verify patterns
16
16
  - `--thorough` (~100+ tool calls): Comprehensive analysis, new domain
17
17
 
18
- ## Load Context
18
+ ## Load Skills Based on Depth
19
+
20
+ ```typescript
21
+ // For --thorough mode, load the deep-research skill
22
+ if (thorough) {
23
+ skill({ name: "deep-research" });
24
+ }
25
+
26
+ // For source code analysis
27
+ skill({ name: "source-code-research" });
28
+ ```
29
+
30
+ ## Delegation Strategy
19
31
 
20
- ### Get Quick Codebase Overview
32
+ ### Internal Codebase → @explore
21
33
 
22
- First, understand the codebase structure:
34
+ Delegate LSP exploration to the explore agent:
23
35
 
24
36
  ```typescript
25
- // Quick overview of relevant directories
26
- lsp_lsp_document_symbols({ filePath: "src/index.ts", line: 1, character: 1 });
37
+ task({
38
+ subagent_type: "explore",
39
+ description: "Analyze <module>",
40
+ prompt: `Very thorough LSP analysis of <target files>.
27
41
 
28
- // Find files by pattern
29
- glob({ pattern: "src/**/*.ts" });
42
+ Questions:
43
+ 1. What functions/classes are exported?
44
+ 2. What are the incoming/outgoing calls?
45
+ 3. What patterns exist in this module?
46
+
47
+ Return file:line references for all findings.`,
48
+ });
30
49
  ```
31
50
 
32
- ### Deep Dive
51
+ ### External Research → @scout (this agent)
33
52
 
34
- ```typescript
35
- // Find similar patterns
36
- grep({ pattern: "<text pattern>", include: "*.ts" });
53
+ Scout handles external sources (context7, grep_search, codesearch, etc.)
37
54
 
38
- // Understand types
39
- lsp_lsp_hover({ filePath: "<file>", line: N, character: N });
40
- lsp_lsp_find_references({ filePath: "<file>", line: N, character: N });
55
+ ### Parallel Execution
56
+
57
+ Run internal and external research in parallel:
58
+
59
+ ```typescript
60
+ // Launch both in parallel
61
+ task({ subagent_type: "explore", prompt: "LSP analysis of..." });
62
+ context7_resolve_library_id({ libraryName: "<lib>" });
63
+ grep_search({ query: "<pattern>", language: "TypeScript" });
41
64
  ```
42
65
 
43
- This helps identify relevant directories and files before diving deeper.
66
+ ## Load Context
44
67
 
45
68
  ### Load Bead Details
46
69
 
@@ -62,21 +85,10 @@ Before hitting external sources, search what we already know:
62
85
 
63
86
  ```typescript
64
87
  // Search past research and observations on similar topics
65
- memory -
66
- search({
67
- query: "[research question/topic]",
68
- mode: "semantic",
69
- limit: 5,
70
- });
88
+ memory_search({ query: "[research question/topic]", limit: 5 });
71
89
 
72
90
  // Search for related gotchas and learnings
73
- memory -
74
- search({
75
- query: "[topic keywords]",
76
- mode: "semantic",
77
- type: "observation",
78
- limit: 3,
79
- });
91
+ memory_search({ query: "[topic keywords] gotchas", limit: 3 });
80
92
  ```
81
93
 
82
94
  **If memory has high-confidence answers, you may skip external research.**
@@ -91,44 +103,32 @@ If memory search fails (Ollama not running), continue to external sources.
91
103
 
92
104
  ## Source Priority
93
105
 
94
- 1. **Codebase patterns** (highest trust) - How does this project already do it?
106
+ 1. **Codebase patterns** (highest trust) - Delegate to @explore for LSP analysis
95
107
  2. **Official docs** (high trust) - What does the library documentation say?
96
108
  3. **Context7** (high trust) - API usage and examples
97
109
  4. **Source code** (high trust) - Library implementation (use `source-code-research` skill)
98
- 5. **GitHub examples** (medium trust) - Real-world patterns via codesearch/gh_grep
110
+ 5. **GitHub examples** (medium trust) - Real-world patterns via codesearch/grep_search
99
111
  6. **Web search** (lower trust) - Only if tiers 1-5 don't answer
100
112
 
101
113
  ## Research
102
114
 
103
- ### Internal Codebase - Get Quick Overview
115
+ ### Internal Codebase Delegate to @explore
104
116
 
105
- First, understand codebase structure:
117
+ **Do NOT run LSP manually.** Delegate to the explore agent:
106
118
 
107
119
  ```typescript
108
- // Quick overview of relevant directories
109
- glob({ pattern: "src/**/*.ts" });
110
-
111
- // Check file structure
112
- lsp_lsp_document_symbols({ filePath: "src/index.ts", line: 1, character: 1 });
113
- ```
114
-
115
- **Use these tools when:**
116
-
117
- - Starting research on a new area of the codebase
118
- - Need to understand file organization before diving deep
119
- - Looking for relevant files to investigate
120
- - Want quick symbol overview for a directory
121
-
122
- ### Deep Dive
120
+ task({
121
+ subagent_type: "explore",
122
+ description: "Analyze codebase patterns",
123
+ prompt: `Very thorough analysis of [target area].
123
124
 
124
- ```typescript
125
- // Find similar patterns
126
- ast - grep({ pattern: "<code pattern>" });
127
- grep({ pattern: "<text pattern>", include: "*.ts" });
125
+ Questions:
126
+ 1. How does this project handle [pattern]?
127
+ 2. What are the existing conventions?
128
+ 3. Where are similar implementations?
128
129
 
129
- // Understand types
130
- lsp_lsp_hover({ filePath: "<file>", line: N, character: N });
131
- lsp_lsp_find_references({ filePath: "<file>", line: N, character: N });
130
+ Return file:line references.`,
131
+ });
132
132
  ```
133
133
 
134
134
  ### External Docs
@@ -155,20 +155,13 @@ npx opensrc pypi:<package> # Python
155
155
  npx opensrc <owner>/<repo> # GitHub repo
156
156
  ```
157
157
 
158
- ```typescript
159
- // Then analyze the source
160
- glob({ pattern: "opensrc/**/src/**/*.ts" });
161
- grep({ pattern: "<function-name>", path: "opensrc/" });
162
- read({ filePath: "opensrc/repos/.../file.ts" });
163
- ```
164
-
165
158
  **See:** `skill({ name: "source-code-research" })` for complete workflow.
166
159
 
167
160
  ### Code Examples
168
161
 
169
162
  ```typescript
170
163
  codesearch({ query: "<API usage pattern>", tokensNum: 5000 });
171
- gh_grep_searchGitHub({ query: "<code pattern>", language: ["TypeScript"] });
164
+ grep_search({ query: "<code pattern>", language: "TypeScript" });
172
165
  ```
173
166
 
174
167
  ## Validate Findings
@@ -246,6 +239,7 @@ Research: $ARGUMENTS
246
239
 
247
240
  Depth: [quick|medium|thorough]
248
241
  Tool calls: [N]
242
+ Delegations: [@explore for codebase, @scout for external]
249
243
 
250
244
  Questions:
251
245
  • [Q1] → Answered (High)
@@ -0,0 +1,29 @@
1
+ ---
2
+ type: decision
3
+ created: 2026-01-28T18:07:13.668Z
4
+ confidence: high
5
+ valid_until: null
6
+ superseded_by: null
7
+ concepts: ["deep-research", "skill", "LSP", "memory-first", "confidence-scoring", "scout-agent", "research-command"]
8
+ files: [".opencode/skill/deep-research/SKILL.md"]
9
+ ---
10
+
11
+ # 🎯 Created deep-research skill for thorough codebase analysis
12
+
13
+ 🟢 **Confidence:** high
14
+
15
+ Created `.opencode/skill/deep-research/SKILL.md` to formalize extended research methodology.
16
+
17
+ Key features:
18
+ 1. **Memory-first protocol** - Check past research before exploring
19
+ 2. **Full LSP exploration** - All 9 operations mandatory before edits
20
+ 3. **Confidence scoring** - High/Medium/Low/None for findings
21
+ 4. **Tool budgets** - quick (~10), default (~30), thorough (~100)
22
+ 5. **Stop conditions** - Clear criteria for when to stop research
23
+
24
+ Integration points:
25
+ - Scout agent loads this for deep mode
26
+ - Research command uses for --thorough flag
27
+ - Pre-edit verification workflow
28
+
29
+ This enhances both scout.md and research.md without breaking changes.
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: decision
3
+ created: 2026-01-28T16:59:35.621Z
4
+ confidence: high
5
+ valid_until: null
6
+ superseded_by: null
7
+ concepts: ["grep-search", "MCP", "native tool", "architecture", "best practices"]
8
+ ---
9
+
10
+ # 🎯 gh-grep MCP wrapper vs native grep-search tool
11
+
12
+ 🟢 **Confidence:** high
13
+
14
+ Created two implementations for GitHub code search:
15
+
16
+ 1. **Native tool** (.opencode/tool/grep-search.ts): TypeScript wrapper around grep.app API - WORKING ✅
17
+ 2. **MCP skill** (.opencode/skill/gh-grep/): Skill wrapper that calls uvx grep-mcp server - BROKEN ❌
18
+
19
+ The MCP server has an argument parsing bug ('str' object has no attribute 'get') that prevents tool execution. Even the SKILL.md documentation admits: "Note: The MCP server (grep-mcp) may have bugs. The native grep_search tool is recommended."
20
+
21
+ **Key insight**: We already documented the problem and recommended against the MCP approach. The native tool works perfectly and doesn't require external process dependencies.
@@ -0,0 +1,32 @@
1
+ ---
2
+ type: decision
3
+ created: 2026-01-28T18:51:45.226Z
4
+ confidence: high
5
+ valid_until: null
6
+ superseded_by: null
7
+ concepts: ["oracle", "second-opinion", "validation", "debugging", "architecture", "decision-making"]
8
+ ---
9
+
10
+ # 🎯 Oracle tool optimal usage patterns
11
+
12
+ 🟢 **Confidence:** high
13
+
14
+ Oracle tool should be used for:
15
+ 1. Validating architectural decisions BEFORE implementing
16
+ 2. Cross-checking debugging hypotheses when stuck
17
+ 3. Getting alternative perspectives on tricky problems
18
+ 4. Breaking out of reasoning ruts or confirmation bias
19
+
20
+ Default model: gpt-5.2-codex (strong code understanding)
21
+ Available models: gemini-3-pro-preview, gemini-claude-opus-4-5-thinking
22
+
23
+ Modes:
24
+ - validate: Check if reasoning is sound (default)
25
+ - alternative: Get completely different approaches
26
+ - critique: Stress-test ideas for weaknesses
27
+ - brainstorm: Expand and generate new possibilities
28
+
29
+ Integration points:
30
+ - Use before major architectural decisions
31
+ - Use when debugging complex failures (after 2 failed attempts)
32
+ - Use in @review agent for code review validation