opencodekit 0.9.1 → 0.9.2
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 +32 -24
- package/dist/template/.opencode/AGENTS.md +64 -38
- package/dist/template/.opencode/README.md +2 -2
- package/dist/template/.opencode/agent/build.md +25 -3
- package/dist/template/.opencode/agent/explore.md +18 -4
- package/dist/template/.opencode/agent/review.md +16 -3
- package/dist/template/.opencode/agent/rush.md +14 -4
- package/dist/template/.opencode/opencode.json +514 -474
- package/dist/template/.opencode/tool/lsp.ts +454 -0
- package/package.json +51 -63
package/README.md
CHANGED
|
@@ -251,10 +251,10 @@ You've successfully set up OpenCodeKit when:
|
|
|
251
251
|
|
|
252
252
|
---
|
|
253
253
|
|
|
254
|
-
**OpenCodeKit v0.9.
|
|
254
|
+
**OpenCodeKit v0.9.2**
|
|
255
255
|
**Architecture**: Two-layer (Memory + Beads + Git)
|
|
256
256
|
**Package**: `npx opencodekit` to scaffold new projects
|
|
257
|
-
**New in v0.9.
|
|
257
|
+
**New in v0.9.2**: 6 new LSP tools, `ock init --beads` flag, improved tool guidance
|
|
258
258
|
**Ready for**: Daily production use
|
|
259
259
|
|
|
260
260
|
Enjoy your streamlined agent system with clean phase transitions!
|
package/dist/index.js
CHANGED
|
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
750
750
|
// package.json
|
|
751
751
|
var package_default = {
|
|
752
752
|
name: "opencodekit",
|
|
753
|
-
version: "0.9.
|
|
753
|
+
version: "0.9.2",
|
|
754
754
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
755
755
|
type: "module",
|
|
756
756
|
repository: {
|
|
@@ -764,10 +764,7 @@ var package_default = {
|
|
|
764
764
|
bin: {
|
|
765
765
|
ock: "dist/index.js"
|
|
766
766
|
},
|
|
767
|
-
files: [
|
|
768
|
-
"dist",
|
|
769
|
-
"README.md"
|
|
770
|
-
],
|
|
767
|
+
files: ["dist", "README.md"],
|
|
771
768
|
scripts: {
|
|
772
769
|
dev: "bun run src/index.ts",
|
|
773
770
|
build: "bun build src/index.ts --outdir dist --target node && mkdir -p dist/template && rsync -av --exclude=node_modules --exclude=dist --exclude=.git --exclude=coverage --exclude=.next --exclude=.turbo --exclude=logs --exclude=package-lock.json .opencode/ dist/template/.opencode/",
|
|
@@ -779,14 +776,7 @@ var package_default = {
|
|
|
779
776
|
lint: "biome check .",
|
|
780
777
|
"lint:fix": "biome check --fix ."
|
|
781
778
|
},
|
|
782
|
-
keywords: [
|
|
783
|
-
"cli",
|
|
784
|
-
"opencodekit",
|
|
785
|
-
"template",
|
|
786
|
-
"agents",
|
|
787
|
-
"mcp",
|
|
788
|
-
"opencode"
|
|
789
|
-
],
|
|
779
|
+
keywords: ["cli", "opencodekit", "template", "agents", "mcp", "opencode"],
|
|
790
780
|
author: "OpenCodeKit",
|
|
791
781
|
license: "MIT",
|
|
792
782
|
engines: {
|
|
@@ -809,9 +799,7 @@ var package_default = {
|
|
|
809
799
|
"@types/node": "^22.10.1",
|
|
810
800
|
typescript: "^5.7.2"
|
|
811
801
|
},
|
|
812
|
-
trustedDependencies: [
|
|
813
|
-
"@beads/bd"
|
|
814
|
-
]
|
|
802
|
+
trustedDependencies: ["@beads/bd"]
|
|
815
803
|
};
|
|
816
804
|
|
|
817
805
|
// src/commands/agent.ts
|
|
@@ -3062,14 +3050,15 @@ async function editAutoupdate(configPath) {
|
|
|
3062
3050
|
}
|
|
3063
3051
|
|
|
3064
3052
|
// src/commands/init.ts
|
|
3053
|
+
import { execSync } from "node:child_process";
|
|
3065
3054
|
import {
|
|
3066
3055
|
existsSync as existsSync3,
|
|
3067
3056
|
mkdirSync as mkdirSync2,
|
|
3068
3057
|
readFileSync as readFileSync3,
|
|
3069
|
-
|
|
3070
|
-
|
|
3058
|
+
readdirSync as readdirSync2,
|
|
3059
|
+
writeFileSync as writeFileSync3
|
|
3071
3060
|
} from "node:fs";
|
|
3072
|
-
import { join as join3
|
|
3061
|
+
import { basename, dirname, join as join3 } from "node:path";
|
|
3073
3062
|
import { fileURLToPath } from "node:url";
|
|
3074
3063
|
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
3075
3064
|
var EXCLUDED_DIRS = [
|
|
@@ -3126,9 +3115,7 @@ async function copyDir(src, dest) {
|
|
|
3126
3115
|
continue;
|
|
3127
3116
|
const srcPath = join3(src, entry.name);
|
|
3128
3117
|
const destPath = join3(dest, entry.name);
|
|
3129
|
-
if (entry.isSymbolicLink()) {
|
|
3130
|
-
continue;
|
|
3131
|
-
} else if (entry.isDirectory()) {
|
|
3118
|
+
if (entry.isSymbolicLink()) {} else if (entry.isDirectory()) {
|
|
3132
3119
|
await copyDir(srcPath, destPath);
|
|
3133
3120
|
} else {
|
|
3134
3121
|
const content = readFileSync3(srcPath, "utf-8");
|
|
@@ -3190,7 +3177,28 @@ async function initCommand(options = {}) {
|
|
|
3190
3177
|
process.exit(1);
|
|
3191
3178
|
}
|
|
3192
3179
|
s.stop("Done");
|
|
3193
|
-
|
|
3180
|
+
if (options.beads) {
|
|
3181
|
+
const beadsDir = join3(targetDir, ".beads");
|
|
3182
|
+
if (!existsSync3(beadsDir)) {
|
|
3183
|
+
const bs = de();
|
|
3184
|
+
bs.start("Initializing .beads/");
|
|
3185
|
+
try {
|
|
3186
|
+
execSync("bd init", { cwd: targetDir, stdio: "ignore" });
|
|
3187
|
+
bs.stop("Beads initialized");
|
|
3188
|
+
} catch {
|
|
3189
|
+
mkdirSync2(beadsDir, { recursive: true });
|
|
3190
|
+
writeFileSync3(join3(beadsDir, "config.yaml"), `# Beads configuration
|
|
3191
|
+
version: 1
|
|
3192
|
+
`);
|
|
3193
|
+
writeFileSync3(join3(beadsDir, "issues.jsonl"), "");
|
|
3194
|
+
writeFileSync3(join3(beadsDir, "metadata.json"), JSON.stringify({ created: new Date().toISOString() }, null, 2));
|
|
3195
|
+
bs.stop("Beads initialized (manual)");
|
|
3196
|
+
}
|
|
3197
|
+
} else {
|
|
3198
|
+
f2.info(".beads/ already exists");
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
le("cd .opencode && bun install", "Next steps");
|
|
3194
3202
|
$e(import_picocolors7.default.green("Ready to code!"));
|
|
3195
3203
|
}
|
|
3196
3204
|
|
|
@@ -3736,7 +3744,7 @@ var cli = cac("ock");
|
|
|
3736
3744
|
cli.option("--verbose", "Enable verbose logging");
|
|
3737
3745
|
cli.option("--quiet", "Suppress all output");
|
|
3738
3746
|
cli.version(`${packageVersion}`);
|
|
3739
|
-
cli.command("init", "Initialize OpenCodeKit in current directory").option("--force", "Reinitialize even if already exists").action(initCommand);
|
|
3747
|
+
cli.command("init", "Initialize OpenCodeKit in current directory").option("--force", "Reinitialize even if already exists").option("--beads", "Also initialize .beads/ for multi-agent coordination").action(initCommand);
|
|
3740
3748
|
cli.command("agent [action]", "Manage agents (list, add, view)").action(async (action) => {
|
|
3741
3749
|
if (!action) {
|
|
3742
3750
|
console.log(`
|
|
@@ -79,35 +79,80 @@ Specify depth when delegating to control tool call budget:
|
|
|
79
79
|
|
|
80
80
|
## Tool Priority
|
|
81
81
|
|
|
82
|
-
**LSP tools → AST
|
|
82
|
+
**LSP tools → AST-grep → Built-in tools**
|
|
83
83
|
|
|
84
|
-
1.
|
|
85
|
-
2. `ast-grep` -
|
|
86
|
-
3. `grep
|
|
87
|
-
4. `
|
|
84
|
+
1. **LSP tools** - Semantic code intelligence (10 tools)
|
|
85
|
+
2. `ast-grep` - **Code search/replace** (functions, patterns, imports, hooks)
|
|
86
|
+
3. `grep` - **Text search** (logs, config, non-code files, simple strings)
|
|
87
|
+
4. `glob` - File discovery by name pattern
|
|
88
|
+
5. `read`, `edit`, `write` - File operations
|
|
89
|
+
|
|
90
|
+
### Choosing the Right Search Tool
|
|
91
|
+
|
|
92
|
+
Ask yourself: **"Am I looking for code structure or just text?"**
|
|
93
|
+
|
|
94
|
+
**Use `ast-grep` when you need to find:**
|
|
95
|
+
|
|
96
|
+
- How a function is called → `pattern="fetchUser($$$)"`
|
|
97
|
+
- Where a hook is used → `pattern="useState($$$)"`
|
|
98
|
+
- Import statements → `pattern="import { $$ } from '$MOD'"`
|
|
99
|
+
- Class definitions → `pattern="class $NAME { $$$ }"`
|
|
100
|
+
- Try-catch blocks → `pattern="try { $$$ } catch ($E) { $$$ }"`
|
|
101
|
+
|
|
102
|
+
**Use `grep` when you need to find:**
|
|
103
|
+
|
|
104
|
+
- Error messages in logs → `pattern="FATAL|ERROR"`
|
|
105
|
+
- Config values → `pattern="API_KEY"`
|
|
106
|
+
- TODO comments → `pattern="TODO|FIXME"`
|
|
107
|
+
- Text in markdown/docs → `pattern="deprecated"`
|
|
108
|
+
|
|
109
|
+
**Use LSP tools when you need to:**
|
|
110
|
+
|
|
111
|
+
- Understand what a symbol is → `lsp_hover`
|
|
112
|
+
- Jump to where something is defined → `lsp_goto_definition`
|
|
113
|
+
- Find all usages before refactoring → `lsp_find_references`
|
|
114
|
+
- Rename across the entire codebase → `lsp_rename`
|
|
88
115
|
|
|
89
116
|
**Rule**: Always `read` before `edit` to verify content.
|
|
90
117
|
|
|
91
|
-
### LSP Tools
|
|
118
|
+
### LSP Tools (10 tools)
|
|
92
119
|
|
|
93
|
-
Semantic
|
|
120
|
+
Semantic code intelligence via Language Server Protocol:
|
|
94
121
|
|
|
95
|
-
|
|
96
|
-
# Rename symbol across entire codebase
|
|
97
|
-
lsp_rename(filePath, line, character, newName)
|
|
122
|
+
**Navigation & Understanding:**
|
|
98
123
|
|
|
99
|
-
|
|
100
|
-
|
|
124
|
+
- `lsp_hover(filePath, line, character)` - Get type info and docs at cursor
|
|
125
|
+
- `lsp_goto_definition(filePath, line, character)` - Jump to where symbol is defined
|
|
126
|
+
- `lsp_find_references(filePath, line, character)` - Find all usages of a symbol
|
|
127
|
+
- `lsp_document_symbols(filePath)` - Get file outline (classes, functions, etc.)
|
|
128
|
+
- `lsp_workspace_symbols(query, filePath)` - Fuzzy search symbols across workspace
|
|
101
129
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
130
|
+
**Diagnostics:**
|
|
131
|
+
|
|
132
|
+
- `lsp_diagnostics(filePath, severity?)` - Get errors/warnings from language server
|
|
133
|
+
|
|
134
|
+
**Refactoring:**
|
|
135
|
+
|
|
136
|
+
- `lsp_rename(filePath, line, character, newName)` - Rename symbol across codebase
|
|
137
|
+
- `lsp_code_actions(filePath, startLine, startChar, endLine, endChar)` - Get available refactorings
|
|
138
|
+
- `lsp_code_action_apply(...)` - Apply a specific code action
|
|
139
|
+
- `lsp_organize_imports(filePath)` - Clean up and sort imports
|
|
105
140
|
|
|
106
|
-
**When to use
|
|
141
|
+
**When to use each tool:**
|
|
107
142
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
143
|
+
**"What type is this variable?"** → Use `lsp_hover` to see type signature without reading the entire definition file.
|
|
144
|
+
|
|
145
|
+
**"Where is this function defined?"** → Use `lsp_goto_definition` to jump directly to source instead of grepping.
|
|
146
|
+
|
|
147
|
+
**"What uses this function?"** → Use `lsp_find_references` before changing anything to see all call sites.
|
|
148
|
+
|
|
149
|
+
**"What's in this file?"** → Use `lsp_document_symbols` for a quick outline without reading the entire file.
|
|
150
|
+
|
|
151
|
+
**"Where is UserService defined?"** → Use `lsp_workspace_symbols` to fuzzy search across all files.
|
|
152
|
+
|
|
153
|
+
**"Are there type errors?"** → Use `lsp_diagnostics` to check before running tests.
|
|
154
|
+
|
|
155
|
+
**"Rename this function safely"** → Use `lsp_rename` to update all references automatically.
|
|
111
156
|
|
|
112
157
|
**Caveat**: LSP tools modify files directly. Re-read files before further edits.
|
|
113
158
|
|
|
@@ -355,25 +400,6 @@ Call `bd_insights` for graph analysis showing bottlenecks and high-priority keys
|
|
|
355
400
|
|
|
356
401
|
Get `bd_priority` recommendations for what to work on next based on graph analysis. Use `bd_diff` to compare issue changes between git revisions.
|
|
357
402
|
|
|
358
|
-
### Quick Start
|
|
359
|
-
|
|
360
|
-
```typescript
|
|
361
|
-
// 1. Join workspace
|
|
362
|
-
bd_init({ team: "project", role: "fe" });
|
|
363
|
-
|
|
364
|
-
// 2. Get next task
|
|
365
|
-
const task = bd_claim();
|
|
366
|
-
|
|
367
|
-
// 3. Lock files before editing
|
|
368
|
-
bd_reserve({ paths: ["src/auth.ts", "src/types.ts"] });
|
|
369
|
-
|
|
370
|
-
// 4. Do the work...
|
|
371
|
-
|
|
372
|
-
// 5. Complete and restart
|
|
373
|
-
bd_done({ id: task.id, msg: "Implemented auth" });
|
|
374
|
-
// RESTART SESSION
|
|
375
|
-
```
|
|
376
|
-
|
|
377
403
|
### Rules
|
|
378
404
|
|
|
379
405
|
- **Always `bd_init()` first** in any session using beads tools
|
|
@@ -329,8 +329,8 @@ fi
|
|
|
329
329
|
|
|
330
330
|
---
|
|
331
331
|
|
|
332
|
-
**OpenCodeKit v0.9.
|
|
332
|
+
**OpenCodeKit v0.9.2**
|
|
333
333
|
**Architecture:** Two-Layer (Memory + Beads + Git)
|
|
334
|
-
**New in v0.9.
|
|
334
|
+
**New in v0.9.2:** 6 new LSP tools, `ock init --beads` flag, improved tool guidance
|
|
335
335
|
**Package:** `npx opencodekit` to scaffold new projects
|
|
336
336
|
**Last Updated:** January 2, 2026
|
|
@@ -47,9 +47,31 @@ Primary orchestrator. Execute-first. Autonomous task completion until resolved.
|
|
|
47
47
|
## Tool Priority
|
|
48
48
|
|
|
49
49
|
1. **LSP tools** for semantic refactoring (rename, code actions, organize imports)
|
|
50
|
-
2. **AST-Grep** for
|
|
51
|
-
3. **
|
|
52
|
-
4. **
|
|
50
|
+
2. **AST-Grep** for code search/replace (functions, hooks, imports, patterns)
|
|
51
|
+
3. **grep** for text search (logs, config, non-code files)
|
|
52
|
+
4. **glob** for file discovery by name
|
|
53
|
+
5. **Bash** for running tests, builds, commands
|
|
54
|
+
|
|
55
|
+
### Choosing the Right Search Tool
|
|
56
|
+
|
|
57
|
+
Ask yourself: **"Am I looking for code structure or just text?"**
|
|
58
|
+
|
|
59
|
+
**Use `ast-grep` when you need to find:**
|
|
60
|
+
|
|
61
|
+
- How a function is called → `pattern="fetchUser($$$)"`
|
|
62
|
+
- Where a hook is used → `pattern="useState($$$)"`
|
|
63
|
+
- Import statements → `pattern="import { $$ } from '$MOD'"`
|
|
64
|
+
|
|
65
|
+
**Use `grep` when you need to find:**
|
|
66
|
+
|
|
67
|
+
- Error messages, config values, TODO comments, text in docs
|
|
68
|
+
|
|
69
|
+
**Use LSP tools when you need to:**
|
|
70
|
+
|
|
71
|
+
- Understand what a symbol is → `lsp_hover`
|
|
72
|
+
- Jump to where something is defined → `lsp_goto_definition`
|
|
73
|
+
- Find all usages before refactoring → `lsp_find_references`
|
|
74
|
+
- Rename across the entire codebase → `lsp_rename`
|
|
53
75
|
|
|
54
76
|
### LSP Tools
|
|
55
77
|
|
|
@@ -14,6 +14,7 @@ tools:
|
|
|
14
14
|
todoread: false
|
|
15
15
|
todowrite: false
|
|
16
16
|
ast-grep*: true
|
|
17
|
+
lsp*: true
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
# Explore Agent
|
|
@@ -26,6 +27,7 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
26
27
|
- Searching code with regex patterns
|
|
27
28
|
- Reading and analyzing file contents
|
|
28
29
|
- Semantic code search with AST-Grep
|
|
30
|
+
- Understanding symbol types and definitions with LSP
|
|
29
31
|
|
|
30
32
|
## Guidelines
|
|
31
33
|
|
|
@@ -37,7 +39,19 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
37
39
|
|
|
38
40
|
## Tool Priority
|
|
39
41
|
|
|
40
|
-
**
|
|
42
|
+
**LSP tools for understanding → AST-Grep for patterns → Built-in for text**
|
|
43
|
+
|
|
44
|
+
### LSP Tools (Code Intelligence)
|
|
45
|
+
|
|
46
|
+
**"What type is this?"** → Use `lsp_hover` to see type signature at a position.
|
|
47
|
+
|
|
48
|
+
**"Where is this defined?"** → Use `lsp_goto_definition` to jump to source.
|
|
49
|
+
|
|
50
|
+
**"What uses this?"** → Use `lsp_find_references` to find all call sites.
|
|
51
|
+
|
|
52
|
+
**"What's in this file?"** → Use `lsp_document_symbols` for quick outline.
|
|
53
|
+
|
|
54
|
+
**"Where is X defined in the codebase?"** → Use `lsp_workspace_symbols` to fuzzy search.
|
|
41
55
|
|
|
42
56
|
### AST-Grep (Semantic Search)
|
|
43
57
|
|
|
@@ -59,8 +73,8 @@ File search specialist. Navigate and explore codebases efficiently.
|
|
|
59
73
|
|
|
60
74
|
## Thoroughness Levels
|
|
61
75
|
|
|
62
|
-
**Quick**: Single ast-grep or glob. Read 1-3 files. Return immediately.
|
|
76
|
+
**Quick**: Single ast-grep, lsp_workspace_symbols, or glob. Read 1-3 files. Return immediately.
|
|
63
77
|
|
|
64
|
-
**Medium**: AST-grep +
|
|
78
|
+
**Medium**: AST-grep + LSP verification. Check 2-3 naming conventions. Read 3-5 files. Use `lsp_find_references` to trace usage.
|
|
65
79
|
|
|
66
|
-
**Very Thorough**: Comprehensive search across multiple terms and locations.
|
|
80
|
+
**Very Thorough**: Comprehensive search across multiple terms and locations. Use `lsp_find_references` to build dependency map. Report with file:line references.
|
|
@@ -18,6 +18,8 @@ tools:
|
|
|
18
18
|
codesearch: true
|
|
19
19
|
memory-read: true
|
|
20
20
|
memory-update: true
|
|
21
|
+
ast-grep*: true
|
|
22
|
+
lsp*: true
|
|
21
23
|
---
|
|
22
24
|
|
|
23
25
|
# Review Agent
|
|
@@ -30,6 +32,7 @@ Critical analysis: code review, debugging, security audit, refactoring decisions
|
|
|
30
32
|
- Root cause analysis
|
|
31
33
|
- Code quality assessment
|
|
32
34
|
- Evidence-based recommendations
|
|
35
|
+
- Understanding code with LSP tools
|
|
33
36
|
|
|
34
37
|
## Guidelines
|
|
35
38
|
|
|
@@ -69,9 +72,19 @@ bd create "[type]: [description]" -t bug -p [0-4] -d "[details, file:line]"
|
|
|
69
72
|
|
|
70
73
|
## Tool Priority
|
|
71
74
|
|
|
72
|
-
**
|
|
73
|
-
|
|
74
|
-
**
|
|
75
|
+
**LSP tools for understanding → AST-grep for patterns → Built-in for verification**
|
|
76
|
+
|
|
77
|
+
**"What type is this variable?"** → Use `lsp_hover` to understand without reading entire file.
|
|
78
|
+
|
|
79
|
+
**"Where is this defined?"** → Use `lsp_goto_definition` to jump to source.
|
|
80
|
+
|
|
81
|
+
**"What calls this function?"** → Use `lsp_find_references` to trace all usages.
|
|
82
|
+
|
|
83
|
+
**"Are there type errors?"** → Use `lsp_diagnostics` before investigating runtime issues.
|
|
84
|
+
|
|
85
|
+
**"Find this pattern across codebase"** → Use `ast-grep` for semantic code search.
|
|
86
|
+
|
|
87
|
+
**Verification**: `bash` for tests, lint, type-check. `git log -p`, `git blame` for history.
|
|
75
88
|
|
|
76
89
|
## Execution Discipline
|
|
77
90
|
|
|
@@ -45,11 +45,21 @@ Fast execute-first agent. Speed over depth. Delegate anything complex.
|
|
|
45
45
|
|
|
46
46
|
## Tool Priority
|
|
47
47
|
|
|
48
|
-
**LSP tools
|
|
48
|
+
1. **LSP tools** for semantic refactoring (rename, organize imports)
|
|
49
|
+
2. **AST-Grep** for code search/replace (functions, hooks, imports)
|
|
50
|
+
3. **grep** for text search (logs, config, non-code)
|
|
51
|
+
4. **glob** for file discovery
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
### Choosing the Right Search Tool
|
|
54
|
+
|
|
55
|
+
Ask: **"Code structure or just text?"**
|
|
56
|
+
|
|
57
|
+
- Code structure (functions, hooks, imports) → `ast-grep`
|
|
58
|
+
- Text patterns (logs, config, docs) → `grep`
|
|
59
|
+
- Understand symbol type → `lsp_hover`
|
|
60
|
+
- Find definition → `lsp_goto_definition`
|
|
61
|
+
- Find all usages → `lsp_find_references`
|
|
62
|
+
- Rename across codebase → `lsp_rename`
|
|
53
63
|
|
|
54
64
|
### LSP Tools (Fast Refactoring)
|
|
55
65
|
|