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,21 +1,451 @@
1
1
  ---
2
- description: Research then implement
3
- argument-hint: "<bead-id> or [topic]"
2
+ description: End-to-end research-driven implementation workflow
3
+ argument-hint: "<bead-id> | <topic> [--quick] [--tdd]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Research & Implement: $ARGUMENTS
8
8
 
9
- ## Simple edit (no bead needed)
9
+ Complete workflow that combines research, planning, and implementation into a single guided process.
10
10
 
11
- Fix directly with clear comments. Commit.
11
+ ## Load Beads Skill
12
12
 
13
- ## Structured work (bead-based)
13
+ ```typescript
14
+ skill({ name: "beads" });
15
+ ```
14
16
 
15
- 1. Validate bead exists: `bd_show({ id: "$ARGUMENTS" })`
16
- 2. Load constraints from `.beads/artifacts/$ARGUMENTS/spec.md`
17
- 3. Research within scope: `/research $ARGUMENTS`
18
- 4. Plan approach: `/plan $ARGUMENTS`
19
- 5. Implement with TDD: `skill({ name: "test-driven-development" })`
20
- 6. Complete review: `.beads/artifacts/$ARGUMENTS/review.md`
21
- 7. Run `/finish $ARGUMENTS`
17
+ ## When to Use
18
+
19
+ | Scenario | Use This Command |
20
+ | ------------------------- | -------------------------- |
21
+ | New feature with unknowns | Yes |
22
+ | Bug with unclear cause | ✓ Yes |
23
+ | Integration with new API | ✓ Yes |
24
+ | Simple code change | ✗ No - use `/fix` directly |
25
+ | Already have a plan | ✗ No - use `/implement` |
26
+
27
+ ## Phase 1: Parse Input and Validate
28
+
29
+ ### Detect Input Type
30
+
31
+ ```typescript
32
+ const input = "$ARGUMENTS";
33
+
34
+ if (input.startsWith("bd-")) {
35
+ // Bead-based workflow
36
+ bd_show({ id: input });
37
+ // Load spec for constraints
38
+ read({ filePath: `.beads/artifacts/${input}/spec.md` });
39
+ } else {
40
+ // Ad-hoc topic - may need to create bead
41
+ console.log(`Topic: ${input}`);
42
+ console.log("Consider creating a bead for tracking: /create ${input}");
43
+ }
44
+ ```
45
+
46
+ ### Check Prerequisites
47
+
48
+ ```typescript
49
+ bd_init({ _: true, team: "project", role: "builder" });
50
+ bd_inbox({ n: 5, unread: true, global: true }); // Check for blockers
51
+ ```
52
+
53
+ ## Phase 2: Research Phase
54
+
55
+ ### Scope Definition
56
+
57
+ ```
58
+ RESEARCH SCOPE
59
+ ━━━━━━━━━━━━━━
60
+
61
+ Topic: [from $ARGUMENTS or bead spec]
62
+
63
+ Questions to Answer:
64
+ 1. [Key question 1]
65
+ 2. [Key question 2]
66
+ 3. [Key question 3]
67
+
68
+ Out of Scope:
69
+ - [Explicit exclusion 1]
70
+ - [Explicit exclusion 2]
71
+ ```
72
+
73
+ ### Research Sources
74
+
75
+ ```typescript
76
+ // 1. Codebase exploration
77
+ task({
78
+ subagent_type: "explore",
79
+ description: "Explore codebase for patterns",
80
+ prompt: `
81
+ TASK: Research existing patterns for [topic]
82
+
83
+ Search for:
84
+ - Similar implementations
85
+ - Related utilities
86
+ - Test patterns
87
+ - Configuration examples
88
+
89
+ Return: File paths and key patterns found
90
+ `,
91
+ });
92
+
93
+ // 2. External documentation (if needed)
94
+ context7_resolve_library_id({
95
+ libraryName: "[relevant library]",
96
+ query: "[specific question]",
97
+ });
98
+
99
+ // 3. Real-world examples (if needed)
100
+ gh_grep_searchGitHub({
101
+ query: "[pattern to find]",
102
+ language: ["TypeScript"],
103
+ });
104
+ ```
105
+
106
+ ### Synthesize Findings
107
+
108
+ ```
109
+ RESEARCH FINDINGS
110
+ ━━━━━━━━━━━━━━━━━
111
+
112
+ Key Insights:
113
+ 1. [Finding 1]
114
+ 2. [Finding 2]
115
+ 3. [Finding 3]
116
+
117
+ Existing Patterns to Follow:
118
+ - [Pattern from codebase]
119
+ - [Convention discovered]
120
+
121
+ External Best Practices:
122
+ - [From docs/examples]
123
+
124
+ Risks Identified:
125
+ - [Risk 1]
126
+ - [Risk 2]
127
+
128
+ Recommended Approach:
129
+ [Summary of approach based on research]
130
+ ```
131
+
132
+ ### Save Research (if bead)
133
+
134
+ ```typescript
135
+ if (beadId) {
136
+ write({
137
+ filePath: `.beads/artifacts/${beadId}/research.md`,
138
+ content: researchFindings,
139
+ });
140
+ }
141
+ ```
142
+
143
+ ## Phase 3: Planning Phase
144
+
145
+ ### Generate Implementation Plan
146
+
147
+ Based on research, create actionable plan:
148
+
149
+ ```markdown
150
+ # Implementation Plan: $ARGUMENTS
151
+
152
+ ## Approach
153
+
154
+ [1-2 sentence summary]
155
+
156
+ ## Steps
157
+
158
+ ### Phase 1: Setup
159
+
160
+ - [ ] Step 1.1: [action]
161
+ - [ ] Step 1.2: [action]
162
+
163
+ ### Phase 2: Core Implementation
164
+
165
+ - [ ] Step 2.1: [action]
166
+ - [ ] Step 2.2: [action]
167
+ - [ ] Step 2.3: [action]
168
+
169
+ ### Phase 3: Testing
170
+
171
+ - [ ] Step 3.1: Write tests for [component]
172
+ - [ ] Step 3.2: Run test suite
173
+
174
+ ### Phase 4: Verification
175
+
176
+ - [ ] Step 4.1: Manual verification
177
+ - [ ] Step 4.2: Code review prep
178
+
179
+ ## Files to Modify
180
+
181
+ - `path/to/file1.ts` - [change description]
182
+ - `path/to/file2.ts` - [change description]
183
+
184
+ ## Test Strategy
185
+
186
+ [How to verify implementation]
187
+
188
+ ## Rollback Plan
189
+
190
+ [How to revert if needed]
191
+ ```
192
+
193
+ ### Save Plan (if bead)
194
+
195
+ ```typescript
196
+ if (beadId) {
197
+ write({
198
+ filePath: `.beads/artifacts/${beadId}/plan.md`,
199
+ content: implementationPlan,
200
+ });
201
+ }
202
+ ```
203
+
204
+ ## Phase 4: Implementation Phase
205
+
206
+ ### Load Implementation Skill
207
+
208
+ ```typescript
209
+ skill({ name: "test-driven-development" });
210
+ ```
211
+
212
+ ### Reserve Files
213
+
214
+ ```typescript
215
+ const filesToEdit = extractFilesFromPlan(plan);
216
+ bd_reserve({ paths: filesToEdit, ttl: 600, reason: "Implementing $ARGUMENTS" });
217
+ ```
218
+
219
+ ### Execute Plan Steps
220
+
221
+ For each step in the plan:
222
+
223
+ ```
224
+ IMPLEMENTING: Step [X.Y]
225
+ ━━━━━━━━━━━━━━━━━━━━━━━
226
+
227
+ Action: [step description]
228
+
229
+ [Execute the step]
230
+
231
+ Verification:
232
+ - [ ] Code compiles
233
+ - [ ] Tests pass
234
+ - [ ] Matches research findings
235
+
236
+ Progress: [X/Y] steps complete
237
+ ```
238
+
239
+ ### TDD Cycle (if --tdd flag or complex logic)
240
+
241
+ ```
242
+ For each component:
243
+
244
+ 1. RED: Write failing test
245
+ └── Run tests, confirm failure
246
+
247
+ 2. GREEN: Write minimal code to pass
248
+ └── Run tests, confirm passing
249
+
250
+ 3. REFACTOR: Clean up
251
+ └── Run tests, confirm still passing
252
+ ```
253
+
254
+ ## Phase 5: Verification Phase
255
+
256
+ ### Run Full Test Suite
257
+
258
+ ```bash
259
+ npm test
260
+ # or
261
+ pytest tests/ -v
262
+ ```
263
+
264
+ ### Verify Against Research
265
+
266
+ ```
267
+ VERIFICATION CHECKLIST
268
+ ━━━━━━━━━━━━━━━━━━━━━━
269
+
270
+ Research Requirement │ Status
271
+ ──────────────────────────────────┼────────
272
+ [Requirement from research 1] │ ✓ Met
273
+ [Requirement from research 2] │ ✓ Met
274
+ [Best practice identified] │ ✓ Met
275
+
276
+ Plan Completion │ Status
277
+ ──────────────────────────────────┼────────
278
+ Phase 1: Setup │ ✓ Complete
279
+ Phase 2: Core Implementation │ ✓ Complete
280
+ Phase 3: Testing │ ✓ Complete
281
+ Phase 4: Verification │ ✓ Complete
282
+ ```
283
+
284
+ ### Update Review Document
285
+
286
+ ```typescript
287
+ if (beadId) {
288
+ write({
289
+ filePath: `.beads/artifacts/${beadId}/review.md`,
290
+ content: `
291
+ # Review: ${beadId}
292
+
293
+ ## Implementation Summary
294
+ [What was built]
295
+
296
+ ## Key Decisions
297
+ [Decisions made during implementation]
298
+
299
+ ## Testing
300
+ - Tests added: [count]
301
+ - Coverage: [if available]
302
+ - All tests: PASSING
303
+
304
+ ## Known Limitations
305
+ [Any caveats]
306
+
307
+ ## Ready for Review
308
+ - [ ] Code complete
309
+ - [ ] Tests passing
310
+ - [ ] Documentation updated
311
+ `,
312
+ });
313
+ }
314
+ ```
315
+
316
+ ## Phase 6: Completion
317
+
318
+ ### If Bead-Based
319
+
320
+ ```bash
321
+ /finish $ARGUMENTS
322
+ ```
323
+
324
+ This will:
325
+
326
+ - Run final verification
327
+ - Create PR if needed
328
+ - Close the bead
329
+
330
+ ### If Ad-Hoc
331
+
332
+ ```bash
333
+ /commit "feat: [description]"
334
+ ```
335
+
336
+ ## Quick Mode (--quick)
337
+
338
+ For smaller tasks, compress the workflow:
339
+
340
+ ```
341
+ QUICK MODE
342
+ ━━━━━━━━━━
343
+
344
+ 1. Minimal research (5 min max)
345
+ - Check for existing patterns
346
+ - Identify key constraints
347
+
348
+ 2. No formal plan document
349
+ - Mental model only
350
+
351
+ 3. Direct implementation
352
+ - Write code
353
+ - Add tests
354
+
355
+ 4. Verify and commit
356
+ - Run tests
357
+ - Commit with clear message
358
+
359
+ Time budget: 30 minutes max
360
+ If exceeding: Convert to full workflow with bead
361
+ ```
362
+
363
+ ## Workflow Summary
364
+
365
+ ```
366
+ ┌─────────────────────────────────────────────────────────────────────────┐
367
+ │ RESEARCH & IMPLEMENT WORKFLOW │
368
+ ├─────────────────────────────────────────────────────────────────────────┤
369
+ │ │
370
+ │ INPUT │
371
+ │ │ │
372
+ │ ├── Bead ID → Load spec, create artifacts │
373
+ │ └── Topic → Ad-hoc, consider /create first │
374
+ │ │
375
+ │ RESEARCH (15-30 min) │
376
+ │ │ │
377
+ │ ├── Codebase exploration │
378
+ │ ├── External documentation │
379
+ │ ├── Real-world examples │
380
+ │ └── Synthesize findings │
381
+ │ │
382
+ │ PLANNING (10-20 min) │
383
+ │ │ │
384
+ │ ├── Create step-by-step plan │
385
+ │ ├── Identify files to modify │
386
+ │ └── Define test strategy │
387
+ │ │
388
+ │ IMPLEMENTATION (variable) │
389
+ │ │ │
390
+ │ ├── TDD cycle for each component │
391
+ │ ├── Follow plan steps │
392
+ │ └── Track progress │
393
+ │ │
394
+ │ VERIFICATION (10-15 min) │
395
+ │ │ │
396
+ │ ├── Run full test suite │
397
+ │ ├── Verify against research │
398
+ │ └── Update review document │
399
+ │ │
400
+ │ COMPLETION │
401
+ │ │ │
402
+ │ └── /finish or /commit │
403
+ │ │
404
+ └─────────────────────────────────────────────────────────────────────────┘
405
+ ```
406
+
407
+ ## Examples
408
+
409
+ ```bash
410
+ /research-and-implement bd-auth01 # Full workflow with bead
411
+ /research-and-implement "add caching" # Ad-hoc topic
412
+ /research-and-implement bd-fix02 --quick # Quick mode
413
+ /research-and-implement bd-core03 --tdd # Enforce TDD
414
+ ```
415
+
416
+ ## Error Handling
417
+
418
+ ### Research Stalls
419
+
420
+ ```
421
+ If research is taking too long (>30 min):
422
+
423
+ 1. Time-box remaining research
424
+ 2. Document unknowns explicitly
425
+ 3. Plan for iterative discovery during implementation
426
+ 4. Set "research spike" tasks for deep unknowns
427
+ ```
428
+
429
+ ### Implementation Blocks
430
+
431
+ ```
432
+ If implementation hits unexpected blocker:
433
+
434
+ 1. Stop implementation
435
+ 2. Add finding to research.md
436
+ 3. Revise plan if needed
437
+ 4. Create sub-task for blocker if significant
438
+ 5. Continue or defer based on impact
439
+ ```
440
+
441
+ ### Test Failures
442
+
443
+ ```
444
+ If tests fail during verification:
445
+
446
+ 1. Analyze failure
447
+ 2. Check if bug or missing requirement
448
+ 3. Fix and re-run
449
+ 4. If persistent, document in review.md
450
+ 5. Decide: fix now or create follow-up task
451
+ ```