opencodekit 0.9.2 → 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.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +116 -47
- package/dist/template/.opencode/agent/build.md +16 -48
- package/dist/template/.opencode/agent/explore.md +13 -34
- package/dist/template/.opencode/agent/planner.md +41 -11
- package/dist/template/.opencode/agent/review.md +2 -23
- package/dist/template/.opencode/agent/rush.md +24 -65
- package/dist/template/.opencode/agent/scout.md +5 -21
- package/dist/template/.opencode/agent/vision.md +0 -14
- package/dist/template/.opencode/command/accessibility-check.md +293 -30
- package/dist/template/.opencode/command/analyze-mockup.md +406 -20
- package/dist/template/.opencode/command/analyze-project.md +439 -30
- package/dist/template/.opencode/command/brainstorm.md +288 -5
- package/dist/template/.opencode/command/commit.md +226 -17
- package/dist/template/.opencode/command/create.md +138 -35
- package/dist/template/.opencode/command/design-audit.md +477 -29
- package/dist/template/.opencode/command/design.md +609 -6
- package/dist/template/.opencode/command/edit-image.md +223 -20
- package/dist/template/.opencode/command/finish.md +162 -71
- package/dist/template/.opencode/command/fix-ci.md +296 -24
- package/dist/template/.opencode/command/fix-types.md +345 -13
- package/dist/template/.opencode/command/fix-ui.md +293 -13
- package/dist/template/.opencode/command/fix.md +256 -9
- package/dist/template/.opencode/command/generate-diagram.md +327 -26
- package/dist/template/.opencode/command/generate-icon.md +266 -22
- package/dist/template/.opencode/command/generate-image.md +232 -12
- package/dist/template/.opencode/command/generate-pattern.md +234 -20
- package/dist/template/.opencode/command/generate-storyboard.md +231 -21
- package/dist/template/.opencode/command/handoff.md +202 -30
- package/dist/template/.opencode/command/implement.md +162 -50
- package/dist/template/.opencode/command/import-plan.md +247 -51
- package/dist/template/.opencode/command/init.md +154 -35
- package/dist/template/.opencode/command/integration-test.md +405 -24
- package/dist/template/.opencode/command/issue.md +171 -21
- package/dist/template/.opencode/command/new-feature.md +382 -54
- package/dist/template/.opencode/command/plan.md +144 -118
- package/dist/template/.opencode/command/pr.md +229 -28
- package/dist/template/.opencode/command/quick-build.md +234 -5
- package/dist/template/.opencode/command/research-and-implement.md +436 -12
- package/dist/template/.opencode/command/research-ui.md +444 -34
- package/dist/template/.opencode/command/research.md +173 -45
- package/dist/template/.opencode/command/restore-image.md +416 -22
- package/dist/template/.opencode/command/resume.md +439 -63
- package/dist/template/.opencode/command/revert-feature.md +341 -64
- package/dist/template/.opencode/command/review-codebase.md +193 -4
- package/dist/template/.opencode/command/skill-create.md +506 -14
- package/dist/template/.opencode/command/skill-optimize.md +487 -16
- package/dist/template/.opencode/command/status.md +320 -60
- package/dist/template/.opencode/command/summarize.md +374 -33
- package/dist/template/.opencode/command/triage.md +355 -0
- package/dist/template/.opencode/command/ui-review.md +292 -25
- package/dist/template/.opencode/plugin/README.md +110 -98
- package/dist/template/.opencode/plugin/compactor.ts +95 -171
- package/dist/template/.opencode/plugin/enforcer.ts +177 -127
- package/dist/template/.opencode/plugin/injector.ts +150 -0
- package/dist/template/.opencode/plugin/lib/notify.ts +86 -0
- package/dist/template/.opencode/plugin/notification.ts +57 -123
- package/dist/template/.opencode/plugin/truncator.ts +60 -166
- package/dist/template/.opencode/skill/mqdh/SKILL.md +161 -0
- package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
- package/dist/template/.opencode/skill/v0/SKILL.md +154 -0
- package/package.json +1 -1
|
@@ -6,16 +6,30 @@ agent: build
|
|
|
6
6
|
|
|
7
7
|
# Implement
|
|
8
8
|
|
|
9
|
-
**Load
|
|
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
|
-
**
|
|
35
|
-
|
|
36
|
-
Initialize your agent session and claim the task:
|
|
48
|
+
**Claim the task:**
|
|
37
49
|
|
|
38
50
|
```typescript
|
|
39
|
-
|
|
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
|
-
```
|
|
49
|
-
list_sessions(project
|
|
60
|
+
```typescript
|
|
61
|
+
list_sessions({ project: "current", limit: 3 });
|
|
50
62
|
```
|
|
51
63
|
|
|
52
64
|
If recent session exists:
|
|
53
65
|
|
|
54
|
-
```
|
|
55
|
-
read_session("last", project
|
|
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
|
-
|
|
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
|
-
**
|
|
78
|
+
**Extract estimation from spec/plan:**
|
|
79
|
+
|
|
80
|
+
Look for estimate tag (S/M/L/XL) and set budget:
|
|
67
81
|
|
|
68
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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({
|
|
157
|
+
bd_reserve({
|
|
158
|
+
paths: ["src/auth.ts", "src/utils/**"],
|
|
159
|
+
reason: "Implementing <bead-id>",
|
|
160
|
+
ttl: 600,
|
|
161
|
+
});
|
|
119
162
|
```
|
|
120
163
|
|
|
121
|
-
|
|
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.
|
|
128
|
-
2.
|
|
129
|
-
3.
|
|
130
|
-
4.
|
|
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
|
-
|
|
199
|
+
### Gate Rules
|
|
141
200
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
207
|
+
### Track Progress
|
|
147
208
|
|
|
148
|
-
After
|
|
209
|
+
After every 10 tool calls (or per checkpoint frequency):
|
|
149
210
|
|
|
150
211
|
```
|
|
151
212
|
Progress: <bead-id>
|
|
152
213
|
━━━━━━━━━━━━━━━━━━
|
|
153
214
|
|
|
154
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
274
|
+
Run full verification suite:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
[project-specific test command]
|
|
278
|
+
[project-specific lint command]
|
|
179
279
|
```
|
|
180
280
|
|
|
181
|
-
|
|
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
|
```
|