opencodekit 0.19.5 → 0.19.6

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.19.5";
23
+ var version = "0.19.6";
24
24
 
25
25
  //#endregion
26
26
  //#region src/utils/license.ts
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Extract and persist learnings from completed work into institutional memory
3
3
  argument-hint: "[bead-id]"
4
+ agent: build
4
5
  ---
5
6
 
6
7
  # Compound: $ARGUMENTS
@@ -19,9 +20,9 @@ so future Plan and Ship cycles start with institutional knowledge instead of bla
19
20
  ## Phase 1: Gather Evidence
20
21
 
21
22
  ```bash
22
- # Get what changed
23
- git diff origin/main..HEAD --stat
24
- git log origin/main..HEAD --oneline
23
+ # Get what changed (falls back gracefully if no remote)
24
+ git diff origin/main..HEAD --stat 2>/dev/null || git diff HEAD~5..HEAD --stat
25
+ git log origin/main..HEAD --oneline 2>/dev/null || git log --oneline -10
25
26
 
26
27
  # Get review comments if any
27
28
  br comments list $ARGUMENTS 2>/dev/null || echo "No bead"
@@ -10,7 +10,7 @@ Create a bead and its specification (PRD) from a description.
10
10
 
11
11
  > **Workflow:** **`/create`** → `/start <id>` → `/ship <id>`
12
12
  >
13
- > This command creates the specification ONLY. Do NOT write any implementation code.
13
+ > This command creates the specification ONLY. Do NOT write any implementation code.
14
14
 
15
15
  ## Load Skills
16
16
 
@@ -133,24 +133,19 @@ Extract bead title and description from `$ARGUMENTS` before creating the bead.
133
133
  - If user provided multiple lines, use first line as title and full text as description.
134
134
 
135
135
  ```bash
136
- TITLE=$(echo "$ARGUMENTS" | head -n1)
137
- DESCRIPTION=$(echo "$ARGUMENTS")
138
-
139
- if [ "$TITLE" = "$DESCRIPTION" ]; then
140
- DESCRIPTION="$TITLE"
141
- fi
142
-
143
136
  BEAD_ID=$(br create --title "$TITLE" --description "$DESCRIPTION" --type $BEAD_TYPE --json | jq -r '.id')
144
137
  mkdir -p ".beads/artifacts/$BEAD_ID"
145
138
  ```
146
139
 
140
+ Extract title and description from `$ARGUMENTS`:
141
+ - Single line input: use as both title and description
142
+ - Multi-line input: first line as title, full text as description
143
+
147
144
  ## Phase 6: Write PRD
148
145
 
149
146
  Copy and fill the PRD template using context from Phase 3:
150
147
 
151
- ```bash
152
- cp .opencode/memory/_templates/prd.md ".beads/artifacts/$BEAD_ID/prd.md"
153
- ```
148
+ Read the PRD template from `.opencode/memory/_templates/prd.md` and write it to `.beads/artifacts/$BEAD_ID/prd.md`.
154
149
 
155
150
  ### Required Sections
156
151
 
@@ -32,9 +32,9 @@ skill({ name: "frontend-design" }); // Design system guidance, anti-patterns, re
32
32
  ## Phase 1: Detect Existing Design System
33
33
 
34
34
  ```typescript
35
- glob({ pattern: "**/tailwind.config.{js,ts,mjs}" });
36
- glob({ pattern: "**/globals.css" });
37
- glob({ pattern: "**/components.json" }); // shadcn
35
+ tilth_tilth_files({ pattern: "**/tailwind.config.{js,ts,mjs}" });
36
+ tilth_tilth_files({ pattern: "**/globals.css" });
37
+ tilth_tilth_files({ pattern: "**/components.json" }); // shadcn
38
38
  ```
39
39
 
40
40
  Read what exists. Don't design in a vacuum — build on the project's current system.
@@ -33,7 +33,7 @@ br show $ARGUMENTS
33
33
  git status --porcelain
34
34
  git branch --show-current
35
35
  git rev-parse --short HEAD
36
- ls .beads/artifacts/$ARGUMENTS/ 2>/dev/null
36
+ Read `.beads/artifacts/$ARGUMENTS/` to check existing artifacts.
37
37
  ```
38
38
 
39
39
  ---
@@ -60,10 +60,12 @@ question({
60
60
  If user chooses commit:
61
61
 
62
62
  ```bash
63
- git add -A
63
+ git add <specific-files-you-modified>
64
64
  git commit -m "WIP: $ARGUMENTS - [brief description of where you stopped]"
65
65
  ```
66
66
 
67
+ **Never use `git add -A` or `git add .`** — stage only the files you modified.
68
+
67
69
  ---
68
70
 
69
71
  ## Phase 3: Write Handoff
@@ -1,14 +1,26 @@
1
1
  ---
2
- description: Initialize GSD-style project planning context with integrated skill usage
2
+ description: Initialize project planning context (roadmap, state) with optional brownfield analysis
3
3
  argument-hint: "[--skip-questions] [--brownfield]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Init-Context: $ARGUMENTS
8
8
 
9
- Initialize GSD-style project planning with integrated skill usage.
9
+ Initialize project planning context files from templates.
10
10
 
11
- `tech-stack.md` is the default baseline project memory file. This command adds the optional planning files (`project.md`, `roadmap.md`, `state.md`) used for richer multi-session project context.
11
+ ## Architecture
12
+
13
+ **Auto-injected files** (always loaded into every prompt via `instructions[]`):
14
+ - `user.md` — identity, preferences
15
+ - `tech-stack.md` — framework, constraints
16
+ - `project.md` — vision, success criteria, principles
17
+ - `git-context.md` — spatial awareness
18
+
19
+ **On-demand files** (created by this command, loaded via `memory-read` when needed):
20
+ - `roadmap.md` — phases, milestones, bead planning
21
+ - `state.md` — current position, blockers, next actions
22
+
23
+ > **Warning:** Do NOT add roadmap.md or state.md to `instructions[]`. Per-prompt injection of too many files causes session OOM crashes. Use `memory-read({ file: "project/roadmap" })` or `memory-read({ file: "project/state" })` when needed.
12
24
 
13
25
  ## Load Skills
14
26
 
@@ -32,18 +44,20 @@ const args = {
32
44
 
33
45
  ### 1.1 Check Existing Context
34
46
 
35
- ```bash
36
- ls .opencode/memory/project/ 2>/dev/null && HAS_CONTEXT=true || HAS_CONTEXT=false
37
- cat .opencode/memory/project/project.md 2>/dev/null | head -20
47
+ Use tilth or Read to check for existing files:
48
+
49
+ ```typescript
50
+ tilth_tilth_files({ pattern: "*.md", scope: ".opencode/memory/project" });
51
+ // Or: Read({ filePath: ".opencode/memory/project/project.md", limit: 20 });
38
52
  ```
39
53
 
40
54
  **If planning context exists:**
41
55
 
42
56
  ```
43
- Existing optional planning context found:
44
- - project.md: [exists/size]
45
- - roadmap.md: [exists/size]
46
- - state.md: [exists/size]
57
+ Existing planning context found:
58
+ - project.md: [exists/size] (auto-injected)
59
+ - roadmap.md: [exists/size] (on-demand)
60
+ - state.md: [exists/size] (on-demand)
47
61
 
48
62
  Options:
49
63
  1. Refresh - Delete and recreate from templates
@@ -58,11 +72,10 @@ Wait for user selection.
58
72
  If `--brownfield` flag is set:
59
73
 
60
74
  ```typescript
61
- // Spawn parallel analysis agents (like GSD map-codebase)
62
75
  skill({ name: "swarm-coordination" });
63
76
 
64
77
  // Agent 1: Map tech stack
65
- Task({
78
+ task({
66
79
  subagent_type: "explore",
67
80
  description: "Analyze tech stack",
68
81
  prompt:
@@ -70,7 +83,7 @@ Task({
70
83
  });
71
84
 
72
85
  // Agent 2: Map architecture
73
- Task({
86
+ task({
74
87
  subagent_type: "explore",
75
88
  description: "Analyze architecture",
76
89
  prompt:
@@ -82,12 +95,11 @@ Task({
82
95
 
83
96
  ## Phase 2: Requirements Gathering
84
97
 
85
- ### 2.1 Load Brainstorming Skill (if not --skip-questions)
98
+ ### 2.1 Brainstorming (if not --skip-questions)
86
99
 
87
100
  ```typescript
88
101
  if (!args.skipQuestions) {
89
- skill({ name: "brainstorming" });
90
-
102
+ // brainstorming skill already loaded in Load Skills phase
91
103
  // Follow brainstorming process for project vision
92
104
  // Ask questions one at a time (as per brainstorming skill)
93
105
  // Output: Refined vision, success criteria, target users
@@ -106,12 +118,14 @@ Use template defaults with placeholders for:
106
118
 
107
119
  ## Phase 3: Document Creation
108
120
 
109
- ### 3.1 Create project.md
121
+ ### 3.1 Update project.md (auto-injected)
122
+
123
+ This file is auto-injected into every prompt. Keep it concise.
110
124
 
111
125
  **Load template:**
112
126
 
113
- ```bash
114
- cat .opencode/memory/_templates/project.md
127
+ ```typescript
128
+ Read({ filePath: ".opencode/memory/_templates/project.md" });
115
129
  ```
116
130
 
117
131
  **Fill with gathered data:**
@@ -122,9 +136,15 @@ cat .opencode/memory/_templates/project.md
122
136
  - Core principles (convention over config, minimal, extensible)
123
137
  - Current phase (from user input or template default)
124
138
 
125
- **Write to:** `.opencode/memory/project/project.md`
139
+ **Write using memory tools:**
140
+
141
+ ```typescript
142
+ memory-update({ file: "project/project", content: filledContent, mode: "replace" });
143
+ ```
144
+
145
+ ### 3.2 Create roadmap.md (on-demand)
126
146
 
127
- ### 3.2 Create roadmap.md
147
+ This file is NOT auto-injected. Access via `memory-read({ file: "project/roadmap" })`.
128
148
 
129
149
  **Parse phases from input:**
130
150
 
@@ -141,9 +161,15 @@ cat .opencode/memory/_templates/project.md
141
161
  | [Phase 1] | [Goal] | [Status] | [#] |
142
162
  ```
143
163
 
144
- **Write to:** `.opencode/memory/project/roadmap.md`
164
+ **Write using memory tools:**
145
165
 
146
- ### 3.3 Create state.md
166
+ ```typescript
167
+ memory-update({ file: "project/roadmap", content: roadmapContent, mode: "replace" });
168
+ ```
169
+
170
+ ### 3.3 Create state.md (on-demand)
171
+
172
+ This file is NOT auto-injected. Access via `memory-read({ file: "project/state" })`.
147
173
 
148
174
  **Initialize with:**
149
175
 
@@ -157,7 +183,11 @@ cat .opencode/memory/_templates/project.md
157
183
  - Open Questions: (empty table)
158
184
  - Next Actions: (empty list)
159
185
 
160
- **Write to:** `.opencode/memory/project/state.md`
186
+ **Write using memory tools:**
187
+
188
+ ```typescript
189
+ memory-update({ file: "project/state", content: stateContent, mode: "replace" });
190
+ ```
161
191
 
162
192
  ### 3.4 Brownfield Analysis Integration (if applicable)
163
193
 
@@ -166,16 +196,18 @@ If `--brownfield` analysis was run:
166
196
  ```typescript
167
197
  // Append tech/arch findings to project.md Context Notes section
168
198
  // Or create separate .opencode/memory/project/codebase/ documents
169
- // (similar to GSD's .planning/codebase/ approach)
170
199
  ```
171
200
 
172
201
  ## Phase 4: Verification & Security
173
202
 
174
203
  ### 4.1 Verify Documents Created
175
204
 
176
- ```bash
177
- ls -la .opencode/memory/project/
178
- wc -l .opencode/memory/project/*.md
205
+ ```typescript
206
+ tilth_tilth_files({ pattern: "*.md", scope: ".opencode/memory/project" });
207
+ // Verify each file exists and has content
208
+ Read({ filePath: ".opencode/memory/project/project.md", limit: 5 });
209
+ Read({ filePath: ".opencode/memory/project/roadmap.md", limit: 5 });
210
+ Read({ filePath: ".opencode/memory/project/state.md", limit: 5 });
179
211
  ```
180
212
 
181
213
  **Check:**
@@ -185,20 +217,19 @@ wc -l .opencode/memory/project/*.md
185
217
  - [ ] state.md exists and >20 lines
186
218
  - [ ] All files are readable
187
219
 
188
- ### 4.2 Secret Scan (Critical - from GSD pattern)
220
+ ### 4.2 Secret Scan
189
221
 
190
222
  ```bash
191
223
  # Scan for accidentally leaked secrets in generated docs
192
- grep -E '(sk-[a-zA-Z0-9]{20,}|sk_live_[a-zA-Z0-9]+|AKIA[A-Z0-9]{16}|ghp_[a-zA-Z0-9]{36}|-----BEGIN.*PRIVATE KEY)' .opencode/memory/project/*.md 2>/dev/null && SECRETS_FOUND=true || SECRETS_FOUND=false
224
+ grep -rE '(sk-[a-zA-Z0-9]{20,}|sk_live_[a-zA-Z0-9]+|AKIA[A-Z0-9]{16}|ghp_[a-zA-Z0-9]{36}|xoxb-[a-zA-Z0-9-]+|-----BEGIN.*PRIVATE KEY)' .opencode/memory/project/*.md 2>/dev/null && SECRETS_FOUND=true || SECRETS_FOUND=false
193
225
  ```
194
226
 
195
227
  **If secrets found:** Alert user and pause before proceeding.
196
228
 
197
- ### 4.3 Load Verification Skill
229
+ ### 4.3 Run Verification
198
230
 
199
231
  ```typescript
200
- skill({ name: "verification-before-completion" });
201
-
232
+ // verification-before-completion skill already loaded
202
233
  // Run verification checklist:
203
234
  // 1. IDENTIFY: Files created, structure valid
204
235
  // 2. RUN: Validation commands
@@ -207,25 +238,15 @@ skill({ name: "verification-before-completion" });
207
238
  // 5. CLAIM: Context initialization complete
208
239
  ```
209
240
 
210
- ## Phase 5: Beads Integration
211
-
212
- ### 5.1 Create Initialization Bead (optional)
213
-
214
- ```bash
215
- # If user wants to track context setup as a bead
216
- br create "Initialize project context" --type=task
217
- br update <bead-id> --status closed --reason="Context files created"
218
- ```
219
-
220
241
  ## Output
221
242
 
222
- Creates optional planning context in `.opencode/memory/project/`:
243
+ Creates planning context in `.opencode/memory/project/`:
223
244
 
224
- | File | Purpose | Lines (typical) |
225
- | ------------ | ---------------------------------------- | --------------- |
226
- | `project.md` | Vision, success criteria, principles | 50-100 |
227
- | `roadmap.md` | Phases, milestones, bead planning | 80-150 |
228
- | `state.md` | Current position, blockers, next actions | 60-100 |
245
+ | File | Purpose | Injection | Access |
246
+ | ------------ | ---------------------------------------- | ----------- | -------------------------------------------- |
247
+ | `project.md` | Vision, success criteria, principles | Auto-injected | Updated in-place (already in `instructions[]`) |
248
+ | `roadmap.md` | Phases, milestones, bead planning | On-demand | `memory-read({ file: "project/roadmap" })` |
249
+ | `state.md` | Current position, blockers, next actions | On-demand | `memory-read({ file: "project/state" })` |
229
250
 
230
251
  **If `--brownfield`:**
231
252
  Additional files in `.opencode/memory/project/codebase/`:
@@ -235,21 +256,24 @@ Additional files in `.opencode/memory/project/codebase/`:
235
256
 
236
257
  ## Success Criteria
237
258
 
238
- - [ ] All `/init-context` planning documents created from templates
259
+ - [ ] All planning documents created from templates
239
260
  - [ ] Documents follow template structure
240
261
  - [ ] No secrets leaked in generated files
241
262
  - [ ] Files pass basic validation (readable, non-empty)
242
- - [ ] User informed of next steps
263
+ - [ ] User informed of next steps and access patterns
243
264
 
244
- ## Phase 6: Custom Context (Optional)
265
+ ## Custom Context (Optional)
245
266
 
246
267
  Inform user about `.opencode/context/` for additional project-specific context:
247
268
 
248
269
  ```
249
270
  Custom context folder available at .opencode/context/
250
271
  - Add .md files with architecture decisions, domain knowledge, team agreements
251
- - Add file paths to opencode.json → instructions[] for AI prompt injection
252
272
  - This folder is preserved during init --force and upgrade
273
+
274
+ ⚠️ Only add files to instructions[] if they are essential for EVERY prompt.
275
+ Per-prompt injection adds ~2-4KB each. Too many files cause session OOM.
276
+ Prefer memory-read() for on-demand access instead.
253
277
  ```
254
278
 
255
279
  ## Next Steps
@@ -259,7 +283,7 @@ After init-context completes:
259
283
  1. **For new projects:** Use `/plan` to create first implementation plan
260
284
  2. **For brownfield:** Review codebase analysis, then `/plan`
261
285
  3. **For existing beads:** Use `/resume` to continue tracked work
262
- 4. **For custom context:** Add `.md` files to `.opencode/context/` and reference in `opencode.json` instructions
286
+ 4. **For custom context:** Add `.md` files to `.opencode/context/` (on-demand via Read, not auto-injected)
263
287
 
264
288
  ---
265
289
 
@@ -267,7 +291,7 @@ After init-context completes:
267
291
 
268
292
  | Skill | When Used | Purpose |
269
293
  | -------------------------------- | --------------------------------- | ------------------------------ |
294
+ | `context-initialization` | Phase 1 | Template verification |
270
295
  | `brainstorming` | Phase 2 (if not --skip-questions) | Refine vision and requirements |
271
296
  | `swarm-coordination` | Phase 1.2 (if --brownfield) | Parallel codebase analysis |
272
297
  | `verification-before-completion` | Phase 4 | Validate created files |
273
- | `beads` | Phase 5 | Track as bead if desired |
@@ -83,23 +83,28 @@ updated: [today]
83
83
 
84
84
  Ensure `user.md` is loaded in `instructions` (bare paths, no `file://` prefix).
85
85
 
86
- `tech-stack.md` is the core project memory file. Other files such as `project.md`, `roadmap.md`, `state.md`, and `gotchas.md` are optional/project-specific and should only be added if they actually exist and you want them injected.
87
-
88
- Example minimal setup:
86
+ The default `instructions[]` includes 4 auto-injected files:
89
87
 
90
88
  ```json
91
89
  {
92
- "instructions": [".opencode/memory/project/user.md", ".opencode/memory/project/tech-stack.md"]
90
+ "instructions": [
91
+ ".opencode/memory/project/user.md",
92
+ ".opencode/memory/project/tech-stack.md",
93
+ ".opencode/memory/project/project.md",
94
+ ".opencode/context/git-context.md"
95
+ ]
93
96
  }
94
97
  ```
95
98
 
99
+ > **Warning:** Do not add more files to `instructions[]` unless they are essential for every prompt. Per-prompt injection of too many files causes session OOM crashes. Use `memory-read()` for on-demand access instead.
100
+
96
101
  ## Phase 4: Report
97
102
 
98
103
  Output:
99
104
 
100
105
  1. user.md created at `.opencode/memory/project/user.md`
101
106
  2. Preferences captured
102
- 3. `tech-stack.md` is the only required project memory file by default
103
- 4. Additional project memory files are optional and can be added later
107
+ 3. 4 files are auto-injected by default: user.md, tech-stack.md, project.md, git-context.md
108
+ 4. Additional planning files (roadmap.md, state.md) are on-demand via `/init-context`
104
109
  5. Custom context available at `.opencode/context/` (preserved during init --force and upgrade)
105
110
  6. Next step: `/init-context` if the user wants fuller project-planning memory files
@@ -74,9 +74,7 @@ Create `./AGENTS.md` — **target <60 lines** (max 150). Follow the `index-knowl
74
74
 
75
75
  From template `.opencode/memory/_templates/tech-stack.md`:
76
76
 
77
- ```bash
78
- cp .opencode/memory/_templates/tech-stack.md .opencode/memory/project/tech-stack.md
79
- ```
77
+ Read the template from `.opencode/memory/_templates/tech-stack.md` and write it to `.opencode/memory/project/tech-stack.md`.
80
78
 
81
79
  Fill detected values:
82
80
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Full autonomous chain - Plan → Ship → Review → Compound in one command
3
3
  argument-hint: "<bead-id> [--skip-plan]"
4
+ agent: build
4
5
  ---
5
6
 
6
7
  # LFG (Let's Fucking Go): $ARGUMENTS
@@ -22,9 +23,10 @@ Full compound engineering cycle. One command, all four steps.
22
23
 
23
24
  ```bash
24
25
  br show $BEAD_ID
25
- ls .beads/artifacts/$BEAD_ID/
26
26
  ```
27
27
 
28
+ Read `.beads/artifacts/$BEAD_ID/` to check what artifacts exist.
29
+
28
30
  Verify:
29
31
 
30
32
  - Bead exists and is `in_progress`
@@ -73,7 +75,7 @@ Checkpoint only at `checkpoint:human-verify` or `checkpoint:decision` tasks.
73
75
  ## Step 3: REVIEW
74
76
 
75
77
  ```bash
76
- BASE_SHA=$(git rev-parse origin/main 2>/dev/null || git rev-parse HEAD~$(git log --oneline | wc -l | tr -d ' '))
78
+ BASE_SHA=$(git rev-parse origin/main 2>/dev/null || git merge-base HEAD origin/main)
77
79
  HEAD_SHA=$(git rev-parse HEAD)
78
80
  ```
79
81
 
@@ -10,7 +10,7 @@ Create a detailed implementation plan with TDD steps. Optional deep-planning bet
10
10
 
11
11
  > **Workflow:** `/create` → `/start <id>` → **`/plan <id>`** (optional) → `/ship <id>`
12
12
  >
13
- > Bead MUST be `in_progress` with `prd.md`. Use `/start` first.
13
+ > Bead MUST be `in_progress` with `prd.md`. Use `/start` first.
14
14
  >
15
15
  > **When to use:** Complex tasks where PRD verification steps aren't enough guidance. Skip for simple tasks.
16
16
 
@@ -97,9 +97,10 @@ task({
97
97
 
98
98
  ```bash
99
99
  br show $ARGUMENTS
100
- ls .beads/artifacts/$ARGUMENTS/
101
100
  ```
102
101
 
102
+ Read `.beads/artifacts/$ARGUMENTS/` to check what artifacts exist.
103
+
103
104
  Verify:
104
105
 
105
106
  - Bead is `in_progress`
@@ -125,24 +126,23 @@ Before research, determine discovery level based on PRD:
125
126
  **Decision:** Ask user to confirm or adjust:
126
127
 
127
128
  ```typescript
128
- const suggestedLevel = assessDiscoveryLevel(prdContent);
129
-
130
129
  question({
131
130
  questions: [
132
131
  {
133
132
  header: "Discovery Level",
134
- question: `Suggested: Level ${suggestedLevel} (${getLevelDescription(suggestedLevel)}). Proceed?`,
133
+ question: "Suggested discovery level based on PRD complexity. Proceed?",
135
134
  options: [
136
- { label: `Yes, Level ${suggestedLevel} (Recommended)` },
137
- { label: "Lower (less research)", description: "If you know the patterns" },
138
- { label: "Higher (more research)", description: "If uncertain about approach" },
139
- { label: "Skip research", description: "I know the codebase" },
135
+ { label: "Deep (Recommended for complex work)", description: "Level 2-3: spawn scout + explore agents" },
136
+ { label: "Standard", description: "Level 1: quick doc lookup" },
137
+ { label: "Skip research", description: "Level 0: I know the codebase" },
140
138
  ],
141
139
  },
142
140
  ],
143
141
  });
144
142
  ```
145
143
 
144
+ Determine level from PRD content: Level 2+ if new library, external API, or "choose/evaluate" language. Level 3 if "architecture/design/system".
145
+
146
146
  ## Phase 3: Research (if Level 1-3)
147
147
 
148
148
  Read the PRD and extract tasks, success criteria, affected files, scope.
@@ -53,9 +53,10 @@ If bead ID provided:
53
53
 
54
54
  ```bash
55
55
  br show $ARGUMENTS
56
- ls .beads/artifacts/$ARGUMENTS/
57
56
  ```
58
57
 
58
+ Read `.beads/artifacts/$ARGUMENTS/` to check what artifacts exist.
59
+
59
60
  Read the PRD to extract goal and success criteria for the PR description.
60
61
 
61
62
  ## Phase 2B: Pre-PR Review
@@ -115,6 +116,9 @@ git push -u origin $(git branch --show-current)
115
116
  ## Phase 4: Create PR
116
117
 
117
118
  ```bash
119
+ # Verify gh CLI is installed
120
+ command -v gh >/dev/null 2>&1 || { echo "Error: gh CLI not found. Install: https://cli.github.com"; exit 1; }
121
+
118
122
  gh pr create --title "<title>" --body "$(cat <<'EOF'
119
123
  ## Summary
120
124
 
@@ -33,13 +33,13 @@ If not on the right branch, check out the feature branch. If uncommitted changes
33
33
 
34
34
  ## Phase 3: Find Handoff
35
35
 
36
- Check for handoff notes:
36
+ Check for handoff notes in the memory system:
37
37
 
38
- ```bash
39
- ls .beads/artifacts/$ARGUMENTS/handoffs/ 2>/dev/null
38
+ ```typescript
39
+ memory_read({ file: "handoffs/$ARGUMENTS" });
40
40
  ```
41
41
 
42
- If a handoff exists, read the latest one. It tells you:
42
+ If a handoff exists, it tells you:
43
43
 
44
44
  - What was completed
45
45
  - Where work stopped
@@ -37,7 +37,7 @@ skill({ name: "requesting-code-review" });
37
37
  | `explore` | Finding patterns in codebase, prior art |
38
38
  | `scout` | External research, best practices |
39
39
  | `lsp` | Finding symbol definitions, references |
40
- | `grep` | Finding code patterns |
40
+ | `tilth_tilth_search` | Finding code patterns |
41
41
  | `codesearch` | Real-world usage examples |
42
42
 
43
43
  ## Phase 1: Gather Context
@@ -66,7 +66,7 @@ If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
66
66
 
67
67
  If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
68
68
 
69
- ## Phase 2: Automated Checks
69
+ ## Phase 3: Automated Checks
70
70
 
71
71
  Detect project type and run the appropriate checks in parallel:
72
72
 
@@ -86,7 +86,7 @@ Also scan for common issues appropriate to the detected language:
86
86
  - `TODO|FIXME|HACK` markers
87
87
  - Hardcoded secrets patterns
88
88
 
89
- ## Phase 3: Manual Review
89
+ ## Phase 4: Manual Review
90
90
 
91
91
  Review each category:
92
92
 
@@ -105,7 +105,7 @@ Review each category:
105
105
  - Default: Full automated + manual review
106
106
  - `--thorough`: Deep analysis of all categories
107
107
 
108
- ## Phase 4: Report
108
+ ## Phase 5: Report
109
109
 
110
110
  Group findings by severity:
111
111
 
@@ -10,7 +10,7 @@ Execute PRD tasks, verify each passes, run review, close the bead.
10
10
 
11
11
  > **Workflow:** `/create` → `/start <id>` → **`/ship <id>`**
12
12
  >
13
- > Bead MUST be `in_progress` with `prd.md`. Run `/start` first if not.
13
+ > Bead MUST be `in_progress` with `prd.md`. Run `/start` first if not.
14
14
 
15
15
  ## Load Skills
16
16
 
@@ -43,7 +43,7 @@ skill({ name: "verification-before-completion" });
43
43
  | `explore` | Finding patterns in codebase, prior art |
44
44
  | `scout` | External research, best practices |
45
45
  | `lsp` | Finding symbol definitions, references |
46
- | `grep` | Finding code patterns |
46
+ | `tilth_tilth_search` | Finding code patterns |
47
47
  | `task` | Spawning subagents for parallel execution |
48
48
 
49
49
  ## Phase 1: Guards
@@ -59,9 +59,7 @@ Verify:
59
59
 
60
60
  Check what artifacts exist:
61
61
 
62
- ```bash
63
- ls .beads/artifacts/$ARGUMENTS/
64
- ```
62
+ Read `.beads/artifacts/$ARGUMENTS/` to check what artifacts exist.
65
63
 
66
64
  ## Phase 2: Route to Execution
67
65
 
@@ -203,7 +201,7 @@ Follow the [Verification Protocol](../skill/verification-before-completion/refer
203
201
  - All 4 gates must pass before proceeding to commit/push
204
202
  - Also run PRD `Verify:` commands
205
203
 
206
- ## Phase 6: Review
204
+ ## Phase 5: Review
207
205
 
208
206
  Load and run the review skill:
209
207
 
@@ -267,7 +265,7 @@ return Response.json({ok: true}) // Static, not query result
267
265
 
268
266
  If any artifact fails Level 2 or 3 → fix → re-verify.
269
267
 
270
- ## Phase 7: Close
268
+ ## Phase 6: Close
271
269
 
272
270
  Ask user before closing:
273
271
 
@@ -56,9 +56,10 @@ br list --status=in_progress
56
56
 
57
57
  ```bash
58
58
  br show $ARGUMENTS
59
- ls .beads/artifacts/$ARGUMENTS/
60
59
  ```
61
60
 
61
+ Read `.beads/artifacts/$ARGUMENTS/` to check what artifacts exist.
62
+
62
63
  Verify `prd.md` exists and has real content (not just placeholders). If missing or incomplete, tell user to run `/create` first.
63
64
 
64
65
  ## Phase 3: Claim
@@ -107,18 +108,15 @@ Map bead type to branch prefix:
107
108
  | task | task |
108
109
  | epic | epic |
109
110
 
111
+ Create the branch:
112
+
110
113
  ```bash
111
- PREFIX=$(case "$BEAD_TYPE" in
112
- feature) echo "feat" ;;
113
- bug) echo "fix" ;;
114
- task) echo "task" ;;
115
- epic) echo "epic" ;;
116
- *) echo "task" ;;
117
- esac)
118
- TITLE_SLUG=$(echo "$TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
119
- git checkout -b $PREFIX/$ARGUMENTS-$TITLE_SLUG
114
+ # Example: feat/br-42-add-auth
115
+ git checkout -b $PREFIX/$BEAD_ID-$TITLE_SLUG
120
116
  ```
121
117
 
118
+ Slugify the title (lowercase, spaces to hyphens) and use the bead type to determine the prefix.
119
+
122
120
  **If worktree selected:**
123
121
 
124
122
  ```typescript
@@ -63,7 +63,7 @@ git log --oneline -5
63
63
  ```
64
64
 
65
65
  ```typescript
66
- find_sessions({ query: "today", limit: 5 });
66
+ find_sessions({ query: "<project-name or recent-bead-keywords>", limit: 5 });
67
67
  ```
68
68
 
69
69
  ---
@@ -19,12 +19,12 @@ skill({ name: "accessibility-audit" }); // Keyboard/focus/contrast checks
19
19
 
20
20
  ## Parse Arguments
21
21
 
22
- | Argument | Default | Description |
23
- | --------------- | ------- | -------------------------------------------------- | ----------------------------------------------------------- |
24
- | `[path | auto]` | `auto` | Specific file/dir to audit, or auto-detect changed UI files |
25
- | `--staged` | false | Audit staged changes only (`git diff --cached`) |
26
- | `--since=<ref>` | `HEAD` | Compare against ref (`main`, `HEAD~1`, commit SHA) |
27
- | `--full-report` | false | Include all categories even when no issues found |
22
+ | Argument | Default | Description |
23
+ | --------------- | ------- | ------------------------------------------------------------- |
24
+ | `[path\|auto]` | `auto` | Specific file/dir to audit, or auto-detect changed UI files |
25
+ | `--staged` | false | Audit staged changes only (`git diff --cached`) |
26
+ | `--since=<ref>` | `HEAD` | Compare against ref (`main`, `HEAD~1`, commit SHA) |
27
+ | `--full-report` | false | Include all categories even when no issues found |
28
28
 
29
29
  ## Phase 1: Resolve Target Files
30
30
 
@@ -45,11 +45,10 @@ skill({ name: "verification-before-completion" });
45
45
  Before running any gates, check if a recent verification is still valid:
46
46
 
47
47
  ```bash
48
- # Compute current state fingerprint (commit hash + full diff + untracked files)
49
- CURRENT_STAMP=$(printf '%s\n%s\n%s' \
48
+ # Compute current state fingerprint (commit hash + diff)
49
+ CURRENT_STAMP=$(printf '%s\n%s' \
50
50
  "$(git rev-parse HEAD)" \
51
51
  "$(git diff HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx')" \
52
- "$(git ls-files --others --exclude-standard -- '*.ts' '*.tsx' '*.js' '*.jsx' | xargs cat 2>/dev/null)" \
53
52
  | shasum -a 256 | cut -d' ' -f1)
54
53
  LAST_STAMP=$(tail -1 .beads/verify.log 2>/dev/null | awk '{print $1}')
55
54
  ```
@@ -70,9 +69,10 @@ Verification: cached PASS (no changes since <timestamp from verify.log>)
70
69
 
71
70
  ```bash
72
71
  br show $ARGUMENTS
73
- ls .beads/artifacts/$ARGUMENTS/
74
72
  ```
75
73
 
74
+ Read `.beads/artifacts/$ARGUMENTS/` to check what artifacts exist.
75
+
76
76
  Read the PRD and any other artifacts (plan.md, research.md, design.md).
77
77
 
78
78
  **Verify guards:**
@@ -36,7 +36,7 @@
36
36
  "compress": {
37
37
  // "range" (stable) compresses spans into block summaries
38
38
  // "message" (experimental) compresses individual raw messages
39
- "mode": "message",
39
+ "mode": "range",
40
40
  // "allow" (no prompt) | "ask" (prompt) | "deny" (tool not registered)
41
41
  "permission": "allow",
42
42
  "showCompression": false,
Binary file
@@ -82,8 +82,6 @@
82
82
  ".opencode/memory/project/user.md",
83
83
  ".opencode/memory/project/tech-stack.md",
84
84
  ".opencode/memory/project/project.md",
85
- ".opencode/memory/project/roadmap.md",
86
- ".opencode/memory/project/state.md",
87
85
  ".opencode/context/git-context.md"
88
86
  ],
89
87
  "keybinds": {
@@ -92,7 +90,7 @@
92
90
  },
93
91
  "mcp": {
94
92
  "tilth": {
95
- "command": ["tilth", "--mcp", "--edit"],
93
+ "command": ["npx", "-y", "tilth", "--mcp", "--edit"],
96
94
  "enabled": true,
97
95
  "environment": {
98
96
  "TILTH_THREADS": "8"
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: context-initialization
3
- description: Initialize GSD-style project context files from templates
4
- version: 1.0.0
3
+ description: Initialize project context files from templates. Creates on-demand planning files (roadmap.md, state.md) and updates auto-injected project.md.
4
+ version: 2.0.0
5
5
  tags: [context, workflow]
6
6
  dependencies: []
7
7
  ---
@@ -11,20 +11,19 @@ dependencies: []
11
11
  ## When to Use
12
12
 
13
13
  - When initializing project context files (project.md, roadmap.md, state.md) from templates.
14
+ - project.md is auto-injected into every prompt; roadmap.md and state.md are on-demand.
14
15
 
15
16
  ## When NOT to Use
16
17
 
17
18
  - When context files already exist and only need minor manual edits.
18
19
 
19
-
20
20
  ## Process
21
21
 
22
22
  ### 1. Verify Templates
23
23
 
24
- ```bash
25
- test -f .opencode/memory/_templates/project.md
26
- test -f .opencode/memory/_templates/roadmap.md
27
- test -f .opencode/memory/_templates/state.md
24
+ ```typescript
25
+ tilth_tilth_files({ pattern: "*.md", scope: ".opencode/memory/_templates" });
26
+ // Required templates: project.md, roadmap.md, state.md
28
27
  ```
29
28
 
30
29
  Stop if missing.
@@ -43,28 +42,28 @@ Skip if `--skip-questions` flag set.
43
42
 
44
43
  ### 3. Create Files
45
44
 
46
- **project.md**
45
+ **project.md** (auto-injected — keep concise)
47
46
 
48
- - Read template
47
+ - Read template via `Read({ filePath: ".opencode/memory/_templates/project.md" })`
49
48
  - Fill with answers
50
- - Write to `.opencode/memory/project/`
49
+ - Write via `memory-update({ file: "project/project", content: ..., mode: "replace" })`
51
50
 
52
- **roadmap.md**
51
+ **roadmap.md** (on-demand — access via `memory-read({ file: "project/roadmap" })`)
53
52
 
54
53
  - Read template
55
54
  - Parse phases into table
56
- - Write to `.opencode/memory/project/`
55
+ - Write via `memory-update({ file: "project/roadmap", content: ..., mode: "replace" })`
57
56
 
58
- **state.md**
57
+ **state.md** (on-demand — access via `memory-read({ file: "project/state" })`)
59
58
 
60
59
  - Read template
61
60
  - Set initial state
62
- - Write to `.opencode/memory/project/`
61
+ - Write via `memory-update({ file: "project/state", content: ..., mode: "replace" })`
63
62
 
64
63
  ### 4. Verify
65
64
 
66
- ```bash
67
- ls .opencode/memory/project/
65
+ ```typescript
66
+ tilth_tilth_files({ pattern: "*.md", scope: ".opencode/memory/project" });
68
67
  ```
69
68
 
70
- Report created files.
69
+ Report created files with their injection status (auto-injected vs on-demand).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: tilth-cli
3
3
  description: AST-aware code navigation via tilth CLI. Use when subagents need structural code search, smart file reading, or codebase mapping — complements MCP tilth (which only the main agent can access).
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  tags: [code-navigation, search, subagent]
6
6
  dependencies: []
7
7
  ---
@@ -58,20 +58,31 @@ Output: numbered lines (`N content`). Large files get a structural outline; use
58
58
  ```bash
59
59
  npx -y tilth initCommand --scope src/ # Find definition + all usages
60
60
  npx -y tilth handleAuth --scope src/auth/ # Scoped to subdirectory
61
+ npx -y tilth "sym1,sym2" --scope src/ # Multi-symbol search (max 5)
61
62
  ```
62
63
 
63
64
  Returns: definitions first (with expanded source), then usages with context lines.
64
65
 
65
- ### 3. Search for Text
66
+ ### 3. Search for Text / Regex
66
67
 
67
68
  ```bash
68
69
  npx -y tilth "TODO" --scope src/ # Literal text search
69
70
  npx -y tilth "version" --scope src/ # Finds all occurrences
71
+ npx -y tilth --kind content "config" --scope src/ # Explicit content search
72
+ npx -y tilth --kind regex "/TODO.*fix/" --scope src/ # Regex search
70
73
  ```
71
74
 
72
- tilth auto-detects text vs symbol. Identifiers (camelCase, snake_case) → symbol search. Multi-word or quoted strings → text search.
75
+ tilth auto-detects text vs symbol. Identifiers (camelCase, snake_case) → symbol search. Multi-word or quoted strings → text search. Use `--kind` to force a specific search mode.
73
76
 
74
- ### 4. List Files (Glob)
77
+ ### 4. Find Callers
78
+
79
+ ```bash
80
+ npx -y tilth --kind callers initCommand --scope src/ # Find all call sites
81
+ ```
82
+
83
+ Uses SIMD-accelerated pre-filtering + tree-sitter AST parsing. More accurate than text grep for finding actual function calls vs. comments/strings.
84
+
85
+ ### 5. List Files (Glob)
75
86
 
76
87
  ```bash
77
88
  npx -y tilth "*.test.ts" --scope src/ # List test files
@@ -80,27 +91,37 @@ npx -y tilth "*.ts" --scope src/commands/ # List TS files in subdir
80
91
 
81
92
  Returns: matched file paths with token size estimates.
82
93
 
83
- ### 5. Codebase Map (CLI-Only)
94
+ ### 6. Blast-Radius Analysis (Deps)
95
+
96
+ ```bash
97
+ npx -y tilth --deps src/utils/errors.ts # What imports this file + what it imports
98
+ npx -y tilth --deps src/commands/init.ts --scope src/ # Scoped dependency check
99
+ ```
100
+
101
+ Shows imports (local + external) AND what other files call its exports, with symbol-level detail. Use before renaming/removing exports.
102
+
103
+ ### 7. Codebase Map (CLI-Only)
84
104
 
85
105
  ```bash
86
106
  npx -y tilth --map --scope src/ # Structural skeleton
87
107
  npx -y tilth --map --scope . # Whole project
88
108
  ```
89
109
 
90
- Returns: directory tree with exported symbols per file. **CLI-only** — not available in MCP mode.
110
+ Returns: directory tree with exported symbols per file. **CLI-only** — deliberately excluded from MCP (agents overuse it).
91
111
 
92
112
  ## Available Flags
93
113
 
94
- | Flag | Purpose | Example |
95
- | ------------------- | -------------------------------------- | -------------------- |
96
- | `--scope <DIR>` | Restrict search to directory | `--scope src/` |
97
- | `--section <RANGE>` | Line range or heading for file reads | `--section 45-89` |
98
- | `--full` | Force full file content (skip outline) | `--full` |
99
- | `--budget <N>` | Max tokens in response | `--budget 2000` |
100
- | `--json` | Machine-readable JSON output | `--json` |
101
- | `--map` | Generate codebase structure map | `--map --scope src/` |
102
-
103
- **Note:** `--kind`, `--deps`, `--expand`, and multi-symbol comma syntax are MCP-only features. The CLI does not support them.
114
+ | Flag | Purpose | Example |
115
+ | ------------------- | ---------------------------------------- | --------------------------- |
116
+ | `--scope <DIR>` | Restrict search to directory | `--scope src/` |
117
+ | `--section <RANGE>` | Line range or heading for file reads | `--section 45-89` |
118
+ | `--full` | Force full file content (skip outline) | `--full` |
119
+ | `--budget <N>` | Max tokens in response | `--budget 2000` |
120
+ | `--json` | Machine-readable JSON output | `--json` |
121
+ | `--map` | Generate codebase structure map | `--map --scope src/` |
122
+ | `--kind <TYPE>` | Force search type: symbol/content/regex/callers | `--kind callers` |
123
+ | `--deps` | Show blast-radius (imports + dependents) | `--deps src/file.ts` |
124
+ | `--expand <N>` | Top N matches to show full source | `--expand 3` |
104
125
 
105
126
  ## MCP vs CLI Comparison
106
127
 
@@ -108,10 +129,10 @@ Returns: directory tree with exported symbols per file. **CLI-only** — not ava
108
129
  | ------------------------------------- | ---------------- | ------------------- |
109
130
  | Session dedup (`[shown earlier]`) | Yes | No |
110
131
  | Hash-anchored editing (`tilth_edit`) | Yes | No |
111
- | Blast-radius analysis (`tilth_deps`) | Yes | No |
112
- | Multi-symbol search (`sym1,sym2`) | Yes | No |
113
- | `--kind` flag (content/regex/callers) | Yes | No |
114
- | `--expand` control | Yes | No |
132
+ | Blast-radius analysis (`--deps`) | Yes | Yes (v0.5.7+) |
133
+ | Multi-symbol search (`sym1,sym2`) | Yes | Yes (v0.5.7+) |
134
+ | `--kind` flag (content/regex/callers) | Yes | Yes (v0.5.7+) |
135
+ | `--expand` control | Yes | Yes (v0.5.7+) |
115
136
  | `--map` codebase skeleton | No | Yes |
116
137
  | Subagent access | No (main only) | Yes (any with Bash) |
117
138
  | Process overhead | Once (~17ms) | Per call (~17ms) |
@@ -161,6 +182,8 @@ utils/
161
182
  - **Use `--scope`** to narrow searches — avoids scanning irrelevant directories
162
183
  - **Use `--budget`** when you need concise output (limits token count)
163
184
  - **~17ms per call** — fast enough for interactive use, but avoid unnecessary repeated calls
185
+ - **Use `--kind callers`** for precise call-site analysis instead of text grep
186
+ - **Use `--deps`** before renaming or removing exports to check blast radius
164
187
 
165
188
  ## Example Subagent Dispatch
166
189
 
@@ -171,6 +194,10 @@ task({
171
194
 
172
195
  Find the definition of \`initCommand\` and understand how it's called:
173
196
  npx -y tilth initCommand --scope src/
197
+ npx -y tilth --kind callers initCommand --scope src/
198
+
199
+ Check blast radius before editing:
200
+ npx -y tilth --deps src/commands/init.ts
174
201
 
175
202
  Then read the relevant file section:
176
203
  npx -y tilth src/commands/init.ts --section 515-600
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodekit",
3
- "version": "0.19.5",
3
+ "version": "0.19.6",
4
4
  "description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
5
5
  "keywords": [
6
6
  "agents",