Multi-Agent Orchestration
Spec Kitty supports multi-agent delivery through a host/provider split:
spec-kittyowns workflow state, lane validation, and git-safe mutations.- external providers such as
spec-kitty-orchestratorrun agents and callspec-kitty orchestrator-api.
This replaces in-core orchestration commands. The core CLI does not provide spec-kitty orchestrate.
Why this model exists
- Security boundary: autonomous orchestration is optional and can be disallowed by policy.
- Extensibility: multiple provider strategies can exist without branching core CLI behavior.
- Operational clarity: one host contract for state transitions and lifecycle events.
- Review independence: one agent can implement while a different agent reviews without either agent owning the mission state machine.
Core Principles
- Planning in main, implementation in worktrees.
- One worktree per WP.
- Lane transitions validated by the host state model.
- External providers drive automation through API calls, not direct file edits.
- Activity logs and run state are audit artifacts, not the source of truth.
Two orchestration styles
1) Manual (human- or agent-driven)
Manual coordination still works via normal commands:
spec-kitty next --agent <agent> --mission <slug>
# Your agent calls: spec-kitty agent action implement WP01 --agent <name>
spec-kitty agent tasks move-task WP01 --to for_review
spec-kitty agent tasks move-task WP01 --to done
2) External automated orchestration
Automated coordination is run by external providers such as spec-kitty-orchestrator.
Use a provider build that explicitly supports the current host API. The PyPI
spec-kitty-orchestrator 0.1.0 release appends --json to host API calls
and is not compatible with current hosts.
spec-kitty orchestrator-api contract-version
spec-kitty-orchestrator orchestrate --mission 034-my-feature --dry-run
spec-kitty-orchestrator orchestrate --mission 034-my-feature
Host-compatible provider loop responsibilities:
- Discover ready WPs via host API.
- Start implementation, prepare usable worktrees, and run agents there.
- Transition WPs through review cycles.
- Accept when WPs are accepted-ready (
approvedordone), then merge.
The common local pattern is:
spec-kitty-orchestrator orchestrate \
--mission 034-my-feature \
--impl-agent claude-code \
--review-agent codex \
--max-concurrent 1
That means Claude Code receives the WP prompt and writes the implementation; Codex receives the same WP context after implementation and acts as reviewer. The host, not either agent, decides which lane transitions are legal.
Host API boundary
All state-changing automation calls flow through spec-kitty orchestrator-api.
start-implementationstart-reviewtransitionappend-historyaccept-missionmerge-mission
The host returns a stable JSON envelope with success and error_code for deterministic provider control flow.
The provider can be replaced. The boundary cannot. A custom orchestrator may use a different scheduler, model router, queue, or CI runner, but it still must call the same host API.
Lane semantics
Public API lanes:
plannedin_progressfor_reviewin_reviewapproveddoneblockedcanceled
Compatibility mapping:
- API
in_progressmaps to internaldoing. planned,for_review,in_review,approved, anddonemap directly.
Current host review flow is:
in_progress -> for_review -> in_review -> done
A rejected review moves back to implementation:
in_review -> in_progress -> for_review
Providers should preserve a review reference for both approval and rejection so humans can trace why a WP moved.
Worktrees and Protected Branches
The orchestrator model assumes protected branches stay clean:
- mission planning artifacts live on the main project branch
- implementation runs in WP worktrees
- provider state lives under
.kittify/ - host lane events are appended by the host API
This matters because activity-log updates may be committed by the host. A
provider that invokes mutation commands directly from protected main can hit
branch-protection errors. A compatible provider must create or reuse the
mission and WP worktrees before mutating state or spawning agents.
Policy metadata and mutation authority
Run-affecting operations require policy metadata (--policy) and are validated by the host.
This ensures:
- identity and mode are explicit for each mutation
- malformed or secret-like policy payloads are rejected
- orchestrators cannot bypass host transition rules
What this means for teams
- Teams that want full automation can run an external provider.
- Teams with strict security constraints can keep orchestration manual.
- Teams can build custom providers while preserving a consistent workflow model.
- Teams can test automation safely with deterministic fake-agent e2e before enabling real agent CLIs on a trusted machine.