opencodekit 0.18.4 → 0.18.6
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 +491 -47
- package/dist/template/.opencode/AGENTS.md +13 -1
- package/dist/template/.opencode/agent/build.md +4 -1
- package/dist/template/.opencode/agent/explore.md +25 -58
- package/dist/template/.opencode/command/ship.md +7 -5
- package/dist/template/.opencode/command/verify.md +63 -12
- package/dist/template/.opencode/memory/research/benchmark-framework.md +162 -0
- package/dist/template/.opencode/memory/research/effectiveness-audit.md +213 -0
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +1429 -1678
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/lib/memory-helpers.ts +3 -129
- package/dist/template/.opencode/plugin/lib/memory-hooks.ts +4 -60
- package/dist/template/.opencode/plugin/memory.ts +0 -3
- package/dist/template/.opencode/skill/agent-teams/SKILL.md +16 -1
- package/dist/template/.opencode/skill/beads/SKILL.md +22 -0
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +28 -0
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +130 -0
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +12 -0
- package/dist/template/.opencode/skill/context-management/SKILL.md +122 -113
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +20 -0
- package/dist/template/.opencode/skill/design-system-audit/SKILL.md +113 -112
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +8 -0
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +156 -132
- package/dist/template/.opencode/skill/memory-system/SKILL.md +50 -266
- package/dist/template/.opencode/skill/mockup-to-code/SKILL.md +21 -6
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +8 -0
- package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +15 -0
- package/dist/template/.opencode/skill/session-management/SKILL.md +4 -103
- package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +23 -2
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +17 -1
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +21 -0
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +34 -16
- package/dist/template/.opencode/skill/ui-ux-research/SKILL.md +5 -127
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +36 -0
- package/dist/template/.opencode/skill/verification-before-completion/references/VERIFICATION_PROTOCOL.md +133 -29
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +20 -7
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +7 -0
- package/dist/template/.opencode/tool/context7.ts +9 -1
- package/dist/template/.opencode/tool/grepsearch.ts +9 -1
- package/package.json +1 -1
|
@@ -1,300 +1,84 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memory-system
|
|
3
3
|
description: Use when persisting learnings, loading previous context, or searching past decisions - covers memory file structure, tools, and when to update each file
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
tags: [context, workflow]
|
|
6
6
|
dependencies: []
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Memory System Best Practices
|
|
10
10
|
|
|
11
|
+
> **Replaces** losing context between sessions — persistent knowledge that survives session boundaries
|
|
12
|
+
|
|
11
13
|
## When to Use
|
|
12
14
|
|
|
13
|
-
- Starting work and needing
|
|
14
|
-
- Recording non-obvious learnings
|
|
15
|
+
- Starting work and needing prior decisions, bugfixes, or patterns
|
|
16
|
+
- Recording non-obvious decisions/learnings for future sessions
|
|
17
|
+
- Creating handoffs so the next session can continue quickly
|
|
15
18
|
|
|
16
19
|
## When NOT to Use
|
|
17
20
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Architecture
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
message.part.updated → capture.ts → temporal_messages
|
|
26
|
-
↓ (session.idle, 10+ messages)
|
|
27
|
-
distill.ts → distillations (TF-IDF + key sentences)
|
|
28
|
-
↓ (session.idle)
|
|
29
|
-
curator.ts → observations (pattern-matched)
|
|
30
|
-
↓
|
|
31
|
-
system.transform ← inject.ts ← FTS5 search → scored + packed → system prompt
|
|
32
|
-
messages.transform ← context.ts → token budget enforcement
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 4 Tiers
|
|
36
|
-
|
|
37
|
-
| Tier | Storage | Populated By | Purpose |
|
|
38
|
-
| ----------------- | ------------- | ------------------- | ------------------------------- |
|
|
39
|
-
| temporal_messages | SQLite | Automatic (capture) | Raw message text, 180-day TTL |
|
|
40
|
-
| distillations | SQLite + FTS5 | Automatic (idle) | TF-IDF compressed sessions |
|
|
41
|
-
| observations | SQLite + FTS5 | Manual + curator | Decisions, bugs, patterns, etc. |
|
|
42
|
-
| memory_files | SQLite | Manual | Static docs, handoffs, research |
|
|
21
|
+
- Ephemeral debugging notes that won't matter after the current task
|
|
22
|
+
- Storing generated artifacts/log dumps as long-term memory
|
|
43
23
|
|
|
44
24
|
## Core Principle
|
|
45
25
|
|
|
46
|
-
**Progressive disclosure
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## The Ritual
|
|
51
|
-
|
|
52
|
-
Follow this every session. Memory is not optional — it's how knowledge compounds.
|
|
53
|
-
|
|
54
|
-
### 1. Ground — Search Before You Start
|
|
55
|
-
|
|
56
|
-
Always search memory first.
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
// Search for relevant past work
|
|
60
|
-
memory - search({ query: "<task keywords>", limit: 5 });
|
|
61
|
-
memory - search({ query: "bugfix <component>", type: "observations" });
|
|
62
|
-
|
|
63
|
-
// Check recent handoffs
|
|
64
|
-
memory - search({ query: "handoff", type: "handoffs", limit: 3 });
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Why:** Past you already solved this. Don't rediscover.
|
|
68
|
-
|
|
69
|
-
### 2. Calibrate — Progressive Disclosure
|
|
70
|
-
|
|
71
|
-
Don't fetch full content until you know you need it.
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
// 1. Search returns compact index (50-100 tokens per result)
|
|
75
|
-
const results = memory - search({ query: "auth patterns" });
|
|
76
|
-
// Returns: [{id: 42, title: "Auth bug fixed", ...}]
|
|
77
|
-
|
|
78
|
-
// 2. Fetch full details ONLY for relevant IDs
|
|
79
|
-
memory - get({ ids: "42,45" });
|
|
80
|
-
|
|
81
|
-
// 3. See what led to this decision
|
|
82
|
-
memory - timeline({ anchor_id: 42, depth_before: 3 });
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Why:** Prevents context bloat. High signal, low noise.
|
|
86
|
-
|
|
87
|
-
### 3. Transform — Record Discoveries
|
|
88
|
-
|
|
89
|
-
Create observations for anything non-obvious. Don't wait until the end.
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
observation({
|
|
93
|
-
type: "pattern", // decision | bugfix | pattern | discovery | warning | learning
|
|
94
|
-
title: "Brief description",
|
|
95
|
-
narrative: "Context and reasoning...",
|
|
96
|
-
facts: "key, facts, here",
|
|
97
|
-
concepts: "searchable, keywords",
|
|
98
|
-
files_modified: "src/file.ts",
|
|
99
|
-
source: "manual", // manual (default) | curator | imported
|
|
100
|
-
});
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
| Type | Use When | Example |
|
|
104
|
-
| ----------- | -------------------------- | ---------------------------------- |
|
|
105
|
-
| `decision` | Architectural choice made | "Use zod over yup" |
|
|
106
|
-
| `bugfix` | Root cause found & fixed | "Race condition in async init" |
|
|
107
|
-
| `pattern` | Reusable code pattern | "Repository with error boundaries" |
|
|
108
|
-
| `discovery` | New capability learned | "Bun.test supports mocking" |
|
|
109
|
-
| `warning` | Dangerous pattern to avoid | "Don't use fs.watch in Docker" |
|
|
110
|
-
| `learning` | General insight | "Always validate at boundary" |
|
|
111
|
-
|
|
112
|
-
### 4. Reset — Handoff for Next Session
|
|
113
|
-
|
|
114
|
-
Document completion state for future you.
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
memory -
|
|
118
|
-
update({
|
|
119
|
-
file: "handoffs/YYYY-MM-DD-task",
|
|
120
|
-
content: `## Completed
|
|
121
|
-
- X
|
|
122
|
-
|
|
123
|
-
## Blockers
|
|
124
|
-
- Y
|
|
125
|
-
|
|
126
|
-
## Next
|
|
127
|
-
- Z`,
|
|
128
|
-
mode: "append",
|
|
129
|
-
});
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Memory Tools Reference
|
|
135
|
-
|
|
136
|
-
### memory-search (Start Here)
|
|
26
|
+
**Progressive disclosure**: search compactly, fetch fully only when relevant, then record high-signal observations.
|
|
137
27
|
|
|
138
|
-
|
|
28
|
+
## Session Workflow
|
|
139
29
|
|
|
140
|
-
|
|
141
|
-
memory
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
**
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
- `
|
|
152
|
-
- `all`: Search everything
|
|
153
|
-
|
|
154
|
-
### memory-get (Progressive Disclosure)
|
|
155
|
-
|
|
156
|
-
Fetch full observation details after identifying relevant IDs:
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
memory - get({ ids: "42" }); // Single observation
|
|
160
|
-
memory - get({ ids: "1,5,10" }); // Multiple observations
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### memory-timeline (Chronological Context)
|
|
164
|
-
|
|
165
|
-
See what happened before/after a specific observation:
|
|
166
|
-
|
|
167
|
-
```typescript
|
|
168
|
-
memory - timeline({ anchor_id: 42, depth_before: 5, depth_after: 5 });
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### memory-read (Files)
|
|
172
|
-
|
|
173
|
-
Load project files, handoffs, or templates:
|
|
174
|
-
|
|
175
|
-
```typescript
|
|
176
|
-
memory - read({ file: "project/gotchas" });
|
|
177
|
-
memory - read({ file: "handoffs/2024-01-20-phase-1" });
|
|
178
|
-
memory - read({ file: "research/auth-patterns" });
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### memory-update (Files)
|
|
182
|
-
|
|
183
|
-
Save to project files or handoffs:
|
|
184
|
-
|
|
185
|
-
```typescript
|
|
186
|
-
memory -
|
|
187
|
-
update({
|
|
188
|
-
file: "project/gotchas",
|
|
189
|
-
content: "### New Gotcha\n\nDescription...",
|
|
190
|
-
mode: "append", // or "replace"
|
|
191
|
-
});
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### memory-admin (Maintenance)
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
// Check current status (schema, FTS5, counts, DB size)
|
|
198
|
-
memory - admin({ operation: "status" });
|
|
199
|
-
|
|
200
|
-
// Full maintenance (archive >90 days, checkpoint WAL, vacuum)
|
|
201
|
-
memory - admin({ operation: "full" });
|
|
202
|
-
|
|
203
|
-
// Preview what would be archived
|
|
204
|
-
memory - admin({ operation: "archive", older_than_days: 60, dry_run: true });
|
|
205
|
-
|
|
206
|
-
// Capture pipeline stats (temporal messages, distillations, compression)
|
|
207
|
-
memory - admin({ operation: "capture-stats" });
|
|
208
|
-
|
|
209
|
-
// Force distillation for current session
|
|
210
|
-
memory - admin({ operation: "distill-now" });
|
|
211
|
-
|
|
212
|
-
// Force curator run (extract observations from distillations)
|
|
213
|
-
memory - admin({ operation: "curate-now" });
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
**Automatic:** On session idle — distillation, curation, FTS5 optimize, WAL checkpoint.
|
|
217
|
-
|
|
218
|
-
**Manual:** Run `memory-admin({ operation: "status" })` to check health.
|
|
219
|
-
|
|
220
|
-
---
|
|
30
|
+
1. **Ground (search first)**
|
|
31
|
+
- Run `memory-search` with task keywords before implementation.
|
|
32
|
+
- Check recent handoffs when resuming interrupted work.
|
|
33
|
+
2. **Calibrate (progressive disclosure)**
|
|
34
|
+
- Use search results as index.
|
|
35
|
+
- Fetch full entries only for relevant IDs (`memory-get`).
|
|
36
|
+
- Pull timeline context only when sequencing matters (`memory-timeline`).
|
|
37
|
+
3. **Record (high-signal only)**
|
|
38
|
+
- Create `observation` for decisions, bugfixes, patterns, warnings, or durable learnings.
|
|
39
|
+
- Include searchable concepts and concrete file references.
|
|
40
|
+
4. **Handoff (if session boundary)**
|
|
41
|
+
- Write a concise status note with completed work, blockers, and next steps using `memory-update` under `handoffs/`.
|
|
221
42
|
|
|
222
43
|
## What Goes Where
|
|
223
44
|
|
|
224
|
-
|
|
45
|
+
| Store | Put Here | Avoid Here |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `observation` (SQLite) | Events: decisions, bugfixes, reusable patterns, warnings | Temporary notes, speculative ideas without evidence |
|
|
48
|
+
| `memory-update` files | Durable docs: handoffs, research, project notes | Every minor runtime detail from a single debug run |
|
|
49
|
+
| Auto pipeline | Captured messages + distillations (automatic) | Manual copying of full transcripts |
|
|
225
50
|
|
|
226
|
-
|
|
227
|
-
- Searchable via FTS5 with porter stemming
|
|
228
|
-
- Created manually via `observation()` or automatically by curator
|
|
229
|
-
- Use `observation()` to create
|
|
51
|
+
## Observation Quality Bar
|
|
230
52
|
|
|
231
|
-
|
|
53
|
+
Use this checklist before creating an observation:
|
|
232
54
|
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
55
|
+
- Is it likely useful in a future session?
|
|
56
|
+
- Is it non-obvious (not already in code/comments)?
|
|
57
|
+
- Can I summarize it in one clear title + short narrative?
|
|
58
|
+
- Did I include strong search terms in `concepts` and relevant files?
|
|
237
59
|
|
|
238
|
-
|
|
60
|
+
If most answers are "no", skip creating the observation.
|
|
239
61
|
|
|
240
|
-
-
|
|
241
|
-
- Handoffs: session summaries
|
|
242
|
-
- Research: deep-dive documents
|
|
243
|
-
- Use `memory-read()` / `memory-update()`
|
|
62
|
+
## Anti-Patterns
|
|
244
63
|
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
|
|
|
250
|
-
| `
|
|
251
|
-
| `research/*.md` | Deep-dive analysis | `memory-update()` |
|
|
252
|
-
| SQLite observations | Events, decisions | `observation()` |
|
|
253
|
-
| SQLite distillations | Session summaries | Automatic (idle) or `distill-now` |
|
|
254
|
-
| SQLite temporal_messages | Raw captured text | Automatic (message events) |
|
|
64
|
+
| Anti-Pattern | Why It Fails | Instead |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| Storing transient debugging info as permanent observations | Pollutes search results with low-value noise | Keep transient info in session context; record only durable findings |
|
|
67
|
+
| Creating observations for every small finding (signal-to-noise) | Important items get buried and retrieval quality drops | Batch minor notes; publish one distilled observation per meaningful outcome |
|
|
68
|
+
| Not searching memory before creating duplicate observations | Produces conflicting/duplicated records | Run `memory-search` first; update/supersede existing records when appropriate |
|
|
69
|
+
| Using `memory-update` for data that should be an observation | Durable events become hard to discover and rank | Use `observation` for events; reserve `memory-update` for document-style files |
|
|
255
70
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
## Observations Schema
|
|
259
|
-
|
|
260
|
-
```typescript
|
|
261
|
-
observation({
|
|
262
|
-
type: "decision", // decision, bugfix, pattern, discovery, warning, learning
|
|
263
|
-
title: "Use JWT auth",
|
|
264
|
-
narrative: "Decided to use JWT because it's stateless...",
|
|
265
|
-
facts: "stateless, scalable, industry standard",
|
|
266
|
-
concepts: "auth, jwt, security",
|
|
267
|
-
confidence: "high", // high, medium, low
|
|
268
|
-
files_read: "src/auth.ts, src/middleware.ts",
|
|
269
|
-
files_modified: "src/auth.ts",
|
|
270
|
-
bead_id: "br-abc123", // Link to task (optional)
|
|
271
|
-
source: "manual", // manual (default), curator, imported
|
|
272
|
-
});
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Anti-Patterns (Don't Do This)
|
|
278
|
-
|
|
279
|
-
| ❌ Don't | ✅ Do Instead |
|
|
280
|
-
| ----------------------------------- | -------------------------------------- |
|
|
281
|
-
| Load full memory at session start | Use progressive disclosure |
|
|
282
|
-
| Create observations for everything | Only non-obvious decisions |
|
|
283
|
-
| Duplicate in files AND observations | Files = static, SQLite = events |
|
|
284
|
-
| Vague search queries | Use specific keywords, file paths |
|
|
285
|
-
| Subagents writing to memory | Only leader agents create observations |
|
|
286
|
-
| Wait until end to record | Create observations as you discover |
|
|
287
|
-
|
|
288
|
-
---
|
|
71
|
+
## Verification
|
|
289
72
|
|
|
290
|
-
|
|
73
|
+
After creating an observation: `memory-search` with relevant keywords should find it.
|
|
291
74
|
|
|
292
|
-
|
|
75
|
+
## Practical Defaults
|
|
293
76
|
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
77
|
+
- Prefer specific queries over broad ones (`"auth race condition init"` > `"auth"`).
|
|
78
|
+
- For ongoing work, append to one handoff file per task/day instead of many tiny files.
|
|
79
|
+
- Keep observation titles concrete and action-oriented.
|
|
297
80
|
|
|
298
|
-
|
|
81
|
+
## See Also
|
|
299
82
|
|
|
300
|
-
|
|
83
|
+
- `context-management`
|
|
84
|
+
- `session-management`
|
|
@@ -8,6 +8,8 @@ dependencies: []
|
|
|
8
8
|
|
|
9
9
|
# Mockup to Code Skill
|
|
10
10
|
|
|
11
|
+
> **Replaces** manual pixel-by-pixel CSS translation from designs — structured extraction of layout, colors, typography, and components from visual references
|
|
12
|
+
|
|
11
13
|
## When to Use
|
|
12
14
|
|
|
13
15
|
- Converting Figma/Sketch mockups to React/Vue/HTML
|
|
@@ -19,6 +21,12 @@ dependencies: []
|
|
|
19
21
|
|
|
20
22
|
- No visual reference or mockup to implement.
|
|
21
23
|
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
1. **Analyze** — Use vision agent to extract: layout structure, color palette, typography, spacing, components
|
|
27
|
+
2. **Map** — Match extracted elements to existing design tokens/components in the codebase
|
|
28
|
+
3. **Implement** — Build components using extracted specs, reusing existing tokens where possible
|
|
29
|
+
4. **Verify** — Screenshot the result and compare visually to the original mockup
|
|
22
30
|
|
|
23
31
|
## Core Workflow
|
|
24
32
|
|
|
@@ -156,14 +164,21 @@ Requirements:
|
|
|
156
164
|
- [ ] Uses tokens (no hardcoded values)
|
|
157
165
|
- [ ] Accessible markup
|
|
158
166
|
|
|
167
|
+
## Anti-Patterns
|
|
168
|
+
|
|
169
|
+
| Anti-Pattern | Why It Fails | Instead |
|
|
170
|
+
| ---------------------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
171
|
+
| Hardcoding colors/sizes instead of using design tokens | Creates inconsistency and makes global updates expensive | Map values to existing tokens first; add new tokens only when truly new |
|
|
172
|
+
| Building from scratch when existing components cover 80% of the design | Reintroduces solved problems and increases maintenance cost | Compose and extend existing components, then patch gaps |
|
|
173
|
+
| Pixel-perfect matching without responsive considerations | Breaks on different viewport sizes and device classes | Match intent at multiple breakpoints and validate mobile/tablet/desktop |
|
|
174
|
+
| Not extracting reusable components from repeated patterns | Duplicates code and drifts visual behavior over time | Promote repeated UI blocks into reusable components with variants |
|
|
175
|
+
|
|
159
176
|
## Storage
|
|
160
177
|
|
|
161
178
|
Save implementations to `.opencode/memory/design/implementations/`
|
|
162
179
|
|
|
163
|
-
##
|
|
180
|
+
## See Also
|
|
164
181
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
| Accessibility | `accessibility-audit` |
|
|
169
|
-
| Design tokens | `design-system-audit` |
|
|
182
|
+
- `frontend-design`
|
|
183
|
+
- `visual-analysis`
|
|
184
|
+
- `accessibility-audit`
|
|
@@ -8,6 +8,8 @@ dependencies: []
|
|
|
8
8
|
|
|
9
9
|
# Code Review Reception
|
|
10
10
|
|
|
11
|
+
> **Replaces** blind agreement with reviewer suggestions — requires technical verification and understanding before implementing any feedback
|
|
12
|
+
|
|
11
13
|
## When to Use
|
|
12
14
|
|
|
13
15
|
- You received review feedback and need to evaluate it before implementing
|
|
@@ -242,3 +244,9 @@ You understand 1,2,3,6. Unclear on 4,5.
|
|
|
242
244
|
Verify. Question. Then implement.
|
|
243
245
|
|
|
244
246
|
No performative agreement. Technical rigor always.
|
|
247
|
+
|
|
248
|
+
## See Also
|
|
249
|
+
|
|
250
|
+
- **requesting-code-review** — the complementary skill for dispatching reviews
|
|
251
|
+
- **verification-before-completion** — verification after implementing review feedback
|
|
252
|
+
- **systematic-debugging** — when review feedback reveals a deeper issue
|
|
@@ -8,6 +8,8 @@ dependencies: []
|
|
|
8
8
|
|
|
9
9
|
# Root Cause Tracing
|
|
10
10
|
|
|
11
|
+
> **Replaces** ad-hoc print-statement debugging and "try random fixes until it works" approaches
|
|
12
|
+
|
|
11
13
|
## When to Use
|
|
12
14
|
|
|
13
15
|
- Errors occur deep in a call stack and the immediate failure is just a symptom
|
|
@@ -18,6 +20,15 @@ dependencies: []
|
|
|
18
20
|
- The error is at the entry point and the root cause is obvious
|
|
19
21
|
- You’re doing feature work with no failures to trace
|
|
20
22
|
|
|
23
|
+
## Anti-Patterns
|
|
24
|
+
|
|
25
|
+
| Anti-Pattern | Why It Fails | Instead |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Fixing symptoms where error appears | Hides origin; bug returns via other paths | Trace backward until original trigger is found |
|
|
28
|
+
| Skipping stack trace analysis | Misses the real caller and bad input source | Read full stack, file paths, and line numbers first |
|
|
29
|
+
| Adding instrumentation without hypothesis | Produces noisy logs and slows investigation | Instrument one boundary at a time to answer a specific question |
|
|
30
|
+
| Guessing the cause without evidence | Leads to random fixes and regressions | Form evidence-backed hypothesis, then test |
|
|
31
|
+
|
|
21
32
|
## Overview
|
|
22
33
|
|
|
23
34
|
Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom.
|
|
@@ -175,3 +186,7 @@ From debugging session (2025-10-03):
|
|
|
175
186
|
- Fixed at source (getter validation)
|
|
176
187
|
- Added 4 layers of defense
|
|
177
188
|
- 1847 tests passed, zero pollution
|
|
189
|
+
|
|
190
|
+
## See Also
|
|
191
|
+
|
|
192
|
+
- **systematic-debugging** - Full four-phase process before/after tracing deep stack failures
|
|
@@ -1,108 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
description: Use when context is growing large, switching tasks, or needing previous session context - covers thresholds, session tools, and workflow patterns
|
|
4
|
-
version: 1.0.0
|
|
5
|
-
tags: [context, workflow]
|
|
6
|
-
dependencies: []
|
|
2
|
+
description: "Merged into context-management. Load that skill instead."
|
|
7
3
|
---
|
|
8
4
|
|
|
9
5
|
# Session Management
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## When NOT to Use
|
|
16
|
-
|
|
17
|
-
- Single, short tasks that don't require session transitions.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Context Thresholds
|
|
21
|
-
|
|
22
|
-
The environment monitors context usage and warns at these thresholds:
|
|
23
|
-
|
|
24
|
-
| Threshold | Action |
|
|
25
|
-
| --------- | ---------------------------------------------------------- |
|
|
26
|
-
| **70%** | Consolidate work; consider pruning irrelevant tool outputs |
|
|
27
|
-
| **85%** | Summarize findings and consider starting a new session |
|
|
28
|
-
| **95%** | Critical: prune context immediately or restart session |
|
|
29
|
-
|
|
30
|
-
## Session Tools
|
|
31
|
-
|
|
32
|
-
### find_sessions
|
|
33
|
-
|
|
34
|
-
Search and discover sessions by keyword. Returns ranked results with match counts and snippets.
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
find_sessions({ query: "auth bug", limit: 5 }); // Search by keyword
|
|
38
|
-
find_sessions({ query: "refactor" }); // Default limit
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Parameters:**
|
|
42
|
-
|
|
43
|
-
- `query` (required): Search keywords — multi-word queries use AND matching
|
|
44
|
-
- `limit` (optional): Max results to return
|
|
45
|
-
|
|
46
|
-
**Returns:** Ranked sessions with match count, snippets, and suggested next steps.
|
|
47
|
-
|
|
48
|
-
### read_session
|
|
49
|
-
|
|
50
|
-
Read messages from a specific session. Supports optional focus filtering.
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
read_session({ session_id: "ses_abc123" }); // Full session
|
|
54
|
-
read_session({ session_id: "ses_abc123", focus: "auth" }); // Filter to relevant messages
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**Parameters:**
|
|
58
|
-
|
|
59
|
-
- `session_id` (required): Session ID from find_sessions results
|
|
60
|
-
- `focus` (optional): Keyword to filter messages within the session
|
|
61
|
-
|
|
62
|
-
## When to Start New Session
|
|
63
|
-
|
|
64
|
-
- Completing distinct task from `br ready`
|
|
65
|
-
- Token usage approaching 150k
|
|
66
|
-
- Switching phases (implementation → review → testing)
|
|
67
|
-
- After handoff (`/handoff <bead-id>`)
|
|
68
|
-
|
|
69
|
-
## Session Workflow Pattern
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
Session 1: Implement feature X (80k tokens)
|
|
73
|
-
↓ close, update memory
|
|
74
|
-
Session 2: find_sessions({ query: "feature X" }) → read_session(...) → Refactor (60k tokens)
|
|
75
|
-
↓
|
|
76
|
-
Session 3: find_sessions({ query: "feature X" }) → Add tests (90k tokens)
|
|
77
|
-
↓
|
|
78
|
-
Session 4: read_session(...) → Final review (100k tokens)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**Result**: 4 fresh contexts vs 1 degraded 330k context. Better performance, lower cost.
|
|
82
|
-
|
|
83
|
-
## Context Transfer
|
|
84
|
-
|
|
85
|
-
Use all available sources:
|
|
86
|
-
|
|
87
|
-
1. `find_sessions` + `read_session` — Previous session work
|
|
88
|
-
2. Git state — `git diff`, `git log` — Code changes
|
|
89
|
-
3. Memory files — `.opencode/memory/*` — Persistent context
|
|
90
|
-
4. Beads — `br show <id>` — Task specs
|
|
91
|
-
|
|
92
|
-
**Don't**: Carry everything forward. Extract what's needed, discard the rest.
|
|
93
|
-
|
|
94
|
-
## Pruning Strategy
|
|
95
|
-
|
|
96
|
-
When context grows large:
|
|
97
|
-
|
|
98
|
-
1. **Discard** completed task outputs (read files you won't edit again)
|
|
99
|
-
2. **Extract** key findings before discarding research
|
|
100
|
-
3. **Summarize** complex investigations into memory files
|
|
101
|
-
4. **Restart** session if above 85% and work is at a natural break
|
|
102
|
-
|
|
103
|
-
## Anti-Patterns
|
|
104
|
-
|
|
105
|
-
- ❌ Running until context limit forces restart
|
|
106
|
-
- ❌ Carrying all previous reads forward "just in case"
|
|
107
|
-
- ❌ Not using memory files for cross-session persistence
|
|
108
|
-
- ❌ Re-reading the same files every session instead of extracting key info
|
|
7
|
+
> This skill has been merged into `context-management` which now covers both context and session lifecycle management.
|
|
8
|
+
>
|
|
9
|
+
> Load `context-management` instead.
|
|
@@ -8,6 +8,8 @@ dependencies: [executing-plans]
|
|
|
8
8
|
|
|
9
9
|
# Subagent-Driven Development
|
|
10
10
|
|
|
11
|
+
> **Replaces** monolithic single-agent implementation sessions that grow stale — dispatches fresh subagents per task with code review gates between them
|
|
12
|
+
|
|
11
13
|
## When to Use
|
|
12
14
|
|
|
13
15
|
- Executing a plan with mostly independent tasks in the same session
|
|
@@ -18,8 +20,6 @@ dependencies: [executing-plans]
|
|
|
18
20
|
- The plan requires review or revisions first (use executing-plans)
|
|
19
21
|
- Tasks are tightly coupled and need manual sequencing
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
23
|
## Overview
|
|
24
24
|
|
|
25
25
|
**vs. Executing Plans (parallel session):**
|
|
@@ -189,6 +189,21 @@ Done!
|
|
|
189
189
|
- Dispatch fix subagent with specific instructions
|
|
190
190
|
- Don't try to fix manually (context pollution)
|
|
191
191
|
|
|
192
|
+
## Anti-Patterns
|
|
193
|
+
|
|
194
|
+
| Anti-Pattern | Why It Fails | Instead |
|
|
195
|
+
| --- | --- | --- |
|
|
196
|
+
| Dispatching subagents for tasks with shared state/files | Creates edit conflicts, race conditions, and unclear ownership | Keep shared-state work sequential under one subagent at a time |
|
|
197
|
+
| Skipping code review between subagent tasks | Lets defects accumulate and compounds later fixes | Run a review gate after each task before moving on |
|
|
198
|
+
| Giving subagents vague prompts without file paths or acceptance criteria | Produces off-target changes and repeated back-and-forth | Provide exact file paths, task scope, and acceptance criteria |
|
|
199
|
+
| Not verifying subagent output before moving to next task | Carries regressions forward into later tasks | Validate output immediately before starting the next task |
|
|
200
|
+
|
|
201
|
+
## Verification
|
|
202
|
+
|
|
203
|
+
- After each subagent completes: review its changes, run typecheck + lint on modified files
|
|
204
|
+
- After all tasks: run full test suite to catch integration issues
|
|
205
|
+
- Check: no conflicting edits between subagent outputs
|
|
206
|
+
|
|
192
207
|
## Integration
|
|
193
208
|
|
|
194
209
|
**Required workflow skills:**
|
|
@@ -207,3 +222,9 @@ Done!
|
|
|
207
222
|
|
|
208
223
|
See review template: requesting-code-review/review.md
|
|
209
224
|
```
|
|
225
|
+
|
|
226
|
+
## See Also
|
|
227
|
+
|
|
228
|
+
- **dispatching-parallel-agents** — for parallel investigation
|
|
229
|
+
- **executing-plans** — for batch execution with checkpoints
|
|
230
|
+
- **requesting-code-review** — for review between subagent tasks
|
|
@@ -13,6 +13,8 @@ dependencies: [beads-bridge]
|
|
|
13
13
|
|
|
14
14
|
# Swarm Coordination - Kimi K2.5 PARL Multi-Agent Execution
|
|
15
15
|
|
|
16
|
+
> **Replaces** manual task-by-task execution of large plans — sequential bottleneck when tasks have no dependencies
|
|
17
|
+
|
|
16
18
|
## When to Use
|
|
17
19
|
|
|
18
20
|
- Implementing plans with 3+ independent tasks that can run in parallel
|
|
@@ -23,7 +25,6 @@ dependencies: [beads-bridge]
|
|
|
23
25
|
- Single-task or tightly sequential work without parallelizable groups
|
|
24
26
|
- Simple 1–2 file changes better handled by a single agent
|
|
25
27
|
|
|
26
|
-
|
|
27
28
|
## Overview
|
|
28
29
|
|
|
29
30
|
**Swarm = Leader + Workers + Reconciler + Progress Tracking + Todo Persistence**
|
|
@@ -150,6 +151,15 @@ SHUTDOWN:
|
|
|
150
151
|
10. **Use reconciler at scale** - Required for 50+ agents, recommended for 10+
|
|
151
152
|
11. **Reconciler watches continuously** - Spawns fix tasks on detected failures
|
|
152
153
|
|
|
154
|
+
## Anti-Patterns
|
|
155
|
+
|
|
156
|
+
| Anti-Pattern | Why It Fails | Instead |
|
|
157
|
+
| ------------------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
158
|
+
| Spawning agents for tasks with shared file dependencies | Workers block or overwrite each other, causing merge churn | Partition work by non-overlapping files/modules first |
|
|
159
|
+
| Not tracking agent completion status | Leader loses visibility; work appears done when it is not | Require `monitor.progress_update` lifecycle (start/progress/done) |
|
|
160
|
+
| Dispatching without pre-computed dependency graph | Tasks run out of order, causing rework and serial fallback | Run `swarm plan` first and dispatch by `parallelizable_groups` |
|
|
161
|
+
| Using swarm for < 3 tasks (overhead not worth it) | Coordination overhead exceeds execution savings | Use a single agent or 2 direct `Task()` calls |
|
|
162
|
+
|
|
153
163
|
## References
|
|
154
164
|
|
|
155
165
|
- `references/architecture.md` - Swarm architecture diagram
|
|
@@ -161,3 +171,9 @@ SHUTDOWN:
|
|
|
161
171
|
- `references/integration-beads.md` - Swarm integration workflow with Beads
|
|
162
172
|
- `references/tmux-integration.md` - Tmux monitoring setup and commands
|
|
163
173
|
- `references/tier-enforcement.md` - Tier enforcement (Longshot pattern)
|
|
174
|
+
|
|
175
|
+
## See Also
|
|
176
|
+
|
|
177
|
+
- `agent-teams` — for coordinated multi-role collaboration beyond large plan execution
|
|
178
|
+
- `dispatching-parallel-agents` — for lightweight parallel debugging of independent failures
|
|
179
|
+
- `executing-plans` — for plan-driven execution when parallelism is moderate or bounded
|