← All articles

Part 2: Specs, then tickets

Blueprint-Cutting Machine and Conveyor

Build me a login page

Ask an agent for a login page and you'll get a login page. You'll also get a password reset flow, a session store, a new authentication library, a refactor of the user model "for consistency", and a README section congratulating itself on all of the above. Every line of it compiles. Half of it you didn't want, and some of it you won't notice until it's in production.

That isn't the agent being bad. It's the agent doing exactly what you'd expect from something with unlimited stamina, no context and a burning need to be helpful. Give it a vague request and it fills the gaps with decisions. Its decisions, made in the middle of writing code, never written down, buried in a diff you'll skim at 6pm.

Every one of us has worked with that developer. Keen, fast, and making architectural choices in a commit titled "small fixes". You didn't fix that person by hiring a cleverer one. You fixed them by being clear about what you wanted before they started typing.

Agents are the same, only faster. So the factory runs on two documents, in order. A spec, where the decisions live. Then tickets, where the work lives. Never the other way round, and never both in one.

Decisions and work are different things

This is the whole post in one line. A spec decides. A ticket delivers.

When an implementer is forced to make a design decision, it makes it alone, silently, and with the confidence of something that has never been paged at 3am. When a spec has already made the decision, the implementer just has to build it, and the reviewer has something to check the work against.

So the implementing agent never designs anything. If the plan is ambiguous, wrong or can't be built as written, the implementer stops and asks the architect. My engineers' instructions put it bluntly. An unflagged deviation from the plan is the most expensive mistake they can make. More expensive than a bug, because a bug fails a test. A silent design change passes every test, because nobody wrote a test for a decision they didn't know was being made.

Size the ceremony to the change

Here's where most process people lose the plot. They hear "spec first" and produce a twelve-page template for a typo fix. Then the team quietly stops using it, and you're back to "build me a login page".

Most changes don't need a plan at all. The trick is deciding, every time, how much ceremony this particular change has earned. My architect agent sizes every request into one of three buckets before it writes a word:

Size What it is What it gets
Small A clear bug, or a change at one seam with no real design choice No plan. No questions. One ticket with acceptance criteria.
Standard Critical-path code with a new design, or more than a few files A short plan. Assumptions stated, not asked about.
Major Changes the architecture or the data model, adds an external surface, or weakens one of the product's stated non-negotiables A plan, and the plan gets attacked before anyone builds it.

The default is the smallest bucket that fits. Docs, tests, CI scripts and UI wording never get a plan, whatever their size. A big change isn't automatically a Major one. Size is not risk.

Before it sizes anything, the architect reads what the request rests on, at the tip of the main branch. The repository's agent instructions, the glossary and decision records for that area, and the code involved. Every claim a plan makes about the code has to cite what the code says now. Not what the architect remembers. Not what last month's plan said. Now.

What goes in a plan

When a change earns a plan, the plan covers six things:

  • the problem and the solution;
  • the decisions and trade-offs, including the failure modes you accept and the ones you design against;
  • how the change meets the product's acceptance criteria;
  • the test seams, preferring seams that already exist, and as few as possible;
  • what's out of scope;
  • open questions, and any recorded dissent.

That second bullet is the one people skip. "The failure modes you accept" is where the honest engineering happens. Every design accepts some failure. A plan that doesn't say which ones is either naive or hiding something, and you don't want to find out which during an incident.

Recorded dissent matters too. When the architect is overruled, it complies and writes down why it disagreed. Six months later, when the overruled thing breaks exactly the way it said it would, you'll want that paragraph.

Keep it short, because everyone reads it

Here's the economics nobody mentions. Every run that touches the work reads the plan again. The challenge, the rulings, every ticket, every review stage. A plan isn't read once. It's read twenty times, and you pay for every read.

So my plans have word budgets. About 1,500 words for a Standard plan, 4,000 for a Major one. Cite file:line instead of pasting code. State each decision once. And when a revision changes something, rewrite the passage in place instead of bolting a correction onto the end.

Plans rot without that last rule. A plan with "UPDATE: actually, ignore section 3" at the bottom gets read by an agent that takes section 3 at face value, misses the update, and builds the thing you cancelled. Agents read top to bottom and believe what they read first. Edit in place.

One plan per piece of code

Before the architect writes a plan, it searches the open tickets and plans for work on the same functions and files. If another open plan already changes that code, it extends that plan, or it waits for it.

It sounds obvious. It isn't, once five tickets are in flight. Two plans that disagree about one method are a defect in the plans, and finding it during review is the most expensive place to find it.

Attack the plan before you build it

A Major plan doesn't go straight to implementation. It goes to another agent whose only job is to break it.

I call that agent Counsel. It runs on a different model from the architect, on purpose. The same model reviewing its own plan is an echo chamber with a token bill. A different model has different blind spots, which is the whole point.

Counsel's instructions are short and nasty. Read cold. The request first, then the code, and the plan last, without reading the discussion that produced it. Before reading the plan, sketch your own answer. Wherever the plan differs from your sketch, find out which one is wrong. Then attack it in this order:

Facts        Open the file behind every claim the plan makes about the code.
Assumptions  For each one, what happens when it's false? Which unstated ones does it lean on?
Failure      Errors, concurrency, a half-finished operation, upgrade, rollback, data in the field.
Smaller      Is there a simpler change that meets the request? What does the extra part buy?
Scope        What the request needs and the plan leaves out, and the other way round.
Proof        Can each acceptance criterion fail? A criterion no test could fail is a finding.
Boundaries   Pull requests and review stages. Is a reviewer missing?

Then the most important instruction of the lot. Refute your own findings. For each one, look for the evidence that would make it wrong, and keep only the ones that survive. A reviewer that doesn't try to disprove itself will happily file fifteen findings, nine of which are imaginary, and your architect will burn a day ruling on them.

The challenge ends with a verdict and one of three next steps. Proceed, another round, or this needs the human. "Needs the human" is reserved for money, external services, pricing, licensing, data loss or a change of direction. Everything else, the architect rules on finding by finding, accepted with the plan changed or rejected with a reason, and the plan goes to build without me.

And one line I'd tattoo on every review agent if I could: a challenge with no findings is a valid result. Never invent one to justify the run. Agents hate coming back empty-handed. If you don't explicitly give them permission to say "this is fine", they'll find something wrong with a perfectly good plan, just to look busy. Sound familiar? You've sat in that meeting.

Now cut the tickets

With the decisions made, tickets are almost mechanical. That's the point. The thinking happened in the plan. A ticket is a delivery boundary, and the rules for drawing those boundaries are where most teams get it wrong.

A ticket is a pull request. A slice is not. Each ticket that ends in a pull request is one branch and one PR. If the work is too big for one sitting, it gets slices. Slices are child tickets that commit to the same branch, chained so only one runs at a time. The parent ticket opens the PR when the last slice is done.

Default to one pull request for the whole request. Split only for a reason you write down. Independence, reviewability, merge safety or delivery. "We could run them in parallel" is not a reason. Parallel agents on overlapping code is how you get merge conflicts at a scale no human team could produce.

A one-way door gets its own pull request. A data migration, a schema change, a removed public API, a release step. Anything a revert can't undo goes in a PR on its own, so you read it on its own and the safe work around it isn't held hostage.

Slices that touch the same file share a pull request. So do both sides of logic you've duplicated across languages. Every codebase older than two years has some of that. Don't pretend yours doesn't.

Acceptance criteria that can actually fail

Every ticket carries acceptance criteria, and this is where tickets usually go to die. Two rules.

A criterion states behaviour, and names what proves it. A test, by its seam and case, or the diff itself.

A criterion is never a workflow step or a report format. "Run the tests" is not an acceptance criterion. "Update the docs" isn't either. Those are chores. A criterion describes something the software does, in a way that a test could catch it not doing.

Bad:  The importer handles errors gracefully.
Bad:  Add tests for the new endpoint.
Bad:  Make sure performance is acceptable.

Good: An import file with a malformed row imports every valid row and reports
      the bad row's line number. Proven by: ImporterTests, malformed-row case.
Good: A request without a valid session gets 401 and changes nothing.
      Proven by: the endpoint gate test, unauthenticated case.
Good: Reading the settings file never writes to it.
      Proven by: the diff (no write call on that path).

"Handles errors gracefully" is the "make it pop" of software engineering. It means nothing, so an agent will build whatever it likes and then tell you it handled the errors gracefully. Write criteria that can fail. If you can't think of how a criterion would fail, it isn't one.

Things that will bite you

  • Letting the implementer write the spec. Then nobody checks the decisions, because the person who'd check them made them.
  • Grilling the human for things the code can answer. My architect only asks me questions when the request is genuinely ambiguous, or when I ask it to grill me. When it does ask, it asks everything open in one go, looks facts up itself, and only brings me decisions. Twenty questions over two days isn't diligence. It's a stall wearing a lanyard.
  • Planning around a guess. If a plan depends on a decision I haven't made yet, the architect waits for the decision. It doesn't guess what I'll say and build on the guess. A wrong guess costs a whole plan.
  • One big ticket for everything. It feels efficient. It produces a 4,000-line pull request nobody can review, which then gets merged without review. The merge gate gets a post of its own.
  • Tickets as to-do lists. "Refactor auth, add tests, update docs" is three tickets, or one ticket with three bad acceptance criteria. Either way it isn't done until you split it.

How I did it

In my setup, the architect agent owns one skill, engineering-spec, which does everything in this post. Sizing, plans, routing to the right engineer, pull request boundaries, review stages and acceptance criteria. It doesn't write code and it doesn't review diffs.

Requests don't reach it directly from me. They go through a chief of staff agent that doesn't read or write code at all. Its whole job is understanding what I want and handing it to the right owner as an outcome, not an implementation. It's explicitly told not to guess branches, paths or commands. That's the architect's job, from the repository.

Counsel, the plan challenger, is engaged by me or the architect and nobody else. Its instructions say that if any other agent tries to give it work, it replies in one line that Counsel is engaged only by the board, hands the ticket back, and stops. That rule keeps every agent with a hard question from dragging the expensive reviewer into it.

Effort is sized per job too. When a plan is going to be challenged, the architect doesn't write it in the same run that sized it. It creates a child ticket for itself at a higher reasoning effort, writes the plan there in a fresh session, and comes back at its normal effort to start the challenge. Rulings on the challenge happen at normal effort too. Only a finding that changes the actual design gets another high-effort run. Most findings change a sentence, a test or a criterion, and those don't need the expensive brain.

None of this is clever. Each rule is cheap to write down and expensive to learn the hard way.

The generic skill knows nothing about my product. My product's own layer adds what "critical path" means for it, which code goes to which engineer, and which failures are simply unacceptable. That split between a generic team and a thin project layer gets a post of its own.

Which brings us to roles, not agents. Why a coordinator who can't code, implementers who can and a reviewer whose job is to say no beat one genius agent doing everything.

The conversation

0 comments