opencodekit 0.12.3 → 0.12.5

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 (62) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/template/.opencode/agent/build.md +66 -9
  3. package/dist/template/.opencode/agent/rush.md +43 -19
  4. package/dist/template/.opencode/command/accessibility-check.md +7 -10
  5. package/dist/template/.opencode/command/analyze-mockup.md +3 -16
  6. package/dist/template/.opencode/command/analyze-project.md +57 -69
  7. package/dist/template/.opencode/command/brainstorm.md +3 -11
  8. package/dist/template/.opencode/command/commit.md +10 -18
  9. package/dist/template/.opencode/command/create.md +4 -8
  10. package/dist/template/.opencode/command/design-audit.md +24 -51
  11. package/dist/template/.opencode/command/design.md +10 -17
  12. package/dist/template/.opencode/command/finish.md +9 -9
  13. package/dist/template/.opencode/command/fix-ci.md +7 -28
  14. package/dist/template/.opencode/command/fix-types.md +3 -7
  15. package/dist/template/.opencode/command/fix-ui.md +5 -11
  16. package/dist/template/.opencode/command/fix.md +4 -10
  17. package/dist/template/.opencode/command/handoff.md +8 -14
  18. package/dist/template/.opencode/command/implement.md +13 -16
  19. package/dist/template/.opencode/command/import-plan.md +20 -38
  20. package/dist/template/.opencode/command/init.md +9 -13
  21. package/dist/template/.opencode/command/integration-test.md +11 -13
  22. package/dist/template/.opencode/command/issue.md +4 -8
  23. package/dist/template/.opencode/command/new-feature.md +20 -40
  24. package/dist/template/.opencode/command/plan.md +8 -12
  25. package/dist/template/.opencode/command/pr.md +29 -38
  26. package/dist/template/.opencode/command/quick-build.md +3 -7
  27. package/dist/template/.opencode/command/research-and-implement.md +4 -6
  28. package/dist/template/.opencode/command/research.md +10 -7
  29. package/dist/template/.opencode/command/resume.md +12 -24
  30. package/dist/template/.opencode/command/revert-feature.md +21 -56
  31. package/dist/template/.opencode/command/review-codebase.md +21 -23
  32. package/dist/template/.opencode/command/skill-create.md +1 -5
  33. package/dist/template/.opencode/command/skill-optimize.md +3 -10
  34. package/dist/template/.opencode/command/status.md +28 -25
  35. package/dist/template/.opencode/command/triage.md +19 -31
  36. package/dist/template/.opencode/command/ui-review.md +6 -13
  37. package/dist/template/.opencode/command.backup/analyze-project.md +465 -0
  38. package/dist/template/.opencode/command.backup/finish.md +167 -0
  39. package/dist/template/.opencode/command.backup/implement.md +143 -0
  40. package/dist/template/.opencode/command.backup/pr.md +252 -0
  41. package/dist/template/.opencode/command.backup/status.md +376 -0
  42. package/dist/template/.opencode/memory/project/SHELL_OUTPUT_MIGRATION_PLAN.md +551 -0
  43. package/dist/template/.opencode/memory/project/gotchas.md +33 -28
  44. package/dist/template/.opencode/opencode.json +542 -510
  45. package/dist/template/.opencode/package.json +1 -3
  46. package/dist/template/.opencode/plugin/compaction.ts +51 -129
  47. package/dist/template/.opencode/plugin/handoff.ts +18 -163
  48. package/dist/template/.opencode/plugin/notification.ts +1 -1
  49. package/dist/template/.opencode/plugin/package.json +7 -0
  50. package/dist/template/.opencode/plugin/sessions.ts +185 -651
  51. package/dist/template/.opencode/plugin/skill-mcp.ts +2 -1
  52. package/dist/template/.opencode/plugin/truncator.ts +19 -41
  53. package/dist/template/.opencode/plugin/tsconfig.json +14 -13
  54. package/dist/template/.opencode/tool/bd-inbox.ts +109 -0
  55. package/dist/template/.opencode/tool/bd-msg.ts +62 -0
  56. package/dist/template/.opencode/tool/bd-release.ts +71 -0
  57. package/dist/template/.opencode/tool/bd-reserve.ts +120 -0
  58. package/package.json +2 -2
  59. package/dist/template/.opencode/plugin/beads.ts +0 -1419
  60. package/dist/template/.opencode/plugin/compactor.ts +0 -107
  61. package/dist/template/.opencode/plugin/enforcer.ts +0 -190
  62. package/dist/template/.opencode/plugin/injector.ts +0 -150
@@ -0,0 +1,167 @@
1
+ ---
2
+ description: Finish a bead - verify, commit, close
3
+ argument-hint: "<bead-id>"
4
+ agent: build
5
+ ---
6
+
7
+ # Finish: $ARGUMENTS
8
+
9
+ You're closing out a task. This is the quality gate. No shortcuts.
10
+
11
+ ## Load Skills
12
+
13
+ ```typescript
14
+ skill({ name: "beads" });
15
+ skill({ name: "verification-before-completion" });
16
+ ```
17
+
18
+ ## Verify The Task Exists
19
+
20
+ ```bash
21
+ bd show $ARGUMENTS
22
+ ```
23
+
24
+ If not found, stop. Check `bd list --status=all` for the correct ID.
25
+
26
+ ## Run All Gates
27
+
28
+ Detect your project type and run everything:
29
+
30
+ ```bash
31
+ ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null
32
+ ```
33
+
34
+ **Node/TypeScript:**
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
41
+ ```
42
+
43
+ **Rust:**
44
+
45
+ ```bash
46
+ cargo build
47
+ cargo test
48
+ cargo clippy -- -D warnings
49
+ ```
50
+
51
+ **Python:**
52
+
53
+ ```bash
54
+ pytest
55
+ ruff check .
56
+ mypy . 2>/dev/null || true
57
+ ```
58
+
59
+ **Go:**
60
+
61
+ ```bash
62
+ go build ./...
63
+ go test ./...
64
+ golangci-lint run
65
+ ```
66
+
67
+ If ANY gate fails, stop. Fix it first. Don't close broken work.
68
+
69
+ ## Verify Success Criteria
70
+
71
+ Read the spec and check each criterion:
72
+
73
+ ```bash
74
+ cat .beads/artifacts/$ARGUMENTS/spec.md
75
+ ```
76
+
77
+ For each success criterion listed, run its verification. All must pass. If something's missing, go back and implement it.
78
+
79
+ ## Commit Everything
80
+
81
+ ```bash
82
+ git add -A
83
+ git status
84
+ git commit -m "$ARGUMENTS: [what was done]
85
+
86
+ - [change 1]
87
+ - [change 2]
88
+
89
+ Closes: $ARGUMENTS"
90
+ ```
91
+
92
+ ## Close The Task
93
+
94
+ ```bash
95
+ bd close $ARGUMENTS --reason "Completed: [1-line summary]"
96
+ ```
97
+
98
+ This closes the task. Sync separately if needed.
99
+
100
+ ## Create Review (Optional But Recommended)
101
+
102
+ If this was non-trivial work, document what happened:
103
+
104
+ ```bash
105
+ mkdir -p .beads/artifacts/$ARGUMENTS
106
+ ```
107
+
108
+ Write `.beads/artifacts/$ARGUMENTS/review.md`:
109
+
110
+ ```markdown
111
+ # Review: $ARGUMENTS
112
+
113
+ **Completed:** [date]
114
+
115
+ ## What Changed
116
+
117
+ - [file]: [what and why]
118
+
119
+ ## What Worked
120
+
121
+ - [thing that went smoothly]
122
+
123
+ ## What Was Hard
124
+
125
+ - [challenge and how you solved it]
126
+
127
+ ## Lessons
128
+
129
+ - [anything worth remembering]
130
+ ```
131
+
132
+ ## Record Learnings
133
+
134
+ If you discovered patterns or gotchas worth remembering:
135
+
136
+ ```typescript
137
+ observation({
138
+ type: "learning",
139
+ title: "[concise title]",
140
+ content: "[what you learned]",
141
+ bead_id: "$ARGUMENTS",
142
+ });
143
+ ```
144
+
145
+ ## Output
146
+
147
+ ```
148
+ Closed: $ARGUMENTS
149
+
150
+ Gates: All passed
151
+ Commit: [hash]
152
+ Branch: [branch]
153
+
154
+ Next:
155
+ - /pr $ARGUMENTS # Create pull request
156
+ - Or merge directly: git checkout main && git merge $ARGUMENTS
157
+ ```
158
+
159
+ ## If Work Is Incomplete
160
+
161
+ Don't close incomplete work. Instead:
162
+
163
+ ```
164
+ /handoff $ARGUMENTS "Stopped at [step]. Remaining: [what's left]"
165
+ ```
166
+
167
+ Then start fresh session and `/resume $ARGUMENTS` later.
@@ -0,0 +1,143 @@
1
+ ---
2
+ description: Implement a bead - load context, make changes, verify
3
+ argument-hint: "<bead-id>"
4
+ agent: build
5
+ ---
6
+
7
+ # Implement: $ARGUMENTS
8
+
9
+ You're implementing a tracked task. Stay focused, verify as you go, hand off if you hit limits.
10
+
11
+ ## First: Load Context
12
+
13
+ ```typescript
14
+ skill({ name: "beads" });
15
+ skill({ name: "test-driven-development" });
16
+ skill({ name: "verification-before-completion" });
17
+ ```
18
+
19
+ Get the task details and check for messages:
20
+
21
+ ```bash
22
+ bd show $ARGUMENTS
23
+ bd list --status=in_progress # See what else is active
24
+ ```
25
+
26
+ Check git state. If dirty, ask whether to stash, commit, or continue:
27
+
28
+ ```bash
29
+ git status --porcelain
30
+ git branch --show-current
31
+ ```
32
+
33
+ Create a branch if not already on one for this task:
34
+
35
+ ```bash
36
+ git checkout -b $ARGUMENTS
37
+ ```
38
+
39
+ Mark the task in progress:
40
+
41
+ ```bash
42
+ bd update $ARGUMENTS --status in_progress
43
+ ```
44
+
45
+ ## Load Artifacts
46
+
47
+ Check what context exists:
48
+
49
+ ```bash
50
+ ls .beads/artifacts/$ARGUMENTS/ 2>/dev/null || echo "No artifacts"
51
+ ```
52
+
53
+ If `plan.md` exists, follow it step by step. If only `spec.md` exists, implement directly from requirements. If nothing exists, work from the bead description.
54
+
55
+ Check for previous session work:
56
+
57
+ ```typescript
58
+ list_sessions({ project: "current", limit: 3 });
59
+ read_session({ session_reference: "last", project: "current" });
60
+ ```
61
+
62
+ ## Estimate Your Budget
63
+
64
+ Look at the task complexity and set limits:
65
+
66
+ - **Small** (~10 tool calls): Simple change, one file, clear path
67
+ - **Medium** (~30 tool calls): Multiple files, some exploration needed
68
+ - **Large** (~100 tool calls): Cross-cutting, needs research, checkpoint often
69
+ - **XL**: Should be decomposed into smaller tasks first
70
+
71
+ If you hit 80% of budget without finishing, create a handoff. Don't push past limits and produce garbage.
72
+
73
+ ## Do The Work
74
+
75
+ Detect project type and know your verification commands:
76
+
77
+ ```bash
78
+ ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null
79
+ ```
80
+
81
+ Node/TypeScript: `npm test`, `npm run lint && npm run type-check`
82
+ Rust: `cargo test`, `cargo clippy -- -D warnings`
83
+ Python: `pytest`, `ruff check . && mypy .`
84
+ Go: `go test ./...`, `golangci-lint run`
85
+
86
+ **Rules while implementing:**
87
+
88
+ 1. Read before edit. Always.
89
+ 2. Run verification after each logical change
90
+ 3. If something fails 3 times, stop and try a different approach
91
+ 4. Checkpoint commit after significant progress: `git commit -m "WIP: $ARGUMENTS - [step]"`
92
+ 5. If blocked on external dependency, create a new bead for it and move on
93
+
94
+ Track your progress. Every 10 tool calls, check: Am I on track? Should I checkpoint? Am I approaching budget?
95
+
96
+ ## Before Claiming Done
97
+
98
+ Verify against success criteria in the spec:
99
+
100
+ ```bash
101
+ cat .beads/artifacts/$ARGUMENTS/spec.md | grep -A 20 "Success Criteria"
102
+ ```
103
+
104
+ Run each verification command. All must pass. No exceptions.
105
+
106
+ Run the full test suite one more time:
107
+
108
+ ```bash
109
+ # Whatever your project uses
110
+ npm test && npm run type-check
111
+ ```
112
+
113
+ ## Complete
114
+
115
+ If all gates pass:
116
+
117
+ ```bash
118
+ git add -A
119
+ git commit -m "$ARGUMENTS: [summary]"
120
+ bd sync
121
+ ```
122
+
123
+ Report what was done and suggest next step:
124
+
125
+ ```
126
+ Done: $ARGUMENTS
127
+
128
+ Changes: [files modified]
129
+ Tests: Pass
130
+ Next: /finish $ARGUMENTS
131
+ ```
132
+
133
+ If gates fail, fix them. Don't proceed with broken code.
134
+
135
+ ## If You Can't Finish
136
+
137
+ Hit budget limit or context getting too large? Create a handoff:
138
+
139
+ ```
140
+ /handoff $ARGUMENTS "Stopped at [step]. Next: [what to do]"
141
+ ```
142
+
143
+ Then start a fresh session. Don't grind past diminishing returns.
@@ -0,0 +1,252 @@
1
+ ---
2
+ description: Create and submit pull request with bead traceability
3
+ argument-hint: "<bead-id> [--draft] [--wait]"
4
+ agent: build
5
+ ---
6
+
7
+ # Pull Request
8
+
9
+ **Load skills:**
10
+
11
+ ```typescript
12
+ skill({ name: "beads" }); // Session protocol
13
+ skill({ name: "verification-before-completion" });
14
+ ```
15
+
16
+ ## Options
17
+
18
+ - `--draft`: Create as draft PR (for WIP or early feedback)
19
+ - `--wait`: Wait for CI checks to pass after creation
20
+
21
+ ## Phase 1: Pre-PR Verification
22
+
23
+ Before creating PR, run verification gates:
24
+
25
+ ```bash
26
+ git status --porcelain # Check for uncommitted changes
27
+ ```
28
+
29
+ If uncommitted changes exist, ask: "Commit these changes first?"
30
+
31
+ Run project gates:
32
+
33
+ ```bash
34
+ npm run build 2>&1 | tail -5
35
+ npm test 2>&1 | tail -10
36
+ npm run lint 2>&1 | tail -5
37
+ ```
38
+
39
+ ```
40
+ Pre-PR Gates:
41
+ ━━━━━━━━━━━━━
42
+
43
+ Build: [✓/✗]
44
+ Tests: [✓/✗]
45
+ Lint: [✓/✗]
46
+ ```
47
+
48
+ **If any gate fails: STOP.**
49
+
50
+ ```
51
+ Cannot create PR: [gate] failed.
52
+
53
+ Fix errors first, then run /pr again.
54
+ ```
55
+
56
+ ## Phase 2: Check for Conflicts
57
+
58
+ ```bash
59
+ git fetch origin main
60
+ git merge-base --is-ancestor origin/main HEAD || git diff origin/main...HEAD --name-only
61
+ ```
62
+
63
+ Check for merge conflicts:
64
+
65
+ ```bash
66
+ git merge --no-commit --no-ff origin/main 2>&1 || true
67
+ git merge --abort 2>/dev/null || true
68
+ ```
69
+
70
+ If conflicts detected:
71
+
72
+ ```
73
+ ⚠️ Merge conflicts detected with main:
74
+ - [file1]
75
+ - [file2]
76
+
77
+ Resolve conflicts before creating PR:
78
+ git fetch origin main
79
+ git rebase origin/main
80
+ # Fix conflicts, then /pr again
81
+ ```
82
+
83
+ ## Phase 3: Gather Context
84
+
85
+ **Current state:**
86
+
87
+ ```bash
88
+ git branch --show-current
89
+ git diff main...HEAD --stat
90
+ git log main...HEAD --oneline
91
+ ```
92
+
93
+ **Load bead context (if provided):**
94
+
95
+ ```bash
96
+ bd show $ARGUMENTS
97
+ ```
98
+
99
+ **Load artifacts:**
100
+
101
+ ```bash
102
+ ls .beads/artifacts/<bead-id>/ 2>/dev/null
103
+ cat .beads/artifacts/<bead-id>/spec.md 2>/dev/null | head -30
104
+ cat .beads/artifacts/<bead-id>/review.md 2>/dev/null | head -30
105
+ ```
106
+
107
+ Extract from artifacts:
108
+
109
+ - **Goal** from spec.md
110
+ - **Changes Made** from review.md
111
+ - **Estimation Accuracy** from review.md
112
+ - **Success Criteria** verification
113
+
114
+ ## Phase 4: Push Branch
115
+
116
+ ```bash
117
+ git push -u origin $(git branch --show-current)
118
+ ```
119
+
120
+ ## Phase 5: Create PR
121
+
122
+ Generate PR content from context:
123
+
124
+ ```bash
125
+ gh pr create --title "<title>" --body "$(cat <<'EOF'
126
+ ## Summary
127
+
128
+ [1-2 sentence description of what this PR does and why]
129
+
130
+ ## Changes
131
+
132
+ | File | Change |
133
+ | ---- | ------ |
134
+ | `src/foo.ts` | [description] |
135
+ | `src/bar.ts` | [description] |
136
+
137
+ ## Testing
138
+
139
+ **Automated:**
140
+ - All tests pass ✓
141
+ - Lint passes ✓
142
+ - Type check passes ✓
143
+
144
+ **Manual verification:**
145
+ - [ ] [How to test manually]
146
+
147
+ ## Screenshots
148
+
149
+ [If UI changes, include before/after screenshots]
150
+
151
+ ## Estimation
152
+
153
+ | Metric | Value |
154
+ | ------ | ----- |
155
+ | Estimated | [S/M/L] (~N calls) |
156
+ | Actual | N calls |
157
+ | Accuracy | [+/-N%] |
158
+
159
+ ## Checklist
160
+
161
+ - [x] Tests added/updated
162
+ - [x] All gates pass
163
+ - [ ] Docs updated (if applicable)
164
+ - [ ] Breaking changes documented (if any)
165
+
166
+ ## Artifacts
167
+
168
+ - [spec.md](.beads/artifacts/<bead-id>/spec.md)
169
+ - [review.md](.beads/artifacts/<bead-id>/review.md)
170
+ [- research.md, plan.md, adr.md if they exist]
171
+
172
+ ## Bead Reference
173
+
174
+ Closes: <bead-id>
175
+ EOF
176
+ )"
177
+ ```
178
+
179
+ **For draft PRs (--draft):**
180
+
181
+ ```bash
182
+ gh pr create --draft --title "<title>" --body "..."
183
+ ```
184
+
185
+ ## Phase 6: Wait for CI (if --wait)
186
+
187
+ ```bash
188
+ gh pr checks --watch
189
+ ```
190
+
191
+ Report CI status:
192
+
193
+ ```
194
+ CI Status:
195
+ ━━━━━━━━━━
196
+
197
+ - build: [✓/✗/pending]
198
+ - test: [✓/✗/pending]
199
+ - lint: [✓/✗/pending]
200
+
201
+ [If all pass] CI passed ✓
202
+ [If any fail] CI failed: [which check]
203
+ ```
204
+
205
+ ## Phase 7: Update Bead & Sync
206
+
207
+ ```bash
208
+ bd-msg --subj "PR created" --body "PR: <pr-url>\nStatus: [ready/draft]\nCI: [passing/pending]" --to "all" --importance normal
209
+ bd sync
210
+ ```
211
+
212
+ ## Output
213
+
214
+ ```
215
+ PR Created: <bead-id>
216
+ ━━━━━━━━━━━━━━━━━━━━
217
+
218
+ URL: <pr-url>
219
+ Status: [Ready for Review / Draft]
220
+ Branch: <branch> → main
221
+
222
+ Pre-PR Gates: All passed ✓
223
+ Conflicts: None ✓
224
+ [CI: Passed ✓ (if --wait)]
225
+
226
+ Artifacts linked:
227
+ - spec.md ✓
228
+ - review.md ✓
229
+ [- research.md, plan.md, adr.md]
230
+ ```
231
+
232
+ **Next steps:**
233
+
234
+ ```
235
+ ━━━━━━━━━━━━━━━━━━━━
236
+
237
+ Request review:
238
+ gh pr edit <pr-number> --add-reviewer <username>
239
+
240
+ Check CI:
241
+ gh pr checks
242
+
243
+ Merge when approved:
244
+ gh pr merge --squash
245
+ ```
246
+
247
+ **If draft PR:**
248
+
249
+ ```
250
+ Draft PR created. When ready:
251
+ gh pr ready
252
+ ```