opencodekit 0.18.3 → 0.18.5

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 (44) hide show
  1. package/dist/index.js +407 -17
  2. package/dist/template/.opencode/.version +1 -1
  3. package/dist/template/.opencode/AGENTS.md +13 -1
  4. package/dist/template/.opencode/agent/build.md +4 -1
  5. package/dist/template/.opencode/agent/explore.md +5 -35
  6. package/dist/template/.opencode/command/verify.md +63 -12
  7. package/dist/template/.opencode/memory/research/benchmark-framework.md +162 -0
  8. package/dist/template/.opencode/memory/research/effectiveness-audit.md +213 -0
  9. package/dist/template/.opencode/memory.db +0 -0
  10. package/dist/template/.opencode/memory.db-shm +0 -0
  11. package/dist/template/.opencode/memory.db-wal +0 -0
  12. package/dist/template/.opencode/opencode.json +1429 -1678
  13. package/dist/template/.opencode/package.json +1 -1
  14. package/dist/template/.opencode/plugin/lib/memory-helpers.ts +3 -129
  15. package/dist/template/.opencode/plugin/lib/memory-hooks.ts +4 -60
  16. package/dist/template/.opencode/plugin/memory.ts +0 -3
  17. package/dist/template/.opencode/skill/agent-teams/SKILL.md +16 -1
  18. package/dist/template/.opencode/skill/beads/SKILL.md +22 -0
  19. package/dist/template/.opencode/skill/brainstorming/SKILL.md +28 -0
  20. package/dist/template/.opencode/skill/code-navigation/SKILL.md +130 -0
  21. package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +12 -0
  22. package/dist/template/.opencode/skill/context-management/SKILL.md +122 -113
  23. package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +20 -0
  24. package/dist/template/.opencode/skill/design-system-audit/SKILL.md +113 -112
  25. package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +8 -0
  26. package/dist/template/.opencode/skill/executing-plans/SKILL.md +7 -0
  27. package/dist/template/.opencode/skill/memory-system/SKILL.md +50 -266
  28. package/dist/template/.opencode/skill/mockup-to-code/SKILL.md +21 -6
  29. package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +8 -0
  30. package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +242 -105
  31. package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +15 -0
  32. package/dist/template/.opencode/skill/session-management/SKILL.md +4 -103
  33. package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +23 -2
  34. package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +17 -1
  35. package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +21 -0
  36. package/dist/template/.opencode/skill/tool-priority/SKILL.md +34 -16
  37. package/dist/template/.opencode/skill/ui-ux-research/SKILL.md +5 -127
  38. package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +36 -0
  39. package/dist/template/.opencode/skill/verification-before-completion/references/VERIFICATION_PROTOCOL.md +133 -29
  40. package/dist/template/.opencode/skill/visual-analysis/SKILL.md +20 -7
  41. package/dist/template/.opencode/skill/writing-plans/SKILL.md +7 -0
  42. package/dist/template/.opencode/tool/context7.ts +9 -1
  43. package/dist/template/.opencode/tool/grepsearch.ts +9 -1
  44. 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.0.0
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 to recall prior decisions, bugs, or patterns
14
- - Recording non-obvious learnings or decisions for future sessions
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
- - For ephemeral notes that won't matter beyond the current session
19
- - When you need to change actual markdown files (use read/write), not SQLite memory entries
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** search compactly, fetch fully, timeline chronologically. Never load all memory at once.
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
- Fast FTS5 full-text search with porter stemming. Returns **compact index** for progressive disclosure.
28
+ ## Session Workflow
139
29
 
140
- ```typescript
141
- memory - search({ query: "authentication" });
142
- memory - search({ query: "bugfix", type: "observations", limit: 5 });
143
- memory - search({ query: "session", type: "handoffs" });
144
- memory - search({ query: "patterns", type: "all" }); // Search everything
145
- ```
146
-
147
- **Search modes:**
148
-
149
- - `observations` (default): Search SQLite with FTS5 BM25 ranking
150
- - `handoffs`, `research`, `templates`: Search specific directories
151
- - `beads`: Search .beads/artifacts
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
- ### SQLite (observations)
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
- - Events: decisions, bugfixes, patterns discovered
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
- ### SQLite (distillations automatic)
53
+ Use this checklist before creating an observation:
232
54
 
233
- - Compressed session summaries with TF-IDF terms
234
- - Created automatically when 10+ messages accumulate
235
- - Searchable via FTS5
236
- - Used for relevance-scored LTM injection
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
- ### Markdown Files
60
+ If most answers are "no", skip creating the observation.
239
61
 
240
- - Static knowledge: user preferences, tech stack
241
- - Handoffs: session summaries
242
- - Research: deep-dive documents
243
- - Use `memory-read()` / `memory-update()`
62
+ ## Anti-Patterns
244
63
 
245
- | Location | Content | Tool |
246
- | -------------------------- | -------------------------- | ----------------------------------- |
247
- | `project/user.md` | User identity, preferences | `memory-read()` |
248
- | `project/tech-stack.md` | Frameworks, constraints | `memory-read()` |
249
- | `project/gotchas.md` | Footguns, warnings | `memory-update({ mode: "append" })` |
250
- | `handoffs/YYYY-MM-DD-*.md` | Session summaries | `memory-update()` |
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
- ## Philosophy
73
+ After creating an observation: `memory-search` with relevant keywords should find it.
291
74
 
292
- **Memory is not a dumping ground. It's curated signal.**
75
+ ## Practical Defaults
293
76
 
294
- - Search before you build
295
- - Record what you learned
296
- - Hand off to future you
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
- > "The body is architecture. The breath is wiring. The rhythm is survival."
81
+ ## See Also
299
82
 
300
- Memory is rhythm — it carries knowledge across the silence between sessions.
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
- ## Related Skills
180
+ ## See Also
164
181
 
165
- | Need | Skill |
166
- | ----------------- | --------------------- |
167
- | Aesthetic quality | `frontend-design` |
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