> Agent-ready spec from Diff of the Day (2026-12-03, playbook 1). Give this file to your coding agent (Claude Code, Codex, Cursor) and ask it to build the P0 requirements first.

# Spec: Checks-in-code plan for a small team

## Problem Statement
Agents write changes faster than a small team can read them. Prose rules in an agent file are the weakest check. Lauren Tan describes a team that moves quality into the code: lint rules, deleted legacy code and a running app for the agent. Her page gives about 0.5% reverts and 11,000 production PRs in one month for that team. A small team has no plan to copy this.

## Goals
- Turn the most repeated agent mistake into a lint rule with a helpful message.
- Delete the deprecated code that shows the mistake.
- Give the agent one command that runs the app and saves proof.
- Track the share of reverted pull requests each month.

## Non-Goals
- Copying the volume of the Grok bot team: it depends on team size and tooling that a small team does not have.
- Formal verification: Tan calls it an experiment that caught a few bugs, so it is not a first step.
- A ban on all comments: start with the comments that your lint rule can replace.

## User Stories
- As a team lead, I want repeated mistakes to become checks so that reviewers read less.
- As an engineer, I want old workarounds deleted so that the agent does not copy them.
- Edge case: when a lint rule has many false alarms, the team narrows it before it blocks merges.

## Requirements
### P0
- [ ] Choose one repeated mistake and write a lint rule for it. Accept: the rule fails CI on a bad example and passes on a good one.
- [ ] Write a lint message that explains the fix. Accept: the agent corrects the code after reading only the message.
- [ ] Delete the deprecated code that contains the mistake. Accept: a search for the old pattern returns nothing.
### P1
- [ ] Add one command that runs the app and saves a screenshot. Accept: the agent runs it and attaches the file.
- [ ] Count reverted pull requests each month. Accept: a number and its date are stored in the repository.
### P2
- [ ] Add an import limit between two parts of the code. Accept: a lint rule fails on a forbidden import.
- [ ] Remove comments that a lint message can replace. Accept: the lint rule has a message for each case.

## Success Metrics
- The mistake no longer appears in the next 20 agent pull requests.
- The revert share is known each month; the Grok bot team figure is about 0.5%.
- The agent attaches proof to at least 9 of 10 pull requests.

## Open Questions
- Which mistake costs the most review time today?
- Is the revert share a good measure for your team, given that later fixes are not counted?

## Timeline
- Day 1 morning: choose the mistake and write the rule.
- Day 1 afternoon: lint message and cleanup of old code.
- Day 2: run-the-app command and the revert count.

## Agent Instructions
- Stack: the linter and test tools that the repository already uses.
- Build order: rule, message, cleanup, app command, revert count.
- Safety: run the app against a test instance and never give the agent production credentials.
- Done when: all P0 acceptance checks pass and one agent pull request passes the new rule.

## Sources
- Lauren Tan, talk page, https://ai.engineer/talks/O_zcc6Xl12g-all-code-is-slop-except-mine
- Lauren Tan, talk video, https://www.youtube.com/watch?v=O_zcc6Xl12g