Skip to content
niki

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.

Pipeline docs

architecture · isolation

filesystem isolation + context isolation — validated against JSON schemas
Plannerstage 1

Reads 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 approach
Coderstage 2

Emits 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 sandbox
Testerstage 3

Generates 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 case
Reviewerstage 4

Issues 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 scores
✓ verified branchniki/<id>Every emitted artifact is JSON-schema validated before the next stage consumes it.

why it matters · vs one agent

the failures of single-agent tools map exactly to what independence fixes
single-agent loop
  • 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
niki's pipeline
  • 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 discipline
opt-in

Red agent

An adversarial reviewer that probes the diff before the Reviewer. Opt-in via [red_blue] enabled = true; sees evidence-only projections.

opt-in

Security Auditor

A dedicated security pass over the change via [security] — sees Planner and Coder artifacts only.

opt-in

Parallel Coders

Run multiple Coder implementations in parallel with a Synthesizer agent that merges them — via [parallel].

niki