opencodekit 0.16.0 → 0.16.2
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 +1 -1
- package/dist/template/.opencode/AGENTS.md +109 -8
- package/dist/template/.opencode/command/create.md +37 -3
- package/dist/template/.opencode/command/design.md +35 -0
- package/dist/template/.opencode/command/handoff.md +15 -0
- package/dist/template/.opencode/command/init.md +40 -47
- package/dist/template/.opencode/command/plan.md +1 -0
- package/dist/template/.opencode/command/pr.md +15 -0
- package/dist/template/.opencode/command/research.md +3 -0
- package/dist/template/.opencode/command/resume.md +1 -0
- package/dist/template/.opencode/command/review-codebase.md +30 -0
- package/dist/template/.opencode/command/ship.md +43 -0
- package/dist/template/.opencode/command/start.md +1 -0
- package/dist/template/.opencode/command/status.md +24 -1
- package/dist/template/.opencode/command/ui-review.md +31 -0
- package/dist/template/.opencode/command/verify.md +35 -7
- package/dist/template/.opencode/dcp.jsonc +79 -70
- package/dist/template/.opencode/memory/project/tech-stack.md +25 -22
- 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 +817 -916
- package/dist/template/.opencode/package.json +2 -1
- package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +418 -0
- package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +170 -0
- package/dist/template/.opencode/plans/1770013678126-witty-planet.md +278 -0
- package/dist/template/.opencode/plugin/lib/memory-db.ts +828 -0
- package/dist/template/.opencode/plugin/memory.ts +38 -1
- package/dist/template/.opencode/plugin/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts +3 -6
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +76 -31
- package/dist/template/.opencode/skill/memory-system/SKILL.md +110 -55
- package/dist/template/.opencode/tool/memory-get.ts +143 -0
- package/dist/template/.opencode/tool/memory-maintain.ts +167 -0
- package/dist/template/.opencode/tool/memory-migrate.ts +319 -0
- package/dist/template/.opencode/tool/memory-read.ts +17 -46
- package/dist/template/.opencode/tool/memory-search.ts +131 -28
- package/dist/template/.opencode/tool/memory-timeline.ts +105 -0
- package/dist/template/.opencode/tool/memory-update.ts +21 -26
- package/dist/template/.opencode/tool/observation.ts +112 -100
- package/dist/template/.opencode/tsconfig.json +19 -19
- package/package.json +1 -1
- package/dist/template/.opencode/memory/_templates/README.md +0 -73
- package/dist/template/.opencode/memory/_templates/observation.md +0 -39
- package/dist/template/.opencode/memory/_templates/prompt-engineering.md +0 -333
- package/dist/template/.opencode/memory/observations/2026-01-22-decision-agents-md-prompt-engineering-improvement.md +0 -29
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +0 -20
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +0 -15
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +0 -29
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +0 -32
- package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +0 -42
- package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +0 -32
- package/dist/template/.opencode/memory/observations/2026-01-29-decision-copilot-auth-plugin-rate-limit-handling.md +0 -27
- package/dist/template/.opencode/memory/observations/2026-01-29-decision-spec-driven-approach-for-opencodekit.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-29-learning-karpathy-llm-coding-insights-dec-2025.md +0 -44
- package/dist/template/.opencode/memory/observations/2026-01-30-decision-github-copilot-claude-routing-keep-disab.md +0 -32
- package/dist/template/.opencode/memory/observations/2026-01-30-discovery-context-management-research-critical-gap.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-01-30-discovery-kimi-k2-5-agent-swarm-architecture-patte.md +0 -45
- package/dist/template/.opencode/memory/observations/2026-01-30-pattern-swarm-tools-architecture.md +0 -28
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-copilot-auth-plugin-updated-with-baseurl.md +0 -63
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-created-dedicated-worker-agent-for-swarm.md +0 -20
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-rollback-to-v1-1-47-for-copilot-claude-r.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-simplified-swarm-to-task-tool-pattern.md +0 -44
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-swarm-architecture-task-tool-over-tmux.md +0 -33
- package/dist/template/.opencode/memory/observations/2026-01-31-decision-worker-skills-defined-for-swarm-delegati.md +0 -30
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-gpt-reasoning-config-for-github-copilot.md +0 -51
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-auth-comparison-finding.md +0 -61
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-reasoning-architecture-.md +0 -66
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-custom-tools-api.md +0 -48
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-v1-1-48-skills-as-slash-command.md +0 -21
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-swarm-system-simplified-removed-mailbox-.md +0 -30
- package/dist/template/.opencode/memory/observations/2026-01-31-learning-v1-1-48-native-copilot-reasoning-via-pr-.md +0 -45
- package/dist/template/.opencode/memory/observations/2026-01-31-warning-cannot-add-custom-config-to-opencode-jso.md +0 -18
- package/dist/template/.opencode/memory/observations/2026-01-31-warning-copilot-claude-v1-endpoint-returns-404-c.md +0 -48
- package/dist/template/.opencode/memory/observations/2026-01-31-warning-opencode-v1-1-48-claude-thinking-block-s.md +0 -51
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-add-skills-vs-commands-to-global-agents-.md +0 -15
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-build-agent-auto-loads-skills-contextual.md +0 -31
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-fixed-agent-configuration-for-opencodeki.md +0 -25
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-focused-agents-md-upgrade-for-opencode-k.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-implement-tier-1-permission-upgrades.md +0 -15
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-instructions-config-explicit-paths-not-w.md +0 -40
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-merged-context-into-memory-project-singl.md +0 -42
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-oracle-tool-should-use-review-agent-not-.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-agent-auto-loads-skills-contextuall.md +0 -31
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-phased-oracle-command-merge-into-ne.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-prd-workflow-uses-prd-and-prd-task-skill.md +0 -23
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-prefer-review-agent-via-opencode-cli-ove.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-add-ship-command-with.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command-.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-skills-vs-commands-section-from-a.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-tool-with-ship-command-fl.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-with-ship-command-workflo.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-proxypal-oracle-with-cli-review-.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-dist-template-only-tech-stack.md +0 -50
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-templates-only-tech-stack-md.md +0 -26
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-subagents-load-minimal-skills-stay-lean.md +0 -29
- package/dist/template/.opencode/memory/observations/2026-02-01-decision-user-approved-permission-upgrades-in-ope.md +0 -15
- package/dist/template/.opencode/memory/observations/2026-02-01-discovery-verify-command-already-implemented.md +0 -28
- package/dist/template/.opencode/memory/observations/2026-02-01-feature-openspec-phase-b-complete-template-upgra.md +0 -43
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-build-agent-should-use-dynamic-lsp-not-f.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-kimi-k2-5-model-requires-temperature-1-0.md +0 -22
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-already-imple.md +0 -27
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-uses-instruct.md +0 -35
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-update-build-agent-prompt-to-use-context.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-using-opencode-expert-.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-g.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-r.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-prefers-copilot-gpt-5-2-codex-mediu.md +0 -14
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-contextu.md +0 -15
- package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-reviewed.md +0 -15
- package/dist/template/.opencode/memory/project/architecture.md +0 -60
- package/dist/template/.opencode/memory/project/command-rules.md +0 -122
- package/dist/template/.opencode/memory/project/commands.md +0 -72
- package/dist/template/.opencode/memory/project/conventions.md +0 -68
- package/dist/template/.opencode/memory/project/gotchas.md +0 -41
- /package/dist/template/.opencode/memory/_templates/{project/tech-stack.md → tech-stack.md} +0 -0
- /package/dist/template/.opencode/memory/{user.example.md → _templates/user.md} +0 -0
- /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.
|
|
753
|
+
version: "0.16.2",
|
|
754
754
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
755
755
|
keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
|
|
756
756
|
license: "MIT",
|
|
@@ -16,6 +16,27 @@ Everything else is guidelines, not laws.
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
+
## Trust Hierarchy
|
|
20
|
+
|
|
21
|
+
**DO NOT search when instructions already exist.** Searching is expensive. Follow this order:
|
|
22
|
+
|
|
23
|
+
1. **AGENTS.md** - Project-specific rules (this file or `./AGENTS.md`)
|
|
24
|
+
2. **Memory** - Past decisions, patterns, gotchas (`memory-search`)
|
|
25
|
+
3. **Project files** - `.opencode/memory/project/` (commands, conventions, tech-stack)
|
|
26
|
+
4. **Codebase search** - Only if above sources are incomplete or wrong
|
|
27
|
+
|
|
28
|
+
If instructions are incomplete or wrong, **update them** after finding the truth. Don't just use the correct info once—fix the source so future work benefits.
|
|
29
|
+
|
|
30
|
+
### Atomic Version
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
DO NOT search when instructions exist.
|
|
34
|
+
TRUST: AGENTS.md → memory → project files → search
|
|
35
|
+
UPDATE instructions when you find errors.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
19
40
|
## Skills vs Commands
|
|
20
41
|
|
|
21
42
|
- Use **commands** for user-facing entrypoints (workflows and intent).
|
|
@@ -219,17 +240,51 @@ Chain: grep → read → LSP(9) → memory → understand → edit
|
|
|
219
240
|
|
|
220
241
|
**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
242
|
|
|
243
|
+
### Memory Architecture
|
|
244
|
+
|
|
245
|
+
The memory system uses **SQLite + FTS5** as the single source of truth:
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
Write: observation() → SQLite only
|
|
249
|
+
memory-update() → SQLite only
|
|
250
|
+
|
|
251
|
+
Read: memory-search() → FTS5 full-text search (BM25 ranking)
|
|
252
|
+
memory-get() → Full observation details by ID
|
|
253
|
+
memory-read() → SQLite only
|
|
254
|
+
memory-timeline() → Chronological context around anchor
|
|
255
|
+
```
|
|
256
|
+
|
|
222
257
|
### The Three Actions
|
|
223
258
|
|
|
224
|
-
First, DO NOT start any significant work without checking memory. Run `memory-search` to find relevant context
|
|
259
|
+
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.
|
|
260
|
+
|
|
261
|
+
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:
|
|
225
262
|
|
|
226
|
-
|
|
263
|
+
```typescript
|
|
264
|
+
observation({
|
|
265
|
+
type: "decision", // decision, bugfix, feature, pattern, discovery, learning, warning
|
|
266
|
+
title: "Use JWT for auth",
|
|
267
|
+
narrative: "Why this decision was made...",
|
|
268
|
+
facts: "stateless, scalable", // Key facts (comma-separated)
|
|
269
|
+
concepts: "auth, jwt, security", // Keywords for search
|
|
270
|
+
confidence: "high", // high, medium, low
|
|
271
|
+
});
|
|
272
|
+
```
|
|
227
273
|
|
|
228
274
|
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
275
|
|
|
230
276
|
### Memory-start protocol
|
|
231
277
|
|
|
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-
|
|
278
|
+
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.
|
|
279
|
+
|
|
280
|
+
### Progressive Disclosure Pattern
|
|
281
|
+
|
|
282
|
+
Memory search intentionally returns **compact results** (50-100 tokens each) to avoid context bloat. Follow this pattern:
|
|
283
|
+
|
|
284
|
+
1. `memory-search({ query: "auth" })` → Get compact index
|
|
285
|
+
2. Identify relevant observation IDs from index
|
|
286
|
+
3. `memory-get({ ids: "42,45" })` → Fetch full details only for what you need
|
|
287
|
+
4. `memory-timeline({ anchor_id: 42 })` → See chronological context if needed
|
|
233
288
|
|
|
234
289
|
### Atomic Version
|
|
235
290
|
|
|
@@ -237,8 +292,35 @@ At the start of any significant task, complete these three steps in order. First
|
|
|
237
292
|
DO NOT start without memory-search.
|
|
238
293
|
DO NOT skip observation on decisions.
|
|
239
294
|
DO NOT ignore LSP Nudges.
|
|
295
|
+
|
|
296
|
+
Pattern: search → identify IDs → get details → proceed
|
|
240
297
|
```
|
|
241
298
|
|
|
299
|
+
### Memory Maintenance
|
|
300
|
+
|
|
301
|
+
For long-term storage health, use `memory-maintain` periodically:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# Check current status
|
|
305
|
+
memory-maintain({ operation: "status" })
|
|
306
|
+
|
|
307
|
+
# Full maintenance (archive >90 days, checkpoint WAL, vacuum)
|
|
308
|
+
memory-maintain({ operation: "full" })
|
|
309
|
+
|
|
310
|
+
# Preview what would be archived
|
|
311
|
+
memory-maintain({ operation: "archive", older_than_days: 60, dry_run: true })
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**Automatic maintenance** runs at session end:
|
|
315
|
+
|
|
316
|
+
- FTS5 index optimization
|
|
317
|
+
- WAL checkpoint (if WAL > 1MB)
|
|
318
|
+
|
|
319
|
+
**Manual maintenance** (run monthly or when storage grows):
|
|
320
|
+
|
|
321
|
+
- `archive`: Move old observations to archive table
|
|
322
|
+
- `vacuum`: Defragment and reclaim space
|
|
323
|
+
|
|
242
324
|
---
|
|
243
325
|
|
|
244
326
|
## Beads (Task Tracking)
|
|
@@ -362,7 +444,25 @@ Before you start implementing, verify the requirements are clear. If interpretat
|
|
|
362
444
|
|
|
363
445
|
Before you claim completion, verify these things:
|
|
364
446
|
|
|
365
|
-
1. **Run
|
|
447
|
+
1. **Run validation commands** (in order):
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
# Type check (REQUIRED if TypeScript/JavaScript)
|
|
451
|
+
npm run typecheck # or: bun run typecheck, tsc --noEmit
|
|
452
|
+
|
|
453
|
+
# Build (REQUIRED)
|
|
454
|
+
npm run build # or: bun run build, cargo build, go build
|
|
455
|
+
|
|
456
|
+
# Test (REQUIRED if tests exist)
|
|
457
|
+
npm test # or: bun test, cargo test, go test, pytest
|
|
458
|
+
|
|
459
|
+
# Lint (REQUIRED if linter configured)
|
|
460
|
+
npm run lint # or: bun run lint, cargo clippy, golangci-lint
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Skip only if project lacks that script. Document missing scripts in `project/gotchas.md`.
|
|
464
|
+
|
|
465
|
+
2. **Run review agent** on any significant code changes:
|
|
366
466
|
|
|
367
467
|
```typescript
|
|
368
468
|
Task({
|
|
@@ -374,11 +474,12 @@ Before you claim completion, verify these things:
|
|
|
374
474
|
|
|
375
475
|
If review suggests simplification, implement it before proceeding.
|
|
376
476
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
477
|
+
3. You ran `bd close <id>` with a meaningful reason
|
|
478
|
+
4. You ran `bd sync` to push changes
|
|
479
|
+
5. There are no pending LSP nudges
|
|
480
|
+
6. You saved observations for any important decisions or patterns
|
|
381
481
|
|
|
482
|
+
**DO NOT skip validation commands.** Failed builds/tests after merge waste everyone's time.
|
|
382
483
|
**DO NOT skip the Oracle critique for non-trivial changes.** This prevents bloated, overcomplicated solutions that could be 10x simpler.
|
|
383
484
|
|
|
384
485
|
---
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Create a specification for a bead using templates
|
|
3
3
|
argument-hint: "<bead-id> [--prd] [--proposal]"
|
|
4
|
-
agent:
|
|
5
|
-
subtask: true
|
|
4
|
+
agent: build
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Create: $ARGUMENTS
|
|
@@ -22,8 +21,27 @@ Create structured artifacts for a bead using templates. This is the first step b
|
|
|
22
21
|
```typescript
|
|
23
22
|
skill({ name: "beads" });
|
|
24
23
|
skill({ name: "brainstorming" });
|
|
24
|
+
skill({ name: "memory-system" });
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## Check Memory First
|
|
28
|
+
|
|
29
|
+
Search for similar specs and patterns before creating:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
// Find similar past specs
|
|
33
|
+
memory_search({ query: "[bead title/description]", limit: 3 });
|
|
34
|
+
|
|
35
|
+
// Find related patterns and conventions
|
|
36
|
+
memory_search({ query: "[domain keywords] spec requirements", limit: 3 });
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Review findings for:
|
|
40
|
+
|
|
41
|
+
- Similar specs that worked well (reuse structure)
|
|
42
|
+
- Patterns and conventions already established
|
|
43
|
+
- Gotchas to avoid in this domain
|
|
44
|
+
|
|
27
45
|
## Load Bead Context
|
|
28
46
|
|
|
29
47
|
```bash
|
|
@@ -89,7 +107,8 @@ question({
|
|
|
89
107
|
},
|
|
90
108
|
{
|
|
91
109
|
header: "Users",
|
|
92
|
-
question:
|
|
110
|
+
question:
|
|
111
|
+
"Who will use this? (developers, end users, API consumers, etc.)",
|
|
93
112
|
options: [
|
|
94
113
|
{ label: "Developers", description: "Internal tooling or API" },
|
|
95
114
|
{ label: "End users", description: "Customer-facing feature" },
|
|
@@ -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:
|
|
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
|
-
|
|
157
|
+
Read templates, then use `write` tool to create actual markdown files:
|
|
159
158
|
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
183
|
+
### .opencode/memory/project/user.md
|
|
192
184
|
|
|
193
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
264
|
-
.opencode/memory/
|
|
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
|
```
|
|
@@ -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)
|
|
@@ -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
|