opencodekit 0.20.4 → 0.20.5

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 CHANGED
@@ -20,7 +20,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
 
21
21
  //#endregion
22
22
  //#region package.json
23
- var version = "0.20.4";
23
+ var version = "0.20.5";
24
24
 
25
25
  //#endregion
26
26
  //#region src/utils/license.ts
@@ -216,19 +216,20 @@ For complex delegations, write context to a file instead of inlining it in the `
216
216
  ```typescript
217
217
  // ❌ Token-expensive: inlining large context
218
218
  task({
219
- prompt: `Here is the full plan:\n${longPlanContent}\n\nImplement task 3...`
219
+ prompt: `Here is the full plan:\n${longPlanContent}\n\nImplement task 3...`,
220
220
  });
221
221
 
222
222
  // ✅ Token-efficient: reference by path
223
223
  // Write context file first:
224
- write('.beads/artifacts/<id>/worker-context.md', contextContent);
224
+ write(".beads/artifacts/<id>/worker-context.md", contextContent);
225
225
  // Then reference it:
226
226
  task({
227
- prompt: `Read the context file at .beads/artifacts/<id>/worker-context.md\n\nImplement task 3 as described in that file.`
227
+ prompt: `Read the context file at .beads/artifacts/<id>/worker-context.md\n\nImplement task 3 as described in that file.`,
228
228
  });
229
229
  ```
230
230
 
231
231
  Use this pattern when:
232
+
232
233
  - Context exceeds ~500 tokens
233
234
  - Multiple subagents need the same context
234
235
  - Plan content, research findings, or specs need to be passed to workers
@@ -274,12 +275,12 @@ For major tracked work:
274
275
 
275
276
  ### Token Budget
276
277
 
277
- | Phase | Target | Action |
278
- | ----------------- | ------- | ------------------------------------------ |
279
- | Starting work | <50k | Load only essential AGENTS.md + task spec |
278
+ | Phase | Target | Action |
279
+ | ----------------- | ------- | -------------------------------------------- |
280
+ | Starting work | <50k | Load only essential AGENTS.md + task spec |
280
281
  | Mid-task | 50-100k | Compress completed phases, keep active files |
281
282
  | Approaching limit | >100k | Aggressive compression, sweep stale noise |
282
- | Near capacity | >150k | Session restart with handoff |
283
+ | Near capacity | >150k | Session restart with handoff |
283
284
 
284
285
  ### DCP Commands
285
286
 
@@ -298,7 +299,7 @@ For major tracked work:
298
299
 
299
300
  ## Edit Protocol
300
301
 
301
- `str_replace` failures are the #1 source of LLM coding failures. When tilth MCP is available with `--edit`, prefer hash-anchored edits (see below). Otherwise, use structured edits:
302
+ `str_replace` failures are the #1 source of LLM coding failures. Use the `edit` tool (str_replace) and `patch` tool as the **primary** editing method. Use `tilth_tilth_edit` (hash-anchored edits) only as a **fallback** when str_replace fails. For all edits, follow the structured edit flow:
302
303
 
303
304
  1. **LOCATE** — Use LSP tools (goToDefinition, findReferences) to find exact positions
304
305
  2. **READ** — Get fresh file content around target (offset: line-10, limit: 30)
@@ -332,7 +333,7 @@ Files over ~500 lines become hard to maintain and review. Extract helpers, split
332
333
 
333
334
  ### Hash-Anchored Edits (MCP)
334
335
 
335
- When tilth MCP is available with `--edit` mode, use hash-anchored edits for higher reliability:
336
+ When tilth MCP is available with `--edit` mode, use hash-anchored edits as a **fallback** when str_replace fails:
336
337
 
337
338
  1. **READ** via `tilth_read` — output includes `line:hash|content` format per line
338
339
  2. **EDIT** via `tilth_edit` — reference lines by their `line:hash` anchor
@@ -383,6 +384,10 @@ memory-admin({ operation: "status" })
383
384
  memory-admin({ operation: "capture-stats" })
384
385
  memory-admin({ operation: "distill-now" })
385
386
  memory-admin({ operation: "curate-now" })
387
+ memory-admin({ operation: "lint" }) # Duplicates, contradictions, stale, orphans
388
+ memory-admin({ operation: "index" }) # Generate memory catalog
389
+ memory-admin({ operation: "compile" }) # Concept-clustered articles
390
+ memory-admin({ operation: "log" }) # Append-only operation audit trail
386
391
  ```
387
392
 
388
393
  ### Session Tools
@@ -23,42 +23,10 @@ You are OpenCode, the best coding agent on the planet.
23
23
 
24
24
  You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
25
25
 
26
- # Tone and style
27
-
28
- - Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
29
- - Your output will be displayed on a command line interface. Your responses should be short and concise. You can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
30
- - Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
31
- - NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new file. This includes markdown files.
32
-
33
- # Professional objectivity
34
-
35
- Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation.
36
-
37
- # Task Management
38
-
39
- You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
40
-
41
- # Tool usage policy
42
-
43
- - When doing file search, prefer to use the Task tool in order to reduce context usage.
44
- - You should proactively use the Task tool with specialized agents when the task at hand matches the agent's description.
45
- - Use specialized tools instead of bash commands when possible, as this provides a better user experience. For file operations, use dedicated tools: Read for reading files instead of cat/head/tail, Edit for editing instead of sed/awk, and Write for creating files instead of cat with heredoc or echo redirection. Reserve bash tools exclusively for actual system commands and terminal operations that require shell execution.
46
- - You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel.
47
- - VERY IMPORTANT: When exploring the codebase to gather context or to answer a question that is not a needle query for a specific file/class/function, it is CRITICAL that you use the Task tool instead of running search commands directly.
48
-
49
26
  # Code References
50
27
 
51
28
  When referencing specific functions or pieces of code include the pattern `file_path:line_number` to allow the user to easily navigate to the source code location.
52
29
 
53
- # Web Research Tool Priority
54
-
55
- When fetching content from URLs (docs, READMEs, web pages):
56
-
57
- 1. **`webclaw` MCP tools** (primary) — `scrape`, `crawl`, `batch`, `brand`. Handles 403s, bot protection, 67% fewer tokens.
58
- 2. **`webfetch`** (fallback) — only if webclaw is unavailable or returns an error.
59
-
60
- Never use `webfetch` as first choice when webclaw MCP is connected.
61
-
62
30
  # Build Agent
63
31
 
64
32
  **Purpose**: Primary execution coordinator — you ship working code, not promises.
@@ -29,20 +29,6 @@ permission:
29
29
 
30
30
  You are opencode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
31
31
 
32
- # Tone and style
33
-
34
- - You should be concise, direct, and to the point.
35
- - Your output will be displayed on a command line interface. Use GitHub-flavored markdown.
36
- - Only use emojis if the user explicitly requests it.
37
-
38
- # Tool usage
39
-
40
- - Prefer specialized tools over shell for file operations:
41
- - Use Read to view files, Edit to modify files, and Write only when needed.
42
- - Use Glob to find files by name and Grep to search file contents.
43
- - Use Bash for terminal operations (git, npm/pnpm, builds, tests, running scripts).
44
- - Run tool calls in parallel when neither call needs the other's output; otherwise run sequentially.
45
-
46
32
  # Planning Guidelines
47
33
 
48
34
  - Analyze requirements deeply before creating a plan
@@ -37,46 +37,6 @@ You are a read-only review agent. You output severity-ranked findings with file:
37
37
 
38
38
  ## Task
39
39
 
40
- Review proposed code changes and identify actionable bugs, regressions, and security issues.
41
-
42
- ## Rules
43
-
44
- - Never modify files
45
- - Never run destructive commands
46
- - Prioritize findings over summaries
47
- - Flag only discrete, actionable issues
48
- - Every finding must cite concrete evidence (`file:line`) and impact
49
-
50
- ## Triage Criteria
51
-
52
- Only report issues that meet all of these:
53
-
54
- 1. Meaningfully affects correctness, performance, security, or maintainability
55
- 2. Is introduced or made materially worse by the reviewed change
56
- 3. Is fixable without requiring unrealistic rigor for this codebase
57
- 4. Is likely something the author would actually want to fix
58
-
59
- ## Output
60
-
61
- Structure:
62
-
63
- - Findings (ordered by severity: P0, P1, P2, P3)
64
- - Evidence (`file:line`)
65
- - Impact scenario
66
- - Overall Correctness
67
-
68
- # Review Agent
69
-
70
- **Purpose**: Quality guardian — you find bugs before they find users.
71
-
72
- > _"Verification isn't pessimism; it's agency applied to correctness."_
73
-
74
- ## Identity
75
-
76
- You are a read-only review agent. You output severity-ranked findings with file:line evidence only.
77
-
78
- ## Task
79
-
80
40
  Review proposed code changes and identify actionable bugs, regressions, and security issues that the author would likely fix.
81
41
 
82
42
  ## Rules
@@ -16,6 +16,8 @@ Create a bead, write its specification (PRD), claim it, set up the workspace, an
16
16
 
17
17
  ```typescript
18
18
  skill({ name: "beads" });
19
+ skill({ name: "memory-grounding" });
20
+ skill({ name: "workspace-setup" });
19
21
  skill({ name: "prd" }); // PRD template guidance
20
22
  skill({ name: "prd-task" }); // PRD → executable tasks (Phase 8)
21
23
  ```
@@ -56,14 +58,7 @@ skill({ name: "prd-task" }); // PRD → executable tasks (Phase 8)
56
58
 
57
59
  ### Memory Search
58
60
 
59
- Search memory for prior work on the same topic before creating a new bead:
60
-
61
- ```typescript
62
- memory - search({ query: "<description keywords>" });
63
- memory - search({ query: "<description keywords>", type: "decision" });
64
- ```
65
-
66
- If memory shows a related decision or completed bead, inform the user before proceeding.
61
+ Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: duplicate bead detection, prior decisions.
67
62
 
68
63
  ### Bead List Check
69
64
 
@@ -218,61 +213,16 @@ br update $BEAD_ID --status in_progress
218
213
 
219
214
  ### Create Branch
220
215
 
221
- Ask user how to handle workspace:
216
+ ### Workspace Setup
222
217
 
223
- ```typescript
224
- question({
225
- questions: [
226
- {
227
- header: "Workspace",
228
- question: "How do you want to set up the workspace?",
229
- options: [
230
- {
231
- label: "Create feature branch (Recommended)",
232
- description: "git checkout -b feat/<bead-id>-<title>",
233
- },
234
- {
235
- label: "Use current branch",
236
- description: "Work on current branch",
237
- },
238
- {
239
- label: "Create worktree",
240
- description: "Isolated git worktree for this bead",
241
- },
242
- ],
243
- },
244
- ],
245
- });
246
- ```
247
-
248
- **If feature branch selected:**
249
-
250
- Map bead type to branch prefix:
218
+ Follow the [workspace-setup](../skill/workspace-setup/SKILL.md) skill protocol.
251
219
 
252
- | Bead Type | Branch Prefix |
253
- | --------- | ------------- |
254
- | feature | feat |
255
- | bug | fix |
256
- | task | task |
257
- | epic | epic |
258
-
259
- Create the branch:
260
-
261
- ```bash
262
- # Example: feat/br-42-add-auth
263
- git checkout -b $PREFIX/$BEAD_ID-$TITLE_SLUG
264
- ```
265
-
266
- Slugify the title (lowercase, spaces to hyphens) and use the bead type to determine the prefix.
267
-
268
- **If worktree selected:**
220
+ Additionally offer a "Create worktree" option:
269
221
 
270
222
  ```typescript
271
223
  skill({ name: "using-git-worktrees" });
272
224
  ```
273
225
 
274
- **If current branch:** Continue without branch creation.
275
-
276
226
  ## Phase 9: Convert PRD to Tasks
277
227
 
278
228
  Use `prd-task` skill to convert PRD markdown → executable JSON (`prd.json`).
@@ -295,8 +245,8 @@ br comments add $BEAD_ID "Created prd.md with [N] tasks, [M] success criteria"
295
245
 
296
246
  ## Related Commands
297
247
 
298
- | Need | Command |
299
- | ------------------ | ------------- |
300
- | Research first | `/research` |
301
- | Plan after spec | `/plan <id>` |
302
- | Implement and ship | `/ship <id>` |
248
+ | Need | Command |
249
+ | ------------------ | ------------ |
250
+ | Research first | `/research` |
251
+ | Plan after spec | `/plan <id>` |
252
+ | Implement and ship | `/ship <id>` |
@@ -18,6 +18,7 @@ Create a detailed implementation plan with TDD steps. Optional deep-planning bet
18
18
 
19
19
  ```typescript
20
20
  skill({ name: "beads" });
21
+ skill({ name: "memory-grounding" });
21
22
  skill({ name: "writing-plans" }); // TDD plan format
22
23
  ```
23
24
 
@@ -44,12 +45,7 @@ Before touching the PRD or planning anything, load what the codebase already kno
44
45
 
45
46
  ### Step 1: Search institutional memory
46
47
 
47
- ```typescript
48
- // Search for past decisions, patterns, gotchas related to this work
49
- memory_search({ query: "<bead-title or feature keywords>", limit: 5 });
50
- memory_search({ query: "<key technical concept from bead>", type: "bugfix", limit: 3 });
51
- memory_read({ file: "handoffs/last" }); // Check last session context
52
- ```
48
+ Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: bugfixes, existing plans (ask user before overwriting).
53
49
 
54
50
  If relevant observations found: incorporate them directly into the plan. Don't re-solve solved problems.
55
51
 
@@ -132,7 +128,10 @@ question({
132
128
  header: "Discovery Level",
133
129
  question: "Suggested discovery level based on PRD complexity. Proceed?",
134
130
  options: [
135
- { label: "Deep (Recommended for complex work)", description: "Level 2-3: spawn scout + explore agents" },
131
+ {
132
+ label: "Deep (Recommended for complex work)",
133
+ description: "Level 2-3: spawn scout + explore agents",
134
+ },
136
135
  { label: "Standard", description: "Level 1: quick doc lookup" },
137
136
  { label: "Skip research", description: "Level 0: I know the codebase" },
138
137
  ],
@@ -347,8 +346,8 @@ br comments add $ARGUMENTS "Created plan.md: Level [N] discovery, [X] waves, [Y]
347
346
 
348
347
  ## Related Commands
349
348
 
350
- | Need | Command |
351
- | -------------- | ------------- |
352
- | Create spec | `/create` |
353
- | Execute plan | `/ship <id>` |
354
- | Research first | `/research` |
349
+ | Need | Command |
350
+ | -------------- | ------------ |
351
+ | Create spec | `/create` |
352
+ | Execute plan | `/ship <id>` |
353
+ | Research first | `/research` |
@@ -10,6 +10,8 @@ agent: build
10
10
 
11
11
  ```typescript
12
12
  skill({ name: "beads" });
13
+ skill({ name: "memory-grounding" });
14
+ skill({ name: "verification-gates" });
13
15
  skill({ name: "verification-before-completion" });
14
16
  ```
15
17
 
@@ -28,14 +30,7 @@ git status --porcelain
28
30
 
29
31
  If uncommitted changes exist, ask whether to commit first.
30
32
 
31
- Run verification gates. Detect project type and use the appropriate commands:
32
-
33
- | Project Type | Detect Via | Build | Test | Lint | Typecheck |
34
- | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
35
- | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
36
- | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
37
- | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
38
- | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
33
+ Follow the [verification-gates](../skill/verification-gates/SKILL.md) skill protocol. All gates must pass before creating the PR.
39
34
 
40
35
  Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
41
36
 
@@ -45,14 +40,7 @@ If any gate fails, stop. Fix errors first, then run `/pr` again.
45
40
 
46
41
  ### Memory Grounding
47
42
 
48
- Search memory for relevant decisions, known issues, and prior review findings:
49
-
50
- ```typescript
51
- memory-search({ query: "$ARGUMENTS" });
52
- memory-search({ query: "<branch or feature keywords>", limit: 5 });
53
- ```
54
-
55
- Include relevant findings in the PR description (e.g., architectural decisions, known limitations).
43
+ Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Include relevant findings in the PR description.
56
44
 
57
45
  ### Git Context
58
46
 
@@ -14,6 +14,7 @@ Gather information before implementation. Find answers, document findings, stop
14
14
 
15
15
  ```typescript
16
16
  skill({ name: "beads" });
17
+ skill({ name: "memory-grounding" });
17
18
  // For --thorough mode:
18
19
  skill({ name: "deep-research" });
19
20
  ```
@@ -66,17 +67,7 @@ Read PRD if it exists and extract questions that need answering.
66
67
 
67
68
  ### Memory Search (Required)
68
69
 
69
- Always search memory before spawning research agents:
70
-
71
- ```typescript
72
- memory-search({ query: "$ARGUMENTS" });
73
- memory-search({ query: "<topic keywords>", limit: 10 });
74
- ```
75
-
76
- If memory returns relevant findings, use them to:
77
- - Skip questions already answered
78
- - Narrow research scope to gaps only
79
- - Avoid contradicting prior decisions without justification
70
+ Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Use findings to: skip already-answered questions, narrow scope to gaps only, avoid contradicting prior decisions without justification.
80
71
 
81
72
  ## Phase 2: Research
82
73
 
@@ -130,8 +121,8 @@ Report:
130
121
 
131
122
  ## Related Commands
132
123
 
133
- | Need | Command |
134
- | ------------- | ------------- |
135
- | Create + start | `/create` |
136
- | Plan details | `/plan <id>` |
137
- | Pick up work | `/ship <id>` |
124
+ | Need | Command |
125
+ | -------------- | ------------ |
126
+ | Create + start | `/create` |
127
+ | Plan details | `/plan <id>` |
128
+ | Pick up work | `/ship <id>` |
@@ -12,6 +12,7 @@ Pick up where a previous session left off. Recover context, verify state, contin
12
12
 
13
13
  ```typescript
14
14
  skill({ name: "beads" });
15
+ skill({ name: "memory-grounding" });
15
16
  ```
16
17
 
17
18
  ## Phase 1: Verify Task
@@ -33,11 +34,7 @@ If not on the right branch, check out the feature branch. If uncommitted changes
33
34
 
34
35
  ## Phase 3: Find Handoff
35
36
 
36
- Check for handoff notes in the memory system:
37
-
38
- ```typescript
39
- memory_read({ file: "handoffs/$ARGUMENTS" });
40
- ```
37
+ Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: handoff file by bead ID, session history.
41
38
 
42
39
  If a handoff exists, it tells you:
43
40
 
@@ -46,12 +43,6 @@ If a handoff exists, it tells you:
46
43
  - What to do next
47
44
  - Any blockers
48
45
 
49
- Also search previous sessions:
50
-
51
- ```typescript
52
- find_sessions({ query: "$ARGUMENTS" });
53
- ```
54
-
55
46
  ## Phase 4: Load Artifacts
56
47
 
57
48
  Read all available context:
@@ -11,6 +11,7 @@ agent: review
11
11
  ```typescript
12
12
  skill({ name: "beads" });
13
13
  skill({ name: "requesting-code-review" });
14
+ skill({ name: "verification-gates" });
14
15
  ```
15
16
 
16
17
  ## Determine Input Type
@@ -32,13 +33,13 @@ skill({ name: "requesting-code-review" });
32
33
 
33
34
  ## Available Tools
34
35
 
35
- | Tool | Use When |
36
- | ------------ | --------------------------------------- |
37
- | `explore` | Finding patterns in codebase, prior art |
38
- | `scout` | External research, best practices |
39
- | `lsp` | Finding symbol definitions, references |
40
- | `tilth_tilth_search` | Finding code patterns |
41
- | `codesearch` | Real-world usage examples |
36
+ | Tool | Use When |
37
+ | -------------------- | --------------------------------------- |
38
+ | `explore` | Finding patterns in codebase, prior art |
39
+ | `scout` | External research, best practices |
40
+ | `lsp` | Finding symbol definitions, references |
41
+ | `tilth_tilth_search` | Finding code patterns |
42
+ | `codesearch` | Real-world usage examples |
42
43
 
43
44
  ## Phase 1: Gather Context
44
45
 
@@ -68,14 +69,7 @@ If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
68
69
 
69
70
  ## Phase 3: Automated Checks
70
71
 
71
- Detect project type and run the appropriate checks in parallel:
72
-
73
- | Project Type | Detect Via | Build | Test | Lint | Typecheck |
74
- | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
75
- | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
76
- | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
77
- | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
78
- | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
72
+ Follow the [verification-gates](../skill/verification-gates/SKILL.md) skill protocol.
79
73
 
80
74
  Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
81
75
 
@@ -16,6 +16,8 @@ Execute PRD tasks, verify each passes, run review, close the bead.
16
16
 
17
17
  ```typescript
18
18
  skill({ name: "beads" });
19
+ skill({ name: "memory-grounding" });
20
+ skill({ name: "workspace-setup" });
19
21
  skill({ name: "verification-before-completion" });
20
22
  ```
21
23
 
@@ -38,27 +40,19 @@ skill({ name: "verification-before-completion" });
38
40
 
39
41
  ## Available Tools
40
42
 
41
- | Tool | Use When |
42
- | --------- | ----------------------------------------- |
43
- | `explore` | Finding patterns in codebase, prior art |
44
- | `scout` | External research, best practices |
45
- | `lsp` | Finding symbol definitions, references |
46
- | `tilth_tilth_search` | Finding code patterns |
47
- | `task` | Spawning subagents for parallel execution |
43
+ | Tool | Use When |
44
+ | -------------------- | ----------------------------------------- |
45
+ | `explore` | Finding patterns in codebase, prior art |
46
+ | `scout` | External research, best practices |
47
+ | `lsp` | Finding symbol definitions, references |
48
+ | `tilth_tilth_search` | Finding code patterns |
49
+ | `task` | Spawning subagents for parallel execution |
48
50
 
49
51
  ## Phase 1: Guards
50
52
 
51
53
  ### Memory Grounding
52
54
 
53
- Search memory for context, prior decisions, and known issues before executing:
54
-
55
- ```typescript
56
- memory-search({ query: "$ARGUMENTS" });
57
- memory-search({ query: "<bead title keywords>", limit: 5 });
58
- memory-read({ file: "handoffs/last" });
59
- ```
60
-
61
- Use findings to avoid re-discovering known issues or repeating failed approaches.
55
+ Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: failed approaches to avoid repeating.
62
56
 
63
57
  ### Bead Validation
64
58
 
@@ -85,44 +79,9 @@ br update $ARGUMENTS --status in_progress
85
79
 
86
80
  Then ask about workspace:
87
81
 
88
- ```typescript
89
- question({
90
- questions: [
91
- {
92
- header: "Workspace",
93
- question: "How do you want to set up the workspace?",
94
- options: [
95
- {
96
- label: "Create feature branch (Recommended)",
97
- description: "git checkout -b feat/<bead-id>-<title>",
98
- },
99
- {
100
- label: "Use current branch",
101
- description: "Work on current branch",
102
- },
103
- ],
104
- },
105
- ],
106
- });
107
- ```
108
-
109
- **If feature branch selected:**
110
-
111
- Map bead type to branch prefix:
112
-
113
- | Bead Type | Branch Prefix |
114
- | --------- | ------------- |
115
- | feature | feat |
116
- | bug | fix |
117
- | task | task |
118
- | epic | epic |
119
-
120
- ```bash
121
- # Example: feat/br-42-add-auth
122
- git checkout -b $PREFIX/$BEAD_ID-$TITLE_SLUG
123
- ```
82
+ ### Workspace Setup
124
83
 
125
- **If current branch:** Continue without branch creation.
84
+ Follow the [workspace-setup](../skill/workspace-setup/SKILL.md) skill protocol.
126
85
 
127
86
  **If bead is already `in_progress`:** Skip this phase entirely.
128
87
 
@@ -27,6 +27,12 @@ updated: 2025-01-06
27
27
  - Language: TypeScript
28
28
  - Linter: oxlint
29
29
 
30
+ ## Editing Tool Preferences
31
+
32
+ - **Primary**: `edit` tool (str_replace) and `patch` tool
33
+ - **Secondary/Fallback**: `tilth_tilth_edit` (hash-anchored edits) — only when str_replace fails
34
+ - **Reading/Search**: `tilth_tilth_read` and `tilth_tilth_search` are fine to use freely
35
+
30
36
  ## Rules to Always Follow
31
37
 
32
38
  - Run `npm run lint:fix` before any commit
@@ -34,5 +40,6 @@ updated: 2025-01-06
34
40
  - Don't modify dist/ directly (it's built output)
35
41
  - Ask before adding new dependencies
36
42
  - Ask before changing .opencode/ structure
43
+ - Ask before schema changes (zod schemas, config shapes)
37
44
  - Never commit secrets or .env files
38
45
  - Never force push to main
Binary file
@@ -175,23 +175,25 @@
175
175
  "output": 32000
176
176
  },
177
177
  "options": {
178
- "thinking_budget": 24000,
179
- "type": "enabled"
178
+ "reasoningEffort": "high"
180
179
  },
181
180
  "reasoning": true,
182
181
  "temperature": true,
183
182
  "tool_call": true,
184
183
  "variants": {
185
- "high": {
184
+ "low": {
186
185
  "options": {
187
- "thinking_budget": 16000,
188
- "type": "enabled"
186
+ "reasoningEffort": "low"
189
187
  }
190
188
  },
191
- "max": {
189
+ "medium": {
192
190
  "options": {
193
- "thinking_budget": 32000,
194
- "type": "enabled"
191
+ "reasoningEffort": "medium"
192
+ }
193
+ },
194
+ "high": {
195
+ "options": {
196
+ "reasoningEffort": "high"
195
197
  }
196
198
  }
197
199
  }
@@ -203,20 +205,25 @@
203
205
  "output": 32000
204
206
  },
205
207
  "options": {
206
- "thinking_budget": 10000
208
+ "reasoningEffort": "medium"
207
209
  },
208
210
  "reasoning": true,
209
211
  "temperature": true,
210
212
  "tool_call": true,
211
213
  "variants": {
212
- "high": {
214
+ "low": {
213
215
  "options": {
214
- "thinking_budget": 16000
216
+ "reasoningEffort": "low"
215
217
  }
216
218
  },
217
- "max": {
219
+ "medium": {
218
220
  "options": {
219
- "thinking_budget": 32000
221
+ "reasoningEffort": "medium"
222
+ }
223
+ },
224
+ "high": {
225
+ "options": {
226
+ "reasoningEffort": "high"
220
227
  }
221
228
  }
222
229
  }
@@ -228,40 +235,25 @@
228
235
  "output": 64000
229
236
  },
230
237
  "options": {
231
- "thinking": {
232
- "budget_tokens": 24000,
233
- "type": "enabled"
234
- }
238
+ "reasoningEffort": "high"
235
239
  },
236
240
  "reasoning": true,
237
241
  "temperature": true,
238
242
  "tool_call": true,
239
243
  "variants": {
240
- "adaptive": {
244
+ "low": {
241
245
  "options": {
242
- "max_tokens": 16000,
243
- "output_config": {
244
- "effort": "max"
245
- },
246
- "thinking": {
247
- "type": "adaptive"
248
- }
246
+ "reasoningEffort": "low"
249
247
  }
250
248
  },
251
- "high": {
249
+ "medium": {
252
250
  "options": {
253
- "thinking": {
254
- "budget_tokens": 24000,
255
- "type": "enabled"
256
- }
251
+ "reasoningEffort": "medium"
257
252
  }
258
253
  },
259
- "max": {
254
+ "high": {
260
255
  "options": {
261
- "thinking": {
262
- "budget_tokens": 32000,
263
- "type": "enabled"
264
- }
256
+ "reasoningEffort": "high"
265
257
  }
266
258
  }
267
259
  }
@@ -273,20 +265,25 @@
273
265
  "output": 16000
274
266
  },
275
267
  "options": {
276
- "thinking_budget": 10000
268
+ "reasoningEffort": "medium"
277
269
  },
278
270
  "reasoning": true,
279
271
  "temperature": true,
280
272
  "tool_call": true,
281
273
  "variants": {
282
- "high": {
274
+ "low": {
283
275
  "options": {
284
- "thinking_budget": 16000
276
+ "reasoningEffort": "low"
285
277
  }
286
278
  },
287
- "max": {
279
+ "medium": {
280
+ "options": {
281
+ "reasoningEffort": "medium"
282
+ }
283
+ },
284
+ "high": {
288
285
  "options": {
289
- "thinking_budget": 32000
286
+ "reasoningEffort": "high"
290
287
  }
291
288
  }
292
289
  }
@@ -298,20 +295,25 @@
298
295
  "output": 32000
299
296
  },
300
297
  "options": {
301
- "thinking_budget": 10000
298
+ "reasoningEffort": "medium"
302
299
  },
303
300
  "reasoning": true,
304
301
  "temperature": true,
305
302
  "tool_call": true,
306
303
  "variants": {
307
- "high": {
304
+ "low": {
308
305
  "options": {
309
- "thinking_budget": 16000
306
+ "reasoningEffort": "low"
310
307
  }
311
308
  },
312
- "max": {
309
+ "medium": {
313
310
  "options": {
314
- "thinking_budget": 32000
311
+ "reasoningEffort": "medium"
312
+ }
313
+ },
314
+ "high": {
315
+ "options": {
316
+ "reasoningEffort": "high"
315
317
  }
316
318
  }
317
319
  }
@@ -323,40 +325,25 @@
323
325
  "output": 32000
324
326
  },
325
327
  "options": {
326
- "thinking": {
327
- "budget_tokens": 24000,
328
- "type": "enabled"
329
- }
328
+ "reasoningEffort": "high"
330
329
  },
331
330
  "reasoning": true,
332
331
  "temperature": true,
333
332
  "tool_call": true,
334
333
  "variants": {
335
- "adaptive": {
334
+ "low": {
336
335
  "options": {
337
- "max_tokens": 16000,
338
- "output_config": {
339
- "effort": "max"
340
- },
341
- "thinking": {
342
- "type": "adaptive"
343
- }
336
+ "reasoningEffort": "low"
344
337
  }
345
338
  },
346
- "high": {
339
+ "medium": {
347
340
  "options": {
348
- "thinking": {
349
- "budget_tokens": 16000,
350
- "type": "enabled"
351
- }
341
+ "reasoningEffort": "medium"
352
342
  }
353
343
  },
354
- "max": {
344
+ "high": {
355
345
  "options": {
356
- "thinking": {
357
- "budget_tokens": 32000,
358
- "type": "enabled"
359
- }
346
+ "reasoningEffort": "high"
360
347
  }
361
348
  }
362
349
  }
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@google/stitch-sdk": "^0.0.3",
15
- "@opencode-ai/plugin": "1.3.17"
15
+ "@opencode-ai/plugin": "1.4.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^25.3.0",
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: memory-grounding
3
+ description: >
4
+ Use at the start of any command that needs prior context — searches memory for decisions, patterns, and handoffs before execution to avoid re-solving solved problems.
5
+ version: 1.0.0
6
+ tags: [memory, grounding, pre-flight]
7
+ ---
8
+
9
+ # Memory Grounding
10
+
11
+ Search institutional memory before executing any command that modifies state or makes decisions.
12
+
13
+ ## When to Use
14
+
15
+ - At the start of `/ship`, `/plan`, `/create`, `/pr`, `/research`, `/resume`
16
+ - Before any command that benefits from prior context
17
+ - When you need to check if work was already done or decisions already made
18
+
19
+ ## When NOT to Use
20
+
21
+ - Read-only commands that don't need historical context (e.g., `/status`)
22
+ - Commands that explicitly skip grounding (e.g., `--no-memory` flag)
23
+
24
+ ## Protocol
25
+
26
+ ### Step 1: Search for relevant context
27
+
28
+ ```typescript
29
+ // Primary: search by bead ID or topic
30
+ memory-search({ query: "$ARGUMENTS" });
31
+
32
+ // Secondary: search by keywords with limit
33
+ memory-search({ query: "<feature or topic keywords>", limit: 5 });
34
+
35
+ // Optional: filter by type for specific needs
36
+ memory-search({ query: "<keywords>", type: "decision" }); // Past decisions
37
+ memory-search({ query: "<keywords>", type: "bugfix" }); // Known issues
38
+ ```
39
+
40
+ ### Step 2: Check last session handoff
41
+
42
+ ```typescript
43
+ memory-read({ file: "handoffs/last" });
44
+ ```
45
+
46
+ ### Step 3: Check session history (if resuming work)
47
+
48
+ ```typescript
49
+ find_sessions({ query: "$ARGUMENTS", limit: 3 });
50
+ ```
51
+
52
+ ### Step 4: Apply findings
53
+
54
+ - **If relevant findings exist:** Incorporate them directly. Don't re-solve solved problems.
55
+ - **If prior decisions found:** Follow them unless there's a clear reason to diverge (document the divergence).
56
+ - **If known issues found:** Account for them in the current approach.
57
+ - **If nothing found:** Proceed normally — absence of memory is not a blocker.
58
+
59
+ ## Command-Specific Variations
60
+
61
+ | Command | Extra Focus |
62
+ | ----------- | ------------------------------------------------------ |
63
+ | `/plan` | Search bugfixes; check for existing plans to overwrite |
64
+ | `/ship` | Search for failed approaches to avoid repeating |
65
+ | `/create` | Search for duplicate beads before creating |
66
+ | `/pr` | Include findings in PR description |
67
+ | `/research` | Search before spawning agents; narrow scope to gaps |
68
+ | `/resume` | Read handoff file by bead ID; check session history |
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: verification-gates
3
+ description: >
4
+ Use when running pre-merge or pre-PR verification checks. Detects project type and runs appropriate build, test, lint, and typecheck commands.
5
+ version: 1.0.0
6
+ tags: [verification, testing, lint, typecheck, ci]
7
+ ---
8
+
9
+ # Verification Gates
10
+
11
+ Detect project type and run the appropriate verification commands before merging or creating PRs.
12
+
13
+ ## When to Use
14
+
15
+ - In `/pr` before creating a pull request
16
+ - In `/review-codebase` during automated checks phase
17
+ - In `/ship` during final verification
18
+ - Any command that needs to verify code quality before completion
19
+
20
+ ## When NOT to Use
21
+
22
+ - For incremental checks during development (just run the specific tool)
23
+ - When only one check type is needed (e.g., lint-only)
24
+
25
+ ## Project Type Detection
26
+
27
+ | Project Type | Detect Via | Build | Test | Lint | Typecheck |
28
+ | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
29
+ | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
30
+ | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
31
+ | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
32
+ | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
33
+
34
+ ## Protocol
35
+
36
+ ### Step 1: Detect project type
37
+
38
+ Check for indicator files in the project root. Multiple types may coexist (e.g., Node + Python monorepo).
39
+
40
+ ### Step 2: Run checks in parallel where possible
41
+
42
+ ```bash
43
+ # Run typecheck and lint in parallel
44
+ npm run typecheck &
45
+ npm run lint &
46
+ wait
47
+
48
+ # Then run tests (may depend on build)
49
+ npm test
50
+ ```
51
+
52
+ ### Step 3: Report results
53
+
54
+ For each check, report:
55
+
56
+ - **Pass/Fail** status
57
+ - **Error count** (if failed)
58
+ - **Key error messages** (first 5)
59
+
60
+ ### Step 4: Gate decision
61
+
62
+ - **All pass:** Proceed with the command
63
+ - **Any fail:** Stop and report. Let the user decide whether to proceed or fix.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: workspace-setup
3
+ description: >
4
+ Use when a command needs to create a feature branch or set up a workspace for bead work. Shared by /create and /ship.
5
+ version: 1.0.0
6
+ tags: [git, workspace, branch, setup]
7
+ ---
8
+
9
+ # Workspace Setup
10
+
11
+ Set up a git workspace (branch or worktree) for bead-based work.
12
+
13
+ ## When to Use
14
+
15
+ - In `/create` after bead creation, before task conversion
16
+ - In `/ship` when auto-claiming an unclaimed bead
17
+ - Any command that needs to transition from "no workspace" to "active workspace"
18
+
19
+ ## When NOT to Use
20
+
21
+ - If bead is already `in_progress` with an existing branch
22
+ - If user explicitly chose "Use current branch"
23
+
24
+ ## Protocol
25
+
26
+ ### Step 1: Ask the user
27
+
28
+ ```typescript
29
+ question({
30
+ questions: [
31
+ {
32
+ header: "Workspace",
33
+ question: "How do you want to set up the workspace?",
34
+ options: [
35
+ {
36
+ label: "Create feature branch (Recommended)",
37
+ description: "git checkout -b <prefix>/<bead-id>-<title>",
38
+ },
39
+ {
40
+ label: "Use current branch",
41
+ description: "Work on current branch without creating a new one",
42
+ },
43
+ ],
44
+ },
45
+ ],
46
+ });
47
+ ```
48
+
49
+ > **Note:** `/create` may additionally offer a "Create worktree" option using `skill({ name: "using-git-worktrees" })`.
50
+
51
+ ### Step 2: Create branch (if selected)
52
+
53
+ Map bead type to branch prefix:
54
+
55
+ | Bead Type | Branch Prefix |
56
+ | --------- | ------------- |
57
+ | feature | feat |
58
+ | bug | fix |
59
+ | task | task |
60
+ | epic | epic |
61
+
62
+ Create the branch:
63
+
64
+ ```bash
65
+ git checkout -b $PREFIX/$BEAD_ID-$TITLE_SLUG
66
+ ```
67
+
68
+ Where `$TITLE_SLUG` is the bead title lowercased with spaces replaced by hyphens, truncated to ~50 chars.
69
+
70
+ ### Step 3: Confirm
71
+
72
+ ```bash
73
+ git branch --show-current
74
+ ```
75
+
76
+ Verify you're on the new branch before proceeding.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodekit",
3
- "version": "0.20.4",
3
+ "version": "0.20.5",
4
4
  "description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
5
5
  "keywords": [
6
6
  "agents",