Skip to main content

Model-agnostic decomposition coding harness that orchestrates agent runtimes (OpenCode, Claude Code) behind deterministic gates.

Project description

director

A model-agnostic decomposition coding harness — a thin orchestrator over agent runtimes (OpenCode, Claude Code, …).

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. When using an OpenCode-owned provider tier, director drives OpenCode headlessly and inherits its 75+ providers. Claude Code tiers use the Claude Code CLI.

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, if you use an OpenCode-owned provider tier (anthropic, openai, google, bedrock, openrouter, lmstudio, …)
  • Claude Code (claude) on PATH, if you use a claude-code/* tier
  • Provider auth: if you use OpenCode tiers, configure auth in OpenCode via opencode auth; Claude Code tiers use the Claude Code CLI's own auth

director never manages provider keys itself — each runtime handles its own credentials.


Quickstart

cd your-repo

# 1. Create .director/config.toml interactively — director init asks which model to
#    use per role and what your gate commands are, then writes the config for you.
director init
#    (See director/config.example.toml for the full/advanced schema if you want to
#     hand-tune beyond what init prompts for.)
$EDITOR .director/config.toml

# 2. Install director's role agents into .opencode/ (+ gitignore, starter opencode.json)
#    — written only when an OpenCode provider tier is configured
director sync-agents

# 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 init [--repo .] Interactively create .director/config.toml — asks which model to use per role and your gate commands.
director sync-agents (Re)install the role agents into <repo>/.opencode/ (plus gitignore, starter opencode.json) — only when an OpenCode provider tier is configured.

All state lives under .director/ (resumable, debuggable): plan.json, state.json, costs.jsonl, metrics.jsonl, per-call logs/, and bench/.

Configuration

director init interactively creates .director/config.toml — it asks which model to use for each role and what your deterministic gate commands are, then writes the config for you. A config is just roles → provider/model strings, the deterministic gate commands, per-model pricing, and run limits. For the full/advanced schema, see the complete, commented director/config.example.toml: it 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-critique runs 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.json are stable JSON for downstream tooling.
  • Resumable: re-running plan --continue / run picks 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

director_cli-0.5.0.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

director_cli-0.5.0-py3-none-any.whl (64.1 kB view details)

Uploaded Python 3

File details

Details for the file director_cli-0.5.0.tar.gz.

File metadata

  • Download URL: director_cli-0.5.0.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for director_cli-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8e442dfd4d355d2f252f4d1a79040f4426fc11a6d95eb7b9949da71326a4ed72
MD5 4792107aeef231987255114b666b0b84
BLAKE2b-256 5dcd860c8b041231462ddb6da5469293b27c472da216f0bf70112fe3f459a7f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for director_cli-0.5.0.tar.gz:

Publisher: release.yml on manziman/director

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file director_cli-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: director_cli-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 64.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for director_cli-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e885050e0ead10711dc5ddc5e3b604fb68c3a2bfbaf34c119c60d9c22e7ea7a9
MD5 95ea528dfdf8fbfafaccbf9fc85f9b2e
BLAKE2b-256 f7932a00c217bdb6c3fda7bdb87dcb82ccdb35e5a9bee37974178681e54edaa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for director_cli-0.5.0-py3-none-any.whl:

Publisher: release.yml on manziman/director

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page