agentleFS
gethrbrgethrbr/deckhand/skills/check-diff/SKILL.md

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.

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
  1. Distinctive:

    If nothing is staged: git diff HEAD (all uncommitted changes).

    line 14
  2. Distinctive:

    If the user named a branch or a range, use that instead, for example git diff main...HEAD.

    line 15
  3. Distinctive:

    If there are no changes, say so in one line and stop.

    line 17
  4. Distinctive:

    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 …

    line 38
  5. Distinctive:

    No findings: say which rules files you checked against, in one line, and stop.

    line 62

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.md at the root and in every folder between the root and each changed file (packages/api/AGENTS.md applies to packages/api/src/x.ts, not to web/)
  • .cursor/rules/*.mdc: a rule applies when its globs match the changed file, or it has alwaysApply: true
  • .claude/rules/**/*.md, .github/copilot-instructions.md, .github/instructions/*.instructions.md (match their applyTo), .cursorrules, .windsurfrules
  • Files these import with an @path line

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 changeset

No 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.