clean-diff
Skill2 starsChanged 2 days agoMITView on GitHub
Strips filler from a change before review. Use on your own diff when the code works and before review-diff, to remove narrating comments, speculative helpers, one-use wrappers, duplicate guards and words the style guard refuses.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-chainSkill
- add-mcp-toolSkill
- add-migrationSkill
- add-protocol-operationSkill
- add-venueSkill
- debug-failureSkill
- handle-security-reportSkill
- releaseSkill
- review-diffSkill
- review-money-pathSkill
- review-testsSkill
- run-testsSkill
- shape-commitSkill
- speed-up-testsSkill
- test-telegramSkill
- tune-ciSkill
- vet-releaseSkill
- write-adrSkill
- binference-toolsSkill
- copy-tradingSkill
- dca-planSkill
- meme-huntingSkill
- safe-swapSkill
- token-due-diligenceSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Run this on the diff you wrote, after the tests pass and before review-diff.
- Distinctive: line 18
Read every changed line once, top to bottom, with the questions below.
- Distinctive: line 22
Every public export keeps one TSDoc block: what it does and what a caller must know.
- Distinctive: line 25
Delete comments that narrate the next line, explain syntax, record history or name a task.
- Very specific: line 26
Delete commented-out code.
- Distinctive: line 45
Every new word a person sees exists in English and Simplified Chinese.
- Distinctive: line 49
Test names are sentences that state the behavior.
- Distinctive: line 50
No conditional expects, no focused or skipped tests, no sleeps or real timers.
- Distinctive: line 51
Delete tests that only repeat the implementation.
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean the diff
Run this on the diff you wrote, after the tests pass and before review-diff. It removes what a
reviewer should never have to read. It changes no behavior.
1. Read the diff
git diff --staged
git diff master...HEADRead every changed line once, top to bottom, with the questions below.
2. Comments
- Every public export keeps one TSDoc block: what it does and what a caller must know.
- A
//comment stays only when it states a constraint the code cannot show: ownership, lifecycle, ordering, cleanup, platform or a dependency's quirk. - Delete comments that narrate the next line, explain syntax, record history or name a task.
- Delete commented-out code. Delete
TODO,FIXMEandXXX; open an issue instead.
3. Code that earns nothing
- A helper with one caller and no second user coming: inline it.
- A wrapper that only renames or forwards: call the target.
- A guard for a state the types or an earlier check rule out: delete it.
- A parameter, option or export no caller uses: delete it.
- A second copy of logic that exists elsewhere: call the first copy, or move it to the lowest package both callers share.
- An abstraction with one implementation and no test fake: remove the layer.
4. Names and words
- Names come from
docs/GLOSSARY.md, never from other agent frameworks. - Units sit in names:
timeoutMs,slippageBps,amountBase,usdMicros. - Booleans read as questions:
isFrozen,hasQuote,canSign. - Text is short, active and in the present tense. No em or en dashes, no emojis, no words from
config/style/banned-words.txt. - Every new word a person sees exists in English and Simplified Chinese.
5. Tests
- Test names are sentences that state the behavior.
- No conditional expects, no focused or skipped tests, no sleeps or real timers.
- Delete tests that only repeat the implementation; keep the ones that pin behavior.
6. Check and report
pnpm format
pnpm check:style --files <each changed file>
pnpm checkReport what you removed and why, in a few lines, then run review-diff.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

