Open Source CLI Tool

Build software
with AI agents.

Write a spec. Dark Factory decomposes it into modules, builds them in parallel, validates against holdout scenarios, and merges the result.

dark build spec_01J7K
scout indexing codebase... 847 files mapped
architect decomposed into 4 modules with contracts
plan-review auto-approved (≤4 modules)
build 4 parallel builders in isolated worktrees
integrate merged worktrees, 23/23 tests passing
evaluate 3 holdout scenarios validated
merge shipped to main
✓ Build complete — 4 modules, $2.14, 3m 42s

An 8-phase pipeline from
spec to shipped code.

Each phase is a gate. Agents coordinate through typed contracts and a SQLite-backed mail system. You stay in control.

scout
architect
plan review
build
integrate
evaluate
merge
01

Scout

Index the codebase so agents understand project structure, conventions, and dependency patterns before building.

02

Architect

Decompose the spec into modules with typed interface contracts, a dependency DAG, and an integration strategy.

03

Plan Review

Small plans auto-approve. Complex decompositions pause for human review before any building starts.

04

Build

Spawn parallel AI builders, each in its own git worktree, each bound by typed interface contracts. No shared state.

05

Integrate

Merge worktrees and run checkpoint tests to verify modules compose correctly at their contract boundaries.

06

Evaluate

Run holdout scenarios the builders never saw. Test changeability by asking fresh agents to extend the code.

07

Iterate

If evaluation fails, retry from the build phase with feedback. The pipeline supports up to N retry attempts.

08

Merge

Integrate into the target branch with post-merge validation. Ship it.

The primitives that make
parallel AI builds reliable.

Parallel Builders

Multiple AI agents build simultaneously in isolated git worktrees. No shared mutable state. Each builder sees only its interface contracts.

Holdout Scenarios

Test scenarios builders never see during construction. Validate what you actually want, not what the builder thought you wanted.

Contract-Driven

Typed interface contracts define module boundaries. Builders implement to contracts without coordinating with each other.

Budget Control

Every agent reports cost. The pipeline respects budgets, surfaces tradeoffs, and prevents runaway API spending.

TDD Cycles

Builders follow red-green-refactor. Tests first, then minimal code to pass, then cleanup. Every module is test-covered.

Agent Mail

SQLite-backed messaging between agents. Durable, inspectable, debuggable. No brittle direct process communication.

Everything from
the command line.

Create & Build
# Write a spec
$ dark spec create "Add JWT authentication"
→ spec_01J7KMRV created

# Run the full pipeline
$ dark build spec_01J7KMRV --budget-usd 10

# Watch progress in real-time
$ dark status
Monitor & Debug
# Launch the live dashboard
$ dark dash

# Inspect agent activity
$ dark agent list --role builder

# Read agent mail
$ dark mail check --agent agt_01DEF
Architecture
# Analyze spec decomposition
$ dark architect analyze spec_01J7KMRV

# View interface contracts
$ dark contract list --run-id run_01XYZ

# Check contract compliance
$ dark contract check ctr_01DEF

Up and running
in under a minute.

# Clone and install
$ git clone https://github.com/a1j9o94/df-cli.git
$ cd df-cli && bun install

# Initialize your project
$ dark init --name my-project

# Create a spec and build
$ dark spec create "Add user authentication"
$ dark build spec_01ABC123