TJ's Desk

Draft. This note is unfinished and unlisted. It can change or disappear, so please do not share it yet. All drafts

Keeping the Slop Out While the Agent Builds

An agent that builds with GRAIN can still reach for the hero, the eyebrow and the sign-up block every model reaches for. A post about a skill called Hallmark showed me how to check for that while the agent works, and it made me change GRAIN's own masthead.

ai grain design

Every agent I have watched build a page reaches for the same page. A small uppercase label over the headline, one word in the headline coloured differently, three identical cards, and a sign-up box at the bottom whether or not there is anything to sign up for. GRAIN gives it the tokens and the components, and the agent still assembles them into that page, because that page is what the model has seen most.

GRAIN already tests what it can test. The tokens are held, the contract is held, and this site runs axe over every page it serves. None of that asks the question that matters here, which is whether a person looking at the page would think a model made it.

The prompt

Roy Derks posted about Hallmark, a coding-agent skill that stops generated design before it ships. I read the Hallmark repo the same afternoon. Three ideas in it were worth taking. It renders the page in a real browser instead of reading the source. It checks the render against a named list of tells, so a finding is a rule and a selector rather than a feeling. And it hands the result to a reviewer with fresh context, which sees what the agent that wrote the page has stopped seeing.

I did not want Hallmark's taste whole. Its tells are written against a generic page, and GRAIN has a design language of its own. So the plan is GRAIN's own check, called grain-lint, with the shape borrowed and the rules written fresh.

Three tiers, one job each

The useful part of Hallmark is that a rule's tier decides what a finding does. That turns a long list of opinions into something an agent can act on without asking.

Floor: always blocks contrast, focus, motion, raw colour Reflex: blocks unless it says why eyebrow, coloured word, card rows Finish: reports, never blocks widows, off-scale spacing

The Floor is the part nobody argues with: text below AA contrast, a focus ring that is gone, motion that ignores reduced-motion, a hex value where a token belongs. Those block, with no way round them.

The Reflex tier is where slop lives. These are the moves a model makes by default, and each is sometimes right. So a Reflex finding blocks unless the element carries its reason in an attribute, next to the thing it excuses, where it shows up in a diff and a reviewer can disagree with it.

The Finish tier reports and stops there. A widow in a heading is worth knowing about and not worth failing a build over.

Built for the agent, not the review

The point is to keep slop out while an agent works, not to grade the page once it is done. So every finding names the rule, the selector, and what GRAIN would use instead, and a static mode runs on every edit in under a second. The agent reads the finding and fixes its own page before I look. The rendered mode and CI are the backstop.

It caught GRAIN first

Writing the Reflex list, I got as far as the eyebrow and stopped. GRAIN's own masthead is an eyebrow, then a display headline, then a hairline rule. The design system I want to hold agents to had the first tell on the list built into its header.

There were two honest options: excuse it with a recorded reason, or change it. I changed it. The masthead becomes the headline, then a byline with the name and the date, then the rule. Context goes below the headline and never above it, and the lint rule that follows is plain: no text above a page's main heading except breadcrumbs, and no labels above section headings.

Where it stands

This is a plan, not a tool. The rules are not written, nothing has run against a page, and the masthead change has not landed. What I have is a shape I trust, borrowed from someone who built it first, and a first finding against my own work before a line of the checker exists. I will write again when it has run over the catalog and I can say how many findings were real.

Sources


The judgment is human. The typing, by design, is not.