opencodekit 0.12.1 → 0.12.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.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +40 -417
- package/dist/template/.opencode/agent/build.md +53 -0
- package/dist/template/.opencode/agent/explore.md +6 -6
- package/dist/template/.opencode/agent/planner.md +0 -1
- package/dist/template/.opencode/agent/rush.md +38 -0
- package/dist/template/.opencode/command/accessibility-check.md +1 -1
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/commit.md +1 -1
- package/dist/template/.opencode/command/create.md +68 -441
- package/dist/template/.opencode/command/finish.md +82 -252
- package/dist/template/.opencode/command/fix-ci.md +52 -247
- package/dist/template/.opencode/command/fix-types.md +33 -293
- package/dist/template/.opencode/command/fix-ui.md +49 -234
- package/dist/template/.opencode/command/fix.md +57 -194
- package/dist/template/.opencode/command/handoff.md +66 -243
- package/dist/template/.opencode/command/implement.md +67 -231
- package/dist/template/.opencode/command/issue.md +42 -190
- package/dist/template/.opencode/command/new-feature.md +1 -1
- package/dist/template/.opencode/command/plan.md +86 -442
- package/dist/template/.opencode/command/pr.md +3 -1
- package/dist/template/.opencode/command/research-and-implement.md +69 -370
- package/dist/template/.opencode/command/research-ui.md +1 -1
- package/dist/template/.opencode/command/research.md +72 -197
- package/dist/template/.opencode/command/resume.md +70 -438
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/command/status.md +11 -11
- package/dist/template/.opencode/command/triage.md +23 -18
- package/dist/template/.opencode/dcp.jsonc +16 -33
- package/dist/template/.opencode/memory/project/commands.md +176 -5
- package/dist/template/.opencode/memory/project/conventions.md +104 -5
- package/dist/template/.opencode/memory/project/gotchas.md +128 -9
- package/dist/template/.opencode/opencode.json +511 -523
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/beads.ts +181 -16
- package/dist/template/.opencode/skill/beads/SKILL.md +15 -0
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +94 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +107 -0
- package/dist/template/.opencode/skill/session-management/SKILL.md +111 -0
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +115 -0
- package/package.json +1 -1
- package/dist/template/.opencode/tool/lsp.ts +0 -786
|
@@ -1,337 +1,167 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Finish a bead -
|
|
2
|
+
description: Finish a bead - verify, commit, close
|
|
3
3
|
argument-hint: "<bead-id>"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Finish
|
|
7
|
+
# Finish: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
You're closing out a task. This is the quality gate. No shortcuts.
|
|
10
|
+
|
|
11
|
+
## Load Skills
|
|
10
12
|
|
|
11
13
|
```typescript
|
|
12
|
-
skill({ name: "beads" });
|
|
14
|
+
skill({ name: "beads" });
|
|
13
15
|
skill({ name: "verification-before-completion" });
|
|
14
|
-
skill({ name: "finishing-a-development-branch" });
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## Verify The Task Exists
|
|
18
19
|
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
bd_inbox({ n: 5, unread: true, global: false });
|
|
20
|
+
```bash
|
|
21
|
+
bd show $ARGUMENTS
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
If not found, stop. Check `bd list --status=all` for the correct ID.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## Run All Gates
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Check which project files exist to determine verification commands:
|
|
28
|
+
Detect your project type and run everything:
|
|
31
29
|
|
|
32
30
|
```bash
|
|
33
|
-
ls package.json Cargo.toml pyproject.toml
|
|
31
|
+
ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null
|
|
34
32
|
```
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
| ------------------ | ---------------- | --------------- | ----------------------------- |
|
|
38
|
-
| Node.js/TypeScript | `npm run build` | `npm test` | `npm run lint && type-check` |
|
|
39
|
-
| Rust | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` |
|
|
40
|
-
| Python | - | `pytest` | `ruff check . && mypy .` |
|
|
41
|
-
| Go | `go build ./...` | `go test ./...` | `golangci-lint run` |
|
|
42
|
-
| Make-based | `make build` | `make test` | `make lint` |
|
|
43
|
-
|
|
44
|
-
Check if each command actually exists before running.
|
|
45
|
-
|
|
46
|
-
## Phase 3: Hard Gates (MUST ALL PASS)
|
|
47
|
-
|
|
48
|
-
Run detected verification commands. Skip any that don't exist.
|
|
34
|
+
**Node/TypeScript:**
|
|
49
35
|
|
|
36
|
+
```bash
|
|
37
|
+
npm run build 2>/dev/null || true
|
|
38
|
+
npm test
|
|
39
|
+
npm run lint 2>/dev/null || true
|
|
40
|
+
npm run type-check 2>/dev/null || true
|
|
50
41
|
```
|
|
51
|
-
Finish Gates: <bead-id>
|
|
52
|
-
━━━━━━━━━━━━━━━━━━━━━━
|
|
53
42
|
|
|
54
|
-
|
|
43
|
+
**Rust:**
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
```bash
|
|
46
|
+
cargo build
|
|
47
|
+
cargo test
|
|
48
|
+
cargo clippy -- -D warnings
|
|
60
49
|
```
|
|
61
50
|
|
|
62
|
-
**
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
Cannot finish: [gate name] failed.
|
|
51
|
+
**Python:**
|
|
66
52
|
|
|
67
|
-
|
|
53
|
+
```bash
|
|
54
|
+
pytest
|
|
55
|
+
ruff check .
|
|
56
|
+
mypy . 2>/dev/null || true
|
|
68
57
|
```
|
|
69
58
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Phase 4: Verify Success Criteria
|
|
73
|
-
|
|
74
|
-
Read spec:
|
|
59
|
+
**Go:**
|
|
75
60
|
|
|
76
61
|
```bash
|
|
77
|
-
|
|
62
|
+
go build ./...
|
|
63
|
+
go test ./...
|
|
64
|
+
golangci-lint run
|
|
78
65
|
```
|
|
79
66
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
Success Criteria:
|
|
84
|
-
━━━━━━━━━━━━━━━━
|
|
85
|
-
|
|
86
|
-
- [x] [Criterion 1]
|
|
87
|
-
Verify: `[command]` ✓
|
|
88
|
-
- [x] [Criterion 2]
|
|
89
|
-
Verify: `[command]` ✓
|
|
90
|
-
- [ ] [Criterion 3] - NOT MET
|
|
91
|
-
Verify: `[command]` ✗
|
|
92
|
-
Reason: [what failed]
|
|
93
|
-
```
|
|
67
|
+
If ANY gate fails, stop. Fix it first. Don't close broken work.
|
|
94
68
|
|
|
95
|
-
|
|
69
|
+
## Verify Success Criteria
|
|
96
70
|
|
|
97
|
-
|
|
98
|
-
Cannot finish: Success criteria not met.
|
|
71
|
+
Read the spec and check each criterion:
|
|
99
72
|
|
|
100
|
-
|
|
101
|
-
|
|
73
|
+
```bash
|
|
74
|
+
cat .beads/artifacts/$ARGUMENTS/spec.md
|
|
102
75
|
```
|
|
103
76
|
|
|
104
|
-
|
|
77
|
+
For each success criterion listed, run its verification. All must pass. If something's missing, go back and implement it.
|
|
105
78
|
|
|
106
|
-
|
|
79
|
+
## Commit Everything
|
|
107
80
|
|
|
108
81
|
```bash
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
For L/XL tasks, ADR should exist documenting the design decision.
|
|
82
|
+
git add -A
|
|
83
|
+
git status
|
|
84
|
+
git commit -m "$ARGUMENTS: [what was done]
|
|
113
85
|
|
|
114
|
-
|
|
86
|
+
- [change 1]
|
|
87
|
+
- [change 2]
|
|
115
88
|
|
|
116
|
-
|
|
89
|
+
Closes: $ARGUMENTS"
|
|
90
|
+
```
|
|
117
91
|
|
|
118
|
-
|
|
92
|
+
## Close The Task
|
|
119
93
|
|
|
94
|
+
```typescript
|
|
95
|
+
bd_done({ id: "$ARGUMENTS", msg: "Completed: [1-line summary]" });
|
|
120
96
|
```
|
|
121
|
-
Estimation Accuracy:
|
|
122
|
-
━━━━━━━━━━━━━━━━━━━
|
|
123
97
|
|
|
124
|
-
|
|
125
|
-
Actual: [N] tool calls
|
|
126
|
-
Variance: [+/-N%] ([over/under]estimated)
|
|
127
|
-
```
|
|
98
|
+
This closes the task, releases any file locks, and syncs with git. Task is done.
|
|
128
99
|
|
|
129
|
-
|
|
100
|
+
## Create Review (Optional But Recommended)
|
|
130
101
|
|
|
131
|
-
|
|
132
|
-
- > 50% under: Task was easier. Consider if similar tasks should be estimated lower.
|
|
133
|
-
- Within 20%: Good estimate. Pattern worth remembering.
|
|
102
|
+
If this was non-trivial work, document what happened:
|
|
134
103
|
|
|
135
|
-
|
|
104
|
+
```bash
|
|
105
|
+
mkdir -p .beads/artifacts/$ARGUMENTS
|
|
106
|
+
```
|
|
136
107
|
|
|
137
|
-
Write `.beads/artifacts
|
|
108
|
+
Write `.beads/artifacts/$ARGUMENTS/review.md`:
|
|
138
109
|
|
|
139
110
|
```markdown
|
|
140
|
-
# Review:
|
|
141
|
-
|
|
142
|
-
**Bead:** <bead-id>
|
|
143
|
-
**Completed:** <date>
|
|
144
|
-
|
|
145
|
-
## Estimation Accuracy
|
|
111
|
+
# Review: $ARGUMENTS
|
|
146
112
|
|
|
147
|
-
|
|
148
|
-
| --------- | -------------------- |
|
|
149
|
-
| Estimated | [S/M/L] (~[N] calls) |
|
|
150
|
-
| Actual | [N] calls |
|
|
151
|
-
| Variance | [+/-N%] |
|
|
113
|
+
**Completed:** [date]
|
|
152
114
|
|
|
153
|
-
|
|
115
|
+
## What Changed
|
|
154
116
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
| File | Change |
|
|
158
|
-
| ------------ | ------------- |
|
|
159
|
-
| `src/foo.ts` | [description] |
|
|
160
|
-
| `src/bar.ts` | [description] |
|
|
117
|
+
- [file]: [what and why]
|
|
161
118
|
|
|
162
119
|
## What Worked
|
|
163
120
|
|
|
164
|
-
- [
|
|
165
|
-
|
|
166
|
-
## What Was Difficult
|
|
167
|
-
|
|
168
|
-
- [Challenge encountered and how resolved]
|
|
169
|
-
|
|
170
|
-
## What Was Skipped
|
|
171
|
-
|
|
172
|
-
- [Thing intentionally not done and why]
|
|
121
|
+
- [thing that went smoothly]
|
|
173
122
|
|
|
174
|
-
##
|
|
123
|
+
## What Was Hard
|
|
175
124
|
|
|
176
|
-
- [
|
|
177
|
-
- [Gotcha to remember]
|
|
125
|
+
- [challenge and how you solved it]
|
|
178
126
|
|
|
179
|
-
##
|
|
127
|
+
## Lessons
|
|
180
128
|
|
|
181
|
-
- [
|
|
182
|
-
- [Existing tests modified]
|
|
183
|
-
|
|
184
|
-
## Success Criteria
|
|
185
|
-
|
|
186
|
-
- [x] [Criterion 1]
|
|
187
|
-
- [x] [Criterion 2]
|
|
129
|
+
- [anything worth remembering]
|
|
188
130
|
```
|
|
189
131
|
|
|
190
|
-
##
|
|
132
|
+
## Record Learnings
|
|
191
133
|
|
|
192
|
-
If you discovered
|
|
134
|
+
If you discovered patterns or gotchas worth remembering:
|
|
193
135
|
|
|
194
136
|
```typescript
|
|
195
137
|
observation({
|
|
196
|
-
type: "learning",
|
|
138
|
+
type: "learning",
|
|
197
139
|
title: "[concise title]",
|
|
198
|
-
content: "[what
|
|
199
|
-
|
|
200
|
-
files: "[affected files]",
|
|
201
|
-
bead_id: "<bead-id>",
|
|
202
|
-
});
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
**Create observations for:**
|
|
206
|
-
|
|
207
|
-
- Patterns that should be reused
|
|
208
|
-
- Gotchas that wasted time
|
|
209
|
-
- Design decisions with rationale
|
|
210
|
-
- Bug root causes
|
|
211
|
-
|
|
212
|
-
## Phase 9: Update Memory (if applicable)
|
|
213
|
-
|
|
214
|
-
If patterns or gotchas discovered:
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
// For new patterns
|
|
218
|
-
memory -
|
|
219
|
-
update({
|
|
220
|
-
file: "project/conventions",
|
|
221
|
-
content: "## [Pattern Name]\n\n[Description and example]",
|
|
222
|
-
mode: "append",
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
// For gotchas
|
|
226
|
-
memory -
|
|
227
|
-
update({
|
|
228
|
-
file: "project/gotchas",
|
|
229
|
-
content: "## [Gotcha Title]\n\n[What happened and how to avoid]",
|
|
230
|
-
mode: "append",
|
|
231
|
-
});
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
## Phase 10: Final Commit
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
git add -A
|
|
238
|
-
git status
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
Commit with bead reference:
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
git commit -m "<bead-id>: [summary of changes]
|
|
245
|
-
|
|
246
|
-
- [bullet 1]
|
|
247
|
-
- [bullet 2]
|
|
248
|
-
|
|
249
|
-
Closes: <bead-id>"
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## Phase 11: Close Bead & Notify
|
|
253
|
-
|
|
254
|
-
Complete the task:
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
bd_done({ id: "$ARGUMENTS", msg: "Implemented: [1-liner summary]" });
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
Notify dependent tasks are now unblocked:
|
|
261
|
-
|
|
262
|
-
```typescript
|
|
263
|
-
bd_msg({
|
|
264
|
-
subj: "<bead-id> completed",
|
|
265
|
-
body: "Dependent tasks now unblocked. Summary: [1-liner]",
|
|
266
|
-
to: "all",
|
|
267
|
-
importance: "normal",
|
|
268
|
-
global: true,
|
|
140
|
+
content: "[what you learned]",
|
|
141
|
+
bead_id: "$ARGUMENTS",
|
|
269
142
|
});
|
|
270
143
|
```
|
|
271
144
|
|
|
272
|
-
## Phase 12: Database Health Check
|
|
273
|
-
|
|
274
|
-
```typescript
|
|
275
|
-
bd_ls({ status: "all", limit: 1 });
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
| Issue Count | Action |
|
|
279
|
-
| ----------- | -------------------------------------------- |
|
|
280
|
-
| >200 | Warn about performance |
|
|
281
|
-
| >500 | Strongly recommend `bd_cleanup({ days: 7 })` |
|
|
282
|
-
|
|
283
145
|
## Output
|
|
284
146
|
|
|
285
147
|
```
|
|
286
|
-
|
|
287
|
-
━━━━━━━━━━━━━━━━━━━━━
|
|
288
|
-
|
|
289
|
-
Gates: All passed ✓
|
|
290
|
-
Criteria: All met ✓
|
|
291
|
-
Commit: [commit hash]
|
|
292
|
-
|
|
293
|
-
Estimation:
|
|
294
|
-
- Estimated: [S/M/L] (~[N] calls)
|
|
295
|
-
- Actual: [N] calls
|
|
296
|
-
- Accuracy: [good/over/under]
|
|
297
|
-
|
|
298
|
-
Artifacts:
|
|
299
|
-
- .beads/artifacts/<bead-id>/spec.md
|
|
300
|
-
- .beads/artifacts/<bead-id>/review.md
|
|
301
|
-
[- .beads/artifacts/<bead-id>/research.md]
|
|
302
|
-
[- .beads/artifacts/<bead-id>/plan.md]
|
|
303
|
-
[- .beads/artifacts/<bead-id>/adr.md]
|
|
304
|
-
|
|
305
|
-
Branch: <bead-id>
|
|
306
|
-
```
|
|
148
|
+
Closed: $ARGUMENTS
|
|
307
149
|
|
|
308
|
-
|
|
150
|
+
Gates: All passed
|
|
151
|
+
Commit: [hash]
|
|
152
|
+
Branch: [branch]
|
|
309
153
|
|
|
154
|
+
Next:
|
|
155
|
+
- /pr $ARGUMENTS # Create pull request
|
|
156
|
+
- Or merge directly: git checkout main && git merge $ARGUMENTS
|
|
310
157
|
```
|
|
311
|
-
━━━━━━━━━━━━━━━━━━━━━
|
|
312
158
|
|
|
313
|
-
|
|
314
|
-
/pr <bead-id> # Create pull request
|
|
315
|
-
git checkout main && git merge <bead-id> # Direct merge
|
|
316
|
-
|
|
317
|
-
Or start fresh:
|
|
318
|
-
→ Start new session for next task
|
|
319
|
-
→ Previous work: read_session("last")
|
|
320
|
-
```
|
|
159
|
+
## If Work Is Incomplete
|
|
321
160
|
|
|
322
|
-
|
|
161
|
+
Don't close incomplete work. Instead:
|
|
323
162
|
|
|
324
163
|
```
|
|
325
|
-
|
|
326
|
-
bd_cleanup({ days: 7 })
|
|
327
|
-
bd_sync({ reason: "Cleanup after finish" })
|
|
164
|
+
/handoff $ARGUMENTS "Stopped at [step]. Remaining: [what's left]"
|
|
328
165
|
```
|
|
329
166
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
```
|
|
333
|
-
⚠️ Work incomplete? Create handoff:
|
|
334
|
-
/handoff <bead-id> "Resume: [what's left]"
|
|
335
|
-
|
|
336
|
-
Next session: /resume <bead-id>
|
|
337
|
-
```
|
|
167
|
+
Then start fresh session and `/resume $ARGUMENTS` later.
|