check-diff
Skill3 starsChanged 5 days agoMITView on GitHub
Check the current changes against this repo's own agent rules (CLAUDE.md, AGENTS.md, Cursor rules, Copilot instructions) before committing. Use when the user asks to check, review or verify their changes or diff against the repo's rules or conventions, or before a commit or pull request.
In this repository6 other files it gives its agents.
- audit-memorySkill
- context-costSkill
- rules-from-reviewsSkill
- rules-scoreSkill
- told-you-twiceSkill
- write-rulesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
If nothing is staged: git diff HEAD (all uncommitted changes).
- Distinctive: line 15
If the user named a branch or a range, use that instead, for example git diff main...HEAD.
- Distinctive: line 17
If there are no changes, say so in one line and stop.
- Distinctive: line 38
Before you report a finding, try to prove yourself wrong: the rule may be scoped to another folder, to new code only, or the repo may …
- Distinctive: line 62
No findings: say which rules files you checked against, in one line, and stop.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Check the diff against the repo's rules
Find every place where the current changes break a rule this repo wrote down for its agents. Report only. Never edit, stage or commit anything during the check.
1. Get the diff
From the repo root (git rev-parse --show-toplevel):
- Staged changes first:
git diff --cached. - If nothing is staged:
git diff HEAD(all uncommitted changes). - If the user named a branch or a range, use that instead, for example
git diff main...HEAD.
If there are no changes, say so in one line and stop. Skip lockfiles, generated files and vendored code.
2. Collect the rules that apply
Rules files are read the way the agents read them, nearest folder wins:
CLAUDE.md,AGENTS.md,GEMINI.mdat the root and in every folder between the root and each changed file (packages/api/AGENTS.mdapplies topackages/api/src/x.ts, not toweb/).cursor/rules/*.mdc: a rule applies when itsglobsmatch the changed file, or it hasalwaysApply: true.claude/rules/**/*.md,.github/copilot-instructions.md,.github/instructions/*.instructions.md(match theirapplyTo),.cursorrules,.windsurfrules- Files these import with an
@pathline
A symlinked rules file is one file: read it once.
Keep only rules a diff can break: conventions ("named exports only", "no default exports"), bans ("never import X directly"), required steps ("add a changeset for changes to packages/", "update the migration when you change schema.prisma"), naming and placement ("services live in services/"). Skip rules about how to talk to the user or how to run tools.
3. Check each changed hunk
For every added or changed line, ask which collected rule it breaks. Look at the hunk with its surrounding code (git diff -U10 or read the file) so you judge it in context.
Also check the required steps against the whole diff: a rule like "add a changeset when you change packages/" is broken by what is missing, not by a line.
Before you report a finding, try to prove yourself wrong: the rule may be scoped to another folder, to new code only, or the repo may plainly allow an exception right next to it. If you are unsure, leave it out.
4. Report
Lead with one line: Checked 7 files against 23 rules from 4 files: 2 findings.
Then each finding:
src/api/users.ts:42
rule: AGENTS.md:18 "Use named exports only"
change: + export default function getUser(...)
fix: export function getUser(...), and update the 2 imports in src/routes/Missing required steps go last:
(missing) .changeset/
rule: AGENTS.md:31 "Add a changeset for any change to packages/"
change: packages/core/src/index.ts changed, no changeset added
fix: pnpm changesetNo findings: say which rules files you checked against, in one line, and stop. Do not pad.
End by asking whether to fix the findings. Change only what the user agrees to.
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.

