A production-ready OpenCode configuration featuring specialized agents, custom commands, helper scripts, and integrated beads task tracking.
- Specialized Agents: Code review, git commits, deep thinking, code simplification, and more
- Custom Commands: GitHub issue management, i18n translations, and project scaffolding examples
- Helper Scripts: Automated git workflows and pre-commit checks
- Beads Integration: Universal task tracking across all projects
- MCP Servers: Brave Search integration (configurable)
- OpenCode installed
- Bun or Node.js for dependencies
- Beads for task tracking (optional but recommended)
- GitHub CLI for
ghi-upsertcommand (optional)
-
Clone this repository to your OpenCode config directory:
git clone https://github.com/yourusername/opencode ~/.config/opencode cd ~/.config/opencode
-
Install dependencies:
bun install # or: npm install -
Configure MCP servers (optional):
cp opencode.example.json opencode.json # Edit opencode.json and add your API keys -
Set up environment variables (optional):
cp .env.example .env # Edit .env and add your API keys -
Initialize beads (if using task tracking):
bd init
The opencode.json file configures MCP (Model Context Protocol) servers that provide additional capabilities to OpenCode. Copy opencode.example.json to opencode.json and add your API keys.
Example configuration:
{
"mcp": {
"brave-search": {
"type": "local",
"command": [ "npx", "-y", "@brave/brave-search-mcp-server", "--transport", "http" ],
"enabled": true,
"environment": {
"BRAVE_API_KEY": "your_api_key_here"
}
}
},
"plugin": ["opencode-beads"]
}The config.json file configures OpenCode's AI provider settings. The default configuration uses Ollama with the qwen3 model running locally.
opencode/
├── agents/ # Specialized agent documentation
│ ├── beads-workflow.md # Mandatory task tracking workflow
│ ├── session-completion.md # Session end protocol
│ ├── code-reviewer.md # Code review agent
│ └── ...
├── commands/ # Custom slash commands
│ ├── ghi-upsert.md # GitHub issue management
│ └── update-translations.md # i18n management
├── examples/ # Example commands and workflows
│ └── create-spring-boot-kotlin-project.prompt.md
├── scripts/ # Helper scripts for git workflows
│ ├── create-commit.sh # Automated commit creation
│ ├── get-git-context.sh # Git context extraction
│ └── run-precommit.sh # Pre-commit checks
├── skills/ # Custom skills
├── AGENTS.md # Agent configuration and preferences
├── config.json # OpenCode provider settings
└── opencode.json # MCP servers & plugins (not versioned)
OpenCode automatically loads agent configurations. Specialized agents include:
beads-workflow- Universal task tracking (mandatory)session-completion- Session end protocol (mandatory)project-onboarding- Setting up new projectscode-reviewer- Comprehensive code reviewsgit-commit- Conventional commit messagesdeep-thinker- Complex problem analysiscode-simplifier- Refactoring for clarityskill-creator- Creating custom skills
See agents/README.md for complete documentation.
Custom commands are invoked with a slash prefix:
/ghi-upsert <issue-number>- Create, update, or comment on GitHub issues/update-translations- Manage i18n translation files
See commands/README.md for detailed documentation.
See examples/ directory for complex command examples like Spring Boot project scaffolding.
The scripts/ directory contains bash scripts for common git workflows:
./scripts/create-commit.sh "commit message" # Create a git commit
./scripts/get-git-context.sh # Extract git context for AI
./scripts/run-precommit.sh # Run pre-commit checksSee scripts/README.md for usage details.
This configuration uses beads for task tracking across projects. The beads workflow is documented in agents/beads-workflow.md and is mandatory for all agents.
Quick start:
bd init # Initialize beads in a project
bd ready --json # Show available tasks
bd create --title="..." -t task # Create new task
bd update <id> --status=in_progress
bd close <id> --reason="..." # Close task with context
bd sync --flush-only # Export to JSONLContributions welcome! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.