OpenCode Config

June 8, 2026 · View on GitHub

Shared OpenCode skills, agents, plugins, and commands.

Published from timmo001/dotfiles — OpenCode config at agents/.config/opencode/ and shared skills at agents/.agents/skills/.

Installation

Clone the repo and copy what you need into your OpenCode config directory:

git clone https://github.com/timmo001/opencode-config.git
cd opencode-config

# Copy individual items
cp -r skills/diagnose ~/.agents/skills/
cp commands/inject-context.md ~/.config/opencode/commands/
cp plugins/env-protection.ts ~/.config/opencode/plugins/
cp agents/reviewer.md ~/.config/opencode/agents/

# Or copy everything
cp -r skills ~/.agents/
cp -r agents commands plugins ~/.config/opencode/

Stow users: If your OpenCode config is managed by GNU Stow or a similar symlink manager, the cp commands above will not work — they copy into the live path rather than your stow source directory. Either follow the dotfiles setup this repo is published from, or ask an agent to adapt the files into your own stow structure.

Some skills and commands depend on plugins to function. Check the tables below for required plugins and install them alongside the skill or command.

Importing Skills

Once you have the import-external-skill skill installed, you can use it to import skills from this or any public GitHub skills repo. Point it at a skill directory URL and it handles fetching, frontmatter conversion, and origin tracking:

# origin: https://github.com/timmo001/opencode-config/tree/main/skills/<skill-name>

It also supports a review mode: give it a repo URL and it will list all available skills, compare them against your local library, and recommend which to import, adapt, or skip.

Agents, commands, and plugins are not managed by import-external-skill — copy them manually as shown above.

Minimum Configuration

This repo provides skills, agents, commands, and plugins but not an opencode.json config file. You need one to load them. Here is a minimal starting point:

{
  "$schema": "https://opencode.ai/config.json",
  // Choose your provider and model
  "model": "anthropic/claude-sonnet-4-20250514",
  // Agents defined in agents/ are loaded automatically from ~/.config/opencode/agents/
  // MCP servers, tool overrides, and provider options go here as needed
}

Place it at ~/.config/opencode/opencode.json (or opencode.jsonc for comments). See the OpenCode docs for the full configuration reference.

How It Fits Together

The config is built around a few patterns:

  • Branch context injection — The branch-context plugin pre-computes git and PR state once per command and injects it as structured XML. Commands that need current-branch context declare a dependency on this plugin instead of running their own git/gh calls.
  • Graduated agent permissions — Agents range from fully read-only (reviewer, ask) through ask-gated (build-ask) to edit-capable (refactorer, build-locked). A guard plugin prevents read-only agents from escalating via subagent delegation.
  • Scoped cleanup commands — Commands like /types-enforce-ts, /cleanup-unnecessary-variables, and /remove-single-use-functions combine branch-context work-scope with a matching skill and route through the refactorer agent, keeping changes within the current git diff.
  • Skill-based routing — Commands are thin wrappers that name an agent, declare required skills, and state whether branch context is needed. The workflow logic lives in skills and plugins, not in the command itself.
  • Secret protection — The env-protection plugin blocks reads of .env files (except .env.example) across all agents.

Skills

SkillDescriptionRequiresWorks with
branch-context-consumerConsume BranchContextPlugin injections in commands. Use when a command depends on an injected block for its scope.branch-context plugin
check-skill-updatesCheck imported skills for upstream changes and apply updates. Use when reviewing whether externally imported skills have new upstream content, or when dot skill-updates reports available changes.import-external-skill skill
cleanup-unnecessary-variablesSafe unnecessary-variable cleanup guidance for code review and refactoring.
dotfiles-stowREQUIRED when changing configs managed by ~/.config/dotfiles or ~/.config/dotfiles-private. Enforces editing stow source paths (not ad-hoc live paths) and using the dot command for stow/update/validation workflows.
git-contextPatterns for working with git branches, remotes, diffs against the default branch, and rebases. Use when resolving rebase conflicts, continuing interactive rebases, amending commits, or any git operation that would open an interactive editor.branch-context plugin
grill-questionsRun an extended one-question-at-a-time planning interview to stress-test a proposed change before implementation. Use when the user says grill, grill me, stress-test this plan, ask more questions, or wants to expand the planning/question window instead of moving straight to a plan.ask-questions-if-underspecified skill
handoffCompact the current conversation into a handoff document for another agent to pick up.
home-assistant-frontendHome Assistant frontend development with Lit Web Components and TypeScript. Use when working in the Home Assistant frontend repo, editing ha-* components, reviewing HA PRs, or applying HA-specific conventions (localization, theming, dialogs, panels, cards).cleanup-unnecessary-variables skill,home-assistant-lazy-context skill,home-assistant-list-components skill,home-assistant-lit-rendering skill,lit-rendering skill,remove-single-use-functions skill,types-enforce-ts skill
home-assistant-lazy-contextHome Assistant frontend lazy-context, memoization, and hass removal guidance. Use when migrating Lit components from hass!: HomeAssistant, .hass=${...}, or broad hass access to context slices.
home-assistant-list-componentsHome Assistant list component migration and usage guidance. Use when editing ha-list, ha-list-item, ha-md-list, or migrating to ha-list-nav, ha-list-selectable, ha-list-item-button, ha-list-item-option, or ha-list-item-base.
home-assistant-lit-renderingHome Assistant Lit rendering extensions for HA components and context-aware picker callback shape.lit-rendering skill
import-external-skillImport skills from external repos into the local dotfiles skill library. Use when pulling in a skill from a public repo, reviewing an external skill set for useful additions, or adapting external skill content into existing local skills.
lit-renderingLit rendering and picker callback-shape guidance for editing and reviewing Lit components.
pkexec-rootUse pkexec first for commands that need root directly or indirectly.
pr-reviewGuidelines for reviewing pull requests - what to analyze, review etiquette, and output formatting
remove-single-use-functionsSafe single-use function removal guidance for code review and refactoring.
safe-process-signalsSafe process killing and signal handling for agent/subprocess contexts. Use when running pkill, killall, kill, or any process termination command from a shell subprocess, automated script, or coding agent.
types-enforce-tsTypeScript type-safety guidance for editing and reviewing .ts, .tsx, .mts, and .cts files.fallow skill

From External Sources

These skills were imported from other repos. Some are used as-is; others have been adapted for local workflows and conventions.

SkillOriginLocal ChangesRequiresWorks with
ask-questions-if-underspecifiedtrailofbits/skillsYesgrill-questions skill
css-motion-systemsstolinski/s-stackYes
diagnosemattpocock/skillsYes
effectanomalyco/opencodeNo
fallowfallow-rs/fallow-skillsNo
htmlstolinski/s-stackYes
improve-codebase-architecturemattpocock/skillsYes
motion-choreography-patternsstolinski/s-stackNo
opentuianomalyco/opentuiYes
write-a-skillmattpocock/skillsYes

Agents

AgentDescription
askAsk clarifying questions before taking action
build-askBuild agent that executes clear tasks and relies on permissions for write actions
build-lockedBuild agent that can edit files but cannot run shell commands
general-readonlyGeneral-style parallel subagent that researches with read-only tools and a narrow shell inspection allowlist (for delegation from read-only primaries).
grillExtended read-only planning interview agent for one-question-at-a-time grilling
refactorerRefactor code while preserving behavior and following local command and skill workflows
reviewerReviews code for quality, bugs, security, and best practices

Commands

CommandDescriptionAgentRequiresWorks with
/all-lit-skillsApply all Lit rendering skills in current git scopedefaultbranch-context plugin,branch-context-consumer skilllit-rendering skill
/all-ts-skillsApply all TypeScript-specific skills in current git scopedefaultbranch-context plugin,branch-context-consumer skillcleanup-unnecessary-variables skill,fallow skill,remove-single-use-functions skill,types-enforce-ts skill
/check-skill-updatesCheck imported skills for upstream updatesdefaultimport-external-skill skill
/debug-frontendDebug browser-specific UI issues with Chrome DevTools tools firstask
/explore-codebaseExplore a codebase topic with the task explore subagentask
/fallow-auditAudit changed JavaScript or TypeScript code with Fallowaskfallow skill
/fallow-project-analyseAnalyse a JavaScript or TypeScript project with Fallowaskfallow skill
/grillStress-test a proposed change with one-question-at-a-time planning questionsgrillgrill-questions skill
/handoffWrite a handoff document for the next agent sessiondefault
/handoffs-listList handoff notes for the current repositorydefaulthandoff skill
/home-assistant/all-frontend-skillsApply all Home Assistant frontend skills in current git scopedefaultbranch-context plugin,branch-context-consumer skillcleanup-unnecessary-variables skill,home-assistant-frontend skill,home-assistant-lazy-context skill,home-assistant-list-components skill,home-assistant-lit-rendering skill,lit-rendering skill,remove-single-use-functions skill,types-enforce-ts skill
/home-assistant/lazy-contextReview and fix Home Assistant frontend lazy-context and memoization usage in current git scopedefaultbranch-context plugin,branch-context-consumer skill,home-assistant-frontend skill,home-assistant-lazy-context skillhome-assistant-lit-rendering skill,lit-rendering skill
/home-assistant/list-componentsMigrate Home Assistant list components from MWC to new primitives in current git scopedefaultbranch-context plugin,branch-context-consumer skill,home-assistant-frontend skill,home-assistant-list-components skill,lit-rendering skill
/home-assistant/lit-renderingReview and fix Home Assistant Lit rendering and picker callback-shape patterns in current git scopedefaultbranch-context plugin,branch-context-consumer skill,home-assistant-frontend skill,home-assistant-lit-rendering skill
/home-assistant/replace-spacingReplace hardcoded spacing values with ha-space tokens from core.globals.tsdefault
/import-external-skillImport or review external skills for the local skill librarydefault
/improve-codebase-architectureReview a codebase area for architectural friction and focused structural improvementsplan
/inject-contextInject branch context and optionally execute an instructiondefault
/investigateInvestigate a topic, issue, or area without editing by defaultaskdiagnose skill
/note-appendAppend new notes to an existing note file for the current repositorydefault
/note-createCreate a new note for the current repository in your Obsidian notes vaultdefault
/note-referenceLoad one or more notes, relevant skills, and next steps for the current repositorydefault
/notes-listList notes for the current repository, optionally filtered by tagdefault
/notes-searchSearch notes for the current repository by topic, keyword, or tagdefault
/planManual entrypoint to native plan mode from the current conversation contextplan
/refactor-cleanup-variablesRefactor - inline and remove unnecessary variables from current git scoperefactorerbranch-context plugin,branch-context-consumer skill,cleanup-unnecessary-variables skill
/refactor-current-workRefactor current branch work while preserving behaviourrefactorerbranch-context plugin,branch-context-consumer skill
/refactor-enforce-typesRefactor - enforce TypeScript type safety in current git scoperefactorerbranch-context plugin,branch-context-consumer skill,types-enforce-ts skill
/refactor-remove-single-useRefactor - inline and remove safe single-use functions from current git scoperefactorerbranch-context plugin,branch-context-consumer skill,remove-single-use-functions skill
/reset-branch-reapplyReset branch to default and reapply current diff stagedbuildbranch-context plugin,branch-context-consumer skill
/review-current-workReview current branch work with BranchContextPlugin contextreviewerbranch-context plugin,branch-context-consumer skill,pr-review skill

Plugins

PluginDescription
branch-contextInjects branch-context blocks into command prompts before execution
env-protectionBlocks direct access to .env files to prevent leaking secrets
notes-guard
notificationPlays a desktop notification sound when agent tasks complete
readonly-subagent-task-guardForces read-only primary agents to delegate only to non-modifying subagents
repo-notes
tui-dot-git-diff
tui-lazygit

Publishing

This repo is published automatically via GitHub Actions when the OpenCode config agents/.config/opencode/ or shared skills agents/.agents/skills/ change.