Essay

Building an agent harness: fix the repo before you tune the prompts

An agent harness is guardrails plus orchestration around coding agents. What I learned leading an agentic SDLC, and why the codebase matters more than the model.

I led SpotDraft’s agentic software development lifecycle. If another engineering leader asked me whether to build something similar, my first answer would be: fix the repository before you tune a single prompt.

Agents fail in the same places new engineers fail. They cannot find the module. They put business logic in the wrong layer. They ignore the shared test setup. They open one pull request that should have been three. A better model reduces some of that. A codebase that teaches its own conventions removes most of it.

That is the half of the work nobody demos. It is also the half that decides whether agents become part of how a team ships, or stay a private habit in a few editors.

What I mean by a harness

“Harness” gets used loosely. I use it to mean two things around the model: guardrails and orchestration.

Guardrails are the rules and checks that keep agent output inside the team’s standards. They cover conventions, layer boundaries, test expectations, PR size, and what a reviewer will reject.

Orchestration is the workflow that routes work through the lifecycle with a check at each step:

requirement and acceptance criteria → planning → task breakdown → implementation → small pull requests → review → automated testing → validation → merge-ready PR.

The target is explicit. “Generate a PR” is too low a bar. The target is a pull request a human can stand behind and merge.

Without the harness you get what most teams already have. Engineers use coding agents in private, with a ticket in one window and an agent in another. The pull request still needs the review comments the team has left for years. Usage goes up. The development system does not improve.

Make the repository teach the conventions

We treated “agent-ready” as a property of the repository. The model was the smaller variable.

Root instructions became an index, not a documentation dump. Detailed context moved into scoped files next to the modules that actually change. Engineering conventions (architecture, testing, PR size, data rules) lived in one central place. Business flows lived with the domain they describe. An agent should navigate from the index to the right context. It should not reread the same framework lecture in every folder.

The rules came from review comments, not from a style guide someone wished the team followed. I took recent review feedback and turned the repeated points into rules. Then we ran real implementation tasks against those rules and reviewed the agent output ourselves. Every miss went back into the rules.

That loop is the whole method. If the same review comment appears twice, the rule is incomplete.

Route normal prompts into the workflow

The workflow has to be the default path. An engineer should be able to write a normal engineering prompt and land in the lifecycle without remembering commands or picking the right skill.

If people have to select the right skill, you do not have a lifecycle. You have a menu.

This mattered more for adoption than anything else we built. Two things drove wider use. The first was that normal prompts routed in, so engineers did not have to learn a new interface to get the benefit. The second was a clear leadership expectation that new tickets go through the harness. The expectation alone would have produced compliance theater. The routing alone would have produced a nice option few people chose. Together, they made the harness the normal way to work.

Slow is not always a bug

The first complaints were specific, which is a good sign. The harness was slower than a raw coding-agent session, and the orchestrator could be better. Those are production-system complaints. You only get them once people actually use the thing.

Slow is not automatically a problem. A flow that asks follow-up questions, writes a plan, and looks for edge cases does work that a fast autocomplete skips. If the extra time is thinking, keep it. If it goes to context thrash or a single long session that cannot isolate steps, fix the system.

Since then the harness has become faster for three reasons:

  • The orchestrator got better at running steps in isolation instead of as one long session.
  • Context got tighter. Agents load the scoped context they need and less of everything else.
  • Models improved, and that did part of the work.

Review also got better. Pull requests arrive closer to review-ready. Part of that is the rule loop: conventions that used to show up as review comments now apply before the code is written.

The tool layer is an architecture decision

Once agents are in the loop, they need tools: the ticketing system, the documentation system, and the product itself. The obvious move is to let each team wire up its own. That works until several products and agents depend on the same tools, and every new tool risks breaking someone.

The pattern I would keep is one shared gateway for agent tools. Standing it up is easy. Letting a team register a tool without breaking every consumer is the hard part. Three rules help:

  • Tag every tool by capability, product area, and maturity.
  • Define an audience as a filter on those tags, not a hardcoded list of tools.
  • Keep preview tools out of production agents until someone has evaluated them.

Part of my job is also to say when this layer is the wrong abstraction. An agent that needs a tool catalog is a different problem from a deterministic script with an owner. Glue enough tool servers together and nobody can explain a failure. Skip the layer entirely and the harness cannot reach the systems where the work already lives.

What changes for engineering managers

If implementation drafts get cheaper, specification quality gets more expensive. If tests can be generated, deciding what to trust gets more expensive. If pull requests arrive faster, review design gets more expensive.

I have moved my own review time toward architecture, contracts, risks, and high-context decisions. Implementation quality moves through peer and tech-lead review. A harness makes that split mandatory. A manager who still inspects every diff will drown. A manager who never looks at the new workflow will ship confident nonsense.

People development does not go away. Engineers still grow through the same progression: task ownership, project ownership, technical judgment, organizational ownership. An agent can draft the spec. It cannot own the decision. If the important call still routes through me by default, the engineer does not own the work yet, however the PR was generated.

Defaults I would keep

  1. Fix the repository first. Make it teach the conventions instead of re-prompting them.
  2. Build rules from repeated review comments, and feed every miss back into them.
  3. Put the agent inside the lifecycle, with a check at every step.
  4. Route a normal engineering prompt into the workflow. Do not make people pick skills.
  5. Pair the default path with a clear expectation. Neither works alone.
  6. Measure review-ready output on real tickets, not session counts.
  7. Keep humans accountable for architecture, acceptance, and the merge.

I like building reusable things. Internal platforms, developer portals, public API docs, and now an agent harness come from one instinct: stop paying the same tax in twelve places. A harness applies that instinct to how engineering happens. If it only lives in one champion’s editor, it disappears when the champion changes teams.

Related

Oct 2026
Vibe coding passes the interview. It fails code review.

I do not test whether a candidate wrote the code themselves or an agent did. I test whether they can defend why they built it that way, because vibe-coded work fails downstream, not in the interview room.

career engineering leadership ai
Oct 2026
Think before you code: why I ask engineers to spend 90% of their time thinking

Why I ask every engineer to think about problems, solutions, and architecture before writing code, and why that thinking is what lets you review designs from other engineers and AI agents.

engineering leadership architecture ai
Oct 2026
Building a platform team from one engineer: know why, and know what you skipped

How I built a platform team from one engineer working ad hoc. Follow the repeated pain, write the charter before you hire, protect roadmap time, and have an answer for every bet and every skip.

platform engineering engineering leadership architecture