Package Exports
- opencode-orchestrator
Readme
OpenCode Orchestrator 🎯
Autonomous Multi-Agent Plugin for OpenCode
Why I Built This 🤔
I was frustrated coding with DeepSeek and Z.AI.
I wanted to achieve the same quality of work as premium models like Gemini 3 Pro and Claude Opus, but with affordable models. For developers who chose budget-friendly subscriptions instead of expensive plans, I built a multi-agent system that can autonomously complete complex engineering tasks even with mid-tier LLMs.
"Intelligence is a resource. Orchestrate it."
What is this?
A 5-agent autonomous architecture designed to solve complex engineering tasks with high reliability, even on mid-range LLMs.
Core Philosophy: Intelligence is a resource. We orchestrate that resource through Phase-based Workflows and Mandatory Environment Scans to ensure code always fits the project's infrastructure.
🦀 Powered by Rust — Background tasks and parallel searches run on native Rust binaries for maximum performance.
Key Features
- 🎯 Autonomous Loop — Commander runs relentlessly until the mission is complete.
- 🔍 Environment Scan — Mandatory analysis of Infra (Docker/OS), Stack, and Domain before any code change.
- 🔨 Smart Implementation — Builder matches existing codebase patterns exactly.
- 🛡️ Rigorous Audit — Inspector proves success with environment-specific evidence (Builds/Tests/Logs).
- 💾 Persistent Context — Recorder saves session state to disk, enabling resume at any time.
- 🏗️ Parallel Agents — Delegated agent execution (
delegate_task) with sync/async modes. - ⏳ Background Tasks — Run long commands (builds, tests) in background and check results later.
- 🔎 mgrep — Multi-pattern parallel search powered by Rust for blazing-fast codebase analysis.
Installation
npm install -g opencode-orchestratorRestart OpenCode after installation.
Usage
🚀 Method 1: Select Commander via Tab Key (Recommended)
In OpenCode, press Tab to open the Agent selection menu. Select Commander and type your mission!
Press Tab to select Commander
"Fix the login bug in the docker-compose environment"The Commander will:
- Survey: Scan the Docker environment and codebase.
- Plan: Break the fix into steps.
- Execute: Call Builder to fix while matching patterns.
- Verify: Run builds/tests to prove the fix works.
- Complete: Report results with concrete evidence.
📋 Method 2: Use /task Command
/task "Implement user authentication with JWT"💡 Tip: Using the
/taskcommand makes Commander mode run 2x longer. Use/taskfor complex tasks that need extended processing!
⚡ Example: Parallel Execution
Trigger parallel agent execution with prompts like:
"Build and test in parallel"
"Implement feature X while reviewing module Y"
"Run linting, tests, and build at the same time"Commander will automatically use delegate_task with background: true for independent tasks.
Monitor parallel tasks in the terminal:
[parallel] 🚀 SPAWNED task_a1b2 → builder: Implement feature X
[parallel] 🚀 SPAWNED task_c3d4 → inspector: Review module Y
[parallel] ✅ COMPLETED task_c3d4 → inspector: Review module Y (45s)
[parallel] 🗑️ CLEANED task_c3d4 (session deleted)Agents (5-Agent Architecture)
| Agent | Emoji | Role | Responsibility |
|---|---|---|---|
| Commander | 🎯 | Orchestrator | Autonomous mission control & delegation |
| Architect | 🏗️ | Planner | Task decomposition & strategy correction |
| Builder | 🔨 | Developer | Full-stack implementation (Logic + UI) |
| Inspector | 🔍 | Quality | 5-point audit & automatic bug fixing |
| Recorder | 💾 | Context | Persistent environment & progress tracking |
The Workflow (Progressive Phases)
- Phase 0: Triage (Smart)
- Fast Track 🟢: Simple fixes → Execute instantly (Skip heavy scans).
- Deep Track 🔴: Complex features → Full Environment Scan & Plan.
- Phase 1: Environment Scan
- Mandatory for Deep Track: Infra/Domain/Stack analysis.
- Phase 2: Parallel Planning
- Architect creates a DAG of atomic tasks (Scalable Planning).
- Phase 3: Execution & Audit
- Builder writes code ↔ Inspector verifies with evidence.
- Phase 4: Completion
- Mission Complete reported with proof of build/test success.
Development
Quick Start (Local Development)
# Step 1: Build and link (run this ONCE)
npm run dev:link
# Step 2: Restart OpenCode
# Step 3: Make code changes...
# Step 4: Rebuild and re-link (after code changes)
npm run dev:link
# (Optional) Check link status
npm run dev:statusDevelopment Scripts
# Build the plugin
npm run build
# Run all tests (87 tests)
npm run test:all
# Run unit tests only
npm run test:unit
# Run E2E tests only
npm run test:e2e
# Link for local testing (auto-rebuilds)
npm run dev:link
# Unlink from global
npm run dev:unlink
# Check if plugin is linked globally
npm run dev:statusTest Suite
| Command | Description | Tests |
|---|---|---|
npm run test:all |
Run all tests with verbose output | 87 |
npm run test:unit |
Unit tests (concurrency, task-store, etc.) | 40 |
npm run test:e2e |
E2E tests (background, session, rust, system) | 47 |
npm run test:coverage |
Generate coverage report | - |
Development Workflow
| Step | Command | Description |
|---|---|---|
| 1️⃣ Initial setup | npm run dev:link |
Build + link for the first time |
| 2️⃣ Test | Open OpenCode | Test your changes |
| 3️⃣ Make changes | Edit code | Modify TypeScript files |
| 4️⃣ Rebuild | npm run dev:link |
Rebuild + re-link |
| 5️⃣ Repeat | 2-4 | Iterate on changes |
| ❌ Cleanup | npm run dev:unlink |
Unlink when done |
Release Scripts
# Release patch version (0.5.4 → 0.5.5)
npm run release:patch
# Release minor version (0.5.5 → 0.6.0)
npm run release:minor
# Release major version (0.5.5 → 1.0.0)
npm run release:majorEach release script:
- Builds the plugin
- Bumps version in package.json
- Creates git tag
- Pushes to remote
- Publishes to npm
Uninstall
npm uninstall -g opencode-orchestratorDocs
- Architecture & Design — Detailed system design and agent protocols
- Plugin Troubleshooting — Setup and common issues
- Changelog — Version history and updates
License
MIT License. LICENSE
Reliability over slop. Environment over assumptions.