
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
opencode-agent-orchestration-kit
Advanced tools
A reproducible product-development workflow for OpenCode.
Turn OpenCode into a structured team of specialized agents that can research, design, specify, implement, review, and validate software changes — without building every agent, command, skill, tool, and workflow convention from scratch.
Built for developers and small teams who want more structure than a single general-purpose coding agent, while keeping the setup local, inspectable, version-controlled, and adaptable.
[!NOTE] This project is a configuration and workflow kit for OpenCode. It is not a hosted platform, a fully autonomous software factory, or a replacement for engineering judgment.
A basic coding-agent setup often starts simple:
Over time, that setup becomes harder to maintain:
This kit provides a documented OpenCode harness with:
The goal is not to force every request through a heavy process. Small, clear, low-risk changes can go directly to implementation. Larger or ambiguous work can follow a structured flow with research, planning, review, and evidence.
| Capability | What it gives you |
|---|---|
| Role-based agents | Dedicated agents for routing, research, design, specification, implementation, review, and optional harness evolution |
| Product-development workflows | Structured flows for features, plans, scoped research, bounded engineering loops, MVP specs, testing, simplification, and review |
| Bounded routing | A default lead agent that routes simple requests directly and escalates only when needed |
| Local skills | Practical checklists for testing, debugging, security, performance, documentation, APIs, code review, and more |
| Safe installation | Backup-aware install and uninstall scripts, plus a project-local test mode |
| Validation | Mechanical checks for JSON configuration, agent contracts, command contracts, and harness consistency |
| Adversarial safety | Portable fixtures for injection, unsafe paths, wrapper/network permissions, approval integrity, supply-chain pins, and corrupt events |
| Optional design workflow | Open Design integration for editable UI workspaces and design-oriented flows |
| Optional token visibility | TUI plugin for lead and subagent token usage when OpenCode exposes session trees |
| Versioned documentation | Agent, command, evidence, and validation contracts stored alongside the configuration |
This kit builds on and integrates with the following projects:
Each integration is optional. The core workflow can be used with OpenCode alone.
This kit is a good fit if you:
This kit may not be the right fit if you:
Free-form requests start with the lead agent.
lead acts as a bounded router:
developer.researcher.designer.specifier.Simple change
lead
└── developer
└── validation
Feature work
lead
├── designer when visual or interaction design is needed
├── researcher when technical uncertainty must be resolved
├── specifier creates tasks, acceptance criteria, and validation plan
├── developer implements approved work
└── reviewer checks the final diff against the agreed scope
Plan-only work
lead
└── researcher
└── specifier
└── reviewer
Bounded engineering loop
lead
└── human approval gate
└── developer
└── reviewer
└── developer state sync
Scoped research and specification
scoper
└── researcher
└── scoper synthesis
└── specifier
Optional harness evolution
evaluator
└── debugger
└── evolver
└── lead approval
└── developer
└── evaluator
└── debugger
└── reviewer
The normal workflow is intentionally not a fixed ceremony for every task.
Use the smallest useful flow:
/plan when you want an implementation-ready plan but no code changes./scope when you need research and an MVP-oriented specification./feature when the work deserves full orchestration./loop when you want an approved, resumable implementation-review cycle with
crash-recoverable structured state and a three-iteration cap./autonomous for one explicitly requested local task with a task-specific
one-to-six-iteration budget, a hard ceiling of six, durable state, and
reviewer-only closure. Final approval stops the cycle immediately.| Agent | Responsibility |
|---|---|
lead | Default router, feature orchestrator, and phase-barrier owner |
scoper | Lightweight research-to-spec orchestration |
designer | Product and interaction design using project context, optional Impeccable, and Open Design |
researcher | Code, documentation, API, alternative, and risk investigation |
specifier | Specs, tasks, acceptance criteria, scope boundaries, and validation plans |
developer | Implementation, direct-mode changes, and focused validation |
reviewer | Final, read-only review against scope, real diff, original evidence, and contextual architecture |
evaluator | Optional benchmark and smoke-test evidence collection |
debugger | Optional root-cause analysis from failures and traces |
evolver | Optional evidence-driven harness improvement proposals |
The evaluator, debugger, and evolver agents are optional harness-evolution sidecars. They are not part of the normal feature-development path.
| Command | Use it when you want to... |
|---|---|
/feature | Run the full feature workflow |
/plan | Research and create an implementation-ready plan without implementing |
/scope | Research a topic and produce a scoped MVP specification |
/loop | Design and run a bounded, resumable engineering loop |
/mvp-spec | Create a strict MVP spec with small tasks and explicit out-of-scope items |
/design | Create or evolve a design through project context and Open Design |
/research | Run a direct research task |
/spec | Run a direct specification task |
/implement | Implement approved work directly |
/test | Reproduce a bug or run focused validation |
/code-simplify | Simplify code without changing behavior |
/review | Run the final read-only review of the current diff |
/evolve | Run the optional harness-evolution workflow |
/init | Initialize project-oriented context for the workflow |
Examples:
/feature Create onboarding with plan selection and welcome screen
/plan Add a dry-run flag to the harness check without implementing it yet
/scope Research Stripe Checkout integration and generate an MVP spec
/loop Add request retries with focused tests and independent review
/loop resume request-retries
/mvp-spec Email notifications when an agent finishes a task
/design Read PRODUCT.md and DESIGN.md, create an editable Open Design project, and generate a first version
/test Reproduce the checkout regression with a focused test
/code-simplify Simplify the parser branch without changing behavior
/review
/loop stores its approved human-readable contract in Markdown and uses a
schema-versioned JSON snapshot, append-only JSONL history, and exclusive lock
for execution state. Contract hashing rejects stale approvals, action IDs make
retries idempotent, and explicit repair recovers interrupted writes without
turning the loop into unattended automation.
A small request can also be written directly:
Change the Settings heading to Account settings and run the smallest relevant validation.
All review entry points use the same language- and framework-neutral policy. The reviewer checks correctness, security, contracts, architecture, maintainability, tests, and evidence—not only whether tests pass.
Generic backend and frontend profiles adapt those checks to the changed surface. Strict Clean Architecture, DDD, hexagonal, CQRS, or layered profiles activate only when the task or repository explicitly declares that architecture; folder names alone do not activate them.
Only problems introduced or materially worsened by the current task can block
it. Relevant pre-existing debt is reported separately as a non-blocking
observation. /review-preflight remains deterministic, and focused
/review-orchestrated modes remain partial; only the general /review agent
emits a final verdict.
For this kind of request, lead should choose the direct path and delegate to developer without invoking the full feature workflow.
The safest way to try the kit is to load it from the repository directory without changing your global OpenCode configuration.
PATH^22.9.0 || ^24.0.0 and npmopencode auth logingit clone https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git
cd opencode-agent-orchestration-kit
cp env.example .env
source .env
env.example provides a shared default model plus optional per-role overrides.
export OPENCODE_MODEL="openai/gpt-5.5"
export OPENCODE_SMALL_MODEL="$OPENCODE_MODEL"
export OPENCODE_LEAD_MODEL="$OPENCODE_MODEL"
export OPENCODE_SCOPER_MODEL="$OPENCODE_MODEL"
export OPENCODE_DESIGNER_MODEL="$OPENCODE_MODEL"
export OPENCODE_RESEARCHER_MODEL="$OPENCODE_MODEL"
export OPENCODE_SPECIFIER_MODEL="$OPENCODE_MODEL"
export OPENCODE_DEVELOPER_MODEL="$OPENCODE_MODEL"
export OPENCODE_REVIEWER_MODEL="$OPENCODE_MODEL"
export OPENCODE_EVALUATOR_MODEL="$OPENCODE_MODEL"
export OPENCODE_DEBUGGER_MODEL="$OPENCODE_MODEL"
export OPENCODE_EVOLVER_MODEL="$OPENCODE_MODEL"
You can use one model for every role or assign different models depending on cost, speed, and task complexity.
The repository also includes oc-switch, a standalone TUI for changing the
OpenCode default model, small/title model, and per-agent overrides. It builds
its provider list from OpenCode itself and reads the local model catalog from
opencode models --pure, so it only shows providers configured in your
OpenCode installation. Startup is cache-first; press r when you want an
explicit remote catalog refresh through --refresh. It does not share a
catalog with Pi.
From this checkout, run:
npm run oc-switch
To install the command globally with npm from the cloned checkout:
npm install --global .
oc-switch
After a tagged release is published, you can install the same CLI directly from GitHub without keeping a checkout:
npm install --global "git+https://github.com/jcarlosrodicio/opencode-agent-orchestration-kit.git#v1.0.39"
oc-switch
The package exposes oc-switch through its npm bin entry; no separate
wrapper or shell alias is required. Keep ~/.npm-global/bin (or your npm
global bin directory) on PATH if npm is configured with a user prefix.
oc-switch quick guide↑/↓ moves through Default, Small/title, and the agent rows.Enter or / opens the model picker for the focused row.q, r, and s are search
characters while the picker is open. Backspace deletes one character.Enter applies the highlighted model. Space marks several agent rows so
one selection can be applied to all of them.s saves. q saves and exits. Esc returns to the assignment list, and
r explicitly refreshes OpenCode's catalog.The selected values are persisted in the OpenCode model-switcher state and in
the managed model block of .zshrc or .bashrc.
Pi has its own independent pi-switch; its catalog comes only from Pi's
pi --list-models command.
(cd opencode && npm ci --ignore-scripts)
export OPENCODE_CONFIG_DIR="$PWD/opencode"
opencode auth login
opencode
OpenCode now loads the configuration from this repository instead of your default global config.
Try one of these commands:
/scope Research whether this repository should use Stripe Checkout or Payment Element and produce an MVP spec
/plan Add a dry-run flag to the harness check without implementing it yet
/feature Add a small settings page with a saved theme preference
Once you are happy with the workflow, preview and install it into your OpenCode configuration directory:
./install.sh --dry-run
./install.sh
The default target is:
${OPENCODE_CONFIG_DIR:-$HOME/.config/opencode}
Use a custom target when needed:
./install.sh --target "$HOME/.config/opencode"
An explicit --target wins over a non-empty OPENCODE_CONFIG_DIR, which wins over $HOME/.config/opencode. Argument values are literal; ~ is not expanded.
The installer inventories the payload, computes a complete plan, and tracks ownership in TARGET/.oak/manifest.json. A dry run performs no writes. A real operation recomputes the plan under an exclusive lock and commits through a durable journal with one rollback generation.
The root package.json is the canonical kit-version source. Display the same
identity through the manager or any lifecycle wrapper:
node scripts/version.mjs
./install.sh --version
./upgrade.sh --version
./doctor.sh --version
./uninstall.sh --version
./rollback.sh --version
Initial install preserves differing AGENTS.md, opencode.json, tui.json, package.json, and package-lock.json as user-owned files. Exact existing matches may be adopted without rewriting. Any other collision blocks the whole operation. A legacy installation without a manifest follows these same initial-install rules.
Use --force only on initial install to authorize replacement of colliding regular files after their bytes and modes are durably backed up:
./install.sh --force
It never authorizes directory or symlink replacement, unsafe paths, state repair, upgrade conflicts, or deletion of user-modified files.
After global installation, install the OpenCode config dependencies:
(cd "${OPENCODE_CONFIG_DIR:-$HOME/.config/opencode}" && npm ci --ignore-scripts)
Use that frozen command only when the installed package.json and
package-lock.json still match the shipped manifests. If installation
preserved differing manifests, review and merge the required dependencies
first, then choose the install command for that user-owned dependency graph.
The package also exposes the dependency-free oak CLI as a thin frontend over
the same tested engines:
oak --help
oak doctor
oak check
oak replay
oak state inspect --root /path/to/project --slug task-slug
The shell wrappers remain supported. oak check validates the installed target
without executing a target-provided checker, while oak replay defaults to the
packaged static corpus and synthetic fixtures. See the oak CLI
guide for commands, target precedence, exit codes, and explicit
exclusions.
oak state runs the packaged durable loop-state runtime against an explicit
project root; it is intended for bounded local workflows that need a journal,
lock, and recovery without copying harness scripts into the project.
Its completion gate requires a durable reviewer subagent APPROVE
attestation; see the CLI guide for the exact command.
Preview an ownership-safe upgrade, then apply it:
./upgrade.sh --dry-run
./upgrade.sh
Upgrade aborts before writing if an owned file is missing or modified, an obsolete owned file changed, or an unowned collision exists. Preserved files remain user-owned. When a shipped protected file changes, doctor reports whether the source, user copy, or both changed:
./doctor.sh
Upgrade also compares the local source version with kit_version in the active
manifest. A newer source may upgrade; equal version and payload is a no-op;
equal version with a different payload is blocked as an identity contradiction;
and an older source is blocked to prevent downgrade. doctor reports
not-installed, current, upgrade-available, source-older,
same-version-different-payload, or invalid-version-state without consulting
the network.
Doctor prints twelve ordered findings for OpenCode and Node compatibility,
installed dependencies, managed files and drift, required configuration,
optional plugins, permissions, executable scripts, the generated skill
registry, aggregate compatibility, and legacy residue. Each finding is
classified as pass, info, action-required, or not-applicable, followed
by a deterministic summary. It does not print configuration contents,
subprocess stderr, environment values, credentials, or rollback bytes.
Doctor returns 0 when no finding requires action, 1 for safely actionable
state, and 2 for invalid invocation, corrupt/unsafe state, or an unrecoverable
filesystem error. Suggested actions are never applied automatically, and
preserved custom configuration remains user-owned. See the
installation lifecycle guide for the full diagnostic
contract. To acknowledge a completed manual merge, run:
./doctor.sh --accept-preserved opencode.json
The command prints a full ACK-PRESERVED line containing the exact target/source hashes and modes. Paste that line back byte-for-byte; yes, a path alone, truncated values, or a stale tuple do not authorize mutation.
Uninstall previews first and removes only unchanged files owned by the manifest. Modified, missing, preserved, and unrelated user files are never deleted:
./uninstall.sh --dry-run
./uninstall.sh
./uninstall.sh --yes
The most recent committed install, upgrade, acknowledgement, or uninstall can be reversed once:
./rollback.sh --dry-run
./rollback.sh
If an operation was interrupted, rollback.sh uses the active journal to restore the pre-operation state instead. Do not delete or edit .oak manually: it contains ownership metadata, recovery state, and potentially sensitive exact backup bytes. See the installation lifecycle guide for command syntax, conflict handling, and recovery details.
The kit includes local skills that agents use as practical checklists rather than mandatory process overhead.
Included skills cover:
These skills are available under:
opencode/skills/
They are designed to help agents make better engineering decisions without forcing every task through every checklist.
The integrations below are optional extensions. They are not required for the core agent workflow.
| Integration | What it adds | Setup |
|---|---|---|
| Open Design | Editable, local-first design workspace workflows | Open Design guide |
| Superpowers | Additional skills and software-development workflow discipline | Superpowers guide |
| Impeccable | Design guidance and deterministic frontend-quality checks | Impeccable guide |
Open Design is included as an optional local integration for design-oriented workflows.
The designer agent can use:
PRODUCT.md and DESIGN.md.OPEN_DESIGN_URL.Set OPEN_DESIGN_URL to the base URL of your Open Design workbench:
export OPEN_DESIGN_URL="https://open-design.example.com"
A local or LAN URL is also valid:
export OPEN_DESIGN_URL="http://192.168.1.50:7456"
Do not use a project page or file URL:
# Invalid
export OPEN_DESIGN_URL="https://open-design.example.com/projects/my-project"
export OPEN_DESIGN_URL="https://open-design.example.com/projects/my-project/files/index.html"
Open Design is optional. You can use the rest of the kit without it.
A Docker setup is included:
cd docker/open-design
cp .env.example .env
docker compose up -d --build
If Open Design should use OpenCode as a design engine, authenticate inside the container:
docker exec -it open-design bash
opencode auth login
opencode models openai --refresh
exit
Then configure the Open Design base URL:
export OPEN_DESIGN_URL="http://192.168.1.50:7456"
Superpowers is not vendored into this repository.
When plugins are supported and network access is available, the kit can reference the upstream plugin:
{
"plugin": [
"superpowers@git+https://github.com/obra/superpowers.git#d884ae04edebef577e82ff7c4e143debd0bbec99"
]
}
The human-readable upstream release is v6.1.1; the configuration uses the
full reviewed commit because the label alone is not immutable:
{
"plugin": [
"superpowers@git+https://github.com/obra/superpowers.git#d884ae04edebef577e82ff7c4e143debd0bbec99"
]
}
If your existing opencode.json was preserved during installation, add the plugin manually.
Impeccable is optional and is not included in this repository.
Install it from its upstream source when you want the designer agent to use it as additional design context, particularly when project-specific PRODUCT.md or DESIGN.md files are missing.
The bundled TUI plugin can show:
This depends on OpenCode exposing the session tree through its TUI plugin API.
If your existing tui.json was preserved during installation, add the bundled plugin manually:
{
"plugin": [
"./plugins/token-tree-usage.tsx"
]
}
Normal harness use requires Node.js, npm, and a supported OpenCode version; it does not require a system SQLite client.
Full validation and development additionally require the external sqlite3
binary because the session-evidence tests create real SQLite fixtures. On
Ubuntu or Debian, install it with:
sudo apt-get install -y sqlite3
Run the normal local check with:
npm run check
The bundled routing corpus can also be replayed deterministically without calling a model:
node opencode/scripts/replay-routing.mjs \
--corpus opencode/docs/ai/evolution/benchmarks/router-scenarios.jsonl \
--fixtures opencode/docs/ai/evolution/benchmarks/replay-fixtures.jsonl
Aggregate one or more sanitized replay reports into deterministic routing metrics without calling a model or rereading raw evidence:
node opencode/scripts/summarize-routing-metrics.mjs \
--corpus opencode/docs/ai/evolution/benchmarks/router-scenarios.jsonl \
--report /path/to/routing-replay-report.json
Inconclusive observations are excluded from metric denominators. Token cost is reported as unavailable until the replay report schema carries token evidence.
An isolated live replay is available only through explicit opt-in. It may consume model tokens, is intentionally excluded from normal checks and CI, and does not persist model/provider configuration or raw output by default.
This runs the fast contract checker and every bundled node:test suite. For a
fast structural check while editing documentation or contracts, use
npm run check:quick. Before a release, use npm run check:release; it performs
a frozen dependency install and also runs typechecking, dependency integrity,
audit/signature checks, installation smoke, and the exact package smoke.
Publication remains separately authorized; follow the reviewed artifact and
checksum procedure in the supply-chain policy.
Validate only the canonical identity and current release note with:
npm run check:version
node scripts/version.mjs --check-tag v1.0.39
Tag validation compares an explicitly supplied tag with the package identity. It does not create or push a tag, publish npm content, or create a hosted release. Those remain separate manual, explicitly approved steps.
The contract checker validates the shipped harness, including:
lead routing contract./feature sidecar boundaries./plan behavior.opencode/docs/ai/harness/.The core harness validator is located at:
opencode/scripts/check-harness.mjs
After global installation, you can also run it from the installed OpenCode configuration directory:
node scripts/check-harness.mjs
.
├── .github/
│ ├── ISSUE_TEMPLATE/
│ ├── workflows/
│ ├── CODEOWNERS
│ └── PULL_REQUEST_TEMPLATE.md
├── docker/
│ └── open-design/
├── docs/
│ ├── releases/
│ ├── agents.md
│ ├── commands.md
│ ├── configuration.md
│ ├── docker-open-design.md
│ ├── impeccable.md
│ ├── installation.md
│ ├── models.md
│ ├── open-design.md
│ ├── quickstart.md
│ ├── security.md
│ ├── superpowers.md
│ ├── synology.md
│ ├── troubleshooting.md
│ └── workflows.md
├── opencode/
│ ├── agents/
│ ├── commands/
│ ├── docs/ai/
│ ├── plugins/
│ ├── references/
│ ├── scripts/
│ ├── skills/
│ ├── tools/
│ ├── AGENTS.md
│ ├── opencode.json
│ └── tui.json
├── scripts/
│ ├── check.sh
│ ├── install-smoke.sh
│ ├── manage-installation.mjs
│ └── manage-installation.test.mjs
├── doctor.sh
├── install.sh
├── rollback.sh
├── uninstall.sh
├── upgrade.sh
└── env.example
The shipped OpenCode configuration contains:
| Path | Purpose |
|---|---|
AGENTS.md | Global behavior rules and agent index |
opencode.json | Models, permissions, plugins, and default agent |
tui.json | TUI plugin registration |
agents/ | Specialized agent prompts |
commands/ | Slash-command workflows |
skills/ | Local process skills |
tools/ | Custom TypeScript tools |
plugins/ | Bundled OpenCode/TUI plugins |
references/ | Reusable checklists referenced by skills |
docs/ai/harness/ | Agent, command, evidence, and validation contracts |
docs/ai/evolution/ | Harness-evolution benchmark and evidence records |
scripts/check-harness.mjs | Mechanical harness validation |
The default OpenCode permissions are conservative:
Security recommendations:
.env, authentication files, sessions, logs, or provider credentials.PRODUCT.md or DESIGN.md files unless intended.OPEN_DESIGN_URL is not setSet the base URL only:
export OPEN_DESIGN_URL="http://192.168.1.50:7456"
Do not use a project-specific path.
/api/health failsCheck that Open Design is running and reachable from the machine or container where OpenCode runs.
Run:
opencode auth login
Also verify that opencode is available on PATH.
Restart OpenCode and verify that the Superpowers plugin entry is present in opencode.json.
Verify:
tui.json contains the bundled plugin entry.npm ci --ignore-scripts was run in the OpenCode config directory while
its shipped manifests were intact (or preserved manifests were reviewed and
merged before selecting another install command).Verify:
OPEN_DESIGN_URL.opencode/tools/open_design.ts.crypto.randomUUID fails over HTTP on a LAN URLUse HTTPS, or apply the optional upstream frontend patch described in the documentation.
Detailed guides are available in docs/:
^22.9.0 || ^24.0.0.>=1.14.41 <2.0.0 is supported through tested boundary versions.See the complete compatibility matrix for status definitions, exact pins, evidence, and scope.
Contributions are welcome.
Found a bug or have an idea? Open an issue · Browse existing issues
Good contributions include:
Before opening a pull request:
npm run check
Use npm run check:release for release readiness.
If Docker files changed:
docker compose -f docker/open-design/docker-compose.yml config
Please avoid committing credentials, authentication files, sessions, logs, private product documents, or machine-specific paths.
See CONTRIBUTING.md for details.
Licensed under the Apache License 2.0.
See NOTICE.md for attribution notices.
This repository is not affiliated with OpenCode, Open Design, Impeccable, or Superpowers.
FAQs
Open-source multi-agent orchestration harness for OpenCode with specialized agents, durable workflows, review gates, and reproducible software-engineering processes.
The npm package opencode-agent-orchestration-kit receives a total of 13 weekly downloads. As such, opencode-agent-orchestration-kit popularity was classified as not popular.
We found that opencode-agent-orchestration-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.