A lightweight OpenCode configuration that implements a practical orchestrator pattern for AI-assisted software development.
The goal is to get the benefits of a multi-agent workflow - planning, execution, review, and security checks - without turning the setup into a complex agent framework or adding excessive token overhead.
Single-agent workflows are often enough for small tasks, but they tend to become less reliable as work gets larger or more ambiguous. Common issues include:
- Planning and implementation getting mixed together
- Repeated context consuming unnecessary tokens
- Reviews being skipped or performed inconsistently
- Security, documentation, and testing concerns being handled too late
- Large tasks producing broad, hard-to-review diffs
- Inefficient token usage when the same model is applied to tasks of varying complexity
This repository provides a small orchestrator-based pattern that keeps the workflow structured while remaining easy to inspect, modify, and run.
- A very simple orchestrator pattern - A central agent coordinates planning, approval, implementation, and review phases that you can build upon and customize as needed.
- Scoped subagents - Specialized agents handle planning, execution, testing, documentation, security, and code review
- Token-conscious delegation - Subagents receive focused tasks instead of the full problem context whenever possible
- Approval-gated planning - Non-trivial work is planned before implementation starts
- Minimal framework overhead - The system is implemented as OpenCode configuration, agent prompts, skills, and a small plugin
- Reusable development skills - Shared skill definitions for delegation, task management, Python quality, and security investigation
This project is intentionally small. It is not trying to be a general-purpose agent platform.
It aims to:
- Keep orchestration understandable
- Reduce unnecessary context passed between agents
- Preserve code quality through explicit planning and review steps
- Make agent responsibilities clear
- Avoid excessive automation that hides what is happening
- Provide a useful starting point for customizing OpenCode workflows
- Sync the improvements with my own personal workflow.
The default entry point is the orchestrator agent.
For non-trivial tasks, the workflow typically follows this pattern:
- Orchestrator receives the user request
- Planning is delegated to a planning subagent
- A concrete plan is written under
.opencode/plans/ - The user approves or rejects the plan
- Implementation is delegated in scoped slices
- Review agents validate the result for correctness, tests, documentation impact, and security concerns
This keeps the main agent focused on coordination instead of forcing one large prompt/session to handle every phase of the task.
βββ π agents # Agent definitions
β βββ π api-docs-researcher.md
β βββ π code-executor.md # Implementation subagent
β βββ π code-explorer.md # Read-only subagent
β βββ π code-reviewer.md
β βββ π docs-reviewer.md
β βββ π host-security-investigator.md
β βββ π orchestrator.md # Workflow coordinator (No writting. Only analysis, context managment and delegation to subagents)
β βββ π plan-runner.md # Plan drafting subagent apart from opencode Plan default agent, so we don't mess with that.
β βββ π security-reviewer.md
β βββ π spec-critic.md
β βββ π test-verifier.md
βββ π command # Optional OpenCode command hooks (may be empty)
βββ π plugins
β βββ π plan-post-approval.ts
βββ π skills
β βββ π agent-delegation
β β βββ π SKILL.md
β βββ π context7
β β βββ π README.md
β β βββ π SKILL.md
β β βββ π library-registry.md
β β βββ π navigation.md
β βββ π pythonic-quality
β β βββ π SKILL.md
β βββ π security-investigation
β β βββ π references
β β β βββ π vps-checklist.md
β β βββ π scripts
β β β βββ π vps-security-scan.sh
β β βββ π SKILL.md
β βββ π skill-creator
β β βββ π references
β β β βββ π output-patterns.md
β β β βββ π workflows.md
β β βββ π scripts
β β β βββ π init_skill.py
β β β βββ π package_skill.py
β β β βββ π quick_validate.py
β β βββ π LICENSE.txt
β β βββ π SKILL.md
β βββ π task-management
β βββ π scripts
β β βββ π migrate-schema.ts
β β βββ π task-cli.ts
β βββ π SKILL.md
β βββ π router.sh
βββ βοΈ .gitignore
βββ π AGENTS.md # Global agent rules and delegation guidelines
βββ π LICENSE
βββ π README.md
βββ π opencode.jsonc # Main OpenCode configuration
βββ βοΈ package-lock.json
βββ βοΈ package.json # Plugin / tooling dependencies
βββ βοΈ tsconfig.json # Typescript configuration
βββ βοΈ tui.json # TUI settings (if used)
Local-only skills (not tracked; see .gitignore): add skills/context7/ or skills/gitnexus-* on your machine if you use those toolchains. Agent configs may still reference gitnexus-* in skill permissions.
- orchestrator - Coordinates multi-phase work through plan files, approval gates, and implementation slices
- build - OpenCode Default Agent (Best for simple tasks)
- plan - OpenCode Default Agent (Best for simple tasks)
- plan-runner - Drafts implementation plans under
.opencode/plans/ - code-executor - Implements scoped coding tasks with minimal diffs
- test-verifier - Validates changes through tests, linting, and type checking
- code-reviewer - Reviews diffs for correctness, maintainability, and implementation risk
- docs-reviewer - Checks whether documentation needs to be updated
- security-reviewer - Identifies security risks in application code
- spec-critic - Challenges plans before coding starts
- api-docs-researcher - Researches external API documentation
- host-security-investigator - Assesses hosting and infrastructure security concerns
This configuration is useful when you want:
- More structure than a single-agent coding workflow
- Planning before implementation
- Smaller, easier-to-review diffs
- Separate review passes for tests, docs, code quality, and security
- A multi-agent setup that is still simple enough to understand and modify
It may be unnecessary for very small edits where a direct build agent is faster and cheaper.
plugins/plan-post-approval.ts automates the handoff after a plan is approved through PlanApprove.
It:
- Extracts plan file paths from approval questions
- Uses the last user message
agentfield as routing context - Hands off
plansessions tobuildafter idle usingsession.summarizeandsession.prompt - Avoids duplicate Phase B automation for
orchestratorsessions whenagent.orchestrator.plan_post_approval_handoff_agentis set toorchestrator - Falls back to
plan_post_approval_handoff_agentfromopencode.jsonc, underagent.orchestratoror root configuration - Retries
session.promptwith backoff
- agent-delegation - Decision table for routing work to the appropriate subagent
- task-management - CLI for tracking feature subtasks with dependencies
- pythonic-quality - Pythonic idioms, SOLID design, and Liskov-safe patterns
- security-investigation - Security audit orchestration
- skill-creator - Guide for creating effective skills
-
Install OpenCode
-
Clone this repository to your OpenCode config directory:
git clone <repo-url> ~/.config/opencode
-
Install dependencies:
cd ~/.config/opencode npm install
Start OpenCode and describe your task.
The orchestrator agent is configured as the default entry point. For simple tasks, the system can proceed directly. For larger or riskier tasks, it routes work through planning, approval, implementation, and review phases.
The intended flow is:
user request
β
orchestrator
β
plan-runner / plan
β
user approval
β
code-executor / build
β
review subagents
Key settings in opencode.jsonc:
default_agent: "orchestrator"- Sets the orchestrator as the default entry pointpermission- Provides a minimal deny-by-default workspace baseline; each agent declares its tool policy inagents/<id>.mdfrontmatteragent.*.model- Configures model selection for primary agents and selected subagentsreasoningEffort,textVerbosity, andtemperature- Tune agent behavior where neededagent.orchestrator.plan_post_approval_handoff_agent- Controls post-approval routing for the plan handoff plugin
- Changed
- Orchestrator agent now don't have write permissions by default so we can force subagent usage.
- Updated agent configurations (orchestrator and all subagents)
- Updated
opencode.jsoncwith refined model routing, reasoning effort, and permission settings - Updated README with structure, workflow, and configuration documentation
- Fixed
- Corrected model names in agent configurations
- Added DeepSeek max reasoning effort support in
opencode.jsonc
- Removed
- Build and Plan customization. The config now uses the opencode default Build and Plan agents. Add
agents/build.mdandagents/plan.mdif you want to override.
- Build and Plan customization. The config now uses the opencode default Build and Plan agents. Add
Initial release: multi-agent orchestrator pattern with planning, code execution, and review subagents.