opencodekit 0.15.13 → 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.
- package/dist/index.js +16 -4
- package/dist/template/.opencode/AGENTS.md +28 -3
- package/dist/template/.opencode/agent/scout.md +20 -1
- package/dist/template/.opencode/command/research.md +55 -61
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +29 -0
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +32 -0
- package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +42 -0
- package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +32 -0
- package/dist/template/.opencode/opencode.json +697 -696
- package/dist/template/.opencode/skill/deep-research/SKILL.md +385 -0
- package/dist/template/.opencode/tool/oracle.ts +240 -0
- package/package.json +16 -4
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.
|
|
753
|
+
version: "0.15.14",
|
|
754
754
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
755
|
-
keywords: [
|
|
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: [
|
|
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: [
|
|
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.
|
|
307
|
-
4.
|
|
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 →
|
|
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
|
|
@@ -98,6 +98,25 @@ Run 2-3 tool calls in parallel.
|
|
|
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
|
|
@@ -295,7 +314,7 @@ webfetch({
|
|
|
295
314
|
|
|
296
315
|
## Source Code Deep Dive
|
|
297
316
|
|
|
298
|
-
When documentation is insufficient, analyze actual source code.
|
|
317
|
+
When documentation is insufficient, analyze actual **external library** source code.
|
|
299
318
|
|
|
300
319
|
### Step 1: Load the Skill
|
|
301
320
|
|
|
@@ -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
|
|
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
|
-
###
|
|
32
|
+
### Internal Codebase → @explore
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
Delegate LSP exploration to the explore agent:
|
|
23
35
|
|
|
24
36
|
```typescript
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
task({
|
|
38
|
+
subagent_type: "explore",
|
|
39
|
+
description: "Analyze <module>",
|
|
40
|
+
prompt: `Very thorough LSP analysis of <target files>.
|
|
27
41
|
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
###
|
|
51
|
+
### External Research → @scout (this agent)
|
|
33
52
|
|
|
34
|
-
|
|
35
|
-
// Find similar patterns
|
|
36
|
-
grep({ pattern: "<text pattern>", include: "*.ts" });
|
|
53
|
+
Scout handles external sources (context7, grep_search, codesearch, etc.)
|
|
37
54
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,7 +103,7 @@ 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) -
|
|
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)
|
|
@@ -100,35 +112,23 @@ If memory search fails (Ollama not running), continue to external sources.
|
|
|
100
112
|
|
|
101
113
|
## Research
|
|
102
114
|
|
|
103
|
-
### Internal Codebase
|
|
115
|
+
### Internal Codebase → Delegate to @explore
|
|
104
116
|
|
|
105
|
-
|
|
117
|
+
**Do NOT run LSP manually.** Delegate to the explore agent:
|
|
106
118
|
|
|
107
119
|
```typescript
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
130
|
-
|
|
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
|
-
|
|
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,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
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: learning
|
|
3
|
+
created: 2026-01-28T18:03:19.579Z
|
|
4
|
+
confidence: high
|
|
5
|
+
valid_until: null
|
|
6
|
+
superseded_by: null
|
|
7
|
+
concepts: ["deep-mode", "ampcode", "scout", "research", "autonomous", "extended-thinking", "oracle"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 📚 AmpCode Deep Mode Research - Integration with Scout/Research
|
|
11
|
+
|
|
12
|
+
🟢 **Confidence:** high
|
|
13
|
+
|
|
14
|
+
## AmpCode Deep Mode Research (Jan 2026)
|
|
15
|
+
|
|
16
|
+
### Key Concepts from AmpCode:
|
|
17
|
+
1. **Three Modes**: smart (collaborative), rush (fast/cheap), deep (autonomous/extended thinking)
|
|
18
|
+
2. **Deep Mode Behavior**: 5-15 minutes of silent reading before changes, uses GPT-5.2-Codex
|
|
19
|
+
3. **Oracle Pattern**: Second opinion tool using reasoning model for complex decisions
|
|
20
|
+
4. **Handoff**: Move context between modes/threads
|
|
21
|
+
|
|
22
|
+
### How This Maps to OpenCodeKit:
|
|
23
|
+
|
|
24
|
+
**Scout Agent** already has:
|
|
25
|
+
- Quick Mode (~2-3 tool calls)
|
|
26
|
+
- Deep Mode (~4-6 tool calls) - triggers on "how do others", "compare", "best practices"
|
|
27
|
+
|
|
28
|
+
**Research Command** already has:
|
|
29
|
+
- `--quick` (~10 tool calls)
|
|
30
|
+
- Default (~30 tool calls)
|
|
31
|
+
- `--thorough` (~100+ tool calls)
|
|
32
|
+
|
|
33
|
+
### Enhancement Opportunities:
|
|
34
|
+
1. Add `--deep` flag to research that enforces extended LSP exploration before ANY findings
|
|
35
|
+
2. Create oracle tool for "second opinion" on complex architectural decisions
|
|
36
|
+
3. Add mode handoff commands: `/mode deep`, `/mode smart`
|
|
37
|
+
4. Make thorough mode more autonomous (fewer check-ins)
|
|
38
|
+
|
|
39
|
+
### AmpCode Insights to Adopt:
|
|
40
|
+
- "Deep mode is lazy about verification" - sometimes useful to defer verification
|
|
41
|
+
- "Requires clear problem definition upfront" - enforce problem statement template
|
|
42
|
+
- "Goes off to solve problems alone, not pair program" - reduce chattiness in thorough mode
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: pattern
|
|
3
|
+
created: 2026-01-28T18:11:31.174Z
|
|
4
|
+
confidence: high
|
|
5
|
+
valid_until: null
|
|
6
|
+
superseded_by: null
|
|
7
|
+
concepts: ["delegation", "explore-agent", "scout-agent", "research-command", "LSP", "deep-research", "parallel-execution"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 🔄 Research delegation pattern: @explore for LSP, @scout for external
|
|
11
|
+
|
|
12
|
+
🟢 **Confidence:** high
|
|
13
|
+
|
|
14
|
+
Optimized scout.md and research.md to use proper delegation:
|
|
15
|
+
|
|
16
|
+
**Delegation pattern:**
|
|
17
|
+
- Internal codebase LSP analysis → delegate to @explore agent
|
|
18
|
+
- External docs/GitHub patterns → @scout handles directly
|
|
19
|
+
- Run both in parallel when possible
|
|
20
|
+
|
|
21
|
+
**Key changes:**
|
|
22
|
+
1. Scout agent loads deep-research skill for deep mode
|
|
23
|
+
2. Research command loads deep-research skill for --thorough
|
|
24
|
+
3. Both delegate LSP exploration to @explore instead of manual LSP calls
|
|
25
|
+
4. Removed redundant manual LSP code examples
|
|
26
|
+
5. Added parallel execution pattern for internal + external research
|
|
27
|
+
|
|
28
|
+
**Why this is better:**
|
|
29
|
+
- @explore is specialized for LSP with structured output
|
|
30
|
+
- Reduces manual tool call overhead (9 LSP ops → 1 delegation)
|
|
31
|
+
- Enables parallel research (codebase + external simultaneously)
|
|
32
|
+
- Consistent methodology via deep-research skill
|