Imported from AgustinH09/dotfiles (
dot_config/opencode/AGENTS.md). Install upstream withnpx skills add AgustinH09/dotfiles --skill opencode. Copyright stays with the author.
AGENTS.md — ~/.config/opencode
This repo IS the global OpenCode configuration, not a project. Every edit here
affects all OpenCode sessions on this machine. Load the built-in
customize-opencode skill before changing config shapes.
Golden rules
- Restart required:
opencode.jsonc,tui.json, agents, commands, skills, plugins, and themes are loaded once at startup. After any edit, tell the user to quit and restart OpenCode. No hot reload. - Strict validation: OpenCode refuses to start on an invalid
opencode.jsoncfield. Check https://opencode.ai/config.json before writing fields you are unsure about. Keep the$schemaline. JSONC comments are OK. - Broken startup: fix config files directly in neovim. For plugin/skill
breakage, boot with
OPENCODE_PURE=1(skips external plugins) orOPENCODE_DISABLE_EXTERNAL_SKILLS=1, fix, restart without the flag.
Layout (all auto-discovered — no registration in opencode.jsonc needed)
| Path | Contents |
|---|---|
opencode.jsonc |
global config: MCP servers, small_model, instructions, npm plugin array |
notification-ntfy.json |
ntfy.sh push-notification backend config (topic via {env:NTFY_TOPIC}) |
tui.json |
keybinds + theme |
agents/*.md |
subagents (bugbot, security-review, council-*) |
commands/*.md |
slash commands |
skills/<name>/SKILL.md |
skills paired with commands |
plugins/*.{ts,js} |
local plugins (rtk, notify); npm plugins live in the plugin array |
themes/*.json |
custom themes, referenced by name from tui.json |
- Prefer new files in these dirs over inline
agent:/command:blocks inopencode.jsonc. - Commands are thin wrappers:
commands/review.mdonly says "load thereviewskill". To change behavior, editskills/<name>/SKILL.md, not the command.
Gotchas
- MCP env vars: local MCP servers here use
"environment"(verified working withlinkedin), NOT"env"as some docs/skills show. Thelinkedinserver needsuvxon PATH;sentryis remote. plugins/rtk.tsis a thin delegator: rewrite rules live in the rtk Rust registry (rtk rewrite), never in this file. Requires thertkbinary on PATH (homebrew).plugins/notify.jsfires macOS notifications on idle/error/permission-ask.- cursor-acp bridge (
@rama_nigg/open-cursor): pinned version + source-audit date are recorded inline inopencode.jsonc; never bump without re-auditing the npm tarball. Provider model keys must be bare ids ("auto", NOT"cursor-acp/auto") or lookup fails with a misleading "Model not found … Did you mean" error. Auth comes fromcursor-agent login(first-party token store), noopencode auth loginneeded. The proxy spawns per-process on 127.0.0.1:32124 (no persistent daemon). The model list is a synced snapshot (19 families, see date in the config comment); to refresh, runopen-cursor sync-models --variants --compactwithOPENCODE_CONFIGpointed at a THROWAWAY json file, then hand-merge themodelsmap — running it against this JSONC directly rewrites it as plain JSON and strips comments. Variant selection (fast/thinking/effort) happens in the TUI viavariant_cycleafter picking the family, or thevariantfield in an agent/command definition — there is NO--model provider/model/variantCLI syntax (opencode 1.18.3 rejects it with a cryptic "Unexpected server error"). Bridge env toggles (set in~/.zshrc):CURSOR_ACP_BRIDGE_JSON=offdisables the bridge-json prompt shim (its "SYSTEM: opencode bridge" preamble makes models complain about prompt injection on every message);CURSOR_ACP_WORKSPACEpins the workspace path Cursor attributes usage to (oc-lmsalias pins the principal work repo);CURSOR_ACP_SESSION_RESUME=trueresumes the underlying Cursor chat across opencode restarts. Env only reaches the process that OWNS the :32124 proxy — restart stale opencode processes after changing these. Caveat: with the Option C manual provider block ALL bridge traffic goes to whatever opencode process owns :32124 first, so attribution follows the proxy owner's spawn directory unless the env pin is set on that process. package.json+node_modulesexist only for@opencode-ai/plugintypes (editor IntelliSense when writing plugins). npm plugins from thepluginarray install to~/.cache/opencode/node_modules/instead.node_modules,package-lock.json,bun.lock, and.gitignorehere are chezmoi-ignored (see.chezmoiignore.tmplin the dotfiles repo); runnpm installafter a fresh machine bootstrap.- Versioned via chezmoi, not local git. This whole tree is managed by
chezmoi (source repo:
~/.local/share/chezmoi, remote: dotfiles). Any change here MUST be tracked and shipped with this workflow:- Edit files in
~/.config/opencode(the target dir). chezmoi re-add ~/.config/opencodefor modified files;chezmoi addfor new files (skip machine-generated artifacts — chezmoiignore covers them).- In the source repo: branch off
origin/main(git checkout -b feat/<topic> origin/mainafter a fetch; never branch off whatever feature branch happens to be checked out). - Always run pre-commit before committing:
uvx pre-commit run --files <changed>(pre-commitis not installed globally;uvxis). The repo runs gitleaks/trivy/trufflehog — no secrets, tokens, or plaintext topics in committed files. - Conventional commit, push,
gh pr create --base main.
- Edit files in
- External skills:
~/.agents/skills/(computer-use, council, find-skills, orca-cli, orchestration) auto-load but live OUTSIDE this repo — edit them in place there, never copy them in here.
Instruction chain (keep these scopes separate)
- This
AGENTS.md— only active when a session's cwd is inside this directory (i.e. when managing the config itself). personal-rules.md— loaded for EVERY session viainstructionsinopencode.jsonc(no AI attribution in commits/PRs, conventional commits).~/.claude/CLAUDE.md→@RTK.md— loaded via Claude Code compatibility; RTK token-saver rules. Thertkplugin enforces them automatically.
Keep global personal rules in personal-rules.md; keep config-management
guidance here. Do not duplicate one into the other.
Conventions
- User is a neovim user who wants keybind-driven workflows. TUI leader is
ctrl+x; follow the existing leader-based style when adding keybinds intui.json. Current theme:tokyonight-storm. small_model: google/gemini-3.5-flashhandles housekeeping (title/summary). Subagents pin their own models in frontmatter (e.g. bugbot →google/gemini-3.1-pro-preview); pick a deliberate per-agent model when adding new agents instead of inheriting the session model.- The
council-*agents are a deliberately model-diverse set (different labs per role) — extend the set rather than collapsing them into one agent.