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