Personal opencode configuration with custom AI agents for code review, semantic commits, and refactoring.
This repository contains a ready-to-use opencode workspace configuration. It ships with three purpose-built agents and sensible defaults for permissions and formatting.
-
Install opencode
npm install -g opencode-ai
-
Clone this config into your project
Copy the files below into the root of any project you want to use opencode with:
.env.example → environment variable template .ignore → paths opencode should never index opencode.json → main configuration .opencode/ → agent definitions -
Set up your environment
cp .env.example .env
Variable Description OPENCODE_ENABLE_EXASet to 1to enable Exa web searchOPENCODE_EXPERIMENTALSet to trueto unlock experimental features -
Run opencode
opencode
opencode.json sets the following defaults:
| Setting | Value |
|---|---|
| Formatter | Prettier (npx prettier --write $FILE) |
| Instructions | CONTRIBUTING.md, docs/guidelines.md (add to your project) |
| Permissions | Read / grep / glob / list / LSP / question / todowrite / webfetch → allow; bash → ask |
Performs a structured read-only code review of all current changes and writes a report to /tmp/code-review.md.
Findings are categorised as:
- 🔴 CRITICAL — bugs, security issues, data-loss risks
- 🟡 WARNING — style violations, performance concerns, missing error handling
- 🔵 SUGGESTION — readability improvements and structural enhancements
Usage:
/agent review
Analyses all uncommitted changes, groups them by logical concern (not by file), and creates clean Conventional Commits — one commit per feature/fix/chore.
Commit types supported: feat, fix, refactor, chore, docs, style, test, perf, ci, build
The agent always presents a plan and waits for your confirmation before staging anything.
Usage:
/agent commit
Refactors changed files to follow Google Style Guides for Python, TypeScript/JavaScript, Go, Java, and C++. It adds section markers (MARK:), removes dead code, enforces naming conventions, and breaks down long functions.
Usage:
/agent refactor
.
├── .env.example # Environment variable template
├── .ignore # Paths excluded from opencode indexing
├── opencode.json # Main opencode configuration
└── .opencode/
└── agents/
├── commit.md # Semantic commit agent
├── refactor.md # Google-style refactor agent
└── review.md # Code review agent
MIT