opencodekit 0.16.15 → 0.16.18
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/README.md +77 -242
- package/dist/index.js +19 -6
- package/dist/template/.opencode/AGENTS.md +72 -236
- package/dist/template/.opencode/README.md +49 -482
- package/dist/template/.opencode/agent/build.md +71 -345
- package/dist/template/.opencode/agent/explore.md +47 -139
- package/dist/template/.opencode/agent/general.md +61 -172
- package/dist/template/.opencode/agent/looker.md +65 -161
- package/dist/template/.opencode/agent/painter.md +46 -200
- package/dist/template/.opencode/agent/plan.md +37 -220
- package/dist/template/.opencode/agent/review.md +72 -153
- package/dist/template/.opencode/agent/scout.md +44 -486
- package/dist/template/.opencode/agent/vision.md +63 -178
- package/dist/template/.opencode/command/create.md +75 -307
- package/dist/template/.opencode/command/design.md +53 -589
- package/dist/template/.opencode/command/handoff.md +76 -180
- package/dist/template/.opencode/command/init.md +45 -211
- package/dist/template/.opencode/command/plan.md +62 -514
- package/dist/template/.opencode/command/pr.md +56 -226
- package/dist/template/.opencode/command/research.md +55 -266
- package/dist/template/.opencode/command/resume.md +33 -138
- package/dist/template/.opencode/command/review-codebase.md +54 -202
- package/dist/template/.opencode/command/ship.md +78 -127
- package/dist/template/.opencode/command/start.md +47 -577
- package/dist/template/.opencode/command/status.md +60 -353
- package/dist/template/.opencode/command/ui-review.md +52 -298
- package/dist/template/.opencode/command/verify.md +36 -250
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +133 -35
- package/dist/template/.opencode/plugin/README.md +40 -166
- package/dist/template/.opencode/plugin/compaction.ts +162 -131
- package/dist/template/.opencode/plugin/lib/memory-db.ts +112 -0
- package/dist/template/.opencode/plugin/swarm-enforcer.ts +182 -27
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +112 -0
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +6 -0
- package/dist/template/.opencode/skill/core-data-expert/SKILL.md +82 -0
- package/dist/template/.opencode/skill/core-data-expert/references/batch-operations.md +543 -0
- package/dist/template/.opencode/skill/core-data-expert/references/cloudkit-integration.md +259 -0
- package/dist/template/.opencode/skill/core-data-expert/references/concurrency.md +522 -0
- package/dist/template/.opencode/skill/core-data-expert/references/fetch-requests.md +643 -0
- package/dist/template/.opencode/skill/core-data-expert/references/glossary.md +233 -0
- package/dist/template/.opencode/skill/core-data-expert/references/migration.md +393 -0
- package/dist/template/.opencode/skill/core-data-expert/references/model-configuration.md +597 -0
- package/dist/template/.opencode/skill/core-data-expert/references/performance.md +300 -0
- package/dist/template/.opencode/skill/core-data-expert/references/persistent-history.md +553 -0
- package/dist/template/.opencode/skill/core-data-expert/references/project-audit.md +60 -0
- package/dist/template/.opencode/skill/core-data-expert/references/saving.md +574 -0
- package/dist/template/.opencode/skill/core-data-expert/references/stack-setup.md +625 -0
- package/dist/template/.opencode/skill/core-data-expert/references/testing.md +300 -0
- package/dist/template/.opencode/skill/core-data-expert/references/threading.md +589 -0
- package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +246 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/actors.md +640 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-algorithms.md +822 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-await-basics.md +249 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-sequences.md +670 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/core-data.md +533 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/glossary.md +128 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/linting.md +142 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/memory-management.md +542 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/migration.md +1076 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/performance.md +574 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/sendable.md +578 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/tasks.md +604 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/testing.md +565 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/threading.md +452 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +290 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-advanced.md +351 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-basics.md +284 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-transitions.md +326 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/image-optimization.md +286 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/layout-best-practices.md +312 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/liquid-glass.md +377 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/list-patterns.md +153 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/modern-apis.md +400 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/performance-patterns.md +377 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/scroll-patterns.md +305 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/state-management.md +447 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/text-formatting.md +285 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/view-structure.md +276 -0
- package/dist/template/.opencode/tool/action-queue.ts +308 -0
- package/dist/template/.opencode/tool/swarm.ts +65 -40
- package/package.json +16 -3
- package/dist/template/.opencode/.agents/skills/context7/SKILL.md +0 -88
|
@@ -1,310 +1,99 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Research a topic or bead before implementation
|
|
3
|
-
argument-hint: "<bead-id> [--quick|--thorough]"
|
|
3
|
+
argument-hint: "<topic-or-bead-id> [--quick|--thorough]"
|
|
4
4
|
agent: scout
|
|
5
|
-
subtask: true
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Research: $ARGUMENTS
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
Gather information before implementation. Find answers, document findings, stop when done.
|
|
11
10
|
|
|
12
|
-
> **Lifecycle context:** Ideation → Design → **Research (optional)** → Specification → Planning → Implementation → Verification
|
|
13
|
-
>
|
|
14
11
|
> Research can happen at any phase when you need external information or codebase understanding.
|
|
15
12
|
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
- `--quick` (~10 tool calls): Single question, API syntax lookup
|
|
19
|
-
- Default (~30 tool calls): Moderate exploration, verify patterns
|
|
20
|
-
- `--thorough` (~100+ tool calls): Comprehensive analysis, new domain
|
|
21
|
-
|
|
22
|
-
## Load Skills Based on Depth
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
skill({ name: "development-lifecycle" }); // Phase guidance
|
|
26
|
-
|
|
27
|
-
// For --thorough mode, load the deep-research skill
|
|
28
|
-
if (thorough) {
|
|
29
|
-
skill({ name: "deep-research" });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// For npm package evaluation
|
|
33
|
-
skill({ name: "v1-run" });
|
|
34
|
-
|
|
35
|
-
// For source code analysis
|
|
36
|
-
skill({ name: "source-code-research" });
|
|
37
|
-
|
|
38
|
-
// For swarm coordination (if parallel research needed)
|
|
39
|
-
skill({ name: "swarm-coordination" });
|
|
40
|
-
|
|
41
|
-
// For memory context
|
|
42
|
-
skill({ name: "memory-system" });
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Delegation Strategy
|
|
46
|
-
|
|
47
|
-
### Step 1: Classify Research Task
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
// Analyze if research benefits from parallelization
|
|
51
|
-
const analysis = await swarm({
|
|
52
|
-
operation: "plan",
|
|
53
|
-
action: "analyze",
|
|
54
|
-
task: "Research " + $ARGUMENTS,
|
|
55
|
-
files: "<detected files or leave empty for external research>",
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// For search-type research with multiple sources, use swarm
|
|
59
|
-
if (analysis.classification.type === "search" && analysis.classification.recommended_agents > 1) {
|
|
60
|
-
console.log(`Research classified as ${analysis.classification.type}`);
|
|
61
|
-
console.log(`Recommended: ${analysis.classification.recommended_agents} parallel agents`);
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Internal Codebase → @explore
|
|
66
|
-
|
|
67
|
-
Delegate LSP exploration to the explore agent:
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
task({
|
|
71
|
-
subagent_type: "explore",
|
|
72
|
-
description: "Analyze <module>",
|
|
73
|
-
prompt: `Very thorough LSP analysis of <target files>.
|
|
74
|
-
|
|
75
|
-
Questions:
|
|
76
|
-
1. What functions/classes are exported?
|
|
77
|
-
2. What are the incoming/outgoing calls?
|
|
78
|
-
3. What patterns exist in this module?
|
|
79
|
-
|
|
80
|
-
Return file:line references for all findings.`,
|
|
81
|
-
});
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### External Research → @scout (this agent)
|
|
85
|
-
|
|
86
|
-
Scout handles external sources (context7, grepsearch, codesearch, etc.)
|
|
87
|
-
|
|
88
|
-
### Parallel Execution (Swarm Mode for Research)
|
|
89
|
-
|
|
90
|
-
For comprehensive research across multiple domains, use parallel agents:
|
|
91
|
-
|
|
92
|
-
```typescript
|
|
93
|
-
// Option A: Simple parallel (2-3 agents)
|
|
94
|
-
// Launch both in parallel
|
|
95
|
-
task({ subagent_type: "explore", prompt: "LSP analysis of..." });
|
|
96
|
-
context7({ operation: "resolve", libraryName: "<lib>" });
|
|
97
|
-
grepsearch({ query: "<pattern>", language: "TypeScript" });
|
|
98
|
-
|
|
99
|
-
// Option B: Swarm mode for complex multi-domain research
|
|
100
|
-
// Use when researching 3+ different areas simultaneously
|
|
101
|
-
|
|
102
|
-
// Spawn research workers (results returned when all complete)
|
|
103
|
-
Task({
|
|
104
|
-
subagent_type: "explore",
|
|
105
|
-
description: "Research domain A",
|
|
106
|
-
prompt: `Research [domain A] for ${$ARGUMENTS}...
|
|
107
|
-
Return: Key findings, file paths, patterns discovered`,
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
Task({
|
|
111
|
-
subagent_type: "scout",
|
|
112
|
-
description: "Research domain B",
|
|
113
|
-
prompt: `Research [domain B] for ${$ARGUMENTS}...
|
|
114
|
-
Return: Documentation, code examples, best practices`,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// Results available immediately when all workers complete
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Load Context
|
|
121
|
-
|
|
122
|
-
### Load Bead Details
|
|
123
|
-
|
|
124
|
-
!`br show $ARGUMENTS`
|
|
125
|
-
!`cat .beads/artifacts/$ARGUMENTS/prd.md`
|
|
126
|
-
|
|
127
|
-
Extract questions that need answering from spec.
|
|
128
|
-
|
|
129
|
-
## Check For Previous Research
|
|
130
|
-
|
|
131
|
-
!`search_session({ query: "[topic keywords]" })`
|
|
132
|
-
!`list_sessions({ project: "current", since: "this week", limit: 5 })`
|
|
133
|
-
|
|
134
|
-
Extract the questions that need answering from the spec.
|
|
135
|
-
|
|
136
|
-
## Check Memory First (Semantic Search)
|
|
137
|
-
|
|
138
|
-
Before hitting external sources, search what we already know:
|
|
13
|
+
## Load Skills
|
|
139
14
|
|
|
140
15
|
```typescript
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// Search for related gotchas and learnings
|
|
145
|
-
memory_search({ query: "[topic keywords] gotchas", limit: 3 });
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**If memory has high-confidence answers, you may skip external research.**
|
|
149
|
-
|
|
150
|
-
Review findings for:
|
|
151
|
-
|
|
152
|
-
- Previous research on this exact topic
|
|
153
|
-
- Related patterns and decisions
|
|
154
|
-
- Known gotchas to avoid
|
|
155
|
-
|
|
156
|
-
If memory search fails (Ollama not running), continue to external sources.
|
|
157
|
-
|
|
158
|
-
## Source Priority
|
|
159
|
-
|
|
160
|
-
1. **Codebase patterns** (highest trust) - Delegate to @explore for LSP analysis
|
|
161
|
-
2. **Official docs** (high trust) - What does the library documentation say?
|
|
162
|
-
3. **v1-run** (high trust) - npm package health, vulnerabilities, comparisons
|
|
163
|
-
4. **Context7** (high trust) - API usage and examples
|
|
164
|
-
5. **Source code** (high trust) - Library implementation (use `source-code-research` skill)
|
|
165
|
-
6. **GitHub examples** (medium trust) - Real-world patterns via codesearch/grepsearch
|
|
166
|
-
7. **Web search** (lower trust) - Only if tiers 1-6 don't answer
|
|
167
|
-
|
|
168
|
-
## Research
|
|
169
|
-
|
|
170
|
-
### Internal Codebase → Delegate to @explore
|
|
171
|
-
|
|
172
|
-
**Do NOT run LSP manually.** Delegate to the explore agent:
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
task({
|
|
176
|
-
subagent_type: "explore",
|
|
177
|
-
description: "Analyze codebase patterns",
|
|
178
|
-
prompt: `Very thorough analysis of [target area].
|
|
179
|
-
|
|
180
|
-
Questions:
|
|
181
|
-
1. How does this project handle [pattern]?
|
|
182
|
-
2. What are the existing conventions?
|
|
183
|
-
3. Where are similar implementations?
|
|
184
|
-
|
|
185
|
-
Return file:line references.`,
|
|
186
|
-
});
|
|
16
|
+
skill({ name: "beads" });
|
|
17
|
+
// For --thorough mode:
|
|
18
|
+
skill({ name: "deep-research" });
|
|
187
19
|
```
|
|
188
20
|
|
|
189
|
-
|
|
21
|
+
## Parse Arguments
|
|
190
22
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
23
|
+
| Argument | Default | Description |
|
|
24
|
+
| ---------------- | -------- | ----------------------------------- |
|
|
25
|
+
| Topic or bead ID | required | What to research |
|
|
26
|
+
| `--quick` | false | ~10 tool calls, single question |
|
|
27
|
+
| `--thorough` | false | ~100+ calls, comprehensive analysis |
|
|
195
28
|
|
|
196
|
-
|
|
29
|
+
Default depth: ~30 tool calls for moderate exploration.
|
|
197
30
|
|
|
198
|
-
|
|
31
|
+
## Phase 1: Load Context
|
|
199
32
|
|
|
200
|
-
|
|
201
|
-
- Need to understand edge cases or internals
|
|
202
|
-
- Library behaving unexpectedly
|
|
203
|
-
- Evaluating library quality/fit
|
|
33
|
+
If argument is a bead ID:
|
|
204
34
|
|
|
205
35
|
```bash
|
|
206
|
-
|
|
207
|
-
npx opensrc <package> # npm package
|
|
208
|
-
npx opensrc <package>@<version> # specific version
|
|
209
|
-
npx opensrc pypi:<package> # Python
|
|
210
|
-
npx opensrc <owner>/<repo> # GitHub repo
|
|
36
|
+
br show $ARGUMENTS
|
|
211
37
|
```
|
|
212
38
|
|
|
213
|
-
|
|
39
|
+
Read PRD if it exists and extract questions that need answering.
|
|
214
40
|
|
|
215
|
-
|
|
41
|
+
Check memory for previous research on this topic.
|
|
216
42
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
```
|
|
43
|
+
## Phase 2: Research
|
|
44
|
+
|
|
45
|
+
### Source Priority
|
|
221
46
|
|
|
222
|
-
|
|
47
|
+
1. **Codebase patterns** — delegate to `explore` agent for LSP analysis
|
|
48
|
+
2. **Official docs** — `context7` for API references
|
|
49
|
+
3. **Source code** — `npx opensrc <package>` when docs are insufficient
|
|
50
|
+
4. **GitHub examples** — `codesearch` / `grepsearch` for real-world patterns
|
|
51
|
+
5. **Web search** — only if tiers 1-4 don't answer
|
|
223
52
|
|
|
224
|
-
|
|
53
|
+
### Delegation
|
|
225
54
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
55
|
+
| What | Agent | When |
|
|
56
|
+
| ----------------- | ---------------------------- | -------------------------------------- |
|
|
57
|
+
| Codebase analysis | `explore` | Internal patterns, file structure, LSP |
|
|
58
|
+
| External docs | `scout` (this agent) | Library APIs, best practices |
|
|
59
|
+
| Multiple domains | Parallel `explore` + `scout` | 3+ independent questions |
|
|
230
60
|
|
|
231
|
-
|
|
61
|
+
### Confidence Levels
|
|
232
62
|
|
|
233
63
|
- **High**: Multiple authoritative sources agree, verified in codebase
|
|
234
64
|
- **Medium**: Single good source, plausible but unverified
|
|
235
|
-
- **Low**: Conflicting info, speculation
|
|
65
|
+
- **Low**: Conflicting info, speculation — discard without corroboration
|
|
236
66
|
|
|
237
|
-
|
|
67
|
+
## Phase 3: Stop When
|
|
238
68
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
- All spec questions answered with medium+ confidence
|
|
242
|
-
- Tool budget exhausted
|
|
69
|
+
- All questions answered with medium+ confidence
|
|
70
|
+
- Tool budget exhausted for depth level
|
|
243
71
|
- Last 5 tool calls yielded no new insights
|
|
244
72
|
- Blocked and need human input
|
|
245
73
|
|
|
246
|
-
## Document
|
|
247
|
-
|
|
248
|
-
Write `.beads/artifacts/$ARGUMENTS/research.md`:
|
|
74
|
+
## Phase 4: Document
|
|
249
75
|
|
|
250
|
-
|
|
251
|
-
# Research: [Title]
|
|
76
|
+
Write findings to `.beads/artifacts/$ARGUMENTS/research.md` (if bead) or report directly (if topic):
|
|
252
77
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
## Questions
|
|
258
|
-
|
|
259
|
-
1. [Question] → Answered (High)
|
|
260
|
-
2. [Question] → Partial (Medium)
|
|
261
|
-
3. [Question] → Unanswered
|
|
262
|
-
|
|
263
|
-
## Key Findings
|
|
264
|
-
|
|
265
|
-
### [Topic 1]
|
|
266
|
-
|
|
267
|
-
**Confidence:** High
|
|
268
|
-
**Sources:** `src/utils/auth.ts:42`, Context7 /vercel/next.js
|
|
269
|
-
|
|
270
|
-
[Finding with code example]
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
### [Topic 2]
|
|
275
|
-
|
|
276
|
-
**Confidence:** Medium
|
|
277
|
-
[Finding]
|
|
278
|
-
|
|
279
|
-
---
|
|
280
|
-
|
|
281
|
-
## Recommendation
|
|
282
|
-
|
|
283
|
-
[Approach based on findings]
|
|
284
|
-
|
|
285
|
-
## Open Items
|
|
286
|
-
|
|
287
|
-
- [Remaining question] - needs: [what would resolve it]
|
|
288
|
-
```
|
|
78
|
+
- Questions asked → answered/partial/unanswered with confidence
|
|
79
|
+
- Key findings with sources (file paths, docs)
|
|
80
|
+
- Recommendation based on findings
|
|
81
|
+
- Open items needing resolution
|
|
289
82
|
|
|
290
83
|
## Output
|
|
291
84
|
|
|
292
|
-
|
|
293
|
-
Research: $ARGUMENTS
|
|
294
|
-
|
|
295
|
-
Depth: [quick|medium|thorough]
|
|
296
|
-
Tool calls: [N]
|
|
297
|
-
Delegations: [@explore for codebase, @scout for external]
|
|
85
|
+
Report:
|
|
298
86
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
87
|
+
1. Depth level and tool call count
|
|
88
|
+
2. Questions with answer status and confidence
|
|
89
|
+
3. Key insights (bullet points)
|
|
90
|
+
4. Open items remaining
|
|
91
|
+
5. Next step suggestion
|
|
302
92
|
|
|
303
|
-
|
|
304
|
-
• [insight 1]
|
|
305
|
-
• [insight 2]
|
|
93
|
+
## Related Commands
|
|
306
94
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
95
|
+
| Need | Command |
|
|
96
|
+
| ------------- | ------------- |
|
|
97
|
+
| Create spec | `/create` |
|
|
98
|
+
| Plan details | `/plan <id>` |
|
|
99
|
+
| Start working | `/start <id>` |
|
|
@@ -6,187 +6,82 @@ agent: build
|
|
|
6
6
|
|
|
7
7
|
# Resume: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Pick up where a previous session left off. Recover context, verify state, continue.
|
|
10
10
|
|
|
11
11
|
## Load Skills
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
skill({ name: "beads" });
|
|
15
|
-
skill({ name: "beads-bridge" }); // For cross-session recovery
|
|
16
|
-
skill({ name: "memory-system" });
|
|
17
15
|
```
|
|
18
16
|
|
|
19
|
-
## Verify
|
|
17
|
+
## Phase 1: Verify Task
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## Check Git State
|
|
19
|
+
```bash
|
|
20
|
+
br show $ARGUMENTS
|
|
21
|
+
```
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
!`git rev-parse --short HEAD`
|
|
29
|
-
!`git status --porcelain`
|
|
23
|
+
If not found, check `br list --status=all` — it may have been closed or the ID is wrong.
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
## Phase 2: Git State
|
|
32
26
|
|
|
33
27
|
```bash
|
|
34
|
-
git
|
|
28
|
+
git branch --show-current
|
|
29
|
+
git status --porcelain
|
|
35
30
|
```
|
|
36
31
|
|
|
37
|
-
If
|
|
38
|
-
|
|
39
|
-
## Find The Handoff
|
|
32
|
+
If not on the right branch, check out the feature branch. If uncommitted changes exist, ask user what to do.
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
## Phase 3: Find Handoff
|
|
42
35
|
|
|
43
|
-
|
|
36
|
+
Check for handoff notes:
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
```bash
|
|
39
|
+
ls .beads/artifacts/$ARGUMENTS/handoffs/ 2>/dev/null
|
|
40
|
+
```
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
If a handoff exists, read the latest one. It tells you:
|
|
48
43
|
|
|
49
44
|
- What was completed
|
|
50
45
|
- Where work stopped
|
|
51
46
|
- What to do next
|
|
52
47
|
- Any blockers
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Search for related work:
|
|
49
|
+
Also search previous sessions:
|
|
57
50
|
|
|
58
51
|
```typescript
|
|
59
52
|
search_session({ query: "$ARGUMENTS" });
|
|
60
|
-
list_sessions({ project: "current", limit: 5 });
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Load the most recent relevant session:
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
read_session({ session_reference: "last", project: "current" });
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Extract from session:
|
|
70
|
-
|
|
71
|
-
- Files modified
|
|
72
|
-
- Decisions made
|
|
73
|
-
- Where work stopped
|
|
74
|
-
- Problems encountered
|
|
75
|
-
|
|
76
|
-
## Load Related Memory (Semantic Search)
|
|
77
|
-
|
|
78
|
-
Search for relevant observations and past work:
|
|
79
|
-
|
|
80
|
-
```typescript
|
|
81
|
-
// Find observations related to this bead
|
|
82
|
-
memory_search({ query: "$ARGUMENTS [bead title/description]", limit: 5 });
|
|
83
|
-
|
|
84
|
-
// Find similar past work
|
|
85
|
-
memory_search({ query: "[bead description keywords]", limit: 3 });
|
|
86
53
|
```
|
|
87
54
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- Gotchas discovered during previous sessions
|
|
91
|
-
- Decisions already made
|
|
92
|
-
- Patterns that worked
|
|
93
|
-
|
|
94
|
-
If memory search fails (Ollama not running), continue without it.
|
|
95
|
-
|
|
96
|
-
## Load Artifacts
|
|
55
|
+
## Phase 4: Load Artifacts
|
|
97
56
|
|
|
98
57
|
Read all available context:
|
|
99
58
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
## Recover Swarm State (If Active)
|
|
105
|
-
|
|
106
|
-
Check if there was an active swarm for this task:
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
// Check for active swarm state
|
|
110
|
-
const teamName = "$ARGUMENTS-swarm";
|
|
111
|
-
const status = await swarm({
|
|
112
|
-
operation: "monitor",
|
|
113
|
-
action: "status",
|
|
114
|
-
team_name: teamName,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
const stats = JSON.parse(status);
|
|
118
|
-
if (stats.summary?.total_workers > 0) {
|
|
119
|
-
console.log(`✓ Found active swarm with ${stats.summary.total_workers} workers`);
|
|
120
|
-
|
|
121
|
-
// Show current progress
|
|
122
|
-
const ui = await swarm({
|
|
123
|
-
operation: "monitor",
|
|
124
|
-
action: "render_block",
|
|
125
|
-
team_name: teamName,
|
|
126
|
-
});
|
|
127
|
-
console.log(ui);
|
|
128
|
-
} else {
|
|
129
|
-
console.log("No active swarm session");
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Sync beads to OpenCode todos for subagent visibility
|
|
133
|
-
swarm({ operation: "sync", action: "push" });
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Check For Stale Context
|
|
137
|
-
|
|
138
|
-
If handoff is more than 3 days old, things may have changed:
|
|
59
|
+
- `.beads/artifacts/$ARGUMENTS/prd.md`
|
|
60
|
+
- `.beads/artifacts/$ARGUMENTS/plan.md` (if exists)
|
|
61
|
+
- `.beads/artifacts/$ARGUMENTS/progress.txt` (if exists)
|
|
62
|
+
- `.beads/artifacts/$ARGUMENTS/research.md` (if exists)
|
|
139
63
|
|
|
140
|
-
|
|
141
|
-
!`git diff [handoff-commit]..HEAD --stat` # What files changed?
|
|
64
|
+
## Phase 5: Check Staleness
|
|
142
65
|
|
|
143
|
-
If
|
|
66
|
+
If handoff is more than 3 days old:
|
|
144
67
|
|
|
145
68
|
```bash
|
|
146
|
-
git
|
|
147
|
-
git rebase origin/main
|
|
69
|
+
git log --oneline -10
|
|
148
70
|
```
|
|
149
71
|
|
|
150
|
-
|
|
72
|
+
Check if significant changes happened on main. If so, consider rebasing. Don't blindly follow an outdated plan — verify it still makes sense.
|
|
151
73
|
|
|
152
|
-
|
|
153
|
-
Resuming: $ARGUMENTS
|
|
154
|
-
|
|
155
|
-
Branch: [branch]
|
|
156
|
-
Commit: [hash]
|
|
157
|
-
Handoff: [date] ([age])
|
|
158
|
-
|
|
159
|
-
Progress:
|
|
160
|
-
- [x] [completed]
|
|
161
|
-
- [x] [completed]
|
|
162
|
-
- [ ] [in progress] <- resume here
|
|
163
|
-
- [ ] [remaining]
|
|
164
|
-
|
|
165
|
-
Next: [from handoff resume instructions]
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Continue Work
|
|
169
|
-
|
|
170
|
-
Mark in progress if not already:
|
|
74
|
+
## Phase 6: Continue
|
|
171
75
|
|
|
172
76
|
```bash
|
|
173
77
|
br update $ARGUMENTS --status in_progress
|
|
174
78
|
```
|
|
175
79
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| Condition | Command |
|
|
179
|
-
| ----------------------- | ---------------------------------------- |
|
|
180
|
-
| Swarm was restored | Continue with `/ship $ARGUMENTS --swarm` |
|
|
181
|
-
| No swarm, standard work | `/ship $ARGUMENTS` |
|
|
182
|
-
| Need to re-plan | `/plan $ARGUMENTS` |
|
|
183
|
-
|
|
184
|
-
## If Context Is Too Stale
|
|
185
|
-
|
|
186
|
-
If more than a week old or significant changes happened:
|
|
80
|
+
Report:
|
|
187
81
|
|
|
188
|
-
1.
|
|
189
|
-
2.
|
|
190
|
-
3.
|
|
82
|
+
1. Branch and commit
|
|
83
|
+
2. Handoff age
|
|
84
|
+
3. Progress (completed/remaining tasks)
|
|
85
|
+
4. Next action (from handoff or PRD)
|
|
191
86
|
|
|
192
|
-
|
|
87
|
+
Then continue with `/ship $ARGUMENTS` or `/plan $ARGUMENTS` as appropriate.
|