opencodekit 0.20.2 → 0.20.3

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 (50) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/agent/build.md +4 -0
  3. package/dist/template/.opencode/agent/explore.md +4 -0
  4. package/dist/template/.opencode/agent/general.md +4 -0
  5. package/dist/template/.opencode/agent/plan.md +4 -0
  6. package/dist/template/.opencode/agent/review.md +4 -0
  7. package/dist/template/.opencode/agent/scout.md +4 -0
  8. package/dist/template/.opencode/command/create.md +119 -25
  9. package/dist/template/.opencode/command/design.md +1 -2
  10. package/dist/template/.opencode/command/health.md +234 -0
  11. package/dist/template/.opencode/command/init-user.md +15 -0
  12. package/dist/template/.opencode/command/plan.md +3 -4
  13. package/dist/template/.opencode/command/pr.md +13 -0
  14. package/dist/template/.opencode/command/research.md +15 -3
  15. package/dist/template/.opencode/command/review-codebase.md +11 -1
  16. package/dist/template/.opencode/command/ship.md +72 -8
  17. package/dist/template/.opencode/command/status.md +1 -1
  18. package/dist/template/.opencode/command/ui-review.md +0 -1
  19. package/dist/template/.opencode/command/ui-slop-check.md +1 -1
  20. package/dist/template/.opencode/command/verify.md +11 -1
  21. package/dist/template/.opencode/memory.db +0 -0
  22. package/dist/template/.opencode/memory.db-shm +0 -0
  23. package/dist/template/.opencode/memory.db-wal +0 -0
  24. package/dist/template/.opencode/opencode.json +1678 -1677
  25. package/dist/template/.opencode/plugin/lib/compile.ts +253 -0
  26. package/dist/template/.opencode/plugin/lib/index-generator.ts +170 -0
  27. package/dist/template/.opencode/plugin/lib/lint.ts +359 -0
  28. package/dist/template/.opencode/plugin/lib/memory-admin-tools.ts +42 -1
  29. package/dist/template/.opencode/plugin/lib/memory-db.ts +7 -0
  30. package/dist/template/.opencode/plugin/lib/memory-helpers.ts +30 -0
  31. package/dist/template/.opencode/plugin/lib/memory-hooks.ts +10 -0
  32. package/dist/template/.opencode/plugin/lib/memory-tools.ts +30 -1
  33. package/dist/template/.opencode/plugin/lib/operation-log.ts +109 -0
  34. package/dist/template/.opencode/plugin/lib/validate.ts +243 -0
  35. package/dist/template/.opencode/skill/design-taste-frontend/SKILL.md +13 -1
  36. package/dist/template/.opencode/skill/figma-go/SKILL.md +1 -1
  37. package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +13 -0
  38. package/dist/template/.opencode/skill/high-end-visual-design/SKILL.md +13 -0
  39. package/dist/template/.opencode/skill/industrial-brutalist-ui/SKILL.md +13 -0
  40. package/dist/template/.opencode/skill/memory-system/SKILL.md +65 -1
  41. package/dist/template/.opencode/skill/minimalist-ui/SKILL.md +13 -0
  42. package/dist/template/.opencode/skill/redesign-existing-projects/SKILL.md +13 -0
  43. package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +48 -2
  44. package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +108 -0
  45. package/dist/template/.opencode/skill/skill-creator/SKILL.md +25 -0
  46. package/dist/template/.opencode/skill/stitch-design-taste/SKILL.md +13 -0
  47. package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +46 -0
  48. package/package.json +1 -1
  49. package/dist/template/.opencode/agent/runner.md +0 -79
  50. package/dist/template/.opencode/command/start.md +0 -156
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.2";
23
+ var version = "0.20.3";
24
24
 
25
25
  //#endregion
26
26
  //#region src/utils/license.ts
@@ -8,6 +8,10 @@ permission:
8
8
  "git push*": ask
9
9
  "rm -rf*": ask
10
10
  "sudo*": ask
11
+ "git add .": deny
12
+ "git add -A": deny
13
+ "*--no-verify*": deny
14
+ "cat .env*": deny
11
15
  write:
12
16
  "*": allow
13
17
  edit:
@@ -21,6 +21,10 @@ permission:
21
21
  "git commit*": deny
22
22
  "git reset*": deny
23
23
  "sudo*": deny
24
+ "git add .": deny
25
+ "git add -A": deny
26
+ "*--no-verify*": deny
27
+ "cat .env*": deny
24
28
  ---
25
29
 
26
30
  You are OpenCode, the best coding agent on the planet.
@@ -9,6 +9,10 @@ permission:
9
9
  "git commit*": ask
10
10
  "rm -rf*": deny
11
11
  "sudo*": deny
12
+ "git add .": deny
13
+ "git add -A": deny
14
+ "*--no-verify*": deny
15
+ "cat .env*": deny
12
16
  ---
13
17
 
14
18
  You are OpenCode, the best coding agent on the planet.
@@ -20,6 +20,10 @@ permission:
20
20
  "git commit*": deny
21
21
  "git reset*": deny
22
22
  "npm publish*": deny
23
+ "git add .": deny
24
+ "git add -A": deny
25
+ "*--no-verify*": deny
26
+ "cat .env*": deny
23
27
  question: allow
24
28
  ---
25
29
 
@@ -17,6 +17,10 @@ permission:
17
17
  "git push*": deny
18
18
  "git commit*": deny
19
19
  "git reset*": deny
20
+ "git add .": deny
21
+ "git add -A": deny
22
+ "*--no-verify*": deny
23
+ "cat .env*": deny
20
24
  ---
21
25
 
22
26
  You are opencode, an interactive CLI tool that helps users with software engineering tasks.
@@ -22,6 +22,10 @@ permission:
22
22
  "git commit*": deny
23
23
  "git reset*": deny
24
24
  "npm publish*": deny
25
+ "git add .": deny
26
+ "git add -A": deny
27
+ "*--no-verify*": deny
28
+ "cat .env*": deny
25
29
  ---
26
30
 
27
31
  You are OpenCode, the best coding agent on the planet.
@@ -1,30 +1,32 @@
1
1
  ---
2
- description: Create a bead with specification from a description
3
- argument-hint: "<description> [--type epic|feature|task|bug]"
2
+ description: Create a bead with specification, claim it, and prepare workspace
3
+ argument-hint: "<description> [--type epic|feature|task|bug] [--spec-only]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Create: $ARGUMENTS
8
8
 
9
- Create a bead and its specification (PRD) from a description.
9
+ Create a bead, write its specification (PRD), claim it, set up the workspace, and convert to executable tasks — ready for `/ship`.
10
10
 
11
- > **Workflow:** **`/create`** → `/start <id>` → `/ship <id>`
11
+ > **Workflow:** **`/create`** → `/ship <id>`
12
12
  >
13
- > This command creates the specification ONLY. Do NOT write any implementation code.
13
+ > Use `--spec-only` to create the specification without claiming or setting up workspace.
14
14
 
15
15
  ## Load Skills
16
16
 
17
17
  ```typescript
18
18
  skill({ name: "beads" });
19
19
  skill({ name: "prd" }); // PRD template guidance
20
+ skill({ name: "prd-task" }); // PRD → executable tasks (Phase 8)
20
21
  ```
21
22
 
22
23
  ## Parse Arguments
23
24
 
24
- | Argument | Default | Description |
25
- | --------------- | ------------- | ---------------------------------- |
26
- | `<description>` | required | What to build/fix (quoted string) |
27
- | `--type` | auto-detected | Override: epic, feature, task, bug |
25
+ | Argument | Default | Description |
26
+ | --------------- | ------------- | ----------------------------------------- |
27
+ | `<description>` | required | What to build/fix (quoted string) |
28
+ | `--type` | auto-detected | Override: epic, feature, task, bug |
29
+ | `--spec-only` | false | Create spec without claiming or workspace |
28
30
 
29
31
  ## Determine Input Type
30
32
 
@@ -39,7 +41,7 @@ skill({ name: "prd" }); // PRD template guidance
39
41
  - **Be certain**: Only create beads you're confident have clear scope
40
42
  - **Don't over-spec**: If the description is vague, ask clarifying questions first
41
43
  - **Check duplicates**: Always run Phase 1 duplicate check
42
- - **No implementation**: This command creates specs only, don't write code
44
+ - **No implementation**: This command creates specs and workspace — don't write implementation code
43
45
  - **Verify PRD**: Before saving, verify all sections are filled (no placeholders)
44
46
 
45
47
  ## Available Tools
@@ -52,11 +54,24 @@ skill({ name: "prd" }); // PRD template guidance
52
54
 
53
55
  ## Phase 1: Duplicate Check
54
56
 
57
+ ### Memory Search
58
+
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.
67
+
68
+ ### Bead List Check
69
+
55
70
  ```bash
56
71
  br list --status=open --status=in_progress
57
72
  ```
58
73
 
59
- If a matching bead exists, stop and tell the user to use `/start <id>` instead.
74
+ If a matching bead exists, stop and tell the user to use `/ship <id>` instead.
60
75
 
61
76
  ## Phase 2: Classify Type
62
77
 
@@ -137,13 +152,9 @@ BEAD_ID=$(br create --title "$TITLE" --description "$DESCRIPTION" --type $BEAD_T
137
152
  mkdir -p ".beads/artifacts/$BEAD_ID"
138
153
  ```
139
154
 
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
-
144
155
  ## Phase 6: Write PRD
145
156
 
146
- Copy and fill the PRD template using context from Phase 3:
157
+ Copy and fill the PRD template using context from Phase 4:
147
158
 
148
159
  Read the PRD template from `.opencode/memory/_templates/prd.md` and write it to `.beads/artifacts/$BEAD_ID/prd.md`.
149
160
 
@@ -156,10 +167,10 @@ Read the PRD template from `.opencode/memory/_templates/prd.md` and write it to
156
167
  | Proposed Solution | Codebase patterns + user intent | Always |
157
168
  | Success Criteria | User verification + test commands (must include `Verify:`) | Always |
158
169
  | Technical Context | Explore agent findings | Always |
159
- | Affected Files | Explore agent findings (real paths from Phase 3) | Always |
170
+ | Affected Files | Explore agent findings (real paths from Phase 4) | Always |
160
171
  | Tasks | Derived from scope + solution | Always |
161
172
  | Risks | Codebase exploration | Feature/epic only |
162
- | Open Questions | Unresolved items from Phase 3 | If any exist |
173
+ | Open Questions | Unresolved items from Phase 4 | If any exist |
163
174
 
164
175
  ### Task Format
165
176
 
@@ -184,14 +195,97 @@ Before saving, verify:
184
195
 
185
196
  If any check fails, fix it — don't ask the user.
186
197
 
187
- ## Phase 8: Report
198
+ ## Phase 8: Claim and Prepare Workspace
199
+
200
+ **If `--spec-only` was passed, skip to Phase 10 (Report).**
201
+
202
+ ### Workspace Check
203
+
204
+ ```bash
205
+ git status --porcelain
206
+ git branch --show-current
207
+ br list --status=in_progress
208
+ ```
209
+
210
+ - If uncommitted changes: ask user to stash, commit, or continue
211
+ - If other tasks in progress: warn before claiming another
212
+
213
+ ### Claim Bead
214
+
215
+ ```bash
216
+ br update $BEAD_ID --status in_progress
217
+ ```
218
+
219
+ ### Create Branch
220
+
221
+ Ask user how to handle workspace:
222
+
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:
251
+
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:**
269
+
270
+ ```typescript
271
+ skill({ name: "using-git-worktrees" });
272
+ ```
273
+
274
+ **If current branch:** Continue without branch creation.
275
+
276
+ ## Phase 9: Convert PRD to Tasks
277
+
278
+ Use `prd-task` skill to convert PRD markdown → executable JSON (`prd.json`).
279
+
280
+ ## Phase 10: Report
188
281
 
189
282
  Output:
190
283
 
191
284
  1. Bead ID and type
192
285
  2. PRD location (`.beads/artifacts/$BEAD_ID/prd.md`)
193
286
  3. Summary: task count, success criteria count, affected files count
194
- 4. Next steps: `/start $BEAD_ID` or `/plan $BEAD_ID`
287
+ 4. Branch name and workspace (if claimed)
288
+ 5. Next step: `/ship $BEAD_ID` (or `/plan $BEAD_ID` for complex work)
195
289
 
196
290
  ```bash
197
291
  br comments add $BEAD_ID "Created prd.md with [N] tasks, [M] success criteria"
@@ -201,8 +295,8 @@ br comments add $BEAD_ID "Created prd.md with [N] tasks, [M] success criteria"
201
295
 
202
296
  ## Related Commands
203
297
 
204
- | Need | Command |
205
- | --------------- | ------------- |
206
- | Research first | `/research` |
207
- | Plan after spec | `/plan <id>` |
208
- | Start working | `/start <id>` |
298
+ | Need | Command |
299
+ | ------------------ | ------------- |
300
+ | Research first | `/research` |
301
+ | Plan after spec | `/plan <id>` |
302
+ | Implement and ship | `/ship <id>` |
@@ -8,7 +8,7 @@ agent: vision
8
8
 
9
9
  Design a component, page, or design system with a clear aesthetic point of view.
10
10
 
11
- > **Design track (optional):** Not part of the core `/create → /start → /ship` workflow.
11
+ > **Design track (optional):** Not part of the core `/create → /ship` workflow.
12
12
  > Use when you need visual design guidance before or during implementation.
13
13
 
14
14
  ## Parse Arguments
@@ -108,5 +108,4 @@ observation({
108
108
  | Need | Command |
109
109
  | ------------------ | --------------- |
110
110
  | Review existing UI | `/ui-review` |
111
- | Start building | `/start <bead>` |
112
111
  | Ship it | `/ship <bead>` |
@@ -0,0 +1,234 @@
1
+ ---
2
+ description: Audit .opencode/ configuration for consistency, stale references, and enforcement gaps
3
+ argument-hint: "[--fix] [--layer <intent|knowledge|control>]"
4
+ agent: review
5
+ ---
6
+
7
+ # Health Check: $ARGUMENTS
8
+
9
+ Self-audit the .opencode/ configuration for drift, inconsistencies, and enforcement gaps.
10
+
11
+ ## Load Skills
12
+
13
+ ```typescript
14
+ skill({ name: "verification-before-completion" });
15
+ ```
16
+
17
+ ## Parse Arguments
18
+
19
+ | Argument | Default | Description |
20
+ | --------- | ------- | --------------------------------------------------- |
21
+ | `--fix` | false | Auto-fix safe issues (stale refs, dead links) |
22
+ | `--layer` | all | Focus on specific layer: intent, knowledge, control |
23
+
24
+ ## Overview
25
+
26
+ This command runs a multi-layer health check inspired by three-layer defense:
27
+
28
+ 1. **Intent** (AGENTS.md) — policies and rules
29
+ 2. **Knowledge** (Skills) — procedures and workflows
30
+ 3. **Control** (Agent frontmatter, hooks) — structural enforcement
31
+
32
+ A rule that exists at intent but not control is a gap. This command finds those gaps.
33
+
34
+ ## Phase 1: Inventory
35
+
36
+ Build an inventory of all .opencode/ artifacts:
37
+
38
+ ```bash
39
+ # Count artifacts
40
+ echo "=== Skills ==="
41
+ ls .opencode/skill/ | wc -l
42
+ echo "=== Commands ==="
43
+ ls .opencode/command/ | wc -l
44
+ echo "=== Agents ==="
45
+ ls .opencode/agent/ | wc -l
46
+ echo "=== Tools ==="
47
+ ls .opencode/tool/ 2>/dev/null | wc -l
48
+ echo "=== Plugins ==="
49
+ ls .opencode/plugin/ 2>/dev/null | wc -l
50
+ ```
51
+
52
+ Report totals as a summary table.
53
+
54
+ ## Phase 2: Stale Reference Detection
55
+
56
+ Check for references to skills, commands, or agents that don't exist:
57
+
58
+ ### 2a. Skill references in commands and AGENTS.md
59
+
60
+ For every `skill({ name: "X" })` call found in `.opencode/command/*.md` and `AGENTS.md`:
61
+
62
+ - Verify `.opencode/skill/X/SKILL.md` exists
63
+ - Flag any that don't exist as **CRITICAL**
64
+
65
+ ### 2b. Command references in skills and AGENTS.md
66
+
67
+ For every `/command-name` reference found in `.opencode/skill/*/SKILL.md` and `AGENTS.md`:
68
+
69
+ - Verify `.opencode/command/command-name.md` exists
70
+ - Flag missing as **IMPORTANT**
71
+
72
+ ### 2c. Agent references
73
+
74
+ For every `agent: X` in command frontmatter:
75
+
76
+ - Verify `.opencode/agent/X.md` exists (or is a built-in agent)
77
+ - Flag missing as **CRITICAL**
78
+
79
+ ### 2d. Cross-references between skills
80
+
81
+ For every `dependencies: [X, Y]` in skill YAML frontmatter:
82
+
83
+ - Verify each dependency skill exists
84
+ - Flag missing as **IMPORTANT**
85
+
86
+ Report format:
87
+
88
+ ```text
89
+ | Reference Type | Source File | Target | Status |
90
+ |---------------------|-----------------------|---------------|---------|
91
+ | skill() | command/ship.md:15 | beads | OK |
92
+ | skill() | command/plan.md:22 | old-skill | MISSING |
93
+ | /command | skill/X/SKILL.md:45 | /deploy | MISSING |
94
+ ```
95
+
96
+ ## Phase 3: Skill Quality Audit
97
+
98
+ For each skill in `.opencode/skill/*/SKILL.md`:
99
+
100
+ 1. **Frontmatter check:**
101
+ - [ ] Has `name:` field
102
+ - [ ] Has `description:` field
103
+ - [ ] `name:` matches directory name
104
+ - [ ] Starts with `---` on line 1
105
+
106
+ 2. **Content check:**
107
+ - [ ] Has `## When to Use` section
108
+ - [ ] Has `## When NOT to Use` section
109
+ - [ ] Under 200 lines (warn if over)
110
+ - [ ] Has `## Gotchas` section (advisory — new skills may not have one yet)
111
+
112
+ 3. **Description trigger check:**
113
+ - [ ] Description starts with action trigger (Use when, MUST load, Use INSTEAD OF)
114
+ - Flag descriptions that don't specify when to load as **MINOR**
115
+
116
+ Report as a scorecard:
117
+
118
+ ```text
119
+ | Skill | Frontmatter | Content | Trigger | Gotchas | Lines | Grade |
120
+ |-------------------------|-------------|---------|---------|---------|-------|-------|
121
+ | verification-before-... | OK | OK | OK | NO | 237 | B+ |
122
+ | skill-creator | OK | OK | OK | NO | 157 | B |
123
+ ```
124
+
125
+ Grade scale:
126
+
127
+ - **A** — all checks pass including gotchas
128
+ - **B+** — all required checks pass, missing gotchas (acceptable for newer skills)
129
+ - **B** — missing one optional section
130
+ - **C** — missing required section or over 200 lines
131
+ - **D** — frontmatter issues
132
+ - **F** — broken (missing name, missing description, invalid YAML)
133
+
134
+ ## Phase 4: Three-Layer Defense Audit
135
+
136
+ Check the top safety rules from AGENTS.md for three-layer coverage:
137
+
138
+ | Rule | Intent (AGENTS.md) | Knowledge (Skill) | Control (Agent/Hook) |
139
+ | ------------------------------ | ------------------ | ----------------- | -------------------- |
140
+ | Never force push main | ? | ? | ? |
141
+ | Never bypass hooks | ? | ? | ? |
142
+ | Never expose credentials | ? | ? | ? |
143
+ | Read before write/edit | ? | ? | ? |
144
+ | Verify before completion | ? | ? | ? |
145
+ | Never `git add .` | ? | ? | ? |
146
+ | Review agents are read-only | ? | ? | ? |
147
+ | Never fabricate tool output | ? | ? | ? |
148
+ | Ask before destructive actions | ? | ? | ? |
149
+
150
+ For each rule:
151
+
152
+ - **Intent**: grep AGENTS.md for the policy statement
153
+ - **Knowledge**: check if any skill documents the procedure
154
+ - **Control**: check if any agent frontmatter enforces it (tools: false, permission: deny)
155
+
156
+ Flag rules with intent but no control as **IMPORTANT** gaps.
157
+
158
+ ## Phase 5: Agent Tool Restriction Audit
159
+
160
+ For each agent in `.opencode/agent/*.md`:
161
+
162
+ 1. Read the agent's YAML frontmatter
163
+ 2. Check `tools:` restrictions (which tools are disabled)
164
+ 3. Check `permission:` restrictions (which commands are denied/asked)
165
+ 4. Compare against the agent's stated role
166
+
167
+ Flag:
168
+
169
+ - **CRITICAL**: Write-capable agents that should be read-only (review, explore, scout)
170
+ - **IMPORTANT**: Agents with no tool restrictions at all
171
+ - **MINOR**: Agents with restrictions that could be tighter
172
+
173
+ ## Phase 6: Report
174
+
175
+ Output a health report:
176
+
177
+ ```markdown
178
+ ## Health Report
179
+
180
+ **Date:** [timestamp]
181
+ **Configuration:** [X skills, Y commands, Z agents]
182
+
183
+ ### Summary
184
+
185
+ | Layer | Issues Found | Critical | Important | Minor |
186
+ | ------- | ------------ | -------- | --------- | ----- |
187
+ | Refs | N | N | N | N |
188
+ | Skills | N | N | N | N |
189
+ | Defense | N | N | N | N |
190
+ | Agents | N | N | N | N |
191
+ | TOTAL | N | N | N | N |
192
+
193
+ ### Critical Issues
194
+
195
+ - [list]
196
+
197
+ ### Important Issues
198
+
199
+ - [list]
200
+
201
+ ### Minor Issues
202
+
203
+ - [list]
204
+
205
+ ### Recommendations
206
+
207
+ - [prioritized list of fixes]
208
+ ```
209
+
210
+ If `--fix` flag is provided, auto-fix `safe_auto` issues:
211
+
212
+ - Remove stale skill references from commands (after confirmation)
213
+ - Add missing `## Gotchas` placeholder sections to skills
214
+ - Fix frontmatter formatting issues
215
+
216
+ Record findings:
217
+
218
+ ```typescript
219
+ observation({
220
+ type: "discovery",
221
+ title: "Health check: [summary]",
222
+ narrative: "[Key findings and gaps discovered]",
223
+ concepts: "health, audit, configuration",
224
+ confidence: "high",
225
+ });
226
+ ```
227
+
228
+ ## Related Commands
229
+
230
+ | Need | Command |
231
+ | ------------------- | ------------------ |
232
+ | Review code | `/review-codebase` |
233
+ | Check project state | `/status` |
234
+ | Verify a bead | `/verify <id>` |
@@ -79,6 +79,21 @@ updated: [today]
79
79
  - [Rule 3]
80
80
  ```
81
81
 
82
+ ### Persist to Memory System
83
+
84
+ After writing the file, also store key preferences as a memory observation for cross-session retrieval:
85
+
86
+ ```typescript
87
+ observation({
88
+ type: "decision",
89
+ title: "User profile: [name]",
90
+ narrative: "User preferences captured: [style], [workflow prefs], [technical prefs]. Source: /init-user command.",
91
+ concepts: "user-profile, preferences",
92
+ confidence: "high",
93
+ files_modified: ".opencode/memory/project/user.md",
94
+ });
95
+ ```
96
+
82
97
  ## Phase 3: Update opencode.json
83
98
 
84
99
  Ensure `user.md` is loaded in `instructions` (bare paths, no `file://` prefix).
@@ -6,11 +6,11 @@ agent: plan
6
6
 
7
7
  # Plan: $ARGUMENTS
8
8
 
9
- Create a detailed implementation plan with TDD steps. Optional deep-planning between `/start` and `/ship`.
9
+ Create a detailed implementation plan with TDD steps. Optional deep-planning between `/create` and `/ship`.
10
10
 
11
- > **Workflow:** `/create` → `/start <id>` → **`/plan <id>`** (optional) → `/ship <id>`
11
+ > **Workflow:** `/create` → **`/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 `/create` first.
14
14
  >
15
15
  > **When to use:** Complex tasks where PRD verification steps aren't enough guidance. Skip for simple tasks.
16
16
 
@@ -350,6 +350,5 @@ br comments add $ARGUMENTS "Created plan.md: Level [N] discovery, [X] waves, [Y]
350
350
  | Need | Command |
351
351
  | -------------- | ------------- |
352
352
  | Create spec | `/create` |
353
- | Start working | `/start <id>` |
354
353
  | Execute plan | `/ship <id>` |
355
354
  | Research first | `/research` |
@@ -43,6 +43,19 @@ If any gate fails, stop. Fix errors first, then run `/pr` again.
43
43
 
44
44
  ## Phase 2: Gather Context
45
45
 
46
+ ### Memory Grounding
47
+
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).
56
+
57
+ ### Git Context
58
+
46
59
  ```bash
47
60
  git branch --show-current
48
61
  git log main...HEAD --oneline
@@ -64,7 +64,19 @@ br show $ARGUMENTS
64
64
 
65
65
  Read PRD if it exists and extract questions that need answering.
66
66
 
67
- Check memory for previous research on this topic.
67
+ ### Memory Search (Required)
68
+
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
68
80
 
69
81
  ## Phase 2: Research
70
82
 
@@ -120,6 +132,6 @@ Report:
120
132
 
121
133
  | Need | Command |
122
134
  | ------------- | ------------- |
123
- | Create spec | `/create` |
135
+ | Create + start | `/create` |
124
136
  | Plan details | `/plan <id>` |
125
- | Start working | `/start <id>` |
137
+ | Pick up work | `/ship <id>` |
@@ -120,7 +120,17 @@ Include:
120
120
  3. Verdict: Ready to merge / With fixes / No
121
121
  4. Reasoning (1-2 sentences)
122
122
 
123
- Record significant findings with `observation()`.
123
+ Record significant findings with `observation()`:
124
+
125
+ ```typescript
126
+ observation({
127
+ type: "discovery", // or "warning", "pattern", "bugfix"
128
+ title: "Review: [scope] [key finding]",
129
+ narrative: "[What was found, severity, file:line, recommended fix]",
130
+ concepts: "code-review, [category]",
131
+ confidence: "high",
132
+ });
133
+ ```
124
134
 
125
135
  ## Related Commands
126
136