opencodekit 0.10.0 → 0.11.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 (47) 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 +297 -30
  4. package/dist/template/.opencode/command/analyze-mockup.md +412 -20
  5. package/dist/template/.opencode/command/analyze-project.md +445 -30
  6. package/dist/template/.opencode/command/brainstorm.md +294 -5
  7. package/dist/template/.opencode/command/commit.md +231 -17
  8. package/dist/template/.opencode/command/create.md +415 -77
  9. package/dist/template/.opencode/command/design-audit.md +483 -29
  10. package/dist/template/.opencode/command/design.md +615 -6
  11. package/dist/template/.opencode/command/edit-image.md +223 -20
  12. package/dist/template/.opencode/command/finish.md +163 -71
  13. package/dist/template/.opencode/command/fix-ci.md +297 -24
  14. package/dist/template/.opencode/command/fix-types.md +351 -13
  15. package/dist/template/.opencode/command/fix-ui.md +299 -13
  16. package/dist/template/.opencode/command/fix.md +262 -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 +208 -31
  23. package/dist/template/.opencode/command/implement.md +163 -50
  24. package/dist/template/.opencode/command/import-plan.md +253 -52
  25. package/dist/template/.opencode/command/init.md +154 -35
  26. package/dist/template/.opencode/command/integration-test.md +410 -24
  27. package/dist/template/.opencode/command/issue.md +177 -21
  28. package/dist/template/.opencode/command/new-feature.md +390 -54
  29. package/dist/template/.opencode/command/plan.md +394 -107
  30. package/dist/template/.opencode/command/pr.md +235 -29
  31. package/dist/template/.opencode/command/quick-build.md +234 -5
  32. package/dist/template/.opencode/command/research-and-implement.md +442 -12
  33. package/dist/template/.opencode/command/research-ui.md +444 -34
  34. package/dist/template/.opencode/command/research.md +179 -45
  35. package/dist/template/.opencode/command/restore-image.md +416 -22
  36. package/dist/template/.opencode/command/resume.md +447 -63
  37. package/dist/template/.opencode/command/revert-feature.md +347 -65
  38. package/dist/template/.opencode/command/review-codebase.md +199 -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 +326 -60
  42. package/dist/template/.opencode/command/summarize.md +374 -33
  43. package/dist/template/.opencode/command/triage.md +361 -0
  44. package/dist/template/.opencode/command/ui-review.md +296 -25
  45. package/dist/template/.opencode/skill/beads/SKILL.md +108 -3
  46. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  47. package/package.json +1 -1
@@ -1,53 +1,259 @@
1
1
  ---
2
2
  description: Create and submit pull request with bead traceability
3
- argument-hint: "[bead-id]"
3
+ argument-hint: "<bead-id> [--draft] [--wait]"
4
+ agent: build
4
5
  ---
5
6
 
6
- **Load skill:** `skill({ name: "verification-before-completion" })`
7
+ # Pull Request
7
8
 
8
- ## Create Pull Request
9
+ **Load skills:**
9
10
 
10
- **Current Branch:** `!git branch --show-current`
11
- **Changes Summary:** `!git diff main...HEAD --stat`
12
- **Commits:** `!git log main...HEAD --oneline`
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
+ ```
13
38
 
14
- Create a pull request following these steps:
39
+ ```
40
+ Pre-PR Gates:
41
+ ━━━━━━━━━━━━━
42
+
43
+ Build: [✓/✗]
44
+ Tests: [✓/✗]
45
+ Lint: [✓/✗]
46
+ ```
15
47
 
16
- 1. **Format code** (if formatters available): `!command -v prettier > /dev/null && npm run format || echo "No formatter configured"`
48
+ **If any gate fails: STOP.**
17
49
 
18
- 2. **Push branch**: `!git push -u origin $(git branch --show-current)`
50
+ ```
51
+ Cannot create PR: [gate] failed.
19
52
 
20
- 3. **Check for bead context:**
21
- - If `$ARGUMENTS` contains a bead ID, fetch bead details: `bd_show({ id: "$ARGUMENTS" })`
22
- - Use bead title and spec to inform PR content
23
- - Reference the bead in the PR body for traceability
53
+ Fix errors first, then run /pr again.
54
+ ```
24
55
 
25
- 4. **Generate PR content:**
26
- - Title: Clear, descriptive (under 60 chars)
27
- - Summary: What and why this change matters
28
- - Testing: How to verify the changes
29
- - Breaking changes: Note any API/behavior changes
56
+ ## Phase 2: Check for Conflicts
30
57
 
31
- 5. **Create PR**: `!gh pr create --title "Generated Title" --body "Generated Description"`
58
+ ```bash
59
+ git fetch origin main
60
+ git merge-base --is-ancestor origin/main HEAD || git diff origin/main...HEAD --name-only
61
+ ```
32
62
 
33
- **Template format:**
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]
34
76
 
77
+ Resolve conflicts before creating PR:
78
+ git fetch origin main
79
+ git rebase origin/main
80
+ # Fix conflicts, then /pr again
35
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
+ ```typescript
96
+ bd_show({ id: "$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'
36
126
  ## Summary
37
- - Brief description of changes
38
127
 
39
- ## Bead Reference
40
- Closes: bd-XXXXX (if applicable)
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] |
41
136
 
42
137
  ## Testing
43
- - How to test these changes
44
138
 
45
- ## Breaking Changes
46
- - None / List any breaking changes
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 "..."
47
183
  ```
48
184
 
49
- ## After PR Created
185
+ ## Phase 6: Wait for CI (if --wait)
186
+
187
+ ```bash
188
+ gh pr checks --watch
189
+ ```
50
190
 
51
- If a bead ID was provided, update the bead with PR link:
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
+ ```
52
204
 
53
- Update the bead with a note about the PR using the beads messaging or note system.
205
+ ## Phase 7: Update Bead & Sync
206
+
207
+ ```typescript
208
+ bd_msg({
209
+ subj: "PR created",
210
+ body: "PR: <pr-url>\nStatus: [ready/draft]\nCI: [passing/pending]",
211
+ to: "all",
212
+ importance: "normal",
213
+ global: true,
214
+ });
215
+
216
+ bd_sync({ reason: "PR created for $ARGUMENTS" });
217
+ ```
218
+
219
+ ## Output
220
+
221
+ ```
222
+ PR Created: <bead-id>
223
+ ━━━━━━━━━━━━━━━━━━━━
224
+
225
+ URL: <pr-url>
226
+ Status: [Ready for Review / Draft]
227
+ Branch: <branch> → main
228
+
229
+ Pre-PR Gates: All passed ✓
230
+ Conflicts: None ✓
231
+ [CI: Passed ✓ (if --wait)]
232
+
233
+ Artifacts linked:
234
+ - spec.md ✓
235
+ - review.md ✓
236
+ [- research.md, plan.md, adr.md]
237
+ ```
238
+
239
+ **Next steps:**
240
+
241
+ ```
242
+ ━━━━━━━━━━━━━━━━━━━━
243
+
244
+ Request review:
245
+ gh pr edit <pr-number> --add-reviewer <username>
246
+
247
+ Check CI:
248
+ gh pr checks
249
+
250
+ Merge when approved:
251
+ gh pr merge --squash
252
+ ```
253
+
254
+ **If draft PR:**
255
+
256
+ ```
257
+ Draft PR created. When ready:
258
+ gh pr ready
259
+ ```
@@ -1,13 +1,242 @@
1
1
  ---
2
- description: Quick build for trivial tasks
3
- argument-hint: "[task]"
2
+ description: Quick build for trivial tasks with fast verification
3
+ argument-hint: "<task-description> [--no-test] [--no-commit]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Quick Build: $ARGUMENTS
8
8
 
9
- **Reject if:** ≥2 files, new deps, security risk, DB changes. Use `/create` instead.
9
+ Fast path for trivial tasks. Skip ceremony, keep safety.
10
10
 
11
- **Simple edit:** Fix directly with clear comments, commit.
11
+ ## Parse Arguments
12
12
 
13
- **Needs structure:** Create bead with `/create`, implement, run `/finish`.
13
+ | Argument | Default | Description |
14
+ | ---------------- | -------- | ----------------------------- |
15
+ | Task description | required | What to fix/change |
16
+ | `--no-test` | false | Skip test run (use sparingly) |
17
+ | `--no-commit` | false | Make changes but don't commit |
18
+
19
+ ---
20
+
21
+ ## Qualification Check
22
+
23
+ **This task qualifies for quick-build if ALL are true:**
24
+
25
+ | Criterion | Check | If False |
26
+ | ------------------------ | ------------------------------------ | ----------------- |
27
+ | Single file change | 1 file modified | Use `/create` |
28
+ | No new dependencies | No package.json/requirements changes | Use `/create` |
29
+ | No database changes | No migrations, schema changes | Use `/create` |
30
+ | No security implications | No auth, secrets, permissions | Use `/create` |
31
+ | Under 30 minutes | Estimate < 30 min | Use `/create` |
32
+ | Clear scope | Know exactly what to change | Use `/brainstorm` |
33
+ | Low risk | Won't break critical paths | Use `/create` |
34
+
35
+ **Examples that qualify:**
36
+
37
+ - Fix typo in UI text
38
+ - Update a constant value
39
+ - Fix off-by-one error
40
+ - Add missing null check
41
+ - Update documentation
42
+ - Rename a variable
43
+ - Fix CSS styling issue
44
+
45
+ **Examples that DON'T qualify:**
46
+
47
+ - Add new API endpoint (multiple files)
48
+ - Change authentication logic (security)
49
+ - Update database schema (DB changes)
50
+ - Add new npm package (dependencies)
51
+ - Refactor a module (scope unclear)
52
+
53
+ ---
54
+
55
+ ## Workflow
56
+
57
+ ### Step 1: Verify Scope (30 seconds)
58
+
59
+ ```bash
60
+ # Check what files might be involved
61
+ grep -r "[search-term]" src/ --include="*.{ts,tsx}" -l | head -5
62
+ ```
63
+
64
+ If more than 1 file: **STOP** → Use `/create $ARGUMENTS` instead.
65
+
66
+ ### Step 2: Backup Current State
67
+
68
+ ```bash
69
+ # Stash any existing changes
70
+ git stash push -m "pre-quickbuild-$(date +%s)" 2>/dev/null || true
71
+
72
+ # Note current commit
73
+ git rev-parse HEAD
74
+ ```
75
+
76
+ ### Step 3: Make the Change
77
+
78
+ ```bash
79
+ # Read the file
80
+ read [file-path]
81
+
82
+ # Make minimal, focused edit
83
+ edit [file-path] [oldString] [newString]
84
+ ```
85
+
86
+ **Edit guidelines:**
87
+
88
+ - Change only what's necessary
89
+ - Add comment if non-obvious
90
+ - Don't refactor adjacent code
91
+ - Don't fix unrelated issues
92
+
93
+ ### Step 4: Verify (unless --no-test)
94
+
95
+ ```bash
96
+ # Type check
97
+ npm run type-check || tsc --noEmit
98
+
99
+ # Run relevant tests
100
+ npm test -- --testPathPattern="[related-test]" --passWithNoTests
101
+
102
+ # Lint check
103
+ npm run lint -- [file-path]
104
+ ```
105
+
106
+ **All checks must pass before committing.**
107
+
108
+ ### Step 5: Commit (unless --no-commit)
109
+
110
+ ```bash
111
+ git add [file-path]
112
+ git commit -m "fix: [concise description]
113
+
114
+ Quick-build: [task description]"
115
+ ```
116
+
117
+ **Commit message format:**
118
+
119
+ - `fix:` for bug fixes
120
+ - `chore:` for maintenance
121
+ - `docs:` for documentation
122
+ - `style:` for formatting
123
+
124
+ ---
125
+
126
+ ## Escape Hatch
127
+
128
+ If during work you realize it's more complex:
129
+
130
+ ```
131
+ ⚠ Complexity detected:
132
+ - Multiple files need changes
133
+ - Found related issues that need fixing
134
+ - Discovered missing test coverage
135
+
136
+ Escaping to structured workflow...
137
+ ```
138
+
139
+ **Action:**
140
+
141
+ 1. Revert uncommitted changes: `git checkout -- .`
142
+ 2. Create proper bead: `/create $ARGUMENTS`
143
+ 3. Continue with full workflow
144
+
145
+ **Don't force a complex change through quick-build.**
146
+
147
+ ---
148
+
149
+ ## Time Budget
150
+
151
+ | Task Type | Max Time | Example |
152
+ | -------------- | -------- | ---------------------------- |
153
+ | Typo/text fix | 5 min | Fix spelling in button label |
154
+ | Config change | 10 min | Update timeout value |
155
+ | Simple bug fix | 15 min | Fix null check |
156
+ | Style fix | 10 min | Fix CSS alignment |
157
+ | Doc update | 15 min | Update README section |
158
+
159
+ **If approaching 30 minutes: STOP and escalate to /create.**
160
+
161
+ ---
162
+
163
+ ## Output
164
+
165
+ ```
166
+ Quick Build Complete
167
+ ━━━━━━━━━━━━━━━━━━━━
168
+
169
+ Task: [description]
170
+ File: [path]
171
+ Time: [X minutes]
172
+
173
+ Changes:
174
+ - [summary of change]
175
+
176
+ Verification:
177
+ ✓ Type check passed
178
+ ✓ Tests passed (3 specs)
179
+ ✓ Lint passed
180
+
181
+ Commit: [sha] "fix: [message]"
182
+
183
+ Done. No bead created (trivial task).
184
+ ```
185
+
186
+ ---
187
+
188
+ ## Rollback
189
+
190
+ If the quick fix causes issues:
191
+
192
+ ```bash
193
+ # Revert the commit
194
+ git revert HEAD --no-edit
195
+
196
+ # Or reset to before
197
+ git reset --hard HEAD~1
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Examples
203
+
204
+ ```bash
205
+ # Fix a typo
206
+ /quick-build fix typo in login button text
207
+
208
+ # Update a constant
209
+ /quick-build change MAX_RETRIES from 3 to 5
210
+
211
+ # Fix null check
212
+ /quick-build add null check in getUserName function
213
+
214
+ # CSS fix
215
+ /quick-build fix button alignment in header
216
+
217
+ # Skip tests for doc-only change
218
+ /quick-build update README installation instructions --no-test
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Anti-Patterns
224
+
225
+ | Don't | Why | Do Instead |
226
+ | --------------------------- | ------------------ | --------------------- |
227
+ | Quick-build multiple files | Scope creep | Use `/create` |
228
+ | Skip tests for code changes | Risk of regression | Always verify |
229
+ | Fix "one more thing" | Scope creep | Separate quick-build |
230
+ | Force complex through | Technical debt | Escalate to `/create` |
231
+ | Quick-build without reading | May miss context | Read file first |
232
+
233
+ ---
234
+
235
+ ## Related Commands
236
+
237
+ | Need | Command |
238
+ | --------------- | --------------------------- |
239
+ | Structured task | `/create` then `/implement` |
240
+ | Just exploring | Read files directly |
241
+ | Multiple fixes | `/create` with sub-tasks |
242
+ | Need planning | `/new-feature` |