opencodekit 0.12.2 → 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/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/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 +32 -292
- 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/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.md +72 -197
- package/dist/template/.opencode/command/resume.md +70 -438
- package/dist/template/.opencode/command/status.md +11 -11
- package/dist/template/.opencode/command/triage.md +23 -18
- package/dist/template/.opencode/memory/project/commands.md +139 -7
- package/dist/template/.opencode/memory/project/gotchas.md +85 -0
- 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
|
@@ -1,451 +1,150 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: "<bead-id>
|
|
2
|
+
description: Research and implement in one workflow
|
|
3
|
+
argument-hint: "<bead-id> [--quick] [--tdd]"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Research & Implement: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
End-to-end workflow: research → plan → implement → verify.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Use this for features with unknowns. For simple changes, use `/fix` or `/implement` directly.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
skill({ name: "beads" });
|
|
15
|
-
```
|
|
16
|
-
|
|
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
|
|
13
|
+
## Phase 1: Context
|
|
30
14
|
|
|
31
|
-
```
|
|
32
|
-
|
|
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
|
-
}
|
|
15
|
+
```bash
|
|
16
|
+
bd show $ARGUMENTS
|
|
17
|
+
cat .beads/artifacts/$ARGUMENTS/spec.md
|
|
44
18
|
```
|
|
45
19
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
bd_init({ _: true, team: "project", role: "builder" });
|
|
50
|
-
bd_inbox({ n: 5, unread: true, global: true }); // Check for blockers
|
|
51
|
-
```
|
|
20
|
+
If no spec exists: "Run `/create $ARGUMENTS` first."
|
|
52
21
|
|
|
53
|
-
## Phase 2: Research
|
|
22
|
+
## Phase 2: Research
|
|
54
23
|
|
|
55
|
-
|
|
24
|
+
Define what you need to learn:
|
|
56
25
|
|
|
57
26
|
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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]
|
|
27
|
+
Questions:
|
|
28
|
+
1. [Key question]
|
|
29
|
+
2. [Key question]
|
|
30
|
+
3. [Key question]
|
|
71
31
|
```
|
|
72
32
|
|
|
73
|
-
|
|
33
|
+
Research using:
|
|
74
34
|
|
|
75
35
|
```typescript
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
```
|
|
36
|
+
// Codebase patterns
|
|
37
|
+
ast - grep({ pattern: "<pattern>" });
|
|
38
|
+
grep({ pattern: "<pattern>", include: "*.ts" });
|
|
105
39
|
|
|
106
|
-
|
|
40
|
+
// External docs
|
|
41
|
+
context7_resolve_library_id({ libraryName: "<lib>", query: "<question>" });
|
|
107
42
|
|
|
43
|
+
// Real examples
|
|
44
|
+
codesearch({ query: "<pattern>", tokensNum: 5000 });
|
|
108
45
|
```
|
|
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
46
|
|
|
124
|
-
|
|
125
|
-
- [Risk 1]
|
|
126
|
-
- [Risk 2]
|
|
47
|
+
Synthesize:
|
|
127
48
|
|
|
128
|
-
Recommended Approach:
|
|
129
|
-
[Summary of approach based on research]
|
|
130
49
|
```
|
|
50
|
+
Findings:
|
|
51
|
+
• [Key insight 1]
|
|
52
|
+
• [Key insight 2]
|
|
131
53
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
if (beadId) {
|
|
136
|
-
write({
|
|
137
|
-
filePath: `.beads/artifacts/${beadId}/research.md`,
|
|
138
|
-
content: researchFindings,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
54
|
+
Recommended approach: [summary]
|
|
141
55
|
```
|
|
142
56
|
|
|
143
|
-
|
|
57
|
+
Save to `.beads/artifacts/$ARGUMENTS/research.md`.
|
|
144
58
|
|
|
145
|
-
|
|
59
|
+
## Phase 3: Plan
|
|
146
60
|
|
|
147
|
-
|
|
61
|
+
Create implementation plan:
|
|
148
62
|
|
|
149
63
|
```markdown
|
|
150
|
-
#
|
|
64
|
+
# Plan: $ARGUMENTS
|
|
151
65
|
|
|
152
66
|
## Approach
|
|
153
67
|
|
|
154
|
-
[1-2
|
|
68
|
+
[1-2 sentences]
|
|
155
69
|
|
|
156
70
|
## Steps
|
|
157
71
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
|
72
|
+
1. [Step] - verify: `[command]`
|
|
73
|
+
2. [Step] - verify: `[command]`
|
|
74
|
+
3. [Step] - verify: `[command]`
|
|
220
75
|
|
|
221
|
-
|
|
76
|
+
## Files
|
|
222
77
|
|
|
78
|
+
- `src/foo.ts` - [change]
|
|
79
|
+
- `src/bar.ts` - [change]
|
|
223
80
|
```
|
|
224
|
-
IMPLEMENTING: Step [X.Y]
|
|
225
|
-
━━━━━━━━━━━━━━━━━━━━━━━
|
|
226
81
|
|
|
227
|
-
|
|
82
|
+
Save to `.beads/artifacts/$ARGUMENTS/plan.md`.
|
|
228
83
|
|
|
229
|
-
|
|
84
|
+
## Phase 4: Implement
|
|
230
85
|
|
|
231
|
-
|
|
232
|
-
- [ ] Code compiles
|
|
233
|
-
- [ ] Tests pass
|
|
234
|
-
- [ ] Matches research findings
|
|
86
|
+
Mark in progress:
|
|
235
87
|
|
|
236
|
-
|
|
88
|
+
```bash
|
|
89
|
+
bd update $ARGUMENTS --status in_progress
|
|
237
90
|
```
|
|
238
91
|
|
|
239
|
-
|
|
92
|
+
If `--tdd` flag:
|
|
240
93
|
|
|
241
94
|
```
|
|
242
95
|
For each component:
|
|
243
|
-
|
|
244
96
|
1. RED: Write failing test
|
|
245
|
-
└── Run tests, confirm failure
|
|
246
|
-
|
|
247
97
|
2. GREEN: Write minimal code to pass
|
|
248
|
-
└── Run tests, confirm passing
|
|
249
|
-
|
|
250
98
|
3. REFACTOR: Clean up
|
|
251
|
-
└── Run tests, confirm still passing
|
|
252
99
|
```
|
|
253
100
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
### Run Full Test Suite
|
|
101
|
+
Otherwise, implement step by step from plan. Checkpoint after significant progress:
|
|
257
102
|
|
|
258
103
|
```bash
|
|
259
|
-
|
|
260
|
-
# or
|
|
261
|
-
pytest tests/ -v
|
|
104
|
+
git commit -m "WIP: $ARGUMENTS - [step]"
|
|
262
105
|
```
|
|
263
106
|
|
|
264
|
-
|
|
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
|
-
```
|
|
107
|
+
## Phase 5: Verify
|
|
283
108
|
|
|
284
|
-
|
|
109
|
+
Run all gates:
|
|
285
110
|
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
}
|
|
111
|
+
```bash
|
|
112
|
+
npm test
|
|
113
|
+
npm run type-check
|
|
114
|
+
npm run lint
|
|
314
115
|
```
|
|
315
116
|
|
|
316
|
-
|
|
117
|
+
Verify against research requirements and plan steps.
|
|
317
118
|
|
|
318
|
-
|
|
119
|
+
## Phase 6: Complete
|
|
319
120
|
|
|
320
121
|
```bash
|
|
321
|
-
|
|
122
|
+
git add -A
|
|
123
|
+
git commit -m "$ARGUMENTS: [summary]"
|
|
322
124
|
```
|
|
323
125
|
|
|
324
|
-
|
|
126
|
+
```typescript
|
|
127
|
+
bd_sync({ reason: "Sync research and implementation" });
|
|
128
|
+
```
|
|
325
129
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
- Close the bead
|
|
130
|
+
```
|
|
131
|
+
Done: $ARGUMENTS
|
|
329
132
|
|
|
330
|
-
|
|
133
|
+
Research: .beads/artifacts/$ARGUMENTS/research.md
|
|
134
|
+
Plan: .beads/artifacts/$ARGUMENTS/plan.md
|
|
135
|
+
Changes: [files]
|
|
136
|
+
Tests: Pass
|
|
331
137
|
|
|
332
|
-
|
|
333
|
-
/commit "feat: [description]"
|
|
138
|
+
Next: /finish $ARGUMENTS
|
|
334
139
|
```
|
|
335
140
|
|
|
336
141
|
## Quick Mode (--quick)
|
|
337
142
|
|
|
338
|
-
For smaller tasks
|
|
339
|
-
|
|
340
|
-
```
|
|
341
|
-
QUICK MODE
|
|
342
|
-
━━━━━━━━━━
|
|
143
|
+
For smaller tasks:
|
|
343
144
|
|
|
344
145
|
1. Minimal research (5 min max)
|
|
345
|
-
- Check for existing patterns
|
|
346
|
-
- Identify key constraints
|
|
347
|
-
|
|
348
146
|
2. No formal plan document
|
|
349
|
-
- Mental model only
|
|
350
|
-
|
|
351
147
|
3. Direct implementation
|
|
352
|
-
- Write code
|
|
353
|
-
- Add tests
|
|
354
|
-
|
|
355
148
|
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
149
|
|
|
363
|
-
|
|
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
|
-
```
|
|
150
|
+
Time budget: 30 minutes. If exceeding, convert to full workflow.
|