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

# Spec: Review comment to lint rule drafter

## Problem Statement
A reviewer writes the same comment again and again. A prose rule in an agent file is the weakest check, because the agent can ignore it. Lauren Tan says her team looks for a check or an API change for each repeated correction. Most small teams do not know which comments repeat.

## Goals
- Find the review comments that repeat in one repository.
- Draft one lint rule for each repeated comment.
- Give each rule a message that tells the agent how to fix the code.
- Keep only the rules that have fewer than 3 false alarms on the current code.

## Non-Goals
- Rules for every language: one language keeps the first version small.
- Auto-merge of rules: a person must read each rule, because a wrong rule blocks the team.
- Style rules that a formatter already covers: the formatter is the better tool.

## User Stories
- As a reviewer, I want a list of my repeated comments so that I can stop writing them by hand.
- As an agent user, I want a lint message that explains the fix so that the agent corrects itself.
- Edge case: when a comment group has only one example, the tool skips it and says why.

## Requirements
### P0
- [ ] Read review comments from a file exported with the GitHub CLI. Accept: the tool lists comment groups with their counts.
- [ ] Draft one lint rule for a chosen group. Accept: the rule file runs in the linter of the repository.
- [ ] Run the rule on the current code. Accept: the report shows each hit and a count.
### P1
- [ ] Add a guidance message to each rule. Accept: the message names the preferred pattern.
- [ ] Write one passing and one failing test per rule. Accept: both tests run in CI.
### P2
- [ ] Offer an API change as an alternative to a rule. Accept: the tool writes a short proposal for the group.

## Success Metrics
- At least 3 rules kept after one review of 100 comments.
- Each kept rule has fewer than 3 false alarms.
- The number of repeated comments in the next 20 pull requests goes down.

## Open Questions
- Which linter does the repository use, and can it load custom rules?
- Who approves a new rule?

## Timeline
- Saturday morning: export and grouping.
- Saturday afternoon: rule drafting for one group.
- Sunday: guidance messages, tests and a review of false alarms.

## Agent Instructions
- Stack: the language and linter of your repository, plus a small script for grouping.
- Build order: export, grouping, one rule, tests, then the other groups.
- Safety: do not send private review text to a service you do not control; use a local copy of the data.
- Done when: all P0 acceptance checks pass and one rule runs in CI.

## Sources
- Lauren Tan, talk video, https://www.youtube.com/watch?v=O_zcc6Xl12g