opencodekit 0.15.21 → 0.16.1

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 (144) hide show
  1. package/dist/index.js +5 -7
  2. package/dist/template/.opencode/AGENTS.md +85 -23
  3. package/dist/template/.opencode/agent/build.md +88 -7
  4. package/dist/template/.opencode/agent/explore.md +1 -1
  5. package/dist/template/.opencode/agent/general.md +54 -4
  6. package/dist/template/.opencode/agent/looker.md +1 -1
  7. package/dist/template/.opencode/agent/painter.md +1 -1
  8. package/dist/template/.opencode/agent/plan.md +52 -0
  9. package/dist/template/.opencode/agent/review.md +1 -1
  10. package/dist/template/.opencode/agent/scout.md +3 -3
  11. package/dist/template/.opencode/agent/vision.md +1 -1
  12. package/dist/template/.opencode/command/create.md +231 -91
  13. package/dist/template/.opencode/command/design.md +40 -7
  14. package/dist/template/.opencode/command/handoff.md +22 -0
  15. package/dist/template/.opencode/command/init.md +49 -78
  16. package/dist/template/.opencode/command/plan.md +36 -16
  17. package/dist/template/.opencode/command/pr.md +15 -0
  18. package/dist/template/.opencode/command/research.md +3 -0
  19. package/dist/template/.opencode/command/resume.md +8 -18
  20. package/dist/template/.opencode/command/review-codebase.md +30 -0
  21. package/dist/template/.opencode/command/ship.md +199 -0
  22. package/dist/template/.opencode/command/start.md +316 -28
  23. package/dist/template/.opencode/command/status.md +24 -1
  24. package/dist/template/.opencode/command/ui-review.md +36 -7
  25. package/dist/template/.opencode/command/verify.md +307 -0
  26. package/dist/template/.opencode/memory/_templates/prd.md +29 -0
  27. package/dist/template/.opencode/memory/_templates/proposal.md +38 -0
  28. package/dist/template/.opencode/memory/_templates/spec.md +66 -0
  29. package/dist/template/.opencode/memory/_templates/tasks.md +198 -0
  30. package/dist/template/.opencode/memory/_templates/tech-stack.md +50 -0
  31. package/dist/template/.opencode/memory/project/tech-stack.md +53 -0
  32. package/dist/template/.opencode/memory/research/ccpm-analysis.md +334 -0
  33. package/dist/template/.opencode/memory/research/openspec-analysis.md +226 -0
  34. package/dist/template/.opencode/memory.db +0 -0
  35. package/dist/template/.opencode/memory.db-shm +0 -0
  36. package/dist/template/.opencode/memory.db-wal +0 -0
  37. package/dist/template/.opencode/opencode.json +18 -4
  38. package/dist/template/.opencode/package.json +1 -0
  39. package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +418 -0
  40. package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +170 -0
  41. package/dist/template/.opencode/plans/1770013678126-witty-planet.md +278 -0
  42. package/dist/template/.opencode/plugin/lib/memory-db.ts +828 -0
  43. package/dist/template/.opencode/plugin/memory.ts +38 -1
  44. package/dist/template/.opencode/skill/index-knowledge/SKILL.md +76 -31
  45. package/dist/template/.opencode/skill/memory-system/SKILL.md +110 -55
  46. package/dist/template/.opencode/skill/tool-priority/SKILL.md +2 -2
  47. package/dist/template/.opencode/tool/memory-get.ts +143 -0
  48. package/dist/template/.opencode/tool/memory-maintain.ts +167 -0
  49. package/dist/template/.opencode/tool/memory-migrate.ts +319 -0
  50. package/dist/template/.opencode/tool/memory-read.ts +17 -46
  51. package/dist/template/.opencode/tool/memory-search.ts +131 -28
  52. package/dist/template/.opencode/tool/memory-timeline.ts +105 -0
  53. package/dist/template/.opencode/tool/memory-update.ts +21 -26
  54. package/dist/template/.opencode/tool/observation.ts +112 -100
  55. package/dist/template/.opencode/tsconfig.json +19 -19
  56. package/package.json +1 -1
  57. package/dist/template/.opencode/command/accessibility-check.md +0 -331
  58. package/dist/template/.opencode/command/agent-browser.md +0 -21
  59. package/dist/template/.opencode/command/analyze-mockup.md +0 -423
  60. package/dist/template/.opencode/command/analyze-project.md +0 -295
  61. package/dist/template/.opencode/command/brainstorm.md +0 -373
  62. package/dist/template/.opencode/command/cloudflare.md +0 -70
  63. package/dist/template/.opencode/command/commit.md +0 -245
  64. package/dist/template/.opencode/command/complete-next-task.md +0 -77
  65. package/dist/template/.opencode/command/design-audit.md +0 -480
  66. package/dist/template/.opencode/command/edit-image.md +0 -242
  67. package/dist/template/.opencode/command/finish.md +0 -255
  68. package/dist/template/.opencode/command/fix-ci.md +0 -109
  69. package/dist/template/.opencode/command/fix-types.md +0 -104
  70. package/dist/template/.opencode/command/fix-ui.md +0 -117
  71. package/dist/template/.opencode/command/fix.md +0 -168
  72. package/dist/template/.opencode/command/frontend-design.md +0 -21
  73. package/dist/template/.opencode/command/generate-diagram.md +0 -349
  74. package/dist/template/.opencode/command/generate-icon.md +0 -283
  75. package/dist/template/.opencode/command/generate-image.md +0 -246
  76. package/dist/template/.opencode/command/generate-pattern.md +0 -247
  77. package/dist/template/.opencode/command/generate-storyboard.md +0 -250
  78. package/dist/template/.opencode/command/implement.md +0 -609
  79. package/dist/template/.opencode/command/import-plan.md +0 -406
  80. package/dist/template/.opencode/command/index-knowledge.md +0 -25
  81. package/dist/template/.opencode/command/integration-test.md +0 -424
  82. package/dist/template/.opencode/command/issue.md +0 -102
  83. package/dist/template/.opencode/command/new-feature.md +0 -651
  84. package/dist/template/.opencode/command/opensrc.md +0 -58
  85. package/dist/template/.opencode/command/quick-build.md +0 -238
  86. package/dist/template/.opencode/command/ralph.md +0 -41
  87. package/dist/template/.opencode/command/research-and-implement.md +0 -148
  88. package/dist/template/.opencode/command/research-ui.md +0 -466
  89. package/dist/template/.opencode/command/restore-image.md +0 -424
  90. package/dist/template/.opencode/command/revert-feature.md +0 -386
  91. package/dist/template/.opencode/command/skill-create.md +0 -517
  92. package/dist/template/.opencode/command/skill-optimize.md +0 -556
  93. package/dist/template/.opencode/command/summarize.md +0 -412
  94. package/dist/template/.opencode/command/triage.md +0 -398
  95. package/dist/template/.opencode/memory/_templates/README.md +0 -35
  96. package/dist/template/.opencode/memory/_templates/observation.md +0 -39
  97. package/dist/template/.opencode/memory/_templates/project/architecture.md +0 -60
  98. package/dist/template/.opencode/memory/_templates/project/commands.md +0 -72
  99. package/dist/template/.opencode/memory/_templates/project/conventions.md +0 -68
  100. package/dist/template/.opencode/memory/_templates/project/gotchas.md +0 -41
  101. package/dist/template/.opencode/memory/_templates/prompt-engineering.md +0 -333
  102. package/dist/template/.opencode/memory/observations/2026-01-22-decision-agents-md-prompt-engineering-improvement.md +0 -29
  103. package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +0 -14
  104. package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +0 -20
  105. package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +0 -14
  106. package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +0 -15
  107. package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +0 -29
  108. package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +0 -21
  109. package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +0 -32
  110. package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +0 -42
  111. package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +0 -32
  112. package/dist/template/.opencode/memory/observations/2026-01-29-decision-copilot-auth-plugin-rate-limit-handling.md +0 -27
  113. package/dist/template/.opencode/memory/observations/2026-01-29-decision-spec-driven-approach-for-opencodekit.md +0 -21
  114. package/dist/template/.opencode/memory/observations/2026-01-29-learning-karpathy-llm-coding-insights-dec-2025.md +0 -44
  115. package/dist/template/.opencode/memory/observations/2026-01-30-decision-github-copilot-claude-routing-keep-disab.md +0 -32
  116. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-context-management-research-critical-gap.md +0 -14
  117. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-kimi-k2-5-agent-swarm-architecture-patte.md +0 -45
  118. package/dist/template/.opencode/memory/observations/2026-01-30-pattern-swarm-tools-architecture.md +0 -28
  119. package/dist/template/.opencode/memory/observations/2026-01-31-decision-copilot-auth-plugin-updated-with-baseurl.md +0 -63
  120. package/dist/template/.opencode/memory/observations/2026-01-31-decision-created-dedicated-worker-agent-for-swarm.md +0 -20
  121. package/dist/template/.opencode/memory/observations/2026-01-31-decision-rollback-to-v1-1-47-for-copilot-claude-r.md +0 -21
  122. package/dist/template/.opencode/memory/observations/2026-01-31-decision-simplified-swarm-to-task-tool-pattern.md +0 -44
  123. package/dist/template/.opencode/memory/observations/2026-01-31-decision-swarm-architecture-task-tool-over-tmux.md +0 -33
  124. package/dist/template/.opencode/memory/observations/2026-01-31-decision-worker-skills-defined-for-swarm-delegati.md +0 -30
  125. package/dist/template/.opencode/memory/observations/2026-01-31-learning-gpt-reasoning-config-for-github-copilot.md +0 -51
  126. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-auth-comparison-finding.md +0 -61
  127. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-reasoning-architecture-.md +0 -66
  128. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-custom-tools-api.md +0 -48
  129. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-v1-1-48-skills-as-slash-command.md +0 -21
  130. package/dist/template/.opencode/memory/observations/2026-01-31-learning-swarm-system-simplified-removed-mailbox-.md +0 -30
  131. package/dist/template/.opencode/memory/observations/2026-01-31-learning-v1-1-48-native-copilot-reasoning-via-pr-.md +0 -45
  132. package/dist/template/.opencode/memory/observations/2026-01-31-warning-cannot-add-custom-config-to-opencode-jso.md +0 -18
  133. package/dist/template/.opencode/memory/observations/2026-01-31-warning-copilot-claude-v1-endpoint-returns-404-c.md +0 -48
  134. package/dist/template/.opencode/memory/observations/2026-01-31-warning-opencode-v1-1-48-claude-thinking-block-s.md +0 -51
  135. package/dist/template/.opencode/memory/project/architecture.md +0 -60
  136. package/dist/template/.opencode/memory/project/commands.md +0 -72
  137. package/dist/template/.opencode/memory/project/conventions.md +0 -68
  138. package/dist/template/.opencode/memory/project/gotchas.md +0 -41
  139. package/dist/template/.opencode/skill/notebooklm/SKILL.md +0 -272
  140. package/dist/template/.opencode/skill/notebooklm/references/setup.md +0 -353
  141. package/dist/template/.opencode/tool/notebooklm.ts +0 -488
  142. package/dist/template/.opencode/tool/oracle.ts +0 -240
  143. /package/dist/template/.opencode/memory/{user.example.md → _templates/user.md} +0 -0
  144. /package/dist/template/.opencode/memory/{user.md → project/user.md} +0 -0
@@ -20,6 +20,11 @@ You're creating an implementation plan with proper Epic → Task → Subtask hie
20
20
 
21
21
  ```typescript
22
22
  skill({ name: "beads" });
23
+ skill({ name: "deep-research" });
24
+ skill({ name: "executing-plans" });
25
+ skill({ name: "writing-plans" });
26
+ skill({ name: "subagent-driven-development" });
27
+ skill({ name: "memory-system" });
23
28
  ```
24
29
 
25
30
  ```bash
@@ -37,28 +42,38 @@ cat .beads/artifacts/$ARGUMENTS/research.md 2>/dev/null || echo "No research fou
37
42
 
38
43
  **If complexity > M and no research:** "Consider `/research $ARGUMENTS` first for better planning."
39
44
 
45
+ ## Templates Reference
46
+
47
+ Copy templates from `.opencode/memory/_templates/` to bead artifacts folder:
48
+
49
+ ```bash
50
+ # Copy templates to bead folder
51
+ BEAD_DIR=".beads/artifacts/$ARGUMENTS"
52
+ mkdir -p "$BEAD_DIR"
53
+
54
+ # Copy design template (we'll fill it in Phase 3)
55
+ cp .opencode/memory/_templates/design.md "$BEAD_DIR/design.md"
56
+
57
+ # Copy tasks template (we'll fill it in Phase 6)
58
+ cp .opencode/memory/_templates/tasks.md "$BEAD_DIR/tasks.md"
59
+ ```
60
+
61
+ | Template | Purpose | Phase Used |
62
+ | ----------- | ------------------------------ | ---------- |
63
+ | `spec.md` | WHEN/THEN behavioral scenarios | Input |
64
+ | `design.md` | Architecture decision records | Phase 3 |
65
+ | `tasks.md` | Numbered implementation steps | Phase 6 |
66
+
40
67
  ## Check Memory First (Semantic Search)
41
68
 
42
69
  Before subagent research, check what we already know:
43
70
 
44
71
  ```typescript
45
72
  // Find similar past plans
46
- memory -
47
- search({
48
- query: "[bead title/description]",
49
- mode: "semantic",
50
- type: "bead",
51
- limit: 3,
52
- });
73
+ memory_search({ query: "[bead title/description]", limit: 3 });
53
74
 
54
75
  // Find related patterns and decisions
55
- memory -
56
- search({
57
- query: "[domain keywords]",
58
- mode: "semantic",
59
- type: "observation",
60
- limit: 3,
61
- });
76
+ memory_search({ query: "[domain keywords] gotchas patterns", limit: 3 });
62
77
  ```
63
78
 
64
79
  Review findings for:
@@ -104,6 +119,12 @@ Task({
104
119
 
105
120
  **Integrate findings into your plan.**
106
121
 
122
+ ## Skill Routing
123
+
124
+ - Use **deep-research** when the domain is unfamiliar or ambiguous.
125
+ - Use **writing-plans** when producing a detailed, step-by-step implementation plan.
126
+ - Use **executing-plans** only when a complete plan already exists and needs execution.
127
+
107
128
  ---
108
129
 
109
130
  ## Phase 2: Analyze for Decomposition
@@ -528,8 +549,7 @@ Next: /start bd-xxx1
528
549
 
529
550
  | Need | Command |
530
551
  | -------------------- | ------------------------ |
531
- | Create spec first | `/create <bead-id>` |
532
552
  | Research before plan | `/research <bead-id>` |
533
553
  | Start first task | `/start <first-task-id>` |
554
+ | Ship the work | `/ship <bead-id>` |
534
555
  | View hierarchy | `bd dep tree <bead-id>` |
535
- | Import external plan | `/import-plan` |
@@ -11,8 +11,23 @@ agent: build
11
11
  ```typescript
12
12
  skill({ name: "beads" }); // Session protocol
13
13
  skill({ name: "verification-before-completion" });
14
+ skill({ name: "memory-system" });
14
15
  ```
15
16
 
17
+ ## Check Memory for Related Context
18
+
19
+ Search for related decisions and patterns:
20
+
21
+ ```typescript
22
+ // Find related decisions and patterns for this work
23
+ memory_search({ query: "$ARGUMENTS [feature keywords]", limit: 3 });
24
+
25
+ // Find any gotchas related to this area
26
+ memory_search({ query: "[affected files/modules] gotchas", limit: 2 });
27
+ ```
28
+
29
+ Include relevant context from memory in PR description.
30
+
16
31
  ## Options
17
32
 
18
33
  - `--draft`: Create as draft PR (for WIP or early feedback)
@@ -28,6 +28,9 @@ skill({ name: "source-code-research" });
28
28
 
29
29
  // For swarm coordination (if parallel research needed)
30
30
  skill({ name: "swarm-coordination" });
31
+
32
+ // For memory context
33
+ skill({ name: "memory-system" });
31
34
  ```
32
35
 
33
36
  ## Delegation Strategy
@@ -13,6 +13,7 @@ You're picking up where a previous session left off. Recover context, verify sta
13
13
  ```typescript
14
14
  skill({ name: "beads" });
15
15
  skill({ name: "beads-bridge" }); // For cross-session recovery
16
+ skill({ name: "memory-system" });
16
17
  ```
17
18
 
18
19
  ## Verify The Task Exists
@@ -78,21 +79,10 @@ Search for relevant observations and past work:
78
79
 
79
80
  ```typescript
80
81
  // Find observations related to this bead
81
- memory -
82
- search({
83
- query: "$ARGUMENTS [bead title/description]",
84
- mode: "semantic",
85
- type: "observation",
86
- limit: 5,
87
- });
82
+ memory_search({ query: "$ARGUMENTS [bead title/description]", limit: 5 });
88
83
 
89
84
  // Find similar past work
90
- memory -
91
- search({
92
- query: "[bead description keywords]",
93
- mode: "semantic",
94
- limit: 3,
95
- });
85
+ memory_search({ query: "[bead description keywords]", limit: 3 });
96
86
  ```
97
87
 
98
88
  **Review findings** - past observations may contain:
@@ -183,11 +173,11 @@ bd update $ARGUMENTS --status in_progress
183
173
 
184
174
  Then continue with implementation:
185
175
 
186
- | Condition | Command |
187
- | ----------------------- | -------------------------------------------------------- |
188
- | Swarm was restored | Continue monitoring with `/implement $ARGUMENTS --swarm` |
189
- | No swarm, standard work | `/implement $ARGUMENTS` |
190
- | Need to re-plan | `/plan $ARGUMENTS` |
176
+ | Condition | Command |
177
+ | ----------------------- | ---------------------------------------- |
178
+ | Swarm was restored | Continue with `/ship $ARGUMENTS --swarm` |
179
+ | No swarm, standard work | `/ship $ARGUMENTS` |
180
+ | Need to re-plan | `/plan $ARGUMENTS` |
191
181
 
192
182
  ## If Context Is Too Stale
193
183
 
@@ -11,8 +11,23 @@ subtask: true
11
11
 
12
12
  ```typescript
13
13
  skill({ name: "beads" });
14
+ skill({ name: "memory-system" });
14
15
  ```
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
+
16
31
  ## Phase 1: Determine Scope
17
32
 
18
33
  Parse `$ARGUMENTS` to determine what to review:
@@ -205,3 +220,18 @@ Skip creating beads for Minor issues (just report them).
205
220
  - Vague feedback ("improve error handling" - WHERE? HOW?)
206
221
  - Skipping automated checks "to save time"
207
222
  - Not creating beads for real issues (they get forgotten)
223
+
224
+ ## Record Significant Findings
225
+
226
+ For important findings worth remembering:
227
+
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
+ ```
@@ -0,0 +1,199 @@
1
+ ---
2
+ description: Ship a bead - implement, verify, review, close
3
+ argument-hint: "<bead-id> [--parallel] [--swarm]"
4
+ agent: build
5
+ ---
6
+
7
+ # Ship: $ARGUMENTS
8
+
9
+ This command combines implementation and finish gates. It implements, verifies, runs review, then closes.
10
+
11
+ ## Load Skills
12
+
13
+ ```typescript
14
+ skill({ name: "beads" });
15
+ skill({ name: "test-driven-development" });
16
+ 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
+ ```
35
+
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
44
+
45
+ ```bash
46
+ bd show $ARGUMENTS
47
+ bd update $ARGUMENTS --status in_progress
48
+ ```
49
+
50
+ ## Pre-Flight Verification
51
+
52
+ Run `/verify $ARGUMENTS --quick` to check:
53
+
54
+ - All spec requirements addressed
55
+ - All gates passing
56
+ - No obvious contradictions
57
+
58
+ If verification fails, fix issues before proceeding.
59
+
60
+ ## Implement (Keep It Focused)
61
+
62
+ - Read before edit
63
+ - Delegate research if unclear (Task → explore/scout)
64
+ - Keep scope ≤ 3 files or create subtasks
65
+
66
+ If the task is large (3+ independent subtasks), use swarm mode.
67
+
68
+ ## Run Verification Gates
69
+
70
+ Detect project type:
71
+
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
+ ```
84
+
85
+ **Rust:**
86
+
87
+ ```bash
88
+ cargo build
89
+ cargo test
90
+ cargo clippy -- -D warnings
91
+ ```
92
+
93
+ **Python:**
94
+
95
+ ```bash
96
+ pytest
97
+ ruff check .
98
+ mypy . 2>/dev/null || true
99
+ ```
100
+
101
+ **Go:**
102
+
103
+ ```bash
104
+ go build ./...
105
+ go test ./...
106
+ golangci-lint run
107
+ ```
108
+
109
+ If ANY gate fails, stop and fix before proceeding.
110
+
111
+ ## Stage Changes For Review
112
+
113
+ ```bash
114
+ git add -A
115
+ git status
116
+ git diff --cached --stat
117
+ ```
118
+
119
+ ## Spawn Review Agent (After Tests)
120
+
121
+ ```typescript
122
+ Task({
123
+ subagent_type: "review",
124
+ description: "Review changes for $ARGUMENTS",
125
+ prompt: `Review the staged changes for bead $ARGUMENTS.
126
+
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
131
+
132
+ Return:
133
+ - Summary of findings
134
+ - Critical/High/Medium issues (if any)
135
+ `,
136
+ });
137
+ ```
138
+
139
+ If review finds issues, fix them, re-run verification gates, then re-run review.
140
+
141
+ ## Verify Success Criteria
142
+
143
+ ```bash
144
+ cat .beads/artifacts/$ARGUMENTS/spec.md
145
+ ```
146
+
147
+ Ensure all criteria are met before closing.
148
+
149
+ ## Close Bead (Ask First)
150
+
151
+ ```typescript
152
+ question({
153
+ questions: [
154
+ {
155
+ header: "Close",
156
+ question: "Ship complete. Close bead $ARGUMENTS?",
157
+ options: [
158
+ { label: "Yes, close it (Recommended)", description: "All gates passed" },
159
+ { label: "No, keep open", description: "Need more work" },
160
+ ],
161
+ },
162
+ ],
163
+ });
164
+ ```
165
+
166
+ If confirmed:
167
+
168
+ ```bash
169
+ bd close $ARGUMENTS --reason "Shipped: verification + review passed"
170
+ bd sync
171
+ ```
172
+
173
+ ## Record Learnings (On Completion)
174
+
175
+ Before ending, capture what was learned:
176
+
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
+ });
189
+
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
+ ```