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