opencodekit 0.10.0 → 0.11.0

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 (46) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/agent/planner.md +3 -2
  3. package/dist/template/.opencode/command/accessibility-check.md +293 -30
  4. package/dist/template/.opencode/command/analyze-mockup.md +406 -20
  5. package/dist/template/.opencode/command/analyze-project.md +439 -30
  6. package/dist/template/.opencode/command/brainstorm.md +288 -5
  7. package/dist/template/.opencode/command/commit.md +226 -17
  8. package/dist/template/.opencode/command/create.md +138 -35
  9. package/dist/template/.opencode/command/design-audit.md +477 -29
  10. package/dist/template/.opencode/command/design.md +609 -6
  11. package/dist/template/.opencode/command/edit-image.md +223 -20
  12. package/dist/template/.opencode/command/finish.md +162 -71
  13. package/dist/template/.opencode/command/fix-ci.md +296 -24
  14. package/dist/template/.opencode/command/fix-types.md +345 -13
  15. package/dist/template/.opencode/command/fix-ui.md +293 -13
  16. package/dist/template/.opencode/command/fix.md +256 -9
  17. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  18. package/dist/template/.opencode/command/generate-icon.md +266 -22
  19. package/dist/template/.opencode/command/generate-image.md +232 -12
  20. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  21. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  22. package/dist/template/.opencode/command/handoff.md +202 -30
  23. package/dist/template/.opencode/command/implement.md +162 -50
  24. package/dist/template/.opencode/command/import-plan.md +247 -51
  25. package/dist/template/.opencode/command/init.md +154 -35
  26. package/dist/template/.opencode/command/integration-test.md +405 -24
  27. package/dist/template/.opencode/command/issue.md +171 -21
  28. package/dist/template/.opencode/command/new-feature.md +382 -54
  29. package/dist/template/.opencode/command/plan.md +144 -118
  30. package/dist/template/.opencode/command/pr.md +229 -28
  31. package/dist/template/.opencode/command/quick-build.md +234 -5
  32. package/dist/template/.opencode/command/research-and-implement.md +436 -12
  33. package/dist/template/.opencode/command/research-ui.md +444 -34
  34. package/dist/template/.opencode/command/research.md +173 -45
  35. package/dist/template/.opencode/command/restore-image.md +416 -22
  36. package/dist/template/.opencode/command/resume.md +439 -63
  37. package/dist/template/.opencode/command/revert-feature.md +341 -64
  38. package/dist/template/.opencode/command/review-codebase.md +193 -4
  39. package/dist/template/.opencode/command/skill-create.md +506 -14
  40. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  41. package/dist/template/.opencode/command/status.md +320 -60
  42. package/dist/template/.opencode/command/summarize.md +374 -33
  43. package/dist/template/.opencode/command/triage.md +355 -0
  44. package/dist/template/.opencode/command/ui-review.md +292 -25
  45. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  46. package/package.json +1 -1
@@ -6,16 +6,30 @@ agent: build
6
6
 
7
7
  # Implement
8
8
 
9
- **Load skill:** `skill({ name: "test-driven-development" })`
9
+ **Load skills:**
10
+
11
+ ```typescript
12
+ skill({ name: "test-driven-development" });
13
+ skill({ name: "verification-before-completion" });
14
+ ```
10
15
 
11
16
  For large tasks with 3+ phases, also load: `skill({ name: "subagent-driven-development" })`
12
17
 
13
18
  ## Phase 1: Setup Workspace
14
19
 
15
20
  ```typescript
21
+ bd_init({ team: "project", role: "<your-role>" });
16
22
  bd_show({ id: "$ARGUMENTS" });
17
23
  ```
18
24
 
25
+ **Check for messages from other agents:**
26
+
27
+ ```typescript
28
+ bd_inbox({ n: 5, unread: true, global: true });
29
+ ```
30
+
31
+ Review any coordination messages before starting.
32
+
19
33
  Check git state:
20
34
 
21
35
  ```bash
@@ -31,45 +45,62 @@ Create branch if not on bead branch:
31
45
  git checkout -b <bead-id>
32
46
  ```
33
47
 
34
- **Multi-agent coordination:**
35
-
36
- Initialize your agent session and claim the task:
48
+ **Claim the task:**
37
49
 
38
50
  ```typescript
39
- bd_init({ team: "project", role: "<your-role>" });
51
+ bd_claim({ reason: "Starting implementation of <bead-id>" });
40
52
  ```
41
53
 
42
54
  This registers you in the workspace. If another agent is working on the same task, you'll be notified.
43
55
 
44
- ## Phase 2: Load Context
56
+ ## Phase 2: Load Context & Estimation
45
57
 
46
58
  **Check for previous session work:**
47
59
 
48
- ```bash
49
- list_sessions(project="current", limit=3)
60
+ ```typescript
61
+ list_sessions({ project: "current", limit: 3 });
50
62
  ```
51
63
 
52
64
  If recent session exists:
53
65
 
54
- ```bash
55
- read_session("last", project="current")
66
+ ```typescript
67
+ read_session({ session_reference: "last", project: "current" });
56
68
  ```
57
69
 
58
70
  Review what was already attempted/completed.
59
71
 
60
- Check what artifacts exist:
72
+ **Load artifacts:**
61
73
 
62
74
  ```bash
63
75
  ls .beads/artifacts/<bead-id>/ 2>/dev/null || echo "No artifacts yet"
64
76
  ```
65
77
 
66
- **If `plan.md` exists:** Follow the plan step-by-step (Phase 4).
78
+ **Extract estimation from spec/plan:**
79
+
80
+ Look for estimate tag (S/M/L/XL) and set budget:
67
81
 
68
- **If `research.md` exists but no plan:** Ask user "Create plan first? Or implement directly?"
82
+ | Estimate | Tool Call Budget | Checkpoint Frequency |
83
+ | -------- | ---------------- | -------------------- |
84
+ | S | ~10 | End only |
85
+ | M | ~30 | Every 10 calls |
86
+ | L | ~100 | Every 20 calls |
87
+ | XL | Decomposed | Every step |
69
88
 
70
- **If only `spec.md` exists (Quick Mode):** Read spec and implement directly based on requirements. No plan needed for simple tasks.
89
+ ```
90
+ Implementation Budget:
91
+ ━━━━━━━━━━━━━━━━━━━━━
92
+
93
+ Estimate: [S/M/L] (~[N] tool calls)
94
+ Budget: [N] tool calls
95
+ Checkpoint: Every [N] calls
96
+ ```
97
+
98
+ **Determine mode:**
71
99
 
72
- **If no artifacts:** Read bead description and implement based on that.
100
+ - **If `plan.md` exists:** Follow the plan step-by-step (Planned Mode)
101
+ - **If `research.md` exists but no plan:** Ask user "Create plan first? Or implement directly?"
102
+ - **If only `spec.md` exists:** Read spec and implement directly (Quick Mode)
103
+ - **If no artifacts:** Read bead description and implement based on that
73
104
 
74
105
  Check for handoffs:
75
106
 
@@ -87,71 +118,104 @@ Check which project files exist:
87
118
  ls package.json Cargo.toml pyproject.toml setup.py Makefile go.mod 2>/dev/null || true
88
119
  ```
89
120
 
90
- **Node.js/TypeScript** (`package.json`): `npm test`, `npm run lint`, `npm run type-check`
91
-
92
- **Rust** (`Cargo.toml`): `cargo test`, `cargo clippy -- -D warnings`
93
-
94
- **Python** (`pyproject.toml` or `setup.py`): `pytest`, `ruff check .`, `mypy .`
95
-
96
- **Go** (`go.mod`): `go test ./...`, `golangci-lint run`
97
-
98
- **Make-based** (`Makefile`): `make test`, `make lint`
99
-
100
- **No recognized files:** Skip automated verification.
121
+ | Project Type | Test Command | Lint Command |
122
+ | ------------------ | --------------- | ------------------------------------ |
123
+ | Node.js/TypeScript | `npm test` | `npm run lint && npm run type-check` |
124
+ | Rust | `cargo test` | `cargo clippy -- -D warnings` |
125
+ | Python | `pytest` | `ruff check . && mypy .` |
126
+ | Go | `go test ./...` | `golangci-lint run` |
127
+ | Make-based | `make test` | `make lint` |
101
128
 
102
129
  Report:
103
130
 
104
131
  ```
105
132
  Implementing: <bead-id>
106
133
  ━━━━━━━━━━━━━━━━━━━━━━
134
+
107
135
  Project: [detected type]
108
136
  Mode: [Quick/Planned]
137
+ Estimate: [S/M/L] (~[N] tool calls)
109
138
  ```
110
139
 
111
140
  ## Phase 4: Implementation
112
141
 
113
- **Reserve files before editing:**
142
+ ### Check Locks & Reserve Files
143
+
144
+ ```typescript
145
+ bd_reservations({ reason: "Checking for conflicts before implementation" });
146
+ ```
147
+
148
+ If files you need are locked:
114
149
 
115
- Before making changes, lock the files you'll modify to prevent conflicts with other agents:
150
+ - Wait for lock to expire, or
151
+ - Coordinate via `bd_msg`, or
152
+ - Work on different files
153
+
154
+ Reserve files before editing:
116
155
 
117
156
  ```typescript
118
- bd_reserve({ paths: ["src/auth.ts", "src/utils/**"] });
157
+ bd_reserve({
158
+ paths: ["src/auth.ts", "src/utils/**"],
159
+ reason: "Implementing <bead-id>",
160
+ ttl: 600,
161
+ });
119
162
  ```
120
163
 
121
- This creates an advisory lock. Other agents will see your reservation and avoid those files.
164
+ ### Escape Hatches
165
+
166
+ Set limits before starting:
167
+
168
+ | Condition | Action |
169
+ | ------------------------------ | ------------------------------------- |
170
+ | Step fails 3x | Stop, analyze, try different approach |
171
+ | Tests fail 5x consecutively | Pause, ask human for guidance |
172
+ | Budget 80% exhausted | Checkpoint commit, reassess scope |
173
+ | Budget exhausted | `/handoff` with progress summary |
174
+ | Blocked on external dependency | Create blocker bead, move on |
122
175
 
123
176
  ### With Plan (Planned Mode)
124
177
 
125
178
  For each unchecked step in plan.md:
126
179
 
127
- 1. Make changes to listed files
128
- 2. Run verification (test/lint/type-check)
129
- 3. Mark step complete: `- [x]`
130
- 4. Commit if significant
180
+ 1. **Check rollback point** from plan (if exists)
181
+ 2. Make changes to listed files
182
+ 3. Run step verification command
183
+ 4. If fails 3x: Use rollback, try different approach
184
+ 5. Mark step complete: `- [x]`
185
+ 6. **Checkpoint commit** (if L/XL or significant change)
186
+
187
+ ```bash
188
+ git add <files> && git commit -m "WIP: <bead-id> - Step N complete"
189
+ ```
131
190
 
132
191
  ### Without Plan (Quick Mode)
133
192
 
134
- 1. Read spec requirements
193
+ 1. Read spec requirements and success criteria
135
194
  2. Identify files to change
136
195
  3. Make minimal, focused changes
137
196
  4. Run verification after each logical change
138
197
  5. Keep changes atomic and reviewable
139
198
 
140
- **Gate rules:**
199
+ ### Gate Rules
141
200
 
142
- - Type check fails → Fix before proceeding
143
- - Tests fail Fix before proceeding
144
- - Lint fails Fix if auto-fixable, else note
201
+ | Gate | On Failure |
202
+ | ---------- | ----------------------------------- |
203
+ | Type check | Fix before proceeding |
204
+ | Tests | Fix before proceeding (max 3 tries) |
205
+ | Lint | Auto-fix if possible, else note |
145
206
 
146
- ## Phase 5: Progress Report
207
+ ### Track Progress
147
208
 
148
- After each change:
209
+ After every 10 tool calls (or per checkpoint frequency):
149
210
 
150
211
  ```
151
212
  Progress: <bead-id>
152
213
  ━━━━━━━━━━━━━━━━━━
153
214
 
154
- Changes:
215
+ Tool calls: [N]/[budget]
216
+ Steps: [completed]/[total]
217
+
218
+ Recent changes:
155
219
  - src/foo.ts:15 - [what changed]
156
220
 
157
221
  Verification: Test ✓ | Lint ✓ | Types ✓
@@ -161,29 +225,76 @@ Continue? (yes/pause/stop)
161
225
 
162
226
  If "pause" or "stop": Run `/handoff <bead-id>`.
163
227
 
164
- ## Phase 6: Complete
228
+ ## Phase 5: Pre-Completion Verification
229
+
230
+ Before claiming done, verify against spec success criteria:
231
+
232
+ ```bash
233
+ cat .beads/artifacts/<bead-id>/spec.md | grep -A 20 "Success Criteria"
234
+ ```
235
+
236
+ For each criterion:
237
+
238
+ - [ ] Run the verification command listed
239
+ - [ ] Confirm it passes
240
+ - [ ] Document result
241
+
242
+ ```
243
+ Success Criteria Check:
244
+ ━━━━━━━━━━━━━━━━━━━━━━
245
+
246
+ - [x] [Criterion 1] - Verify: `npm test auth` ✓
247
+ - [x] [Criterion 2] - Verify: `curl localhost:3000/health` ✓
248
+ - [ ] [Criterion 3] - Verify: [command] ✗ (needs fix)
249
+ ```
165
250
 
166
- When done, release any file reservations:
251
+ **Do not proceed until all criteria pass.**
252
+
253
+ ## Phase 6: Update Memory (if needed)
254
+
255
+ If you encountered unexpected issues:
167
256
 
168
257
  ```typescript
169
- bd_release();
258
+ memory -
259
+ update({
260
+ file: "project/gotchas",
261
+ content: "## [Issue Title]\n\n[What happened and how to avoid it]",
262
+ mode: "append",
263
+ });
170
264
  ```
171
265
 
172
- Then report:
266
+ ## Phase 7: Complete
173
267
 
268
+ Release file reservations:
269
+
270
+ ```typescript
271
+ bd_release({ _: true });
174
272
  ```
175
- Implementation Complete: <bead-id>
176
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
177
273
 
178
- Final verification running...
274
+ Run full verification suite:
275
+
276
+ ```bash
277
+ [project-specific test command]
278
+ [project-specific lint command]
179
279
  ```
180
280
 
181
- Run full verification suite.
281
+ Sync with other agents:
282
+
283
+ ```typescript
284
+ bd_sync({ reason: "Implementation complete for <bead-id>" });
285
+ ```
286
+
287
+ **Final report:**
182
288
 
183
289
  If all pass:
184
290
 
185
291
  ```
292
+ Implementation Complete: <bead-id>
293
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
294
+
295
+ Tool calls: [actual]/[budget] ([over/under] by [N])
186
296
  All gates passed ✓
297
+ All success criteria verified ✓
187
298
 
188
299
  Next: /finish <bead-id>
189
300
  ```
@@ -192,6 +303,7 @@ If any fail:
192
303
 
193
304
  ```
194
305
  Gate failed: [which one]
306
+ Retries: [N]/3
195
307
 
196
308
  Fix issues before running /finish.
197
309
  ```