opencodekit 0.12.2 → 0.12.4

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