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,27 +1,51 @@
1
1
  ---
2
2
  description: Research a bead - parallel exploration, gather context, save findings
3
- argument-hint: "<bead-id> [focus area]"
3
+ argument-hint: "<bead-id> [--quick|--thorough] [focus area]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Research
8
8
 
9
+ ## Load Beads Skill
10
+
11
+ ```typescript
12
+ skill({ name: "beads" });
13
+ ```
14
+
15
+ ## Depth Levels
16
+
17
+ | Level | Tool Calls | Use Case |
18
+ | ------------ | ---------- | ------------------------------------- |
19
+ | `--quick` | ~10 | Single question, API syntax lookup |
20
+ | (default) | ~30 | Moderate exploration, verify patterns |
21
+ | `--thorough` | ~100+ | Comprehensive analysis, new domain |
22
+
9
23
  ## Phase 1: Load Bead Context
10
24
 
11
25
  ```typescript
12
26
  bd_show({ id: "$ARGUMENTS" });
13
27
  ```
14
28
 
29
+ Reserve research file:
30
+
31
+ ```typescript
32
+ bd_reserve({
33
+ paths: [".beads/artifacts/<bead-id>/research.md"],
34
+ reason: "Researching $ARGUMENTS",
35
+ ttl: 1200,
36
+ });
37
+ ```
38
+
15
39
  **Check for previous research:**
16
40
 
17
- ```bash
18
- list_sessions(project="current", since="this week", limit=5)
41
+ ```typescript
42
+ list_sessions({ project: "current", since: "this week", limit: 5 });
19
43
  ```
20
44
 
21
45
  If relevant session exists:
22
46
 
23
- ```bash
24
- read_session("<session-id>", focus="research")
47
+ ```typescript
48
+ read_session({ session_reference: "<session-id>", focus: "research" });
25
49
  ```
26
50
 
27
51
  Review existing findings before duplicating work.
@@ -37,47 +61,112 @@ Extract:
37
61
  - **Problem statement** - What we're solving
38
62
  - **Requirements** - What must be done
39
63
  - **Scope** - In/out boundaries
40
- - **Open Questions** - What needs investigation
64
+ - **Open Questions** - What needs investigation (prioritize by importance)
41
65
 
42
66
  ## Phase 2: Parallel Exploration
43
67
 
44
- Run these **in parallel** using batch tool calls:
68
+ Run these **in parallel** using batch tool calls.
69
+
70
+ ### Source Quality Tiers
71
+
72
+ Prioritize sources in this order:
73
+
74
+ | Tier | Source | Trust Level | When to Use |
75
+ | ---- | ---------------------- | ----------- | --------------------------- |
76
+ | 1 | Codebase patterns | Highest | Always check first |
77
+ | 1 | Official documentation | Highest | Authoritative answers |
78
+ | 2 | Context7 library docs | High | API usage, examples |
79
+ | 2 | GitHub code examples | High | Real-world patterns |
80
+ | 3 | Blog posts, tutorials | Medium | Concepts, approaches |
81
+ | 3 | Stack Overflow | Medium | Troubleshooting, edge cases |
45
82
 
46
- ### Internal Codebase
83
+ ### Internal Codebase (Tier 1)
84
+
85
+ ```typescript
86
+ // Semantic understanding
87
+ lsp_find_references({ filePath: "<file>", line: N, character: N });
88
+ lsp_hover({ filePath: "<file>", line: N, character: N });
89
+ lsp_document_symbols({ filePath: "<file>" });
90
+
91
+ // Pattern search
92
+ ast-grep({ pattern: "<code pattern>" });
93
+ grep({ pattern: "<text pattern>", include: "*.ts" });
94
+ glob({ pattern: "**/*<name>*" });
95
+
96
+ // History for "why" questions
97
+ git log -p --follow -S "<search term>" -- <file>
98
+ git blame <file> | grep "<pattern>"
99
+ ```
47
100
 
48
- - `grep` - Find related functions/classes by pattern
49
- - `ast-grep` - Semantic code search for patterns
50
- - `glob` - Map relevant directories
101
+ ### External Docs - Context7 (Tier 2)
51
102
 
52
- ### External Docs (Context7)
103
+ Only for libraries in spec's allowed list:
53
104
 
54
- - Only for libraries in spec's allowed list
55
- - `context7_resolve-library-id` `context7_get-library-docs`
105
+ ```typescript
106
+ context7_resolve - library - id({ libraryName: "<lib>", query: "<question>" });
107
+ context7_query -
108
+ docs({ libraryId: "<resolved-id>", query: "<specific question>" });
109
+ ```
110
+
111
+ ### Code Examples - codesearch/gh_grep (Tier 2)
112
+
113
+ Real-world patterns from GitHub:
114
+
115
+ ```typescript
116
+ codesearch({ query: "<API usage pattern>", tokensNum: 5000 });
117
+ gh_grep_searchGitHub({ query: "<code pattern>", language: ["TypeScript"] });
118
+ ```
56
119
 
57
- ### Code Examples (codesearch)
120
+ Use actual code patterns, not keywords.
58
121
 
59
- - Real-world patterns from GitHub
60
- - Use regex patterns, not keywords
122
+ ### Web Research - websearch (Tier 3)
61
123
 
62
- ### Web Research (websearch)
124
+ Only if Tier 1-2 don't answer the question:
63
125
 
64
- - Documentation, articles, best practices
65
- - Only if Context7 doesn't have it
126
+ ```typescript
127
+ websearch({ query: "<specific question>", numResults: 5 });
128
+ ```
66
129
 
67
130
  ## Phase 3: Filter & Validate
68
131
 
69
- For each finding:
132
+ For each finding, assess:
133
+
134
+ ### Validation Checklist
135
+
136
+ - [ ] Within spec scope?
137
+ - [ ] Follows constraints?
138
+ - [ ] Uses allowed libs?
139
+ - [ ] Matches existing codebase patterns?
140
+
141
+ ### Confidence Scoring
142
+
143
+ | Confidence | Criteria |
144
+ | ---------- | ----------------------------------------------------- |
145
+ | **High** | Multiple Tier 1-2 sources agree, verified in codebase |
146
+ | **Medium** | Single authoritative source, plausible but unverified |
147
+ | **Low** | Tier 3 sources only, conflicting info, speculation |
70
148
 
71
- **Validation checklist:**
149
+ ### Contradiction Handling
72
150
 
73
- - Within spec scope?
74
- - Follows constraints?
75
- - Uses allowed libs?
76
- - Matches existing patterns?
151
+ When sources disagree:
77
152
 
78
- **Discard anything that fails.**
153
+ 1. Prefer Tier 1 over Tier 2 over Tier 3
154
+ 2. Prefer more recent sources
155
+ 3. Prefer sources matching your tech stack version
156
+ 4. Document the contradiction and both perspectives
79
157
 
80
- ## Phase 4: Document Findings
158
+ **Discard findings that fail validation or have Low confidence without corroboration.**
159
+
160
+ ## Phase 4: Stopping Criteria
161
+
162
+ Stop research when ANY of these are true:
163
+
164
+ - [ ] All spec questions answered with Medium+ confidence
165
+ - [ ] Tool call budget exhausted (quick: 10, default: 30, thorough: 100)
166
+ - [ ] Diminishing returns: last 5 tool calls yielded no new insights
167
+ - [ ] Blocked: need human input to proceed
168
+
169
+ ## Phase 5: Document Findings
81
170
 
82
171
  Write to `.beads/artifacts/<bead-id>/research.md`:
83
172
 
@@ -86,51 +175,88 @@ Write to `.beads/artifacts/<bead-id>/research.md`:
86
175
 
87
176
  **Bead:** <bead-id>
88
177
  **Date:** <date>
89
- **Spec:** .beads/artifacts/<bead-id>/spec.md
178
+ **Depth:** [quick|medium|thorough]
179
+ **Tool calls:** [N]
90
180
 
91
181
  ## Questions Investigated
92
182
 
93
- 1. [Question from spec]
94
- 2. [Question from spec]
183
+ 1. [Question from spec] → **Answered** (High confidence)
184
+ 2. [Question from spec] → **Partial** (Medium confidence)
185
+ 3. [Question from spec] → **Unanswered** (needs more info)
95
186
 
96
187
  ## Findings
97
188
 
98
189
  ### [Topic 1]
99
190
 
100
- **Source:** [file:line | URL | library docs]
191
+ **Confidence:** High
192
+ **Sources:**
193
+
194
+ - Tier 1: `src/utils/auth.ts:42` - existing pattern
195
+ - Tier 2: Context7 /vercel/next.js - official docs
196
+
197
+ **Finding:** [Key insight with code example]
101
198
 
102
- [Key insight with code example if applicable]
199
+ **Basis for confidence:** Multiple authoritative sources agree, pattern exists in codebase.
200
+
201
+ ---
103
202
 
104
203
  ### [Topic 2]
105
204
 
106
- **Source:** [file:line | URL | library docs]
205
+ **Confidence:** Medium
206
+ **Sources:**
207
+
208
+ - Tier 2: codesearch - GitHub examples
209
+
210
+ **Finding:** [Key insight]
107
211
 
108
- [Key insight]
212
+ **Basis for confidence:** Single source, but from reputable repo.
213
+
214
+ **Contradiction note:** [If applicable - what sources disagreed and why we chose this interpretation]
215
+
216
+ ---
109
217
 
110
218
  ## Codebase Patterns
111
219
 
112
220
  Existing code that informs implementation:
113
221
 
114
- - `src/utils/foo.ts:42` - [pattern description]
115
- - `src/components/Bar.tsx:15-30` - [pattern description]
222
+ | Location | Pattern | Relevance |
223
+ | ------------------------ | --------- | --------- |
224
+ | `src/utils/foo.ts:42` | [pattern] | Direct |
225
+ | `src/components/Bar.tsx` | [pattern] | Similar |
116
226
 
117
227
  ## Constraints Discovered
118
228
 
119
- - [Constraint 1] - [reason]
120
- - [Constraint 2] - [reason]
229
+ - [Constraint 1] - [reason] (Confidence: High)
230
+ - [Constraint 2] - [reason] (Confidence: Medium)
121
231
 
122
232
  ## Recommendation
123
233
 
124
- [Recommended approach based on findings]
234
+ **Approach:** [Recommended approach based on findings]
235
+
236
+ **Confidence:** [High/Medium/Low]
237
+
238
+ **Rationale:** [Why this approach, citing findings]
125
239
 
126
240
  ## Open Items
127
241
 
128
- - [ ] [Remaining uncertainty]
242
+ - [ ] [Remaining uncertainty] - needs: [what would resolve it]
243
+ - [ ] [Blocked question] - needs: [human input / more context]
129
244
  ```
130
245
 
131
- ## Phase 5: Update Bead
246
+ ## Phase 6: Update Bead & Sync
132
247
 
133
- Add a note about research completion via `bd_msg` or update the spec with key findings.
248
+ ```typescript
249
+ bd_msg({
250
+ subj: "Research complete",
251
+ body: "Findings: [count]\nConfidence: [overall]\nOpen items: [count]",
252
+ to: "all",
253
+ importance: "normal",
254
+ global: false,
255
+ });
256
+
257
+ bd_release({ _: true });
258
+ bd_sync({ reason: "Research complete for $ARGUMENTS" });
259
+ ```
134
260
 
135
261
  ## Output
136
262
 
@@ -138,14 +264,22 @@ Add a note about research completion via `bd_msg` or update the spec with key fi
138
264
  Research Complete: <bead-id>
139
265
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
140
266
 
267
+ Depth: [quick|medium|thorough]
268
+ Tool calls: [N]
141
269
  Findings saved: .beads/artifacts/<bead-id>/research.md
142
270
 
271
+ Questions:
272
+ • [question 1] → Answered (High)
273
+ • [question 2] → Partial (Medium)
274
+
143
275
  Key Insights:
144
- • [insight 1]
145
- • [insight 2]
276
+ • [insight 1] (High confidence)
277
+ • [insight 2] (Medium confidence)
146
278
 
147
279
  Constraints:
148
280
  • [constraint 1]
149
281
 
282
+ Open Items: [N] remaining
283
+
150
284
  Next: /plan <bead-id>
151
285
  ```