Breakthrough Preferences kiro-cli-factory

Ralph loop: autonomous spec-driven multi-component build via Claude Code

breakthroughkiro-cli-factoryai-agents
Key Metric
Before
Manual component-by-component development requiring human...
After
Bash loop invokes Claude Code per spec autonomously. Full...

A bash loop plus Claude Code can build an entire multi-component system without a human in the loop. The ralph loop is the proof.

Context

Building complex multi-component systems with LLM agents was assumed to require constant human supervision. Each component needed a handoff: human reviews output, corrects errors, hands the next spec to the agent, reviews again. The coordination overhead dominated the productivity gains. The hypothesis was that if you could get an agent to work through a list of specs autonomously : without stopping for human approval at each step : you would compress a multi-day build into hours.

The blocker was reliability: agents fail. One bad output would break the next step if the loop was rigid.

What Changed

The ralph loop solves autonomous multi-component builds with three key design decisions. First, scope to one spec at a time using a RALPH_SPEC environment variable. Agents given full project context inject unnecessary dependencies (the “prompt anti-dependency bias” : reference file paths rather than embedding content inline). Second, remove set -e from the loop. Agent failures are recoverable; a rigid shell that exits on the first error wastes all prior work. Third, add a plan-reviewer and coder-replan escape hatch for when agents go off-track.

These three constraints transformed a fragile sequential process into a resilient autonomous build loop. The pattern was first applied to kiro-cli-factory and subsequently adopted in dakka and peon-notify for initial scaffolding phases.

Impact

First successful autonomous multi-component build using an LLM agent loop. The entire kiro-cli-factory scaffolding was generated without a single manual handoff between specs.

Before: multi-component builds required a human handoff after every spec : review, correct, proceed. After: bash loop iterates through all specs autonomously. Escape hatches handle the minority of agent failures without stopping the entire run.

The prompt anti-dependency bias discovery was a bonus finding: agents given content inline inject unnecessary dependencies. Switch to file path references, and the behavior corrects.

Source