opencodekit 0.16.0 → 0.16.1

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 (119) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +64 -3
  3. package/dist/template/.opencode/command/create.md +34 -0
  4. package/dist/template/.opencode/command/design.md +35 -0
  5. package/dist/template/.opencode/command/handoff.md +15 -0
  6. package/dist/template/.opencode/command/init.md +40 -47
  7. package/dist/template/.opencode/command/plan.md +1 -0
  8. package/dist/template/.opencode/command/pr.md +15 -0
  9. package/dist/template/.opencode/command/research.md +3 -0
  10. package/dist/template/.opencode/command/resume.md +1 -0
  11. package/dist/template/.opencode/command/review-codebase.md +30 -0
  12. package/dist/template/.opencode/command/ship.md +43 -0
  13. package/dist/template/.opencode/command/start.md +1 -0
  14. package/dist/template/.opencode/command/status.md +24 -1
  15. package/dist/template/.opencode/command/ui-review.md +31 -0
  16. package/dist/template/.opencode/command/verify.md +35 -7
  17. package/dist/template/.opencode/memory/project/tech-stack.md +25 -22
  18. package/dist/template/.opencode/memory.db +0 -0
  19. package/dist/template/.opencode/memory.db-shm +0 -0
  20. package/dist/template/.opencode/memory.db-wal +0 -0
  21. package/dist/template/.opencode/opencode.json +817 -916
  22. package/dist/template/.opencode/package.json +1 -0
  23. package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +418 -0
  24. package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +170 -0
  25. package/dist/template/.opencode/plans/1770013678126-witty-planet.md +278 -0
  26. package/dist/template/.opencode/plugin/lib/memory-db.ts +828 -0
  27. package/dist/template/.opencode/plugin/memory.ts +38 -1
  28. package/dist/template/.opencode/skill/index-knowledge/SKILL.md +76 -31
  29. package/dist/template/.opencode/skill/memory-system/SKILL.md +110 -55
  30. package/dist/template/.opencode/tool/memory-get.ts +143 -0
  31. package/dist/template/.opencode/tool/memory-maintain.ts +167 -0
  32. package/dist/template/.opencode/tool/memory-migrate.ts +319 -0
  33. package/dist/template/.opencode/tool/memory-read.ts +17 -46
  34. package/dist/template/.opencode/tool/memory-search.ts +131 -28
  35. package/dist/template/.opencode/tool/memory-timeline.ts +105 -0
  36. package/dist/template/.opencode/tool/memory-update.ts +21 -26
  37. package/dist/template/.opencode/tool/observation.ts +112 -100
  38. package/dist/template/.opencode/tsconfig.json +19 -19
  39. package/package.json +1 -1
  40. package/dist/template/.opencode/memory/_templates/README.md +0 -73
  41. package/dist/template/.opencode/memory/_templates/observation.md +0 -39
  42. package/dist/template/.opencode/memory/_templates/prompt-engineering.md +0 -333
  43. package/dist/template/.opencode/memory/observations/2026-01-22-decision-agents-md-prompt-engineering-improvement.md +0 -29
  44. package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +0 -14
  45. package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +0 -20
  46. package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +0 -14
  47. package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +0 -15
  48. package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +0 -29
  49. package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +0 -21
  50. package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +0 -32
  51. package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +0 -42
  52. package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +0 -32
  53. package/dist/template/.opencode/memory/observations/2026-01-29-decision-copilot-auth-plugin-rate-limit-handling.md +0 -27
  54. package/dist/template/.opencode/memory/observations/2026-01-29-decision-spec-driven-approach-for-opencodekit.md +0 -21
  55. package/dist/template/.opencode/memory/observations/2026-01-29-learning-karpathy-llm-coding-insights-dec-2025.md +0 -44
  56. package/dist/template/.opencode/memory/observations/2026-01-30-decision-github-copilot-claude-routing-keep-disab.md +0 -32
  57. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-context-management-research-critical-gap.md +0 -14
  58. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-kimi-k2-5-agent-swarm-architecture-patte.md +0 -45
  59. package/dist/template/.opencode/memory/observations/2026-01-30-pattern-swarm-tools-architecture.md +0 -28
  60. package/dist/template/.opencode/memory/observations/2026-01-31-decision-copilot-auth-plugin-updated-with-baseurl.md +0 -63
  61. package/dist/template/.opencode/memory/observations/2026-01-31-decision-created-dedicated-worker-agent-for-swarm.md +0 -20
  62. package/dist/template/.opencode/memory/observations/2026-01-31-decision-rollback-to-v1-1-47-for-copilot-claude-r.md +0 -21
  63. package/dist/template/.opencode/memory/observations/2026-01-31-decision-simplified-swarm-to-task-tool-pattern.md +0 -44
  64. package/dist/template/.opencode/memory/observations/2026-01-31-decision-swarm-architecture-task-tool-over-tmux.md +0 -33
  65. package/dist/template/.opencode/memory/observations/2026-01-31-decision-worker-skills-defined-for-swarm-delegati.md +0 -30
  66. package/dist/template/.opencode/memory/observations/2026-01-31-learning-gpt-reasoning-config-for-github-copilot.md +0 -51
  67. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-auth-comparison-finding.md +0 -61
  68. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-reasoning-architecture-.md +0 -66
  69. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-custom-tools-api.md +0 -48
  70. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-v1-1-48-skills-as-slash-command.md +0 -21
  71. package/dist/template/.opencode/memory/observations/2026-01-31-learning-swarm-system-simplified-removed-mailbox-.md +0 -30
  72. package/dist/template/.opencode/memory/observations/2026-01-31-learning-v1-1-48-native-copilot-reasoning-via-pr-.md +0 -45
  73. package/dist/template/.opencode/memory/observations/2026-01-31-warning-cannot-add-custom-config-to-opencode-jso.md +0 -18
  74. package/dist/template/.opencode/memory/observations/2026-01-31-warning-copilot-claude-v1-endpoint-returns-404-c.md +0 -48
  75. package/dist/template/.opencode/memory/observations/2026-01-31-warning-opencode-v1-1-48-claude-thinking-block-s.md +0 -51
  76. package/dist/template/.opencode/memory/observations/2026-02-01-decision-add-skills-vs-commands-to-global-agents-.md +0 -15
  77. package/dist/template/.opencode/memory/observations/2026-02-01-decision-build-agent-auto-loads-skills-contextual.md +0 -31
  78. package/dist/template/.opencode/memory/observations/2026-02-01-decision-fixed-agent-configuration-for-opencodeki.md +0 -25
  79. package/dist/template/.opencode/memory/observations/2026-02-01-decision-focused-agents-md-upgrade-for-opencode-k.md +0 -14
  80. package/dist/template/.opencode/memory/observations/2026-02-01-decision-implement-tier-1-permission-upgrades.md +0 -15
  81. package/dist/template/.opencode/memory/observations/2026-02-01-decision-instructions-config-explicit-paths-not-w.md +0 -40
  82. package/dist/template/.opencode/memory/observations/2026-02-01-decision-merged-context-into-memory-project-singl.md +0 -42
  83. package/dist/template/.opencode/memory/observations/2026-02-01-decision-oracle-tool-should-use-review-agent-not-.md +0 -14
  84. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-agent-auto-loads-skills-contextuall.md +0 -31
  85. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-phased-oracle-command-merge-into-ne.md +0 -14
  86. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prd-workflow-uses-prd-and-prd-task-skill.md +0 -23
  87. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prefer-review-agent-via-opencode-cli-ove.md +0 -14
  88. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-add-ship-command-with.md +0 -14
  89. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command-.md +0 -14
  90. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command.md +0 -14
  91. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-skills-vs-commands-section-from-a.md +0 -14
  92. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-tool-with-ship-command-fl.md +0 -14
  93. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-with-ship-command-workflo.md +0 -14
  94. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-proxypal-oracle-with-cli-review-.md +0 -14
  95. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-dist-template-only-tech-stack.md +0 -50
  96. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-templates-only-tech-stack-md.md +0 -26
  97. package/dist/template/.opencode/memory/observations/2026-02-01-decision-subagents-load-minimal-skills-stay-lean.md +0 -29
  98. package/dist/template/.opencode/memory/observations/2026-02-01-decision-user-approved-permission-upgrades-in-ope.md +0 -15
  99. package/dist/template/.opencode/memory/observations/2026-02-01-discovery-verify-command-already-implemented.md +0 -28
  100. package/dist/template/.opencode/memory/observations/2026-02-01-feature-openspec-phase-b-complete-template-upgra.md +0 -43
  101. package/dist/template/.opencode/memory/observations/2026-02-01-learning-build-agent-should-use-dynamic-lsp-not-f.md +0 -14
  102. package/dist/template/.opencode/memory/observations/2026-02-01-learning-kimi-k2-5-model-requires-temperature-1-0.md +0 -22
  103. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-already-imple.md +0 -27
  104. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-uses-instruct.md +0 -35
  105. package/dist/template/.opencode/memory/observations/2026-02-01-learning-update-build-agent-prompt-to-use-context.md +0 -14
  106. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-using-opencode-expert-.md +0 -14
  107. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-g.md +0 -14
  108. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-r.md +0 -14
  109. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-prefers-copilot-gpt-5-2-codex-mediu.md +0 -14
  110. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-contextu.md +0 -15
  111. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-reviewed.md +0 -15
  112. package/dist/template/.opencode/memory/project/architecture.md +0 -60
  113. package/dist/template/.opencode/memory/project/command-rules.md +0 -122
  114. package/dist/template/.opencode/memory/project/commands.md +0 -72
  115. package/dist/template/.opencode/memory/project/conventions.md +0 -68
  116. package/dist/template/.opencode/memory/project/gotchas.md +0 -41
  117. /package/dist/template/.opencode/memory/_templates/{project/tech-stack.md → tech-stack.md} +0 -0
  118. /package/dist/template/.opencode/memory/{user.example.md → _templates/user.md} +0 -0
  119. /package/dist/template/.opencode/memory/{user.md → project/user.md} +0 -0
package/dist/index.js CHANGED
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
750
750
  // package.json
751
751
  var package_default = {
752
752
  name: "opencodekit",
753
- version: "0.16.0",
753
+ version: "0.16.1",
754
754
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
755
755
  keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
756
756
  license: "MIT",
@@ -219,17 +219,51 @@ Chain: grep → read → LSP(9) → memory → understand → edit
219
219
 
220
220
  **DO NOT proceed without checking memory proactively.** Memory is your external brain. Use it before you start work, not just when someone asks you to.
221
221
 
222
+ ### Memory Architecture
223
+
224
+ The memory system uses **SQLite + FTS5** as the single source of truth:
225
+
226
+ ```
227
+ Write: observation() → SQLite only
228
+ memory-update() → SQLite only
229
+
230
+ Read: memory-search() → FTS5 full-text search (BM25 ranking)
231
+ memory-get() → Full observation details by ID
232
+ memory-read() → SQLite only
233
+ memory-timeline() → Chronological context around anchor
234
+ ```
235
+
222
236
  ### The Three Actions
223
237
 
224
- First, DO NOT start any significant work without checking memory. Run `memory-search` to find relevant context about the project, the user's preferences, and past decisions. Run `memory-read` for active files that contain information you need to remember. Checking memory before starting prevents you from forgetting important context that affects your work.
238
+ First, DO NOT start any significant work without checking memory. Run `memory-search` to find relevant context using FTS5 full-text search. The search returns a **compact index** (50-100 tokens per result) for progressive disclosure. If you need full details, use `memory-get` with the observation ID.
225
239
 
226
- Second, DO NOT skip saving your own learnings. When you make decisions, discover patterns, or encounter gotchas, use the `observation` tool to save them immediately. Capture the insight before you forget it. What you don't write down, you will lose.
240
+ Second, DO NOT skip saving your own learnings. When you make decisions, discover patterns, or encounter gotchas, use the `observation` tool to save them immediately. Use the enhanced schema:
241
+
242
+ ```typescript
243
+ observation({
244
+ type: "decision", // decision, bugfix, feature, pattern, discovery, learning, warning
245
+ title: "Use JWT for auth",
246
+ narrative: "Why this decision was made...",
247
+ facts: "stateless, scalable", // Key facts (comma-separated)
248
+ concepts: "auth, jwt, security", // Keywords for search
249
+ confidence: "high", // high, medium, low
250
+ });
251
+ ```
227
252
 
228
253
  Third, DO NOT ignore LSP nudges. If the system suggests running an LSP operation and you see that nudge, execute it immediately. Don't defer it and don't skip it. Nudges exist because something needs attention.
229
254
 
230
255
  ### Memory-start protocol
231
256
 
232
- At the start of any significant task, complete these three steps in order. First, run `memory-search` with relevant keywords to find context. Second, run `memory-read` on project files that might be relevant. Third, run `memory-read` on user preference files to remember what the user wants. Only after completing these steps should you proceed with the actual work.
257
+ At the start of any significant task, complete these three steps in order. First, run `memory-search` with relevant keywords to find context (returns compact index). Second, run `memory-get` for any observations you need full details on. Third, run `memory-read` for handoffs, research, or template files. Only after completing these steps should you proceed with the actual work.
258
+
259
+ ### Progressive Disclosure Pattern
260
+
261
+ Memory search intentionally returns **compact results** (50-100 tokens each) to avoid context bloat. Follow this pattern:
262
+
263
+ 1. `memory-search({ query: "auth" })` → Get compact index
264
+ 2. Identify relevant observation IDs from index
265
+ 3. `memory-get({ ids: "42,45" })` → Fetch full details only for what you need
266
+ 4. `memory-timeline({ anchor_id: 42 })` → See chronological context if needed
233
267
 
234
268
  ### Atomic Version
235
269
 
@@ -237,8 +271,35 @@ At the start of any significant task, complete these three steps in order. First
237
271
  DO NOT start without memory-search.
238
272
  DO NOT skip observation on decisions.
239
273
  DO NOT ignore LSP Nudges.
274
+
275
+ Pattern: search → identify IDs → get details → proceed
276
+ ```
277
+
278
+ ### Memory Maintenance
279
+
280
+ For long-term storage health, use `memory-maintain` periodically:
281
+
282
+ ```bash
283
+ # Check current status
284
+ memory-maintain({ operation: "status" })
285
+
286
+ # Full maintenance (archive >90 days, checkpoint WAL, vacuum)
287
+ memory-maintain({ operation: "full" })
288
+
289
+ # Preview what would be archived
290
+ memory-maintain({ operation: "archive", older_than_days: 60, dry_run: true })
240
291
  ```
241
292
 
293
+ **Automatic maintenance** runs at session end:
294
+
295
+ - FTS5 index optimization
296
+ - WAL checkpoint (if WAL > 1MB)
297
+
298
+ **Manual maintenance** (run monthly or when storage grows):
299
+
300
+ - `archive`: Move old observations to archive table
301
+ - `vacuum`: Defragment and reclaim space
302
+
242
303
  ---
243
304
 
244
305
  ## Beads (Task Tracking)
@@ -22,8 +22,27 @@ Create structured artifacts for a bead using templates. This is the first step b
22
22
  ```typescript
23
23
  skill({ name: "beads" });
24
24
  skill({ name: "brainstorming" });
25
+ skill({ name: "memory-system" });
25
26
  ```
26
27
 
28
+ ## Check Memory First
29
+
30
+ Search for similar specs and patterns before creating:
31
+
32
+ ```typescript
33
+ // Find similar past specs
34
+ memory_search({ query: "[bead title/description]", limit: 3 });
35
+
36
+ // Find related patterns and conventions
37
+ memory_search({ query: "[domain keywords] spec requirements", limit: 3 });
38
+ ```
39
+
40
+ Review findings for:
41
+
42
+ - Similar specs that worked well (reuse structure)
43
+ - Patterns and conventions already established
44
+ - Gotchas to avoid in this domain
45
+
27
46
  ## Load Bead Context
28
47
 
29
48
  ```bash
@@ -232,6 +251,21 @@ Update bead with note:
232
251
  bd note $ARGUMENTS "Created spec.md with [N] requirements"
233
252
  ```
234
253
 
254
+ ## Record Learning (If Significant)
255
+
256
+ If you discovered patterns or made decisions worth remembering:
257
+
258
+ ```typescript
259
+ observation({
260
+ type: "pattern", // or "decision"
261
+ title: "[Domain] spec pattern for [type of feature]",
262
+ narrative: "When creating specs for [this type], include...",
263
+ concepts: "[domain keywords]",
264
+ bead_id: "$ARGUMENTS",
265
+ confidence: "medium",
266
+ });
267
+ ```
268
+
235
269
  ---
236
270
 
237
271
  ## Output
@@ -11,8 +11,27 @@ subtask: true
11
11
 
12
12
  ```typescript
13
13
  skill({ name: "beads" });
14
+ skill({ name: "memory-system" });
14
15
  ```
15
16
 
17
+ ## Check Memory First
18
+
19
+ Search for existing design decisions and patterns:
20
+
21
+ ```typescript
22
+ // Find similar design work
23
+ memory_search({ query: "[component/page name] design UI", limit: 3 });
24
+
25
+ // Find design system decisions
26
+ memory_search({ query: "design system colors typography", limit: 3 });
27
+ ```
28
+
29
+ Review findings for:
30
+
31
+ - Existing aesthetic direction decisions
32
+ - Color and typography choices already made
33
+ - UI patterns that worked well
34
+
16
35
  ## Phase 1: Context Discovery
17
36
 
18
37
  Parse `$ARGUMENTS` to determine design task:
@@ -565,6 +584,22 @@ Before finalizing, verify design does NOT have ALL of these together:
565
584
  **Quick design:** Output inline, no save needed
566
585
  **Full design:** Save to `.opencode/memory/design/specs/[YYYY-MM-DD]-[topic].md`
567
586
 
587
+ ### Record Design Decisions
588
+
589
+ For significant design choices, create an observation:
590
+
591
+ ```typescript
592
+ observation({
593
+ type: "decision",
594
+ title: "Design direction for [component/page]",
595
+ narrative: "Chose [aesthetic direction] because [rationale]...",
596
+ facts: "[key design tokens, colors, typography choices]",
597
+ concepts: "design, ui, [component type], [aesthetic]",
598
+ bead_id: "$ARGUMENTS", // if applicable
599
+ confidence: "high",
600
+ });
601
+ ```
602
+
568
603
  ### Create Implementation Tasks
569
604
 
570
605
  For component/page designs:
@@ -13,8 +13,23 @@ You're pausing work on a task. Save state so the next session can pick up cleanl
13
13
  ```typescript
14
14
  skill({ name: "beads" });
15
15
  skill({ name: "session-management" });
16
+ skill({ name: "memory-system" });
16
17
  ```
17
18
 
19
+ ## Check Memory for Context
20
+
21
+ Before creating handoff, search for related work:
22
+
23
+ ```typescript
24
+ // Find previous handoffs and sessions for this bead
25
+ memory_search({ query: "$ARGUMENTS handoff progress", limit: 3 });
26
+
27
+ // Find related decisions and learnings
28
+ memory_search({ query: "[bead description keywords]", limit: 3 });
29
+ ```
30
+
31
+ Review findings to include relevant context in the handoff.
32
+
18
33
  ## Why Handoff?
19
34
 
20
35
  - Context window getting full
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  description: Initialize project for AI-assisted development (creates AGENTS.md + memory files)
3
3
  argument-hint: "[--deep] [--skip-questions]"
4
- agent: plan
5
- subtask: true
4
+ agent: build
6
5
  ---
7
6
 
8
7
  # Init: $ARGUMENTS
@@ -155,57 +154,49 @@ If the repo is large or keeps changing (monorepos especially), generate/refresh
155
154
 
156
155
  ## Phase 5: Populate Memory Files
157
156
 
158
- ### .opencode/memory/user.md
157
+ Read templates, then use `write` tool to create actual markdown files:
159
158
 
160
- ```markdown
161
- ---
162
- purpose: User identity, preferences, communication style
163
- updated: [today]
164
- ---
165
-
166
- # User Profile
167
-
168
- ## Identity
169
-
170
- - Name: [from git/questions]
171
- - Git contributor: [email/username]
172
-
173
- ## Preferences
174
-
175
- - Communication: [terse/detailed]
176
- - Workflow: [auto-commit/ask-first]
177
-
178
- ## Rules
179
-
180
- [from Phase 1]
159
+ ```typescript
160
+ // 1. Read templates to understand structure
161
+ read({ filePath: ".opencode/memory/_templates/user.md" });
162
+ read({ filePath: ".opencode/memory/_templates/tech-stack.md" });
163
+
164
+ // 2. Use WRITE tool to create/update actual markdown files
165
+ // ⚠️ IMPORTANT: memory-update writes to SQLite, NOT markdown files!
166
+ // Use write() for .md files, memory-update() for SQLite storage
167
+
168
+ write({
169
+ filePath: ".opencode/memory/project/user.md",
170
+ content: "..." // Populated from Phase 1 answers
171
+ });
172
+
173
+ write({
174
+ filePath: ".opencode/memory/project/tech-stack.md",
175
+ content: "..." // Populated from Phase 2 detection
176
+ });
181
177
  ```
182
178
 
183
- ### .opencode/memory/project/tech-stack.md
184
-
185
- ```markdown
186
- ---
187
- purpose: Tech stack, constraints, and integrations for AI context injection
188
- updated: [today]
189
- ---
179
+ **Critical distinction:**
180
+ - `write()` → Updates **markdown files** on disk
181
+ - `memory-update()` → Writes to **SQLite database** (memory system)
190
182
 
191
- # Tech Stack
183
+ ### .opencode/memory/project/user.md
192
184
 
193
- ## Framework & Language
185
+ Populate from Phase 1 answers:
186
+ - Identity (name, git contributor)
187
+ - Communication preferences (terse/detailed)
188
+ - Workflow preferences (auto-commit/ask-first)
189
+ - Custom rules
194
190
 
195
- - **Framework:** [detected, e.g., Next.js 15]
196
- - **Language:** [detected, e.g., TypeScript]
197
- - **Runtime:** [detected, e.g., Node.js 22]
198
-
199
- ## Key Dependencies
200
-
201
- - [detected from package.json/go.mod/etc.]
202
-
203
- ## Key Constraints
191
+ ### .opencode/memory/project/tech-stack.md
204
192
 
205
- - [detected or ask user]
206
- ```
193
+ Populate from Phase 2 detection:
194
+ - Framework & version
195
+ - Language & runtime
196
+ - Key dependencies with versions
197
+ - Key constraints
207
198
 
208
- **Note:** AI discovers commands, architecture, conventions, and gotchas organically from the codebase and saves learnings via the `observation` tool. No need for static template files.
199
+ **Note:** AI discovers commands, architecture, conventions, and gotchas organically and saves via `observation` tool.
209
200
 
210
201
  ## Phase 6: Initialize Beads (if requested)
211
202
 
@@ -260,8 +251,10 @@ Suggested next steps:
260
251
  ```
261
252
  ./AGENTS.md # Project-specific rules (created, <60 lines)
262
253
  .opencode/AGENTS.md # Global rules (untouched)
263
- .opencode/memory/user.md # User preferences (created)
264
- .opencode/memory/project/tech-stack.md # Tech stack for context injection (created)
254
+ .opencode/memory/_templates/user.md # User template
255
+ .opencode/memory/_templates/tech-stack.md # Tech stack template
256
+ .opencode/memory/project/user.md # User preferences (created from template)
257
+ .opencode/memory/project/tech-stack.md # Tech stack (created from template)
265
258
  .opencode/memory/observations/ # Learnings captured organically by AI
266
259
  [packages/*/AGENTS.md] # Subsystem rules (--deep, if requested)
267
260
  ```
@@ -24,6 +24,7 @@ skill({ name: "deep-research" });
24
24
  skill({ name: "executing-plans" });
25
25
  skill({ name: "writing-plans" });
26
26
  skill({ name: "subagent-driven-development" });
27
+ skill({ name: "memory-system" });
27
28
  ```
28
29
 
29
30
  ```bash
@@ -11,8 +11,23 @@ agent: build
11
11
  ```typescript
12
12
  skill({ name: "beads" }); // Session protocol
13
13
  skill({ name: "verification-before-completion" });
14
+ skill({ name: "memory-system" });
14
15
  ```
15
16
 
17
+ ## Check Memory for Related Context
18
+
19
+ Search for related decisions and patterns:
20
+
21
+ ```typescript
22
+ // Find related decisions and patterns for this work
23
+ memory_search({ query: "$ARGUMENTS [feature keywords]", limit: 3 });
24
+
25
+ // Find any gotchas related to this area
26
+ memory_search({ query: "[affected files/modules] gotchas", limit: 2 });
27
+ ```
28
+
29
+ Include relevant context from memory in PR description.
30
+
16
31
  ## Options
17
32
 
18
33
  - `--draft`: Create as draft PR (for WIP or early feedback)
@@ -28,6 +28,9 @@ skill({ name: "source-code-research" });
28
28
 
29
29
  // For swarm coordination (if parallel research needed)
30
30
  skill({ name: "swarm-coordination" });
31
+
32
+ // For memory context
33
+ skill({ name: "memory-system" });
31
34
  ```
32
35
 
33
36
  ## Delegation Strategy
@@ -13,6 +13,7 @@ You're picking up where a previous session left off. Recover context, verify sta
13
13
  ```typescript
14
14
  skill({ name: "beads" });
15
15
  skill({ name: "beads-bridge" }); // For cross-session recovery
16
+ skill({ name: "memory-system" });
16
17
  ```
17
18
 
18
19
  ## Verify The Task Exists
@@ -11,8 +11,23 @@ subtask: true
11
11
 
12
12
  ```typescript
13
13
  skill({ name: "beads" });
14
+ skill({ name: "memory-system" });
14
15
  ```
15
16
 
17
+ ## Check Memory for Context
18
+
19
+ Search for existing patterns and gotchas before review:
20
+
21
+ ```typescript
22
+ // Find related past reviews and findings
23
+ memory_search({ query: "[path/module] review security", limit: 3 });
24
+
25
+ // Find known gotchas for this area
26
+ memory_search({ query: "[module keywords] gotchas patterns", limit: 3 });
27
+ ```
28
+
29
+ Apply past learnings to the review - don't repeat known issues.
30
+
16
31
  ## Phase 1: Determine Scope
17
32
 
18
33
  Parse `$ARGUMENTS` to determine what to review:
@@ -205,3 +220,18 @@ Skip creating beads for Minor issues (just report them).
205
220
  - Vague feedback ("improve error handling" - WHERE? HOW?)
206
221
  - Skipping automated checks "to save time"
207
222
  - Not creating beads for real issues (they get forgotten)
223
+
224
+ ## Record Significant Findings
225
+
226
+ For important findings worth remembering:
227
+
228
+ ```typescript
229
+ observation({
230
+ type: "warning", // or "pattern", "bugfix"
231
+ title: "[Module] [Issue type] pattern detected",
232
+ narrative: "Found [issue] in [location], which can cause...",
233
+ facts: "[key facts about the issue]",
234
+ concepts: "[module], security, [issue keywords]",
235
+ confidence: "high",
236
+ });
237
+ ```
@@ -18,8 +18,23 @@ skill({ name: "finishing-a-development-branch" });
18
18
  skill({ name: "receiving-code-review" });
19
19
  skill({ name: "swarm-coordination" });
20
20
  skill({ name: "beads-bridge" });
21
+ skill({ name: "memory-system" });
21
22
  ```
22
23
 
24
+ ## Check Memory for Context
25
+
26
+ Search for related patterns and gotchas before shipping:
27
+
28
+ ```typescript
29
+ // Find related patterns and decisions
30
+ memory_search({ query: "$ARGUMENTS [feature keywords]", limit: 3 });
31
+
32
+ // Find gotchas for affected modules
33
+ memory_search({ query: "[affected modules] gotchas", limit: 3 });
34
+ ```
35
+
36
+ Apply past learnings to avoid known issues.
37
+
23
38
  ## Skill Routing
24
39
 
25
40
  - Use **systematic-debugging** when a gate fails and root cause is unclear.
@@ -154,3 +169,31 @@ If confirmed:
154
169
  bd close $ARGUMENTS --reason "Shipped: verification + review passed"
155
170
  bd sync
156
171
  ```
172
+
173
+ ## Record Learnings (On Completion)
174
+
175
+ Before ending, capture what was learned:
176
+
177
+ ```typescript
178
+ // Record significant decisions or patterns discovered
179
+ observation({
180
+ type: "feature", // or "decision", "pattern"
181
+ title: "$ARGUMENTS: [brief description]",
182
+ narrative: "Implemented [feature]. Key approach: [summary]...",
183
+ facts: "[key implementation details]",
184
+ concepts: "[domain keywords], [tech stack]",
185
+ bead_id: "$ARGUMENTS",
186
+ files_modified: "[key files changed]",
187
+ confidence: "high",
188
+ });
189
+
190
+ // If encountered gotchas worth remembering
191
+ observation({
192
+ type: "warning",
193
+ title: "[Gotcha discovered during $ARGUMENTS]",
194
+ narrative: "While implementing, discovered that...",
195
+ concepts: "[relevant keywords]",
196
+ bead_id: "$ARGUMENTS",
197
+ confidence: "high",
198
+ });
199
+ ```
@@ -27,6 +27,7 @@ skill({ name: "beads" });
27
27
  skill({ name: "beads-bridge" }); // For cross-session todo coordination
28
28
  skill({ name: "prd" }); // PRD creation workflow
29
29
  skill({ name: "prd-task" }); // PRD to executable tasks conversion
30
+ skill({ name: "memory-system" });
30
31
  ```
31
32
 
32
33
  ## Ensure Git Hooks Installed
@@ -11,9 +11,10 @@ subtask: true
11
11
 
12
12
  ```typescript
13
13
  skill({ name: "beads" });
14
+ skill({ name: "memory-system" });
14
15
  ```
15
16
 
16
- Generate a comprehensive project status report covering tasks, sessions, git state, and system health.
17
+ Generate a comprehensive project status report covering tasks, sessions, git state, memory health, and system health.
17
18
 
18
19
  ## Phase 1: Gather All State (Parallel)
19
20
 
@@ -250,6 +251,28 @@ Fri ██████████ 10
250
251
 
251
252
  ## Phase 5: Session Insights
252
253
 
254
+ ### Memory Health
255
+
256
+ ```typescript
257
+ // Check memory system status
258
+ memory_maintain({ operation: "status", older_than_days: 90, dry_run: false });
259
+ ```
260
+
261
+ Display memory stats in dashboard:
262
+
263
+ ```
264
+ MEMORY STATUS
265
+ ━━━━━━━━━━━━
266
+ Observations: [N] stored
267
+ Database size: [X] KB
268
+ FTS Index: ✓ Healthy
269
+ Last search: [timestamp]
270
+
271
+ Recent learnings:
272
+ • [Latest observation title] (type: decision)
273
+ • [Latest observation title] (type: pattern)
274
+ ```
275
+
253
276
  ### Context Health
254
277
 
255
278
  ```typescript
@@ -14,6 +14,7 @@ Comprehensive UI/UX review with structured scoring and actionable feedback.
14
14
 
15
15
  ```typescript
16
16
  skill({ name: "beads" }); // Session protocol
17
+ skill({ name: "memory-system" });
17
18
  ```
18
19
 
19
20
  ```typescript
@@ -22,6 +23,20 @@ skill({ name: "visual-analysis" });
22
23
  skill({ name: "accessibility-audit" });
23
24
  ```
24
25
 
26
+ ## Check Memory for Design Context
27
+
28
+ Search for existing design decisions and patterns:
29
+
30
+ ```typescript
31
+ // Find design system decisions
32
+ memory_search({ query: "design system colors typography", limit: 3 });
33
+
34
+ // Find previous UI reviews and findings
35
+ memory_search({ query: "[component/page] UI review", limit: 3 });
36
+ ```
37
+
38
+ Apply existing design decisions to the review.
39
+
25
40
  ## Parse Arguments
26
41
 
27
42
  | Argument | Default | Description |
@@ -305,3 +320,19 @@ bd dep add <task-id> <bead-id>
305
320
  | Design from scratch | `/design` |
306
321
  | Start implementation | `/start <bead>` |
307
322
  | Ship implementation | `/ship <bead>` |
323
+
324
+ ## Record Significant Findings
325
+
326
+ For important UI/UX findings worth remembering:
327
+
328
+ ```typescript
329
+ observation({
330
+ type: "warning", // or "pattern", "decision"
331
+ title: "UI: [Component/page] [issue type]",
332
+ narrative: "Found [issue] in [location]. Impact: [description]...",
333
+ facts: "[severity], [category], [fix approach]",
334
+ concepts: "ui, accessibility, [component type]",
335
+ bead_id: "$ARGUMENTS", // if applicable
336
+ confidence: "high",
337
+ });
338
+ ```