goal_gate=true ensures the result meets the spec before the workflow can succeed.
This pattern is useful when you want an agent to build something non-trivial from zero — a CLI tool, a game, a library — where the implementation naturally decomposes into layers that build on each other.
The workflow
build-solitaire.fabro
Key patterns
Phased implementation with verification gates
The workflow decomposes the build into six phases, each building on the previous one:.verify class) a cheaper model. It acts as an independent check — not just “did the implementation node think it succeeded?” but “does an independent evaluation confirm the phase is complete?”
Graph-level retry targets
The graph sets two levels of retry targets:impl_setup to re-attempt from project setup. If that target itself can’t recover, Fabro falls back further to impl_logic. This creates a cascading recovery strategy without cluttering every node with retry configuration.
Three-tier model routing
The stylesheet assigns models by role:- Sonnet handles routine phases: expanding the spec, setting up the project, wiring integration
- Opus handles the hard phases: implementing game logic and terminal UI where correctness and complexity demand the strongest model
- Haiku handles all verification gates: these are straightforward “run the tests, check the output” tasks that don’t need a frontier model
Goal gate on final review
Thereview node has goal_gate=true:
impl_ui rather than to the beginning. The assumption is that by the time you reach review, the foundation (data structures, game logic) is solid and only the UI or integration needs fixing.
Progressive layering
Each phase reads the spec and builds on the artifacts from prior phases. The data structures phase defines Card, Deck, and Pile types. The game logic phase reads those types and implements rules on top of them. The UI phase reads the game logic and renders it. Each layer has its own tests, so failures are caught at the right level of abstraction. This is more reliable than a single “implement everything” node because:- Earlier phases are validated before later phases begin
- Failures are localized — a broken data structure is caught before game logic tries to use it
- Retries target the right phase, not the entire build
Run configuration
Pair the workflow with a run config for repeatable execution:run.toml
Adapting this pattern
The phased build pattern generalizes to any project that decomposes into layers:- CLI tool — argument parsing → core logic → output formatting → integration tests
- REST API — data models → route handlers → middleware → end-to-end tests
- Library — type definitions → core algorithms → public API → documentation
- Compiler — lexer → parser → type checker → code generator → test suite