Agentic App Loop
Build an app through seven bounded phases — plan, test, implement, review, verify, remember, improve — each its own subagent.
- 01Orchestrator that writes no code
- 02One file between phases
- 03A gate after every phase
- 04Loop-backs, capped
- 05Phases adapt to the job
- 06Installed as skill plus agents
Architecture Overview
A Claude Code skill that builds and extends real applications through a fixed seven-phase loop — PLAN, TEST, IMPLEMENT, REVIEW, VERIFY, REMEMBER, IMPROVE — where each phase runs as its own bounded subagent with a written contract. The orchestrator never writes feature code itself: it runs the phases, enforces a gate after each one, and handles loop-backs when review finds a blocking bug or verification fails. Phases never talk directly; they pass state through a single BUILD_STATE.md file in the target repo, which is also what keeps the orchestrator's own context small. It is the difference between 'just build it' and a run that cannot skip its own tests.
How it works
Core mechanics, failure recovery paths, and system design decisions.
Orchestrator that writes no code
The main build-app skill runs the loop and nothing else — it starts each phase's subagent, checks the gate, and decides the next move. Delegating every verbose step keeps its context small enough to see the whole run.
One file between phases
Every phase reads and writes a single BUILD_STATE.md at the repo root: the plan, the numbered acceptance criteria, review findings, verify evidence. No phase calls another, so any one can be re-run in isolation.
A gate after every phase
PLAN needs tasks, criteria and a test strategy; TEST's tests must fail only because the code is absent, not because of a typo; REVIEW must reach zero unresolved blocking findings; VERIFY must show every criterion met with evidence before the loop moves on.
Loop-backs, capped
A blocking review finding sends the run back to IMPLEMENT; a failed VERIFY back to IMPLEMENT or PLAN; a wrong test back to TEST. After four iterations without a green VERIFY the loop stops and asks the operator rather than grinding.
Phases adapt to the job
Greenfield app, new feature, bug fix, refactor and spike keep the same shape: a bug fix makes TEST write a failing regression test first, a refactor makes it add characterization tests, a spike explicitly waives everything but PLAN, IMPLEMENT and REMEMBER.
Installed as skill plus agents
An npx installer copies the skill, the seven subagents and the /build-app command into a project's .claude or the global one. The plan and review phases default to a stronger model, the rest inherit; the iteration cap and loop-back rules live in one file.
Engineering Highlights
- •Each concern — tests, review, verification — is a hard checkpoint with its own agent, not an optional step
- •The orchestrator never edits feature code, so its context stays small enough to run the whole loop
- •Phases communicate only through BUILD_STATE.md, so any phase can be re-run alone
- •Tests that fail for the wrong reason bounce back to TEST instead of being counted as red
- •A test that would be edited to force a pass sends the run back rather than going green
- •Four iterations without a clean verify stops the loop and hands back to the operator