opencodekit 0.20.3 → 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.
Files changed (32) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +14 -9
  3. package/dist/template/.opencode/agent/build.md +0 -32
  4. package/dist/template/.opencode/agent/plan.md +0 -14
  5. package/dist/template/.opencode/agent/review.md +0 -40
  6. package/dist/template/.opencode/command/create.md +11 -61
  7. package/dist/template/.opencode/command/plan.md +11 -12
  8. package/dist/template/.opencode/command/pr.md +4 -16
  9. package/dist/template/.opencode/command/research.md +7 -16
  10. package/dist/template/.opencode/command/resume.md +2 -11
  11. package/dist/template/.opencode/command/review-codebase.md +9 -15
  12. package/dist/template/.opencode/command/ship.md +12 -53
  13. package/dist/template/.opencode/memory/project/user.md +7 -0
  14. package/dist/template/.opencode/memory.db +0 -0
  15. package/dist/template/.opencode/memory.db-shm +0 -0
  16. package/dist/template/.opencode/memory.db-wal +0 -0
  17. package/dist/template/.opencode/opencode.json +54 -67
  18. package/dist/template/.opencode/package.json +1 -1
  19. package/dist/template/.opencode/plugin/README.md +1 -1
  20. package/dist/template/.opencode/plugin/lib/compact.ts +194 -0
  21. package/dist/template/.opencode/plugin/lib/db/graph.ts +253 -0
  22. package/dist/template/.opencode/plugin/lib/db/observations.ts +8 -3
  23. package/dist/template/.opencode/plugin/lib/db/schema.ts +96 -5
  24. package/dist/template/.opencode/plugin/lib/db/types.ts +73 -0
  25. package/dist/template/.opencode/plugin/lib/memory-admin-tools.ts +36 -3
  26. package/dist/template/.opencode/plugin/lib/memory-db.ts +12 -1
  27. package/dist/template/.opencode/plugin/lib/memory-tools.ts +137 -1
  28. package/dist/template/.opencode/plugin/memory.ts +2 -1
  29. package/dist/template/.opencode/skill/memory-grounding/SKILL.md +68 -0
  30. package/dist/template/.opencode/skill/verification-gates/SKILL.md +63 -0
  31. package/dist/template/.opencode/skill/workspace-setup/SKILL.md +76 -0
  32. package/package.json +1 -1
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.3";
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