Fork of fmflurry/settings-opencode — a hardened OpenCode config with Node.js-first stack, framework-agnostic frontend architecture, and stricter model alignment. MIT licensed, fork freely. Evolves with my workflow.
Big thanks to @fmflurry for the original force behind this config. This fork adapts their solid foundation to a different stack and set of conventions.
Want to try it? Jump to Public install — it takes about five minutes.
This fork reorients the upstream config from a .NET + Angular shop toward a Node.js + framework-agnostic frontend stack:
| Area | Upstream (fmflurry) | This fork |
|---|---|---|
| Backend architecture | .NET 8 Clean Architecture (dotnet-clean-architecture) |
Node.js Clean Architecture (nodejs-clean-architecture: Fastify + Prisma + Zod) |
| Frontend architecture | Angular 18 standalone (angular-clean-architecture + store system) |
Framework-agnostic Hexagonal Architecture (frontend-hexagonal-architecture: works with any framework) |
| Accessibility skill | Angular-specific angular-accessibility (ARIA audit) |
Framework-agnostic frontend-accessibility |
| State management | flurryx store patterns (flurryx skill + merge-cop sub-pages) |
Removed — no framework-specific state prescription |
| Pre-merge review | Angular-specific (signals, RxJS, flurryx, clean-architecture sub-pages) | Framework-agnostic (TS strict, architecture, state management) |
| Domain-specific skill | flurryx — custom state-management patterns |
Not applicable; removed |
| Subagent model env vars | OPENCODE_MODEL_SUBAGENT_WORKER |
Renamed to OPENCODE_MODEL_SUBAGENT_PROGRAMMER |
| Autoskills | None | .agents/skills/: bash-defensive-patterns, frontend-design, nodejs-best-practices, use-ai-sdk |
| Development patterns | Not present | instructions/patterns/: KISSME, SINE, POLA, SoC+CQS, CBD |
| Verification gate | Not present | instructions/verification-gate.md: build-verification enforcement before "done" |
| Config style | {.config/opencode/...} path literals |
{env:OPENCODE_SRC_ROUTE}/opencode/... — env-driven for portability |
| Skill reproducibility | Not tracked | skills-lock.json — pins skill SHAs |
| Package manager | package-lock.json only |
bun.lock (Bun-first) + mise.toml |
| Env template | Not present | .env.example — copy to .env.local and fill |
| Documentation | English + French | English only (French section removed) |
| Install method | Manual steps only | install.sh script (interactive or --yes) |
A hardened primary conductor agent backed by 13 specialist sub-agents (planner, architect, coder, writer, code/security/database review, TDD, build-fix, e2e, doc, refactor, git), wired together by:
- Mandatory sub-agent delegation from
conductor: the primary haswriteandeditdenied at the permission layer, plus atool.execute.beforehook that blocks bash redirects to source files (> file.ts,tee,sed -i, heredocs,python -c open().write). The orchestrator cannot patch files — every change MUST go throughcoder(source code),writer(docs/markdown/HTML),tdd-guide(tests), orgit-specialist(commits/PRs). This makes routing model-agnostic: even open-weight models that ignore prose rules are mechanically forced to delegate. - Front-loaded first-tool gate in
prompts/agents/conductor.txt: hard rules at the top, routing table second, six few-shot User →taskexamples (with explicit wrong-way contrasts) so literal models copy the right pattern. - Slash commands that force routing to the right specialist (
/plan,/tdd,/security,/code-review, …). - Always-on skills loaded at session start — Socratic design, security review, coding standards, git workflow, Serena bootstrap.
- OpenCode plugins — ECC hooks (Prettier +
tscon save), continuous-learning v2 (the homunculus instinct store), worktree spawner, auto-compact, caveman ultra mode, Figma RAG trigger, macOS notifications, startup bootstrap, persistent memory blocks (opencode-agent-memory). - Custom tools —
run-tests,check-coverage,security-audit, plus a codemap generator. - A
.claude/mirror — hooks, rule packs, learned skills, and the shared homunculus store, so Claude Code benefits from the same guardrails.
The two halves stand alone. Use the OpenCode side, the Claude Code mirror, or both — whichever you'd find useful.
The repo is designed to become (or symlink into) ~/.config/opencode/, plus an optional ~/.claude/ mirror. There are two paths: a one-shot script (recommended) and a manual walk-through if you want to see every step.
- macOS or Linux (the worktree and notification plugins assume macOS — works on Linux with minor degradation).
- OpenCode CLI installed and on your
PATH. - Claude Code installed if you want the
.claude/half. - Either Bun (recommended —
bun.lockis what's checked in) or Node.js 20+ withnpm. git, plusuv/uvxfor the Serena MCP server (brew install uvon macOS, orpip install uv).
git clone https://github.com/YoelCieno/settings-opencode.git ~/Workspace/settings-opencode
cd ~/Workspace/settings-opencode
./install.shinstall.sh is interactive by default. It will:
- Verify your prerequisites (
git,bun/npm,uv). - Symlink the repo into
~/.config/opencode(backing up any existing config to*.bak.<timestamp>). - Run
bun install(ornpm ciif Bun isn't available). - Add the
OPENCODE_MODEL_*andOPENCODE_REASONING_*defaults to your shell rc, fenced with markers so re-runs and uninstalls are idempotent. - Optionally symlink
.claude/into~/.claude(skip with--no-claudeif you only want the OpenCode half). - Print a smoke-test command and the locations to tweak afterwards.
Useful flags:
| Flag | Behaviour |
|---|---|
| (none) | Interactive walk-through with [Y/n] prompts and sensible defaults. |
--yes, -y |
Non-interactive — accept all defaults. Still backs up existing dirs before clobbering. |
--no-claude |
Skip the ~/.claude mirror (handy if you only use OpenCode, or want to manage Claude Code separately). |
--uninstall |
Remove the env-var block + the two symlinks. Never deletes the cloned repo, your data, or *.bak.* backups. |
--help, -h |
Print usage. |
The script writes a fenced block to your shell rc (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish) that looks like this:
# >>> settings-opencode >>>
# Added by settings-opencode installer. Edit values to match your provider.
export OPENCODE_MODEL_PRIMARY="anthropic/claude-sonnet-4-6"
export OPENCODE_MODEL_SUBAGENT_PLANNER="anthropic/claude-opus-4-7"
export OPENCODE_MODEL_SUBAGENT_PROGRAMMER="anthropic/claude-sonnet-4-6"
export OPENCODE_MODEL_SUBAGENT_MINI="anthropic/claude-haiku-4-5"
export OPENCODE_REASONING_PRIMARY="high"
export OPENCODE_REASONING_SECONDARY="medium"
export OPENCODE_REASONING_TERTIARY="low"
# <<< settings-opencode <<<Edit the values inside the markers to point at whichever provider you use. Re-running ./install.sh rewrites the same block; ./install.sh --uninstall removes it cleanly.
If your shell isn't bash/zsh/fish, the script prints the env block for you to paste manually and continues with the rest of the install.
Click to expand the step-by-step manual walk-through (same outcome as the script).
OpenCode loads ~/.config/opencode/opencode.jsonc at startup, so the simplest install is to clone (or symlink) the repo there.
# Back up anything you already have there
mv ~/.config/opencode ~/.config/opencode.bak 2>/dev/null || true
# Clone
git clone https://github.com/YoelCieno/settings-opencode.git ~/.config/opencode
cd ~/.config/opencodePrefer keeping the repo elsewhere? Symlink it instead:
git clone https://github.com/YoelCieno/settings-opencode.git ~/Workspace/settings-opencode
ln -s ~/Workspace/settings-opencode ~/.config/opencodebun install # uses bun.lock
# or
npm ciThe agent block in opencode.jsonc is parameterized via env vars so you can swap providers without editing the config. Add these to your shell profile (~/.zshrc, ~/.bashrc, etc.):
# Required (OpenCode model identifiers — adjust to whatever provider you use)
export OPENCODE_MODEL_PRIMARY="anthropic/claude-sonnet-4-6"
export OPENCODE_MODEL_SUBAGENT_PLANNER="anthropic/claude-opus-4-7"
export OPENCODE_MODEL_SUBAGENT_PROGRAMMER="anthropic/claude-sonnet-4-6"
export OPENCODE_MODEL_SUBAGENT_MINI="anthropic/claude-haiku-4-5"
# Reasoning effort tiers
export OPENCODE_REASONING_PRIMARY="high"
export OPENCODE_REASONING_SECONDARY="medium"
export OPENCODE_REASONING_TERTIARY="low"If your provider doesn't support reasoningEffort, OpenCode silently ignores it — pick any value.
opencode.jsonc declares four MCP servers. Serena is required — instructions/serena.md is loaded on every session and will fail to activate without it. The others are optional but documented here so you know what you're opting into.
| Server | Install | Status |
|---|---|---|
| serena | pip install uv (or brew install uv) — the config invokes uvx --from git+https://github.com/oraios/serena serena start-mcp-server |
Required. IDE-grade semantic code retrieval used by instructions/serena.md. |
| context7 | nothing — npx -y @upstash/context7-mcp@latest is auto-installed at session start |
Live docs lookup. Auto-bootstraps on first use. |
| wallaby | install Wallaby.js and run wallaby update-mcp |
Optional. Runtime-test introspection. |
| Figma | enabled: false by default |
Optional. Flip enabled: true and set up Figma MCP for design-system tools. |
The repo ships a .claude/ subtree. If you also use Claude Code, link or copy it into ~/.claude/. The two halves don't depend on each other — install only what you need.
# Back up
mv ~/.claude ~/.claude.bak 2>/dev/null || true
# Symlink approach (recommended — stays in sync with the repo)
ln -s ~/.config/opencode/.claude ~/.claude
# Or copy approach (independent of the repo)
cp -R ~/.config/opencode/.claude ~/.claudeWhat this installs:
.claude/CLAUDE.md— global user instructions Claude Code reads on every session..claude/settings.json— permissions, hooks, env vars (API_TIMEOUT_MS, autocompact threshold, etc.)..claude/hooks/*.sh— pre-tool-use security warnings + stop hook..claude/rules/{common,typescript}/*.md— coding-style/testing/security rule packs..claude/commands/*.md— extra slash commands (/create-pull-request,/curate-learned-skills,/update-codemaps)..claude/skills/**— a curated catalog of "learned" skills (project-specific patterns, debugging recipes)..claude/homunculus/— the shared instinct store used by continuous-learning v2 (kept empty in fresh installs; populated by the OpenCode plugins as you work).
opencodeYou should see:
- The caveman ultra TUI sidebar plugin show up (or be silent if you're not in a caveman session).
instructions/serena.mdask Serena to activate the project on first user message.- The continuous-learning v2 injector preload high-confidence instincts into the system prompt.
Then drop a slash command:
/plan add a TODO list to my homepage
It should route to the planner sub-agent and return a structured plan without writing code.
cd ~/.config/opencode
git pull
./install.sh --yes # refreshes deps + env block; idempotent
# or, if you want to do it by hand:
# bun install (or: npm ci)If a new plugin shows up, OpenCode picks it up on the next restart. If an env var is added to opencode.jsonc, this README will mention it.
Fork of fmflurry/settings-opencode — dotfiles for OpenCode + the stable parts of ~/.claude. Ships a hardened primary conductor agent (no write/edit perms — must delegate), 13 specialist sub-agents, always-on skills, slash commands, OpenCode plugins (hooks, instincts, worktrees, auto-compact, caveman, figma RAG, notifications), custom tools, and a Claude Code mirror. Replaces .NET + Angular stack with Node.js + framework-agnostic frontend architecture.
- Reproducibility: same agent behavior across machines/sessions.
- Quality: on-demand TDD, frequent verification, centralized conventions.
- Security:
security-reviewskill loaded by default + pre-tool-use hooks. - Continuous improvement: instincts captured into
~/.claude/homunculus, surfaced into the system prompt on the next session.
- Configs:
opencode.jsonc,dcp.jsonc(dynamic context pruning),ocx.jsonc(OCX registries),tui.json(TUI theme). - Profiles:
profiles/<name>/(per-profile overrides +AGENTS.md, run withocx opencode -p <name>). - Skills:
skills/*/SKILL.md(plus auxiliary docs). - Agent prompts:
prompts/agents/*.txt. - Slash commands:
commands/*.md. - OpenCode plugins:
plugins/*.{ts,js}+plugins/kdco-primitives/,plugins/worktree/. - TUI plugins:
tui-plugins/*.tsx. - Custom tools:
tools/*.ts. - Mode notes:
contexts/*.md. - Global instructions:
instructions/subagent-routing.md,instructions/serena.md,instructions/caveman-ultra.md,instructions/verification-gate.md. - Development patterns:
instructions/development-patterns.md(+instructions/patterns/— KISSME, SINE, POLA, SoC+CQS, CBD). - Scripts:
scripts/setup-package-manager.js,scripts/codemaps/generate.ts. - Env template:
.env.example(copy to.env.localand fill). - Skill lockfile:
skills-lock.json(pins skill SHAs for reproducibility). - Claude mirror:
.claude/CLAUDE.md,.claude/settings.json,.claude/hooks/,.claude/rules/,.claude/skills/,.claude/commands/,.claude/homunculus/. - Intentional exclusions (
.gitignore):.serena/local MCP state,node_modules/,.instinct-digest-state.json,antigravity-*,.DS_Store, local.env*files except.env.example.
Six concerns wired in one file:
instructions: always-on skills loaded at session start. Currently:instructions/subagent-routing.md— Task-first subagent delegation gate.instructions/serena.md— activates Serena MCP after the routing gate when specialist delegation does not apply.skills/socratic-design/SKILL.md— evidence-first decision gating.skills/security-review/SKILL.md— OWASP checklist.skills/coding-standards/SKILL.md— code conventions.skills/git-workflow/SKILL.md— branches, commits, PRs.
default_agent:conductor(orchestrator-only — cannot write/edit).agent: sub-agent definitions (model + reasoning effort + prompt + tool allowlist). All models are env-driven (OPENCODE_MODEL_*,OPENCODE_REASONING_*) — see Public install § 4.command: maps/<name>-> template + sub-agent +subtask.mcp: serena, context7, wallaby, Figma (disabled).plugin: external marketplace plugins (@tarquinen/opencode-dcp@latest,opencode-agent-memory).
dcp.jsonc configures the Dynamic Context Pruning plugin. ocx.jsonc registers OCX registries.
Defined in opencode.jsonc under agent:
| Agent | Mode | Role |
|---|---|---|
conductor |
primary | Orchestrator. write + edit denied at the permission layer. Routes every change to a specialist via Task. Bash redirects to source files blocked by the ECC pre-tool hook. |
planner |
subagent | Plan + risks before large changes. Read+bash, no edit. |
architect |
subagent | System design / scalability decisions. Read+bash only. |
coder |
subagent | Pure non-test implementation. Mandatory build+lint+standards self-check before reporting done. Socratic ambiguity gate. |
writer |
subagent | Writes docs/markdown/HTML/text artifacts. Forbidden from touching source code — refuses out-of-scope files back to the conductor. |
code-reviewer |
subagent | Quality review over diffs and conventions. Read-only — findings only; fixes go to coder. |
security-reviewer |
subagent | OWASP/secrets/deps review. Read-only — reports vulnerabilities; remediation routed to coder. |
tdd-guide |
subagent | RED -> GREEN -> REFACTOR + 80% coverage. Writes tests; delegates GREEN impl to coder via scoped Task perm. |
build-error-resolver |
subagent | Build/TS error fixes with minimal diffs. |
e2e-runner |
subagent | Playwright E2E tests. |
doc-updater |
subagent | Generated docs + codemaps. |
refactor-cleaner |
subagent | Dead-code removal + consolidation. |
database-reviewer |
subagent | PostgreSQL / Supabase schema, perf, security. |
git-specialist |
subagent | Branches, commits, pushes, PRs (mini model). |
Delegation is enforced at three layers, so the same behavior holds whether the primary model is Claude, GPT, DeepSeek, or any open-weight runner that ignores prose hints:
- Permissions —
conductorhastools.write: false,tools.edit: false, andpermission.edit/write: denyinopencode.jsonc. The Task allowlist enumerates every legal specialist;*: denyblocks anything else. The orchestrator literally has no file-mutation tool. - Pre-tool hook (
plugins/ecc-hooks.ts) — defense in depth: blocks bash commands that would write to source files via shell redirect (>,>>),tee,sed -i, heredocs, orpython -c open().write. Throws aborting the tool call with an explicit "delegate to coder/writer/tdd-guide" message. Applies globally — no subagent should be writing code through bash either. - Front-loaded prompt (
prompts/agents/conductor.txt) — hard rules in the first lines, routing table second, six worked few-shot examples showing User →taskcalls with explicit wrong-way contrasts.instructions/subagent-routing.mdenforces a Task-first gate before direct inspection.
Use these paths depending on how much control you want:
- Plain request:
conductorconsults the routing table and dispatches the matching specialist via Task. @agentmention: manually invokes a specific subagent in the conversation.- Slash command: forces a subtask with a configured template, e.g.
/plan,/tdd,/security.
Why this exists: GPT/Claude often infer delegation from short descriptions, but open-source/open-weight models are more literal and tend to inspect or edit first. Permissions + the hook + the front-loaded gate make delegation mechanically enforced rather than instruction-dependent.
Templates in commands/. Most run as subtask: true (delegated to a specialist).
| Command | Sub-agent | Purpose |
|---|---|---|
/git |
git-specialist | Bounded git ops (branches, commits). |
/push-changes |
git-specialist | Commit + push with upstream guard. |
/plan |
planner | Implementation plan. |
/tdd |
tdd-guide | TDD cycle with coverage. |
/code-review |
code-reviewer | Quality review. |
/security |
security-reviewer | Security audit. |
/build-fix |
build-error-resolver | Build/TS error resolution. |
/e2e |
e2e-runner | E2E test generation/run. |
/refactor-clean |
refactor-cleaner | Dead-code cleanup. |
/orchestrate |
planner | Multi-agent orchestration. |
/update-docs |
doc-updater | Doc updates. |
/update-codemaps |
doc-updater | Generates docs/CODEMAPS/. |
/test-coverage |
tdd-guide | Coverage analysis. |
/learn |
(primary) | Extract reusable patterns from the session. |
/checkpoint |
(primary) | Save verification + progress state. |
/verify |
(primary) | Verification loop. |
/eval |
(primary) | Evaluate against criteria. |
/setup-pm |
(primary) | Configure package manager. |
/skill-create |
(primary) | Generate a skill from git history. |
/instinct-status |
(primary) | Inspect learned instincts. |
/instinct-import |
(primary) | Import instincts. |
/instinct-export |
(primary) | Export instincts. |
/evolve |
(primary) | Cluster instincts into skills. |
Always-on:
.agents/skills/— autoskills loaded automatically by OpenCode:bash-defensive-patterns,frontend-design,nodejs-best-practices,use-ai-sdk.
Declared in instructions:
skills/socratic-design/SKILL.md— evidence-first decision gating.skills/security-review/SKILL.md— security checklist + scenarios.skills/coding-standards/SKILL.md— naming, immutability, file size, error handling.skills/git-workflow/SKILL.md— branches, conventional commits, push guards.instructions/serena.md— connects Serena MCP per session.
New skills on-demand (loaded by description / by command):
skills/nodejs-clean-architecture/SKILL.md(+ playbooks) — Fastify + Prisma + Zod scaffolding.skills/frontend-hexagonal-architecture/SKILL.md(+ framework-wiring, implementation-playbooks) — Framework-agnostic Hexagonal Architecture for any frontend framew-skills/tdd-workflow/SKILL.md— full TDD methodology.skills/caveman/SKILL.md,caveman-commit,caveman-review— terse mode.skills/strategic-compact/SKILL.md— manual compaction at logical breakpoints.ork.skills/frontend-accessibility/SKILL.md— Framework-agnostic a11y audit and fixes.
All TypeScript plugins use @opencode-ai/plugin@1.4.6.
plugins/ecc-hooks.ts— Prettier on edited JS/TS,console.logdetection, sensitive-command reminders (git pushetc.), and the conductor hard-stop: aborts bash redirects (>,>>,tee,sed -i, heredocs,python -c open().write) targeting source files so delegation cannot be bypassed via shell.plugins/instinct-injector.ts— reads~/.claude/homunculus, filters by confidence, injects instincts into the system prompt (continuous-learning v2 read side).plugins/instinct-observer.ts— capturestool.execute.before/afterevents and appends toobservations.jsonl(write side).plugins/instinct-digest.ts— session-start diff: surfaces new/updated instincts since last session.plugins/continuous-learning-stop-hook.js— legacy v1 stop hook, callsskills/continuous-learning/bin/evaluate-session.jsto write a draft intoskills/learned/.plugins/auto-compact.js— auto-compacts onceOC_COMPACT_THRESHOLDtool calls are reached, only while idle.plugins/notification.js— macOS notification + sound onsession.idle.plugins/caveman-server.ts+tui-plugins/caveman.tsx— injects caveman instructions into the system prompt + TUI sidebar showing active mode.plugins/figma-mcp-trigger.js— Figma RAG: readsfigma-rag.md(orOPENCODE_FIGMA_RAG_PATHS) and injects snippets when designs are referenced.plugins/worktree.ts(+plugins/worktree/) — creates an isolated git worktree for the session and spawns a terminal (mac/Win/Linux). Inspired by opencode-worktree-session.plugins/startup-bootstrap.ts— runsserena_activate_projecton the first tool call of a session.plugins/kdco-primitives/— shared utilities (mutex, shell, terminal-detect, project-id resolver, types).opencode-agent-memory(external, declared inopencode.jsonc › plugin) — Letta-style persistent memory blocks (memory_list,memory_set,memory_replace) + optional journal. Data in~/.config/opencode/memory/*.md(global) +.opencode/memory/*.md(project).@tarquinen/opencode-dcp@latest(external, declared inopencode.jsonc › plugin) — Dynamic Context Pruning. Trims stale tool results and large files from the live context window so long sessions don't blow past the model's limit. Configured viadcp.jsoncat the repo root.
Reusable OpenCode tools exposed via tools/index.ts:
tools/run-tests.ts— detects package manager + framework and builds the test command.tools/check-coverage.ts— reads coverage reports and compares against a threshold.tools/security-audit.ts— scans deps + secrets + risky patterns.
tui-plugins/caveman.tsx — React sidebar that shows a "CAVEMAN ULTRA" badge when the mode is active (flag file written by caveman-server.ts).
Two pipelines coexist (backwards compat):
- v1 (legacy) —
plugins/continuous-learning-stop-hook.js->skills/continuous-learning/stop.sh->skills/continuous-learning/bin/evaluate-session.jswrites at most one draft intoskills/learned/. - v2 (homunculus, shared with Claude Code) —
plugins/instinct-observer.tswrites to~/.claude/homunculus/projects/<id>/observations.jsonl. A daemon (ECC side) clusters observations into instincts.plugins/instinct-injector.tsinjects them into the system prompt.plugins/instinct-digest.tsproduces a session-start diff.
Curation:
/curate-learned-skills(Claude Code side) — reviews drafts inlearned/and promotes the valuable ones into real skills./instinct-status//evolve— inspect and evolve instincts into skills.
CLAUDE.md— global user instructions (noany, facade != UseCase).settings.json— allow/deny permissions, env (API_TIMEOUT_MS=3000000,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=80),PreToolUse/PostToolUse/Stophooks.hooks/pre-tool-use.sh— warning-only checks on sensitive commands/files.hooks/stop.sh— Claude Code stop hook.rules/common/*.md+rules/typescript/*.md— rule packs (style, testing, security, patterns, hooks, agents).commands/{create-pull-request,curate-learned-skills,update-codemaps}.md— Claude commands.skills/**— curated catalog of "learned" skills.homunculus/{instincts,evolved,observations.archive}— store shared with OpenCode.
- Startup: OpenCode loads
opencode.jsonc-> always-on instructions ->instinct-injectorpreloads instincts ->instinct-digestproduces a diff ->caveman-serveradds caveman preamble if active. - First user action:
startup-bootstraptriggersserena_activate_project. - Dev:
conductorexecutes — it cannot write files; it dispatches Task calls to specialists.ecc-hooksformats / flagsconsole.log/ blocks bash-write bypasses.instinct-observerarchives events. - Workflow:
conductorroutes to specialists through Task (perm-enforced);/plan,/tdd,/security, etc. force the same routing explicitly. - Idle:
auto-compacttriggers when the tool-call threshold is reached;notificationpings macOS. - Stop: v1 hook writes a draft; v2 daemon clusters observations into instincts for the next session.