Skip to content

Repository files navigation

Witch — deterministic delegation for OpenCode

Witch

A fixed-lane delegation harness for OpenCode. Route routine volume to Luna, integration to Terra, and consequential judgment to Sol.

Apache-2.0 · Install · Architecture · Provenance

Witch gives OpenCode a deterministic multi-agent workflow instead of leaving model choice, permissions, and delegation shape implicit. One Sol orchestrator routes work into seven named subagents with fixed models and permissions, then owns verification and final acceptance.

witch (Sol / medium)
├── routine work       → witch-routine       (Luna / high)
├── complex work       → witch-complex       (Terra / max)
├── research           → witch-researcher    (Luna / max, read-only)
├── security-sensitive → witch-security      (Sol / high, restricted)
├── task review        → witch-task-reviewer (Luna / max, read-only)
├── repair review      → witch-re-reviewer   (Luna / high, read-only)
└── final acceptance   → witch-final-reviewer (Sol / high, read-only)

There are no escalation profiles, generic-agent fallbacks, dispatch-time model overrides, or Sol/max lane. A failed task is repaired inside its declared lane or stopped for human direction.

Why fixed lanes

  • Predictable cost — inexpensive agents handle bounded volume while Sol is reserved for orchestration, security, and final judgment.
  • Explicit permissions — implementation agents receive bounded edit access; research and review agents cannot edit, delegate, run shell commands, or access external directories.
  • Deterministic routing — security, research, complex integration, and routine work have an enforced precedence.
  • Evidence before acceptance — task review, bounded repair/re-review, and a fresh final review are explicit workflow stages.

Quick start

git clone https://github.com/muratmirgun/witch.git
cd witch
npm install
npm run verify

Start OpenCode from the repository root for project-local loading. To install the same agents, skills, plugin, and model variants into the global OpenCode configuration, run:

npm run install:opencode

The installer creates a timestamped backup before replacing Witch-owned files and preserves unrelated user configuration. See .opencode/INSTALL.md for model preflight, global installation, git-backed loading, and troubleshooting.

Fixed agent matrix

Agent Model Effort Boundary
witch openai/gpt-5.6-sol medium Primary orchestrator, router, verifier, and acceptance owner
witch-routine openai/gpt-5.6-luna high Bounded, mechanically determined implementation
witch-complex openai/gpt-5.6-terra max Multi-file and context-heavy integration
witch-researcher openai/gpt-5.6-luna max Read-only codebase evidence
witch-security openai/gpt-5.6-sol high Restricted security-sensitive implementation
witch-task-reviewer openai/gpt-5.6-luna max Read-only task acceptance review
witch-re-reviewer openai/gpt-5.6-luna high Read-only bounded repair verification
witch-final-reviewer openai/gpt-5.6-sol high Fresh read-only whole-change review

Model economics

OpenAI's standard API list prices changed on 2026-07-30:

Model Input / 1M tokens Output / 1M tokens
GPT-5.6 Luna $0.20 $1.20
GPT-5.6 Terra $2.00 $12.00
GPT-5.6 Sol $5.00 $30.00

For an identical input/output token shape, Luna is approximately 10x cheaper than Terra and 25x cheaper than Sol. That ratio explains Witch's lane choices; it is not a claim that every Witch task costs 10x or 25x less. Real workflow cost depends on lane mix, token volume, prompt caching, reasoning effort, tool loops, and whether a task needs repair.

Source: OpenAI, “Advancing the price-performance frontier with GPT-5.6”.

Routing and workflow

Before implementation or research, the controller calls witch_route with worktree-mutation, security, and integration signals plus a non-empty reason. The first matching rule wins: security, research, complex integration, then routine implementation.

The detailed route contract, review cycle, permission boundaries, and file layout are documented in docs/architecture.md.

Development

npm test       # routing, permissions, installer, plugin, and provenance
npm run verify # tests plus TypeScript plugin syntax validation

License and provenance

Witch is an independent OpenCode-only implementation derived from selected workflow material in obra/superpowers. It vendors its selected source locally and never fetches or installs the upstream package at runtime.

The selected upstream skills are vendored and adapted under the MIT license; these four prompt templates remain byte-for-byte preserved:

  • skills/subagent-driven-development/implementer-prompt.md
  • skills/subagent-driven-development/task-reviewer-prompt.md
  • skills/subagent-driven-development/re-review-prompt.md
  • skills/requesting-code-review/code-reviewer.md

Witch is released under the Apache License 2.0. The pinned upstream revision, hashes, and attribution boundary are recorded in THIRD_PARTY_NOTICES.md and vendor/upstream.json.

About

Deterministic delegation for OpenCode. Fixed lanes, explicit permissions, and evidence-based acceptance.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages