Interactive SDD model selection and profile management for opencode.
Manage SDD (Spec-Driven Development) profiles from gentle-ai directly from the opencode TUI.
- Create: Create an empty SDD profile for manual configuration.
- Activate: Apply a saved profile to the global runtime config instantly β no restart required. Changes are live immediately.
- Edit Models: Pick a different provider/model for any agent or fallback directly from the UI.
- Rename & Delete: Full lifecycle management for your profiles.
- Per-Agent Fallbacks: Configure a fallback model per
sdd-*base agent (exceptsdd-orchestrator). On activation, the plugin ensuressdd-*-fallbackagents exist and stay in sync with their base agent config. Primary models are applied first, so you can define new agents and their fallbacks in a single profile activation. - Active Profile Detection: The plugin automatically detects and highlights which profile matches the current config.
Profiles are stored as JSON files under ~/.config/opencode/profiles/:
{
"models": {
"sdd-init": "openai/gpt-4o",
"sdd-spec": "anthropic/claude-sonnet-4-6",
"sdd-apply": "anthropic/claude-sonnet-4-6"
},
"fallback": {
"sdd-init": "google/gemini-flash-2.0",
"sdd-apply": "openai/gpt-4o-mini"
}
}models: primary model per basesdd-*agent.fallback: optional fallback model override per base agent name. If omitted, the fallback agent inherits the base model.
Legacy flat format is also supported for backwards compatibility:
{
"sdd-init": "openai/gpt-4o",
"sdd-apply": "anthropic/claude-sonnet-4-6"
}Full integration with the Engram memory system.
- List: Browse all stored observations for the current project (resolved across git remote, git root, and cwd aliases).
- Read: View full memory content, type, scope, and timestamp.
- Delete: Logically remove a memory to prevent it from affecting the current session context.
Add the plugin to your tui.json:
~/.config/opencode/tui.json
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["opencode-sdd-engram-manage"]
}Open the plugin with:
- Shortcut:
Alt + K(Linux/Win) orCmd + K(macOS) - Slash command:
/sdd-model
- Open the plugin (
Alt+K/Cmd+Kor/sdd-model). - Create a profile for your project, or Manage Profiles to activate/configure one.
- From the profile detail, click any agent to change its model (provider β model picker).
- Click any fallback entry to override its model.
- Activate to apply the profile to the live runtime.
This is what users will see after installing the plugin:
This repo includes a script to ensure the sdd-orchestrator prompt contains the fallback policy block required for sdd-*-fallback agents to work correctly when a primary sub-agent fails.
- Script:
scripts/ensure-orchestrator-fallback-policy.ts - Supports: Inline prompt text in
opencode.jsonand external{file:...}references.
# Check mode (no changes)
npm run orchestrator:fallback:check
# Apply changes
npm run orchestrator:fallback:apply
# Custom config path
node ./scripts/ensure-orchestrator-fallback-policy.ts --config /path/to/opencode.jsonUnder examples/:
opencode-inline.jsonβ inline orchestrator prompt configopencode-external.json+sdd-orchestrator-example.mdβ external prompt file configprofiles/*.jsonβ profile payloads in new and legacy formats
Run smoke validation:
npm run examplesValidates:
- Fallback policy injection for inline and external prompt configs.
- Profile fixture readability for new (
models+fallback) and legacy formats.
Community PRs are welcome, but they must follow the repository review policy:
- start from a GitHub issue
- use a focused branch such as
feat/short_descriptionorfix/short_description - keep the diff as small as possible
- justify broader changes clearly in the PR description
See CONTRIBUTING.md for the full workflow and review requirements.
npm testTest coverage:
src/profiles.test.tsβ profile read/write, fallback sync, validation, activation logicsrc/memories.test.tsβ memory listing, deletion, normalization, sqlite query escapingsrc/utils.test.tsβ formatting helpers, agent naming predicates, model resolutionsrc/config.test.tsβ path resolution, XDG support, project name detectionscripts/ensure-orchestrator-fallback-policy.test.tsβ fallback policy injection logic
Uses semantic-release on pushes to main. See docs/publish.md for the full publish workflow and commit conventions.
- Package:
opencode-sdd-engram-manage - Current version: see CHANGELOG.md or npm
- Requires:
opencode >= 1.3.13 - Peer dependencies:
@opencode-ai/plugin ^1.4.9,@opentui/core ^0.1.100,@opentui/solid ^0.1.100,solid-js - License: MIT
Developed by j0k3r-dev-rgl.








