← All work
AI systems, 2026

AI-WORKER — autonomous SDLC orchestrator

A Rust daemon that takes a project from requirements to merged PRs by driving Claude Code and local models through a gated software lifecycle.

Role
Architect and developer
Context
Own project
Scale
~41k lines of Rust, 6 crates, 319 commits, Jun – Sep 2026
AI-WORKER projects overview
Projects overview: fleet status, spend so far, live activity log.

Background

Most coding agents answer one prompt. AI-WORKER runs the whole lifecycle: ingest an existing codebase or raw requirements, produce a design prototype, pick a stack, write the architecture, plan sprints, author tests, then execute tasks in parallel and ship through CI and an end-to-end Playwright matrix. A human approves each phase gate.

It is a Rust workspace of six crates: a daemon with HTTP and WebSocket APIs, a CLI, a terminal UI, an MCP server so Claude Code or an IDE can drive it, a prompts crate and a shared core. A React cockpit is embedded in the binary.

Screens

The problem

At work I had watched a team run OpenClaw agents as a simulated company. It produced a lot of output and very little that merged. The failures were structural, not model quality: no gate between phases, no isolation between parallel workers, requirements silently dropped between the analyst and the coder, and no idea what a run had cost until the invoice arrived.

I wanted a system I could leave running overnight on a real repo and trust three things in the morning: nothing merged without a human seeing it, every explicit requirement was either satisfied or flagged, and the bill was known before it was spent.

Approach

  1. Model the lifecycle as an explicit state machine. Ingest, Requirements, Design, TechStack, Architecture, SprintPlan, TestAuthoring, Docs, Execution, CI/CD, E2E, Done. Every transition is a human gate with role-based seats, optional quorum and escalation.
  2. Isolate workers with git. Each task runs in its own worktree on a task branch. The loop is coder, tests, resume on failure, open a PR with gh, reviewer agent, human PR gate, serialized squash merge. Two workers cannot corrupt each other's tree.
  3. Make the model pluggable per role. Eleven roles, each routable to Claude CLI, an OpenAI-compatible endpoint (Groq, Gemini, OpenRouter, Ollama) or Aider. For local models that lack tool use, a custom tool-calling loop lets them edit files. A fallback decorator switches models on rate limits.
  4. Add a constraint ledger. Explicit requirements are extracted verbatim, carried into every coder and reviewer prompt, and scored pass or fail per task. The result is a compliance matrix instead of a vibe.
  5. Track cost as a first-class value. Per-item estimates from a regression over story points, routing advice by model, a stall watchdog, and auto-pause and resume on usage limits so an unattended run does not burn the budget.
  6. Sandbox it. macOS Seatbelt profiles plus a hostname-allowlisted egress CONNECT proxy. A CI gate script runs secret scanning, clippy with warnings as errors and a custom async lint.

Architecture

gh pr createPR gateRequirementsDesignArchitectureSprint planTest authoringHuman gateseats · quorum · escalationWorker · task/1git worktreeWorker · task/2git worktreeWorker · task/ngit worktreeReviewer agentSquash mergeserialised
AI-WORKER: a phase state machine with a human gate at each step; execution fans out to workers in git worktrees and merges serially.
aiwdDaemon: axum HTTP + WebSocket, sqlx over Postgres or SQLite behind one dialect layer, embedded React cockpit.
aiw / aiw-tuiCLI and ratatui terminal UI for boards, sprints, gates and costs.
mcpJSON-RPC over stdio so Claude Code or an IDE can drive the daemon.
prompts / coreRole prompts, constraint ledger, cost model, runners for Claude, Aider and OpenAI-compatible APIs.
recipe-box, ottr-clone, epictest, setup-smokeProjects it built end to end. Generated requirements, design, architecture and sprint artifacts are committed alongside the code.

Outcome

  • Four real projects built unattended from a one-paragraph brief to merged PRs with passing Playwright suites: a recipe app, a static clone of a company site, a Go and React grocery store, and a CI smoke target.
  • Sixty-phase build journal that documents the system by rebuilding it, so a new contributor or a new agent can reconstruct it phase by phase.
  • A clean rewrite (new-ai-worker) started in September 2026 on the same six-crate layout, folding in what the first version taught.

Lessons

  • Gates matter more than models. Swapping a stronger model changed output quality a little. Adding a reviewer agent and a human PR gate changed the merge rate a lot.
  • Local models are usable for narrow roles if the prompt is short and the tool loop is yours. They are not usable as drop-in replacements for Claude in the coder role.
  • Cost tracking has to be built in on day one. Retrofitting it meant re-parsing months of CLI output.

Stack

RusttokioaxumsqlxratatuiReactClaude CodeAiderOllamaMCPPostgreSQLSQLite