← seriesmaclulich.com

Name the existing API in the brief before your coding agent starts

24-second silent illustration of the original trial plan, not a measured outcome.

Four things to do before your coding agent starts building

  1. Search your checkout for the behaviour you are asking forAn audit of one project found two APIs doing the same job under different names.
  2. Name the same owner and acceptance check for the builder and the reviewerThe builder has a place to start, and the reviewer can check whether the final code uses it.
  3. Say why in the brief when the job needs a new APIIf the behaviour differs, the brief says why the existing code needs extending or why a separate path is justified.
  4. For a rename, write down which routes stay and where callers end upA caller left on a retired route, or a second copy still serving the job, should be a finding.
From an audit of one of my own projects and my original trial plan, not measured results.

Search the checkout before you dispatch

If you run AI coding agents and want them to reuse code you already have, this chapter of Fewer tokens to ship is for you.

Two APIs can do the same job and both look right on their own. If review only sees the new code, the older path may never come up.

An audit of one project found two APIs doing the same job under different names. The animation uses a fictional invoice history feature to show how that happens. Original write-up

Give both agents the same owner

A proposed brief names GET /customers/:id/invoices for both the builder and the reviewer.
A proposed brief names GET /customers/:id/invoices for both the builder and the reviewer.

A reader suggested naming the existing function or endpoint in the done list.

If it already does the job, the builder has a place to start and the reviewer can check whether the final code uses it. Reader discussion

Say why when the job needs a new API

The existing API is worth reusing if it fits the task. If the behaviour differs, the brief should say why the existing code needs extending or why a separate path is justified.

Check a rename by its call paths

A reader asked what happens if the endpoint is renamed halfway through. I’d check that the replacement still does the same job, update the shared brief and have the reviewer follow the final calls. Reader discussion

Illustrative review trace. The worker calls the existing owner and the reviewer checks that path.
Illustrative review trace. The worker calls the existing owner and the reviewer checks that path.

In the rename trial, I want the reviewer to accept a rename that preserves behaviour and moves the callers as agreed. A caller left on a retired route or a second implementation still serving the same job should be a finding. Reader follow-up

I’ll check the reviewer’s verdict against tests and the actual call paths. If we agreed to keep the old route, both routes should reach the same implementation. If we retired it, the callers should have moved.

How far to trust it

Naming the owner hasn’t yet been shown to save a retry

  1. Plan, not resultsThe video and pictures show the original trial plan, not a measured outcome.
  2. 10 of 12 for every brief variantIn the rename fixture, each brief variant got 10 of 12 verdicts right.
  3. Still openA live comparison still needs to show whether lookup saves a retry.
The trial results are in chapter 5.

Try it on your rig

  1. Search the current checkout for the requested behaviour, its callers and its tests.
  2. Record the exact owner and the acceptance check in the shared brief.
  3. If a rename or compatibility alias is part of the job, write down which routes should remain and where callers should end up.
  4. Ask the reviewer to follow the final call path and run the acceptance check.
  5. When lookup comes up empty, record that gap and inspect the source before making it a finding.

To follow along on your own setup, start with the shared work record in the series setup guide.

A brief can still miss an owner. Next, does the warning catch it in time?