Planner → Coder → Tester → Reviewer.
Four independent agents, each with its own prompt, model and context. They exchange typed artifacts — never a shared conversation. Independence is what removes the bias a single agent can't escape.
architecture · isolation
filesystem isolation + context isolation — validated against JSON schemasReads the task and the current files, produces the TaskSpec.
The Planner never writes code. It reads your task description plus existing file contents and emits a typed plan: scope, files, approach. With plan mode (`niki plan`), this is the only stage that runs — you review `plan.md` before anything executes.
→ emits TaskSpec — which files to touch, and the approachEmits a unified diff, applied to the sandboxed workspace.
The Coder works from the TaskSpec alone — it never sees the Planner's conversation. It emits a unified diff that Niki applies to the bind-mounted copy of your repo inside the container. Parallel coder topologies and a Synthesizer agent are available in `[pipeline]` config.
→ emits unified diff, applied inside the sandboxGenerates and runs tests against the change.
The Tester generates and executes real test suites against the change. Every test case carries an `oracle_source` — spec, derived or property — and failing red suites block the branch unless you explicitly `--force` (recorded as NOT verified).
→ emits test results, with oracle provenance per caseIssues the verdict; bounces work back until approved.
The Reviewer audits the prior stage's artifact, not shared state. On request-changes it loops back to the Coder for up to `max_revision_rounds`. Optional opt-in agents extend the loop: an adversarial Red agent probing the diff, and a Security Auditor pass.
→ emits verdict — correctness, quality, coverage scoreswhy it matters · vs one agent
the failures of single-agent tools map exactly to what independence fixes- Confirmation bias — it never truly challenges its own assumptions
- Context drift — quality degrades as the conversation grows
- Babysitting tax — you steer, correct and re-verify constantly
- A Tester and Reviewer who never saw the Coder's reasoning
- Narrow contexts — each agent starts clean, no drift
- A Reviewer that bounces work back so you review a finished result
optional stages · opt-in
configurable, off by default, same artifact disciplineRed agent
An adversarial reviewer that probes the diff before the Reviewer. Opt-in via [red_blue] enabled = true; sees evidence-only projections.
Security Auditor
A dedicated security pass over the change via [security] — sees Planner and Coder artifacts only.
Parallel Coders
Run multiple Coder implementations in parallel with a Synthesizer agent that merges them — via [parallel].