Reusable durable-memory workflow for OpenCode projects.
This kit gives you two things:
- global OpenCode commands and agents for durable memory
- a lightweight bootstrap that installs per-project memory scaffolding
Goals:
- keep long-term project context inside each repo
- keep global OpenCode setup small and reusable
- avoid saturating model context with old session noise
- keep the main thread thin by leaning on OpenCode's built-in
exploreandgeneralsubagents
Global commands and agents:
/sync-memory [scope]/remember-feature <slug>/recall-feature <query>/review-memory <scope>memory-curatormemory-recall
Project bootstrap files:
AGENTS.mddocs/ai-memory/INDEX.mddocs/ai-memory/product-vision.mddocs/ai-memory/decisions.mddocs/ai-memory/troubleshooting.mddocs/ai-memory/features/README.md
/sync-memory is the default checkpoint. It decides between a focused feature update, a broader drift review, or no durable memory update.
Recommended setup: use the default OpenCode directories. Do not override OPENCODE_CONFIG_DIR for normal usage.
Install once from the public repo:
PowerShell:
powershell -ExecutionPolicy Bypass -Command "iwr https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.ps1 -UseBasicParsing | iex"Unix shell:
curl -fsSL https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.sh | shBootstrap each repo:
PowerShell:
powershell -ExecutionPolicy Bypass -File "$HOME\.config\opencode\opencode-memory-kit\scripts\bootstrap-project.ps1" -Target .Unix shell:
sh "$HOME/.config/opencode/opencode-memory-kit/scripts/bootstrap-project.sh" .If the repo already has AGENTS.md, bootstrap only refreshes or appends the managed block between:
<!-- opencode-memory-kit:start --><!-- opencode-memory-kit:end -->
That preserves existing project-specific rules outside the managed block.
- Work normally with
planandbuild. - Let OpenCode use
explorefor broad reading andgeneralfor multi-step execution. - After accepted work when durable repo truth changed, run
/sync-memory [scope]. - In later sessions, run
/recall-feature <query>. - Use
/remember-feature <slug>to force a focused feature-note refresh. - Use
/review-memory [scope]after broad refactors, removals, or cleanup.
If the repo uses OpenSpec or another spec workflow, the active spec remains the source of truth for requirements, planning, task tracking, and acceptance criteria. After each spec archive for accepted work, run /sync-memory [scope] or say explicitly that no durable memory update is needed.
Typical commands:
/sync-memory auth-flow
/sync-memory
/remember-feature billing-webhook
/recall-feature auth
/recall-feature "TypeError fetch failed"
/review-memory "remove legacy billing"
Update the installed kit:
PowerShell:
$script = (iwr "https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.ps1" -UseBasicParsing).Content
& ([scriptblock]::Create($script)) -ForceUnix shell:
curl -fsSL https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.sh | sh -s -- --forceThen rerun bootstrap inside the repo:
PowerShell:
powershell -ExecutionPolicy Bypass -File "$HOME\.config\opencode\opencode-memory-kit\scripts\bootstrap-project.ps1" -Target .Unix shell:
sh "$HOME/.config/opencode/opencode-memory-kit/scripts/bootstrap-project.sh" .Safe rerun behavior:
- refreshes the managed block in
AGENTS.md - creates missing scaffold files under
docs/ai-memory/ - preserves existing saved notes and feature memory files
- uses
-Forceor--forceonly for the global kit reinstall step - does not overwrite project memory unless you explicitly use
--force
agents/ Global OpenCode agents
commands/ Global OpenCode commands
templates/project/ Files copied into each target repo
scripts/ Install and bootstrap scripts
Install from a local clone while developing the kit:
PowerShell:
powershell -ExecutionPolicy Bypass -File .\scripts\install-global.ps1Unix shell:
sh ./scripts/install-global.shOPENCODE_CONFIG_DIR is useful for development and testing, but it is not the recommended day-to-day setup.