A coding agent finishes a task and tells you it’s done, everything works and the tests pass. Sometimes that’s true. The message reads the same either way, which is why I don’t treat it as evidence.
What I do instead is make the agent run checks, in a fixed order, from cheapest to most expensive. Each rung catches a kind of mistake the rungs below it can’t see, and each one costs more time than the last. This post walks up that ladder using the repository of this website, an Astro site written in TypeScript and run with Bun.
I timed the rungs that are plain commands on my laptop (an M1 Max) on 10 November 2026:
| Rung | Command in this repo | Time |
|---|---|---|
| Formatter | bunx prettier --write <changed files> |
0.2 to 0.35 s for one file |
| Linter | bun run lint (oxlint, type-aware) |
0.24 s for the whole repo |
| Type checks | bun run check (astro check) |
4.8 s |
| Tests | bun test |
54 tests in about 15 ms |
| Browser check | the agent drives the site with Playwright | an agent turn, not timed |
| Second-agent review | a different model reviews the diff | an agent turn, not timed |
The first four add up to about five seconds, which is cheap enough to run after every edit.
Formatter
A formatter rewrites code into one consistent layout. It sounds cosmetic, and mostly it is, but it matters more with agents than without them. An agent can reformat lines it didn’t need to touch, and then the change you’re reviewing is buried under noise. With a formatter in place, the diff shows what changed and nothing else.
This repository’s instructions to the agent say to format “only the files you changed” and never to reformat the whole repo unless asked, for the same reason.
There’s a catch, and it’s written into the same file. Prettier wraps long lines of HTML, and Astro’s minifier then removes the line break and indentation between two inline elements entirely. If there was meant to be a space between them, the space is gone, and the source diff gives no hint of it. Without an explicit space, the waitlist button on this site would read “Join the waitlist→”. So the instruction ends with “confirm the built HTML is unchanged rather than trusting the source diff”. Proving that a formatting change is a no-op with a fresh production build is a pattern that shows up in my session logs too.
Linter
A linter reads code for patterns that are usually bugs, such as a promise nobody waits for or a comparison that is always true. Here is this repository’s whole configuration for oxlint:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"options": {
"typeAware": true
},
"categories": {
"correctness": "error",
"suspicious": "warn",
"pedantic": "warn"
},
"ignorePatterns": ["dist", ".astro", "node_modules", "brand"],
"overrides": [
{
"files": ["src/data/**/*.ts"],
"rules": {
"max-lines": [
"warn",
{
"max": 1000
}
]
}
}
]
}
typeAware means the linter also knows the types of things, so it can flag mistakes that only make sense with that knowledge. The pedantic category is switched on as well, as warnings. The one override relaxes the line limit for the content files under src/data, for a reason I explain in A real CLAUDE.md, line by line.
The rule I hold agents to is to fix warnings, not silence them. “Can we fix this instead of suppressing?” is a sentence from my logs. When a rule really can’t be satisfied, the exception carries its reason on the line above it. This one is from the file that serves robots.txt:
/* prefer-readonly-parameter-types is unsatisfiable here: the parameter type comes
from Astro's APIRoute, and APIContext holds nested mutable members (request,
params, locals), so it fails the rule's deep-readonly check no matter how the
binding is annotated. Wrapping it in Readonly<> only shallow-freezes and does
not silence it. Suppressed at the one line rather than disabled repo-wide. */
// oxlint-disable-next-line typescript/prefer-readonly-parameter-types
The next agent that opens the file can read why the exception exists before it decides to “fix” it.
Type checks
Type checks catch the mistakes that happen when one part of the code changes and another part still expects the old shape. Agents make them when they change a function in one file and don’t open every file that calls it.
This repository stacks two checkers: astro check, which understands .astro component files, and the type-aware linter above. Stacking checkers like this shows up in 5 to 15 of my sessions across projects. It also has a constraint worth knowing about: TypeScript is pinned to version 6, because astro check needs a compiler API that TypeScript 7 doesn’t offer yet. That pin is written down with its reason. Without it, the next dependency update would bump TypeScript and break this rung.
Tests
Tests check behaviour: given this input, the code does that. This repository has 54 of them. 34 cover the waitlist, the one part of this site that stores personal data, and the other twenty check the blog: that a post can’t go live with a leftover note, a link to an unpublished post or without its drawing, and that a title either fits its link-preview image or stops the build. Here are two from the file that tests how email addresses are hashed:
test('is stable, so a repeat signup finds its own row', async () => {
expect(await hmacEmail(PEPPER, EMAIL)).toBe(await hmacEmail(PEPPER, EMAIL))
})
/* The property the whole scheme rests on: without the pepper the digest is a
* different value, so a D1 snapshot cannot be matched against a guessed address. */
test('depends on the pepper, not only on the address', async () => {
expect(await hmacEmail(PEPPER, EMAIL)).not.toBe(
await hmacEmail('q'.repeat(32), EMAIL),
)
})
The test names say what has to stay true. If an agent later “simplifies” the hashing, one of them fails, and the agent finds out before you do.
Two habits from my logs: bug fixes come with a test, and for a security problem the test comes first. I’ve had an agent write a failing test that proves a vulnerability exists, and only then fix it, so the passing test is the proof the fix worked.
The agent uses the app in a browser
Everything so far reads code. None of it tells you whether the button is visible, the form submits, or the page works on a phone. For that the agent has to use the app the way a person would.
I do this with Playwright, a browser automation tool, through a skill that lets the agent open pages, click, type and take screenshots. In my logs that skill was invoked in 16 sessions. Typical prompts were “verify both open MRs work e2e using playwright-cli”, with real file uploads and throwaway test users that get cleaned up afterwards, and “build prod locally, run the preview server, verify integrity”. The second one checks the production build, which can behave differently from the development server.
When I want screenshots, I ask for them “only at the end”, so I can look at the result without watching every click.
A second agent reviews the change
I don’t let the model that wrote the code be the only one to review it. After an implementation, a model from a different provider reviews the diff. In my logs that’s usually a Codex review of the branch against its base, and it happens in 15 or more sessions. Then the implementing agent decides which findings to fix.
Reviews produce false alarms too, so I treat the findings with the same suspicion as the code. A prompt that appears in 5 to 15 of my sessions is “validate these findings, and fix only if needed”. When I write a review prompt from scratch, I ask the reviewer to stay read-only, put blocking issues first, give a line and evidence for each, and reproduce any serious finding before reporting it.
After review comes a clean-up pass. /simplify is the skill I invoked most in the whole analysis, in 30 sessions: it runs four reviewers in parallel, for reuse, simplification, efficiency and whether code sits at the right level, and a separate agent applies what they find. In this repository, fallow audit does a similar job mechanically, flagging dead code, duplication and complexity in the changed files in about 0.6 seconds.
One command that runs all of it
The ladder only works if every rung runs every time, and that’s where my logs are least flattering. “Verify everything works”, “verify integrity”, “deployed on staging, check”: requests like these appear in 5 to 15 sessions, typed by hand, with no fixed list behind them.
The partial fix is already in this repository’s instructions file. It lists the commands in order and defines when work counts as finished:
Run these in order after any code change. Do not report work as done until check and
lint are clean.
I walk through the rest of that file in A real CLAUDE.md, line by line.
The complete fix is a single command that runs every rung and reports one result, so neither the agent nor I have to remember the list. In Claude Code that’s a skill, a short instruction file the agent can run by name. This is the one from the course’s project, shortened to its frame and four of its eleven steps:
---
name: verify
description: Verify changes before committing. Runs formatter, linter, type checker, code review (max two fix rounds), simplify, Fallow, unit tests, accessibility tests and end-to-end tests. Use when the user runs /verify or asks to check that work is ready to commit.
---
Run these steps in order. If a step fails, fix the problem and run that step again
before moving on. At the end, report a short summary: one line per step with ✅ or ❌.
## Step 2: Lint
```sh
bun run lint
```
If there are errors, try `bun run lint:fix` first, then fix the rest by hand.
## Step 4: Code review (two fix rounds at most)
1. Run the `code-review` skill on the current changes.
2. Fix the findings it reports.
3. Run `code-review` again and fix what is left.
Stop after the second round. Do not start a third round. If findings remain, list
them in the summary for the user.
## Step 9: End-to-end tests
```sh
bun run test:e2e
```
## Step 11: Summary
Tell the user which steps passed, which failed, and anything still open.
Do not commit unless the user asks for it.
Two rules do most of the work. The cap on review rounds stops the agent from polishing forever, and the last line keeps a passing run from turning into a commit nobody asked for. Writing this skill is lesson 16 of the course, “/verify: Everything in One Command”. It comes after every check it bundles, because it can only run the checks that already exist.
If you’re still at the prototype stage and wondering where these checks fit in, start with Your Lovable, Bolt or v0 prototype works. What now?