We had the design — 95% matching what we wanted. Not all of the remaining 5% is critical; some you accept and ship. But the remaining issues that do matter need a developer to fix. And if the code is unmaintainable, the developer can’t fix anything — they’re stuck.
Code quality isn't the goal. It's the prerequisite for the 95/5 model to work at all. Without it, that 95% of visual fidelity becomes throw-away work that never delivers real value.
Building a code constitution for LLM agent workflows
Agents don't infer your project's conventions, they default to whatever patterns dominate their training data. We already had a working constitution from our spec-driven development workflow, but autonomous execution demanded stricter controls.
We significantly improved it: tighter rules, more explicit forbidden patterns, agent-specific constraints, and guidelines for which shared components and styling conventions to use. Generic React knowledge isn't enough when code must fit an existing codebase.
The constitution benefited both human and agent workflows equally: same architecture decisions, same component patterns, same file organisation, regardless of who's doing the work.
Why autonomous AI agents need adversarial code review, not self-evaluation
Self-evaluation doesn't work — same principle as Stage 2's visual tester. A separate code review agent checks every output against the constitution and project rules. If it fails, the coder fixes and resubmits. The key distinction: you're not reviewing code style; you're reviewing compliance to your standards and architecture.
⚠️ One wrong line breaks everything
Our auto-generated agents.md included a statement "use Material UI" which was not used in our solution. The agent kept trying to reuse Material UI icons on every run until someone caught the line and removed it.
One wrong sentence propagates through every agent that references the file, on every run, silently. Your agents.md must be manually reviewed and accurate. Configuration is code, and it needs the same rigor.
The quality tax: What production-grade agentic AI workflows actually cost in runtime
Constitution, code reviewer, and test case generation improved quality significantly — but runs that took 2–3 hours in Stage 2 now take up to 5. Actual code implementation accounts for less than a third of that. The majority is review, testing, visual comparison, and fix cycles. The bottleneck isn't writing code; it's verifying it's correct. That's still cheap compared to developer time. Our answer: run overnight, review in the morning.
What developers actually receive vs agents we ended up with
After an overnight run, a developer reviews and refines — mostly code review, then visual polish and minor adjustments. A feature that would take two days of developer effort gets delivered in under a day of total human work. The remaining 5% is real, identifiable, and fixable by someone who can read the code and understand the intent.
We started with three agents: an orchestrator, a coder, and a tester. Single responsibility grew the team: the tester split into a functional tester and a visual tester. We added a code reviewer, a design decomposer, and a test case creator.
Each new agent emerged because an existing one was doing too much. 3 became 7. All project-agnostic — what makes the swarm project-specific is the constitution, the rules, and the codebase structure.
6-week results: What a production-ready agentic AI workflow actually looks like
Average run: up to 5 hours overnight. Production-quality code that reads like a human wrote it, 95% visual fidelity, a reproducible pipeline of seven agents across three phases. A developer picks up the output and finishes it.
Not solved: the last 5% is still manual, stability is not 100%, and every new project needs tuning.