The journey of making AI good at coding
A year and a half of building AB Method, my agent workflow, from splitting ideas into missions to arguing about interfaces before any code exists. What changed, what I dropped, and why I stopped writing tests first.
AB Method started a year and a half ago as a simple workflow to help me plan things and split the work into missions. Five major versions later, it's closer to a small factory: it asks me questions until the open decisions are closed, argues with me about interfaces before any code exists, writes the code, and only then decides what's worth testing.
Here's how it got there, and where it stands today.
Nov 2026 Argue the interfaces first. Write the code. Protect what matters.
- 5.0seam docs, the protect step, reviewed PRs
- 5.1adopt-or-build: vet libraries before writing one
- 5.2zoom out first: fit the design or reshape it
v1: split the idea, test each piece
Back then people weren't that ambitious with agentic work, and models weren't as capable as they are today. So v1 did one thing. It took my idea, turned it into a task, split the task into individual missions, and tested each one. v2 moved testing into its own mission workflow.
I kept using that for a while, and it was good enough for me. There's a five month gap in the changelog between v2.3 and v3.0, and that's why: nothing was broken enough to fix.
Questions were the real breakthrough
Then skills started popping up here and there, and one idea ended up shaping everything from v2 to v5. I found that I could cut down a lot of the hallucination and drift just by making the agent ask me questions, and close as many decisions as possible before it starts.
v2.1 had a first version of this, a "mission clarification" step. v3.0 made it mandatory: every task starts with a grill, based on Matt Pocock's grill-me skill, and there's no way to skip it. Later releases kept sharpening it:
- 3.8 parks a question I can't answer yet as an explicit unknown, instead of letting the agent guess and move on.
- 3.11.1 explains every option with a code snippet and plain words.
- 4.1 briefs me on an area I haven't seen before the first question, so I'm not answering blind.
I wrote about why this works in Fill the agent gaps: every prompt leaves gaps, and an agent fills each one with its most generic default. Asking first is how you close them before they turn into code.
Docs are written for agents now
The second pillar of v3 was documentation. AB Method writes domain and architecture docs, and after each task a set of subagents reviews the code (3.6) and another one syncs the docs with what actually shipped (3.7.1). That way the docs never drift into contradicting the implementation.
I still believe docs matter. You can argue that code is self-explanatory, but we're not writing code only for humans anymore. Giving an agent one or two lines that explain the goal of a module is better for it than making it read hundreds of lines to work that out.
That's still a controversial point, and it cuts both ways. A doc that's wrong is worse than no doc, so you have to update it after every agent run. v4 added the other half of the deal: docs have word budgets, a script fails the run when they grow past them, and they're edited in place instead of appended to. In my biggest repo, a frontend mission went from reading almost 19,000 words of docs to under 1,000.
Why I stopped writing tests first
I used test-driven development the whole time, and v3.0 ran every single mission through it: red, green, refactor. It was good enough. But the more capable agents got, the more things went off the rails and exploded in size.
The main issue is that a test written first is a prediction about an implementation that doesn't exist yet. An agent asked to write a failing test before any code will happily write things like this:
test("calculates the refund", () => {
const billing = { refund: vi.fn().mockReturnValue(40) };
expect(billing.refund(order, 40)).toBe(40);
});It goes red, then green, and it proves nothing. The only thing under test is the mock. Multiply that by every mission and you get a suite that grows with the number of missions, not with risk, and a design bent around whatever made the tests easy to write.
I'm not the first to say this. In TDD is dead. Long live testing., DHH writes that "test-first units leads to an overly complex web of intermediary objects and indirection in order to avoid doing anything that's slow." His follow-up, Test-induced design damage, names the result: code "warped out of shape" just to make it easier to test. His advice is to "embrace backfilling of tests when you're happy with the design."
John Ousterhout makes the design argument in his debate with Robert Martin: "The fundamental problem with TDD is that it forces developers to work too tactically, in units of development that are too small; it discourages design thinking." The natural unit of design is a class or a module, which covers many tests at once, and you can't design it well if you only think about the next test. What he proposes instead is "design first, then code, then write unit tests."
That's exactly what AB Method does now:
- grill
- missions
- test
- code
- test
- code
- test
- code
- design known
- review
every mission writes its tests against code that doesn't exist yet
- grill
- test plan
- missions
- test
- code
- code
- design known
- review
fewer tests, still chosen before the design is known
- grill
- zoom out
- seams
- design known
- code
- code
- protect
- PR review
tests come last, through the seams the design settled on
v4 was the first step. Each task got a test plan, and only missions tagged verify: test got tests,
so the suite stopped growing with every mission. But the plan still picked tests before the design
existed. v5 removed the plan and moved testing to the end.
One exception survived on purpose. A bug fix is still test first (verify: repro), because a test
that reproduces the bug before the fix is the only proof the fix works. There, the test isn't
predicting anything, it's describing something that already happened.
Things got bigger, so the method got stricter
As agents got better, tasks got bigger, and the output got bigger with them. More tests, longer docs, a second copy of a helper the codebase already had. I'd been patching the workflow with new rules on top of old ones, and I had to rethink the whole design so it could work as a reliable factory instead of a slop machine.
That rewrite was v4, and I covered it in I rewrote AB Method: decide where code lives before writing it, prototype the UI and pick a version, write less, and keep docs small with a gate instead of a polite request. The core workflows went from 2,989 lines to 2,097.
v4 moved the checks from after the code to before it. v5 goes one level deeper, into the shape of the code itself.
v5: argue about the seams before the code
A seam is a place where many parts of the app cross one interface, and going around it is a bug.
Data fetching is the classic one: components call useOrders(), and only the seam knows about the
query client, the cache keys and fetch. Most apps have a handful of these, and AB Method ships a
catalog of seven common ones, each drawn from an example in Ousterhout's
A Philosophy of Software Design: storage,
transport, client data cache, configuration, error boundary, request context and domain core.
Every seam gets a short living doc in docs/seams/, and its most important lines are commands, not
prose:
useOrders() useOrderMutation()errors arrive as QueryError- Callers never
- call fetch or apiClient directly from a component
- Check
grep -rln "fetch(" src/componentsno resultsCheckoutButton.tsx- Status
- settledmigrating, old pattern: direct fetch() in components
When a task introduces a new seam or changes one, the plan stops at a seam design gate. The agent designs the interface several radically different ways (Ousterhout's "design it twice"), compares them on depth and on what they hide, and I pick one. That's where I get to argue with it, about how an interface should look and where the boundary goes, while changing my mind costs nothing. The picked design is written to the seam doc before any code, and it becomes the target the missions build toward and the reviewers check against.
The status moves on its own after that. sync-architecture runs the doc's Check command after
each task: introducing while most callers don't use the seam yet, migrating while a few still go
around it, and settled once the check comes back empty.
The protect step
Once the code exists, the protect step decides what must not break and tests only that: what a seam promises its callers, the domain rules (money, permissions, data loss), and one critical flow end to end when the task changed one. Styling and wiring never make the list, and there are no coverage targets.
Every test also has to prove it can fail. After the fact there's no natural red, so the agent breaks the behaviour on purpose (inverts the rule, returns the wrong value), checks that the test fails for the right reason, then restores the code:
## Protected
- UC1 Partial refund past the window is rejected → billing seam · `src/billing/refund.test.ts`
red: broke the window check → "expected RefundWindowClosed, got Refund" · green after restoreA test you never saw fail protects nothing. And the tests go through the seam's interface, so a refactor behind it doesn't break them.
Missions, PRs and the zoom out
The rest of v5 follows from the same idea:
- Missions are whole slices. One mission delivers one capability across every layer it needs, and a task only splits at a real boundary, like a seam that has to land first. Most tasks end up with one to three missions.
- Every task ends in a reviewed pull request.
/start-taskpushes the branch, opens a draft PR, and runs a final review on two axes, seams and code rules, before marking it ready. Both the PR template and the review shape are adapted from Matt Pocock's pr and code-review skills. - 5.1, adopt or build. Before building anything large or already solved, the agent checks for an open-source library that's actively maintained and fits the project's exact versions. If one wins, it goes behind a seam, never imported all over the codebase.
- 5.2, zoom out first. Agents love to fit a feature into the code that's there: the smallest diff, "start with the simple version". So before planning, the agent sketches the design the area would have if it were written today with the feature as a requirement, and decides between fit and reshape. For an agent, writing code is cheap, and lines changed are never counted as a cost. A design that makes every future feature bend around it is.
Where it stands
Put the eras side by side and the direction is pretty clear. Each version moved a decision earlier: v3 moved the questions before the plan, v4 moved placement, UI and docs before the code, and v5 moved the interfaces before the code and the tests after it. The only check that's still expected to do real work at the end is the protect step, and that's on purpose, because it's the one step that needs the code to exist.
It's not finished, and it has limits. Seams take judgment, and the domain core seam usually has no grep that can check it, so a reviewer has to read the code. The protect step leans on the agent to pick the right few tests, and it can still pick wrong. I run it on my own projects, so read my results as one developer's data points, not a benchmark.
If you want to try it, it installs into Claude Code or Codex:
npx ab-methodIf you're on v4, the upgrade is breaking: /test-mission is gone, new plans have no test plan, and
/start-task now pushes a branch and opens a PR. Old trackers still run.
Thank you
None of this came out of nowhere, and I want to thank three people for the resources they put out.
Matt Pocock, whose skills are all over AB Method: the grill, the domain model, the codebase architecture review, the PR template and the code review shape all started as his.
John Ousterhout, whose A Philosophy of Software Design gave v5 its vocabulary: deep modules, information hiding, design it twice, and the red flags the reviewers check for.
DHH, for saying out loud, more than ten years ago, that test-first can damage a design, and that backfilling tests once you're happy with the design is fine.
They keep bringing good ideas to the programming world, and they made this a lot easier to build.
Resources
- AB Method on GitHub and its changelog
- Matt Pocock, skills, including grill-me
- John Ousterhout, A Philosophy of Software Design
- John Ousterhout and Robert Martin, A Philosophy of Software Design vs Clean Code
- DHH, TDD is dead. Long live testing.
- DHH, Test-induced design damage
- Rahul Garg, Design-First Collaboration