The Agent Coding Specialist: A Machine That Follows Orders
The Myth of the "10x Engineer Agent"
We’ve all seen the demos. "Look, Devin built a whole website in 5 minutes!" It’s impressive. It’s flashy.
And it’s completely unmaintainable.
When you ask an AI to "build a website," it acts like a cowboy coder. It writes one massive file. It hardcodes API keys. It names variables data1 and data2. It creates a house of cards that collapses the moment you try to change the font size.
In our "Agentic Assembly Line," we didn't want a cowboy. We wanted a soldier. We wanted the Agent Coding Specialist.
Narrowing the Context
The secret to getting high-quality code from an LLM is to starve it of context.
That sounds counterintuitive. Don't we want the AI to know everything?
No. If you give an AI the entire codebase and say "add a feature," it gets distracted. It tries to refactor unrelated files. It gets confused by legacy code.
Our Coding Agent operates in a tunnel. When it wakes up, it sees exactly three things:
1. The Active Task: A single line from tasklist.md. E.g., "Implement src/components/auth/models.py."
2. The Component Contract: The contract.md that defines exactly what inputs and outputs are required.
3. The Prime Directive: The system prompt that enforces style, determinism, and atomic patterns.
It doesn't know about the marketing strategy. It doesn't know about the UI color palette. It only knows that it must create a Pydantic model that matches the contract.
The "Halt" Protocol
The most important feature of our Coding Agent isn't what it can do, but what it cannot do.
We programmed a Hard Halt.
If the Coder encounters a situation where the Spec is ambiguous, or the libraries have changed, or the task is impossible as written, it is forbidden from fixing it.
Most agents try to be helpful. "Oh, the library doesn't have method_A, I'll just use method_B instead!" This helps in the short term but corrupts the system in the long term. The documentation (Spec) and the Reality (Code) drift apart.
Our Coding Agent says: "I cannot proceed. The map does not match the territory. HALT."
It stops coding. It raises a flag. And it hands control back to the Business Analyst to update the spec. This ensures that the documentation remains the Single Source of Truth, not the code.
## Constraint-Based Coding
We don't trust the Coding Agent to write good architecture. We trust it to write good syntax. The architecture is enforced by the directory structure.
We force the Atomic Component Pattern:
You must* create a component.py with a run() function.
You must* create a ports.py Protocol for dependencies.
You must* create models.py with frozen dataclasses.
The Agent doesn't have a choice. If it tries to write a class-based service in src/utils, the linter screams, "VIOLATION: Atomic Pattern Required."
By constraining the "creative space" of the agent, we paradoxically make it smarter. It doesn't have to waste tokens thinking about file structure or naming conventions. It can focus all its "reasoning" power on the logic inside the function.
TDD as a Specification Tool
We used Test-Driven Development (TDD) not just for quality, but for control.
The Coding Agent is often asked to write the tests before the implementation.
1. Read contract.md.
2. Write test_component.py that asserts the contract is met.
3. Run tests (Fail).
4. Write component.py to make tests pass.
This loop prevents the agent from hallucinating features. If there's no test for it, it doesn't get written. It keeps the code lean and focused purely on the requirements.
## The Result: Readable, Boring Code
The code produced by the Agent Coding Specialist is remarkably... boring. It looks like it was written by a strict pedant. Every function has type hints. Every dependency is injected. Every variable is named descriptively.
It lacks "flair." It lacks "clever hacks."
And that makes it perfect.
In a human team, we value "rockstar developers" who can pull off miracles. In an AI team, miracles are usually just unassigned variables waiting to crash production. We built a machine that writes code the way a printer prints text: line by line, exactly as specified, without asking "But what if we made it blue?"