opencodekit 0.16.14 → 0.16.17

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 (70) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +1 -1
  3. package/dist/template/.opencode/agent/plan.md +77 -161
  4. package/dist/template/.opencode/command/create.md +75 -307
  5. package/dist/template/.opencode/command/design.md +53 -589
  6. package/dist/template/.opencode/command/handoff.md +76 -180
  7. package/dist/template/.opencode/command/init.md +45 -211
  8. package/dist/template/.opencode/command/plan.md +62 -514
  9. package/dist/template/.opencode/command/pr.md +56 -226
  10. package/dist/template/.opencode/command/research.md +55 -266
  11. package/dist/template/.opencode/command/resume.md +33 -138
  12. package/dist/template/.opencode/command/review-codebase.md +54 -202
  13. package/dist/template/.opencode/command/ship.md +78 -127
  14. package/dist/template/.opencode/command/start.md +47 -577
  15. package/dist/template/.opencode/command/status.md +55 -354
  16. package/dist/template/.opencode/command/ui-review.md +52 -298
  17. package/dist/template/.opencode/command/verify.md +36 -250
  18. package/dist/template/.opencode/dcp.jsonc +10 -9
  19. package/dist/template/.opencode/memory.db-shm +0 -0
  20. package/dist/template/.opencode/memory.db-wal +0 -0
  21. package/dist/template/.opencode/plugin/README.md +8 -4
  22. package/dist/template/.opencode/plugin/swarm-enforcer.ts +182 -27
  23. package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +112 -0
  24. package/dist/template/.opencode/skill/augment-context-engine/mcp.json +6 -0
  25. package/dist/template/.opencode/skill/core-data-expert/SKILL.md +82 -0
  26. package/dist/template/.opencode/skill/core-data-expert/references/batch-operations.md +543 -0
  27. package/dist/template/.opencode/skill/core-data-expert/references/cloudkit-integration.md +259 -0
  28. package/dist/template/.opencode/skill/core-data-expert/references/concurrency.md +522 -0
  29. package/dist/template/.opencode/skill/core-data-expert/references/fetch-requests.md +643 -0
  30. package/dist/template/.opencode/skill/core-data-expert/references/glossary.md +233 -0
  31. package/dist/template/.opencode/skill/core-data-expert/references/migration.md +393 -0
  32. package/dist/template/.opencode/skill/core-data-expert/references/model-configuration.md +597 -0
  33. package/dist/template/.opencode/skill/core-data-expert/references/performance.md +300 -0
  34. package/dist/template/.opencode/skill/core-data-expert/references/persistent-history.md +553 -0
  35. package/dist/template/.opencode/skill/core-data-expert/references/project-audit.md +60 -0
  36. package/dist/template/.opencode/skill/core-data-expert/references/saving.md +574 -0
  37. package/dist/template/.opencode/skill/core-data-expert/references/stack-setup.md +625 -0
  38. package/dist/template/.opencode/skill/core-data-expert/references/testing.md +300 -0
  39. package/dist/template/.opencode/skill/core-data-expert/references/threading.md +589 -0
  40. package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +246 -0
  41. package/dist/template/.opencode/skill/swift-concurrency/references/actors.md +640 -0
  42. package/dist/template/.opencode/skill/swift-concurrency/references/async-algorithms.md +822 -0
  43. package/dist/template/.opencode/skill/swift-concurrency/references/async-await-basics.md +249 -0
  44. package/dist/template/.opencode/skill/swift-concurrency/references/async-sequences.md +670 -0
  45. package/dist/template/.opencode/skill/swift-concurrency/references/core-data.md +533 -0
  46. package/dist/template/.opencode/skill/swift-concurrency/references/glossary.md +128 -0
  47. package/dist/template/.opencode/skill/swift-concurrency/references/linting.md +142 -0
  48. package/dist/template/.opencode/skill/swift-concurrency/references/memory-management.md +542 -0
  49. package/dist/template/.opencode/skill/swift-concurrency/references/migration.md +1076 -0
  50. package/dist/template/.opencode/skill/swift-concurrency/references/performance.md +574 -0
  51. package/dist/template/.opencode/skill/swift-concurrency/references/sendable.md +578 -0
  52. package/dist/template/.opencode/skill/swift-concurrency/references/tasks.md +604 -0
  53. package/dist/template/.opencode/skill/swift-concurrency/references/testing.md +565 -0
  54. package/dist/template/.opencode/skill/swift-concurrency/references/threading.md +452 -0
  55. package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +290 -0
  56. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-advanced.md +351 -0
  57. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-basics.md +284 -0
  58. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-transitions.md +326 -0
  59. package/dist/template/.opencode/skill/swiftui-expert-skill/references/image-optimization.md +286 -0
  60. package/dist/template/.opencode/skill/swiftui-expert-skill/references/layout-best-practices.md +312 -0
  61. package/dist/template/.opencode/skill/swiftui-expert-skill/references/liquid-glass.md +377 -0
  62. package/dist/template/.opencode/skill/swiftui-expert-skill/references/list-patterns.md +153 -0
  63. package/dist/template/.opencode/skill/swiftui-expert-skill/references/modern-apis.md +400 -0
  64. package/dist/template/.opencode/skill/swiftui-expert-skill/references/performance-patterns.md +377 -0
  65. package/dist/template/.opencode/skill/swiftui-expert-skill/references/scroll-patterns.md +305 -0
  66. package/dist/template/.opencode/skill/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
  67. package/dist/template/.opencode/skill/swiftui-expert-skill/references/state-management.md +447 -0
  68. package/dist/template/.opencode/skill/swiftui-expert-skill/references/text-formatting.md +285 -0
  69. package/dist/template/.opencode/skill/swiftui-expert-skill/references/view-structure.md +276 -0
  70. package/package.json +1 -1
@@ -2,236 +2,88 @@
2
2
  description: Review code for quality, security, and compliance
3
3
  argument-hint: "[path|bead-id|pr-number|'all'] [--quick|--thorough]"
4
4
  agent: review
5
- subtask: true
6
5
  ---
7
6
 
8
7
  # Review: $ARGUMENTS
9
8
 
10
- ## Load Beads Skill
9
+ ## Load Skills
11
10
 
12
11
  ```typescript
13
12
  skill({ name: "beads" });
14
- skill({ name: "memory-system" });
15
- ```
16
-
17
- ## Check Memory for Context
18
-
19
- Search for existing patterns and gotchas before review:
20
-
21
- ```typescript
22
- // Find related past reviews and findings
23
- memory_search({ query: "[path/module] review security", limit: 3 });
24
-
25
- // Find known gotchas for this area
26
- memory_search({ query: "[module keywords] gotchas patterns", limit: 3 });
27
- ```
28
-
29
- Apply past learnings to the review - don't repeat known issues.
30
-
31
- ## Phase 1: Determine Scope
32
-
33
- Parse `$ARGUMENTS` to determine what to review:
34
-
35
- | Input | Scope | How to Get Code |
36
- | ------------------------ | ---------------------- | ------------------------------------------- |
37
- | File/directory path | That path only | `read` or `glob` + `read` |
38
- | Bead ID (e.g., `br-123`) | Implementation vs spec | `br show` then `git diff` from spec |
39
- | PR number (e.g., `#45`) | PR changes | `gh pr diff 45` |
40
- | `all` or empty | Recent changes | `git diff main...HEAD` or `git diff HEAD~5` |
41
-
42
- If bead exists, load spec from `.beads/artifacts/$ID/spec.md` and review against constraints.
43
-
44
- ## Phase 2: Automated Analysis
45
-
46
- Run these checks first (batch for speed):
47
-
48
- ```typescript
49
- // Type/lint errors
50
- lsp_lsp_diagnostics(); // for each changed file
51
- ```
52
-
53
- !`npm run type-check || tsc --noEmit`
54
- !`npm run lint || true`
55
-
56
- ```typescript
57
- // Anti-pattern detection with grep
58
- grep({ pattern: "console\\.log" }); // Debug statements
59
- grep({ pattern: "any" }); // TypeScript any
60
- grep({ pattern: "TODO|FIXME|HACK|XXX" });
61
- grep({ pattern: "password\\s*=" }); // Hardcoded secrets
62
- ```
63
-
64
- !`npm test || pytest || cargo test`
65
-
66
- Collect all automated findings before manual review.
67
-
68
- ## Phase 3: Manual Review Categories
69
-
70
- ```typescript
71
13
  skill({ name: "requesting-code-review" });
72
14
  ```
73
15
 
74
- Review each category with specific focus:
75
-
76
- ### Security
77
-
78
- - Authentication/authorization checks on all endpoints
79
- - Input validation and sanitization
80
- - No secrets in code (API keys, passwords, tokens)
81
- - SQL/command injection prevention
82
- - XSS prevention (output encoding)
83
-
84
- ### Performance
85
-
86
- - N+1 query patterns
87
- - Unbounded loops or recursion
88
- - Missing pagination on large datasets
89
- - Expensive operations in hot paths
90
- - Missing caching where appropriate
91
-
92
- ### Maintainability
93
-
94
- - Cyclomatic complexity (functions > 10 branches)
95
- - DRY violations (duplicated logic)
96
- - Dead code or unreachable branches
97
- - Naming clarity (can you understand without comments?)
98
- - Single Responsibility violations
99
-
100
- ### Error Handling
101
-
102
- - All async operations have error handling
103
- - Errors are logged with context
104
- - User-facing errors are sanitized (no stack traces)
105
- - Graceful degradation where appropriate
106
-
107
- ### Testing
108
-
109
- - Test coverage on new/changed code
110
- - Tests verify behavior, not implementation
111
- - Edge cases covered (empty, null, boundary)
112
- - No excessive mocking (tests actually test something)
113
-
114
- ### Type Safety (TypeScript/typed languages)
115
-
116
- - No `any` types without justification
117
- - Proper null/undefined handling
118
- - Generic types used appropriately
119
- - Return types explicit on public APIs
120
-
121
- ## Phase 4: Create Tracking Issues
122
-
123
- For each Critical or Important finding:
124
-
125
- ```bash
126
- br create "[Review] <brief issue description>" --type bug --priority 1
127
- ```
128
-
129
- Skip creating beads for Minor issues (just report them).
130
-
131
- ## Phase 5: Output Format
132
-
133
- ### Summary
134
-
135
- | Metric | Value |
136
- | ------------------ | ------- |
137
- | Files reviewed | X |
138
- | Lines changed | +X / -Y |
139
- | Critical issues | X |
140
- | Important issues | X |
141
- | Minor issues | X |
142
- | Automated findings | X |
143
-
144
- ### Automated Findings
145
-
146
- ```
147
- [LSP] src/auth.ts:45 - Type 'string' is not assignable to type 'User'
148
- [AST] src/utils.ts:12 - console.log detected
149
- [GREP] src/config.ts:8 - TODO: implement rate limiting
150
- ```
151
-
152
- ### Manual Findings
153
-
154
- #### Critical (Must Fix Before Merge)
155
-
156
- | File:Line | Issue | Category | Fix |
157
- | ---------------- | ------------------------------------ | -------- | ------------------------------ |
158
- | `src/auth.ts:45` | Missing auth check on admin endpoint | Security | Add `requireAuth()` middleware |
159
-
160
- #### Important (Should Fix)
161
-
162
- | File:Line | Issue | Category | Fix |
163
- | -------------- | ---------------------- | ----------- | ---------------------------- |
164
- | `src/db.ts:89` | N+1 query in user list | Performance | Use `include` or batch query |
165
-
166
- #### Minor (Nice to Have)
167
-
168
- | File:Line | Issue | Category | Fix |
169
- | ----------------- | ------------------------ | --------------- | --------------------------- |
170
- | `src/utils.ts:12` | Console.log left in code | Maintainability | Remove or use proper logger |
171
-
172
- ### Strengths
16
+ ## Phase 1: Determine Scope
173
17
 
174
- - [What's done well - be specific with file:line]
18
+ | Input | Scope | How to Get Code |
19
+ | ------------------------ | --------------------- | ------------------------- |
20
+ | File/directory path | That path only | `read` or `glob` + `read` |
21
+ | Bead ID (e.g., `br-123`) | Implementation vs PRD | `br show` then `git diff` |
22
+ | PR number (e.g., `#45`) | PR changes | `gh pr diff 45` |
23
+ | `all` or empty | Recent changes | `git diff main...HEAD` |
175
24
 
176
- ### Recommendations
25
+ If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
177
26
 
178
- - [Improvements beyond immediate fixes]
27
+ ## Phase 2: Automated Checks
179
28
 
180
- ### Verdict
29
+ Detect project type and run the appropriate checks in parallel:
181
30
 
182
- **Ready to merge:** Yes | No | With Fixes
31
+ | Project Type | Detect Via | Build | Test | Lint | Typecheck |
32
+ | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
33
+ | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
34
+ | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
35
+ | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
36
+ | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
183
37
 
184
- **Reasoning:** [1-2 sentences explaining the decision]
38
+ Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first prefer those over generic defaults.
185
39
 
186
- **Beads created:** [List bead IDs for Critical/Important findings, or "None"]
40
+ Also scan for common issues appropriate to the detected language:
187
41
 
188
- ---
42
+ - Debug statements (`console.log`, `print()`, `println!`, `fmt.Println`)
43
+ - Loose typing (`any` in TypeScript, `type: ignore` in Python)
44
+ - `TODO|FIXME|HACK` markers
45
+ - Hardcoded secrets patterns
189
46
 
190
- ## Depth Levels
47
+ ## Phase 3: Manual Review
191
48
 
192
- **--quick** (~5-10 min): Automated checks + skim changed files, focus on Critical only
193
- **--thorough** (default, ~15-30 min): Full automated + manual review of all categories
194
- **--security**: Focus only on security category with deeper analysis
49
+ Review each category:
195
50
 
196
- ## Examples
51
+ | Category | Focus |
52
+ | ------------------- | ----------------------------------------------------------------------- |
53
+ | **Security** | Auth checks, input validation, no secrets in code, injection prevention |
54
+ | **Performance** | N+1 queries, unbounded loops, missing pagination, hot path ops |
55
+ | **Maintainability** | Complexity, DRY violations, dead code, naming clarity |
56
+ | **Error Handling** | Async error handling, error context, sanitized user errors |
57
+ | **Testing** | Coverage on changed code, behavior tests, edge cases |
58
+ | **Type Safety** | No unjustified `any`, null handling, explicit return types |
197
59
 
198
- ```bash
199
- # Review a specific file
200
- /review-codebase src/auth/login.ts
60
+ **Depth levels:**
201
61
 
202
- # Review against a bead spec
203
- /review-codebase br-feature-auth
62
+ - `--quick`: Automated checks + skim, critical issues only
63
+ - Default: Full automated + manual review
64
+ - `--thorough`: Deep analysis of all categories
204
65
 
205
- # Review a PR
206
- /review-codebase #45
66
+ ## Phase 4: Report
207
67
 
208
- # Quick review of recent changes
209
- /review-codebase all --quick
68
+ Group findings by severity:
210
69
 
211
- # Security-focused review
212
- /review-codebase src/api/ --security
213
- ```
70
+ - **Critical** (must fix before merge): with file:line, issue, fix
71
+ - **Important** (should fix): with file:line, issue, fix
72
+ - **Minor** (nice to have): with file:line, suggestion
214
73
 
215
- ## Anti-Patterns (Don't Do This)
74
+ Include:
216
75
 
217
- - "LGTM" without actually reviewing
218
- - Marking style issues as Critical
219
- - Reviewing code you didn't read
220
- - Vague feedback ("improve error handling" - WHERE? HOW?)
221
- - Skipping automated checks "to save time"
222
- - Not creating beads for real issues (they get forgotten)
76
+ 1. Summary metrics (files reviewed, issues by severity)
77
+ 2. Strengths (what's done well, with file:line)
78
+ 3. Verdict: Ready to merge / With fixes / No
79
+ 4. Reasoning (1-2 sentences)
223
80
 
224
- ## Record Significant Findings
81
+ Record significant findings with `observation()`.
225
82
 
226
- For important findings worth remembering:
83
+ ## Related Commands
227
84
 
228
- ```typescript
229
- observation({
230
- type: "warning", // or "pattern", "bugfix"
231
- title: "[Module] [Issue type] pattern detected",
232
- narrative: "Found [issue] in [location], which can cause...",
233
- facts: "[key facts about the issue]",
234
- concepts: "[module], security, [issue keywords]",
235
- confidence: "high",
236
- });
237
- ```
85
+ | Need | Command |
86
+ | ------------------- | -------------- |
87
+ | Ship after review | `/ship <id>` |
88
+ | Verify completeness | `/verify <id>` |
89
+ | Check status | `/status` |
@@ -1,161 +1,120 @@
1
1
  ---
2
- description: Ship a bead - implement, verify, review, close
3
- argument-hint: "<bead-id> [--parallel] [--swarm]"
2
+ description: Ship a bead - implement PRD tasks, verify, review, close
3
+ argument-hint: "<bead-id>"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Ship: $ARGUMENTS
8
8
 
9
- This command combines implementation and finish gates. It implements, verifies, runs review, then closes.
9
+ Execute PRD tasks, verify each passes, run review, close the bead.
10
+
11
+ > **Workflow:** `/create` → `/start <id>` → **`/ship <id>`**
12
+ >
13
+ > ⛔ Bead MUST be `in_progress` with `prd.md`. Run `/start` first if not.
10
14
 
11
15
  ## Load Skills
12
16
 
13
17
  ```typescript
14
18
  skill({ name: "beads" });
15
- skill({ name: "test-driven-development" });
16
19
  skill({ name: "verification-before-completion" });
17
- skill({ name: "finishing-a-development-branch" });
18
- skill({ name: "receiving-code-review" });
19
- skill({ name: "swarm-coordination" });
20
- skill({ name: "beads-bridge" });
21
- skill({ name: "memory-system" });
22
- ```
23
-
24
- ## Check Memory for Context
25
-
26
- Search for related patterns and gotchas before shipping:
27
-
28
- ```typescript
29
- // Find related patterns and decisions
30
- memory_search({ query: "$ARGUMENTS [feature keywords]", limit: 3 });
31
-
32
- // Find gotchas for affected modules
33
- memory_search({ query: "[affected modules] gotchas", limit: 3 });
34
20
  ```
35
21
 
36
- Apply past learnings to avoid known issues.
37
-
38
- ## Skill Routing
39
-
40
- - Use **systematic-debugging** when a gate fails and root cause is unclear.
41
- - Use **receiving-code-review** to triage review feedback after the review agent runs.
42
-
43
- ## Verify Task & Claim
22
+ ## Phase 1: Guards
44
23
 
45
24
  ```bash
46
25
  br show $ARGUMENTS
47
- br update $ARGUMENTS --status in_progress
48
26
  ```
49
27
 
50
- ## Pre-Flight Verification
28
+ Verify:
51
29
 
52
- Run `/verify $ARGUMENTS --quick` to check:
30
+ - Bead status is `in_progress` (if not, tell user to run `/start $ARGUMENTS`)
31
+ - `.beads/artifacts/$ARGUMENTS/prd.md` exists (if not, tell user to run `/create` first)
53
32
 
54
- - All spec requirements addressed
55
- - All gates passing
56
- - No obvious contradictions
33
+ Check what artifacts exist:
57
34
 
58
- If verification fails, fix issues before proceeding.
59
-
60
- ## Implement (Keep It Focused)
35
+ ```bash
36
+ ls .beads/artifacts/$ARGUMENTS/
37
+ ```
61
38
 
62
- - Read before edit
63
- - Delegate research if unclear (Task → explore/scout)
64
- - Keep scope ≤ 3 files or create subtasks
39
+ ## Phase 2: Route to Execution
65
40
 
66
- If the task is large (3+ independent subtasks), use swarm mode.
41
+ | Artifact exists | Action |
42
+ | --------------- | -------------------------------------------------------- |
43
+ | `plan.md` | Load `executing-plans` skill, follow its batch process |
44
+ | `prd.json` | Proceed to PRD task loop below |
45
+ | Only `prd.md` | Load `prd-task` skill to create `prd.json`, then proceed |
67
46
 
68
- ## Run Verification Gates
47
+ ## Phase 3: PRD Task Loop
69
48
 
70
- Detect project type:
49
+ For each task in `prd.json` (respecting `depends_on` ordering):
71
50
 
72
- ```bash
73
- ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null
74
- ```
75
-
76
- **Node/TypeScript:**
77
-
78
- ```bash
79
- npm run build 2>/dev/null || true
80
- npm test
81
- npm run lint 2>/dev/null || true
82
- npm run typecheck 2>/dev/null || true
83
- ```
51
+ 1. **Read** the task description, verification steps, and affected files
52
+ 2. **Read** the affected files before editing
53
+ 3. **Implement** the changes — stay within the task's `files` list
54
+ 4. **Verify** — run each verification step from the task
55
+ 5. **If verification fails**, fix and retry (max 2 attempts per task)
56
+ 6. **Mark** `passes: true` in `prd.json`
57
+ 7. **Append** progress to `.beads/artifacts/$ARGUMENTS/progress.txt`
84
58
 
85
- **Rust:**
59
+ ### Stop Conditions
86
60
 
87
- ```bash
88
- cargo build
89
- cargo test
90
- cargo clippy -- -D warnings
91
- ```
61
+ - Verification fails 2x on same task → stop, report blocker
62
+ - Blocked by unfinished dependency → stop, report which one
63
+ - Modifying files outside task scope → stop, ask user
92
64
 
93
- **Python:**
65
+ ## Phase 4: Verification Gates
94
66
 
95
- ```bash
96
- pytest
97
- ruff check .
98
- mypy . 2>/dev/null || true
99
- ```
67
+ After all PRD tasks pass, detect project type and run the appropriate verification gates:
100
68
 
101
- **Go:**
69
+ | Project Type | Detect Via | Build | Test | Lint | Typecheck |
70
+ | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
71
+ | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
72
+ | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
73
+ | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
74
+ | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
102
75
 
103
- ```bash
104
- go build ./...
105
- go test ./...
106
- golangci-lint run
107
- ```
76
+ Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
108
77
 
109
- If ANY gate fails, stop and fix before proceeding.
78
+ Also read the PRD's success criteria and run each `Verify:` command.
110
79
 
111
- ## Stage Changes For Review
80
+ If any gate fails, fix before proceeding.
112
81
 
113
- ```bash
114
- git add -A
115
- git status
116
- git diff --cached --stat
117
- ```
82
+ ## Phase 5: Review
118
83
 
119
- ## Spawn Review Agent (After Tests)
84
+ Spawn review agent to check changes against the PRD:
120
85
 
121
86
  ```typescript
122
87
  Task({
123
88
  subagent_type: "review",
124
89
  description: "Review changes for $ARGUMENTS",
125
- prompt: `Review the staged changes for bead $ARGUMENTS.
90
+ prompt: `Review changes for bead $ARGUMENTS.
126
91
 
127
- Context:
128
- - Use git status and git diff --cached to see changes
129
- - Focus on correctness, edge cases, and risks
130
- - Report issues with file:line references
92
+ Read PRD: .beads/artifacts/$ARGUMENTS/prd.md
93
+ Review: git diff HEAD
131
94
 
132
- Return:
133
- - Summary of findings
134
- - Critical/High/Medium issues (if any)
135
- `,
95
+ Check:
96
+ 1. Changes satisfy PRD success criteria
97
+ 2. Correctness, edge cases, security
98
+ 3. No scope creep beyond PRD files
99
+
100
+ Return: findings by severity, whether success criteria are met.`,
136
101
  });
137
102
  ```
138
103
 
139
- If review finds issues, fix them, re-run verification gates, then re-run review.
104
+ If review finds critical issues fix re-run Phase 4 re-review.
140
105
 
141
- ## Verify Success Criteria
106
+ ## Phase 6: Close
142
107
 
143
- ```bash
144
- cat .beads/artifacts/$ARGUMENTS/prd.md
145
- ```
146
-
147
- Ensure all criteria are met before closing.
148
-
149
- ## Close Bead (Ask First)
108
+ Ask user before closing:
150
109
 
151
110
  ```typescript
152
111
  question({
153
112
  questions: [
154
113
  {
155
114
  header: "Close",
156
- question: "Ship complete. Close bead $ARGUMENTS?",
115
+ question: "All tasks pass, gates green, review clean. Close bead $ARGUMENTS?",
157
116
  options: [
158
- { label: "Yes, close it (Recommended)", description: "All gates passed" },
117
+ { label: "Yes, close it (Recommended)", description: "All checks passed" },
159
118
  { label: "No, keep open", description: "Need more work" },
160
119
  ],
161
120
  },
@@ -166,34 +125,26 @@ question({
166
125
  If confirmed:
167
126
 
168
127
  ```bash
169
- br close $ARGUMENTS --reason "Shipped: verification + review passed"
128
+ br close $ARGUMENTS --reason "Shipped: all PRD tasks pass, verification + review passed"
170
129
  br sync --flush-only
171
130
  ```
172
131
 
173
- ## Record Learnings (On Completion)
132
+ Record significant learnings with `observation()`.
174
133
 
175
- Before ending, capture what was learned:
134
+ ## Output
176
135
 
177
- ```typescript
178
- // Record significant decisions or patterns discovered
179
- observation({
180
- type: "feature", // or "decision", "pattern"
181
- title: "$ARGUMENTS: [brief description]",
182
- narrative: "Implemented [feature]. Key approach: [summary]...",
183
- facts: "[key implementation details]",
184
- concepts: "[domain keywords], [tech stack]",
185
- bead_id: "$ARGUMENTS",
186
- files_modified: "[key files changed]",
187
- confidence: "high",
188
- });
136
+ Report:
189
137
 
190
- // If encountered gotchas worth remembering
191
- observation({
192
- type: "warning",
193
- title: "[Gotcha discovered during $ARGUMENTS]",
194
- narrative: "While implementing, discovered that...",
195
- concepts: "[relevant keywords]",
196
- bead_id: "$ARGUMENTS",
197
- confidence: "high",
198
- });
199
- ```
138
+ 1. PRD task results (completed/total, each task status)
139
+ 2. Verification gate results (typecheck, build, test, lint)
140
+ 3. Success criteria results
141
+ 4. Review summary
142
+ 5. Next steps: commit changes or create PR
143
+
144
+ ## Related Commands
145
+
146
+ | Need | Command |
147
+ | ----------- | ------------- |
148
+ | Create spec | `/create` |
149
+ | Claim task | `/start <id>` |
150
+ | Create PR | `/pr` |