Model-agnostic decomposition coding harness — a thin orchestrator over OpenCode
Project description
director
A model-agnostic decomposition coding harness — a thin orchestrator over OpenCode.
director tests one hypothesis:
A strong planner model decomposes a coding task into small, atomic, well-specified units with acceptance tests written first. A cheaper executor model — local or low-cost cloud — implements each unit in an isolated, fresh context. Deterministic gates (tests, lint, typecheck — exit codes, never an LLM's opinion) decide what merges. This cuts token cost dramatically with minimal quality loss.
It is model-agnostic by construction: roles (planner, executor, reviewer, …)
bind to provider/model strings in config. Switching the executor from a local 27B to
a frontier model — or anything in between — is a one-line config edit, never a code
change. director drives OpenCode headlessly, so it inherits OpenCode's 75+ providers.
Status: beta. Validated end-to-end (plan → run → bench) under local, cheap-cloud, and all-frontier executor tiers.
Install
director is a pure-standard-library Python CLI (no dependencies), so it installs anywhere Python 3.11+ runs:
uv tool install director-cli # recommended
# or
pipx install director-cli
# or
pip install director-cli
Prerequisites (runtime)
director orchestrates other tools rather than replacing them, so it needs:
- Python ≥ 3.11
- git on
PATH(isolation is real git worktrees + branches) - OpenCode on
PATH(the agent runtime director drives) - Provider auth configured in OpenCode (
opencode auth): your planner/executor model providers — e.g. Anthropic/Bedrock, OpenRouter, or a local OpenAI-compatible endpoint such as LM Studio for thelocal-firstprofile.
director never manages provider keys itself — that lives in your OpenCode config.
Quickstart
cd your-repo
# 1. Install director's role agents into .opencode/ and seed .director/config.toml
director sync-agents
# 2. Edit .director/config.toml — bind roles to models, set your gate commands.
# (sync-agents seeded it from the bundled, fully-commented example.)
$EDITOR .director/config.toml
# 3. Plan: brainstorm → spec → test-gated task DAG (two approval gates)
director plan "Add a --json flag to the export command"
# …review .director/spec.md, then continue; review the plan, then continue:
director plan --continue # after approving the spec
director plan --continue # after approving the plan + failing tests
# 4. Run the DAG: isolated worktree per node, deterministic gates, auto-merge
director run
# 5. Inspect
director status
Unattended? Let the planner self-critique at each gate instead of pausing for you:
director plan "…" --auto # planner self-critiques at each gate
director plan "…" --auto --no-critique # gates auto-pass, fully hands-off
director run
Commands
| Command | What it does |
|---|---|
director plan "<task>" [--auto] [--no-critique] [--continue] |
Brainstorm → spec → test-gated task DAG, with two artifact-based approval gates. |
director run [--parallel N] [--max-attempts K] |
Execute the DAG: each node in an isolated git worktree, gated by tests/lint/typecheck, auto-merged on pass; escalates a stuck node one tier up. |
director status |
Per-node progress, attempts, cost, and the executor-tier completion rate. |
director bench "<task>" --profiles a,b,c |
Run the same task (same frozen acceptance tests) across profile variants and diff cost / quality / wall-time. |
director sync-agents |
(Re)install the role agents into <repo>/.opencode and seed .director/config.toml. |
All state lives under .director/ (resumable, debuggable): plan.json, state.json,
costs.jsonl, metrics.jsonl, per-call logs/, and bench/.
Configuration
director sync-agents seeds .director/config.toml from a complete, commented example
(also at director/config.example.toml). A config is
just roles → provider/model strings, the deterministic gate commands, per-model
pricing, and run limits — the example shows how to bind the executor tier to a local
model (≈ $0 implementation), a low-cost cloud model (zero local infra), or a frontier
model (the expensive baseline). See director/README.md for the
full architecture (gates, two-stage review, red-green hardening, metrics).
Comparing setups with bench
director bench plans a task once, then runs the same frozen acceptance tests under
several config variants to compare cost/quality/wall-time. Create the variants as
.director/profiles/<name>.toml (copy your config.toml and change the executor tier in
each), then:
director bench "<task>" --profiles all-frontier,cheap-cloud,local-first
For agents & scripting
director is built to be driven by humans or by another agent:
- Deterministic, non-interactive:
--auto --no-critiqueruns plan→run with no prompts; every merge decision is an exit code, never a chat. - Machine-readable output:
.director/metrics.jsonl(per-node + per-run records) and.director/bench/summary.jsonare stable JSON for downstream tooling. - Resumable: re-running
plan --continue/runpicks up from.director/state.
Development
uv sync # create the dev environment
uv run python -m unittest discover -s tests -q # tests
uvx ruff check . && uvx ruff format --check . # lint + format
uv build # build the wheel/sdist
Releases are automated with python-semantic-release
on merge to main (conventional-commit messages drive the version bump, changelog, and
PyPI publish via Trusted Publishing). See CONTRIBUTING.md.
License
MIT © Christopher Manzi. The ported TDD/review discipline is adapted from obra/superpowers (MIT).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file director_cli-0.3.0.tar.gz.
File metadata
- Download URL: director_cli-0.3.0.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbd8baf5e34ab8bcce53276d0442b0903b49264ae18bf266f3c199a07171affe
|
|
| MD5 |
4fdd7eed00ed643fccc89ad0a48fe654
|
|
| BLAKE2b-256 |
2345a61bff57f3eff30a4c3a04145a7511b1a447f7529a551130a17de70ab090
|
Provenance
The following attestation bundles were made for director_cli-0.3.0.tar.gz:
Publisher:
release.yml on manziman/director
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
director_cli-0.3.0.tar.gz -
Subject digest:
fbd8baf5e34ab8bcce53276d0442b0903b49264ae18bf266f3c199a07171affe - Sigstore transparency entry: 1942400044
- Sigstore integration time:
-
Permalink:
manziman/director@134c202e9e1df98bc20d1f7a51ab7619dd2a55fe -
Branch / Tag:
refs/heads/main - Owner: https://github.com/manziman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@134c202e9e1df98bc20d1f7a51ab7619dd2a55fe -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file director_cli-0.3.0-py3-none-any.whl.
File metadata
- Download URL: director_cli-0.3.0-py3-none-any.whl
- Upload date:
- Size: 56.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a83108ca098eeaf8f6ca1c40d99d511d139d05b9ecf1d55cfa2bf4d5a386930a
|
|
| MD5 |
dc8b5a774be003681b1e9e17617b09ed
|
|
| BLAKE2b-256 |
1b53a752f549ecf9995540d3abfc7058f880af19b555707ae571e04d9f60e788
|
Provenance
The following attestation bundles were made for director_cli-0.3.0-py3-none-any.whl:
Publisher:
release.yml on manziman/director
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
director_cli-0.3.0-py3-none-any.whl -
Subject digest:
a83108ca098eeaf8f6ca1c40d99d511d139d05b9ecf1d55cfa2bf4d5a386930a - Sigstore transparency entry: 1942400199
- Sigstore integration time:
-
Permalink:
manziman/director@134c202e9e1df98bc20d1f7a51ab7619dd2a55fe -
Branch / Tag:
refs/heads/main - Owner: https://github.com/manziman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@134c202e9e1df98bc20d1f7a51ab7619dd2a55fe -
Trigger Event:
workflow_dispatch
-
Statement type: