reading-the-diff
The summary is only as honest as the diff you read. The single most common failure is reading the latest commit instead of the whole branch. This reference is how you get the *complete* change set and turn it into a structure you can summarize.
$ npx -y skills add vanara-agents/skills --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
The summary is only as honest as the diff you read. The single most common failure is reading the latest commit instead of the whole branch. This reference is how you get the *complete* change set and turn it into a structure you can summarize.
Agent definition
reading-the-diff.mdReading the Full Diff
The summary is only as honest as the diff you read. The single most common failure is reading the latest commit instead of the whole branch. This reference is how you get the *complete* change set and turn it into a structure you can summarize.
Get the whole branch, not the tip
Always read the union of every commit on the branch since it forked from its base — the **three-dot** range:
# What files changed and by how much (read this first for shape)
git diff --stat <base>...HEAD
# The full patch across the whole branch
git diff <base>...HEAD
# The list of commits, so you can see intent but never summarize from it alone
git log --oneline <base>..HEAD
- `<base>...HEAD` (three dots) diffs HEAD against the *merge base* — exactly what the PR proposes to
merge. This is what you want.
- `<base>..HEAD` (two dots) can include unrelated changes that landed on base after the fork. Avoid
it for the patch; it is fine for `git log`.
- `git show HEAD` or `git diff HEAD~1` reads **one commit**. Never summarize from these — a branch
that introduces and later fixes an issue must be summarized as it stands at HEAD.
If the base branch is unknown, it is usually `main`, `master`, or `develop`. Confirm with `git remote show origin` or the PR metadata rather than guessing.
When there is no git access
If you only have the working tree (no VCS, or a squashed export you cannot expand), read the changed files directly with Read/Grep and say explicitly in the summary that it was produced from a snapshot, not a `base...HEAD` diff. Do not fabricate a delta you cannot see.
Group changes by area
Before writing prose, bucket every changed file. This structure becomes the skeleton of the summary and makes risk obvious:
| Bucket | What goes here | Attention level | |---|---|---| | **Feature / behavior** | New or changed runtime logic | High — read closely | | **Refactor / mechanical** | Renames, moves, formatting, codemods | Low — collapse to one line | | **Tests** | New/changed test files | Cross-check against feature changes | | **Config / infra** | CI, Dockerfiles, env, dependency manifests | High — silent blast radius | | **Migrations** | Schema/data migration files | Highest — often irreversible | | **Docs / generated** | READMEs, lockfiles, generated code | Low — note but don't dwell |
A useful heuristic: **lines changed is not importance.** A 400-line lockfile churn is low-signal; a 3-line change to an auth check is the headline.
Handling large and rename-heavy diffs
- **Rename detection:** `git diff -M <base>...HEAD` marks moves as renames so a moved file doesn't
read as a full delete+add. This collapses noise dramatically.
- **Ignore whitespace:** `git diff -w <base>...HEAD` when a formatter touched many lines, so you see
the real logic change underneath.
- **Focus a path:** `git diff <base>...HEAD -- path/to/dir` to read one area at a time on a big PR.
- **Numstat for triage:** `git diff --numstat <base>...HEAD` gives machine-readable add/delete
counts per file — feed this shape into `scripts/diff-risk.mjs` to flag oversized or risky files before you read them line by line.
Read the highest-attention buckets in full. Skim mechanical churn only to confirm it *is* mechanical — codemods occasionally smuggle a real behavior change into an otherwise-uniform rename.
Read more
Reading the Full Diff
The summary is only as honest as the diff you read. The single most common failure is reading the latest commit instead of the whole branch. This reference is how you get the *complete* change set and turn it into a structure you can summarize.
Get the whole branch, not the tip
Always read the union of every commit on the branch since it forked from its base — the **three-dot** range:
# What files changed and by how much (read this first for shape) git diff --stat <base>...HEAD # The full patch across the whole branch git diff <base>...HEAD # The list of commits, so you can see intent but never summarize from it alone git log --oneline <base>..HEAD
- `<base>...HEAD` (three dots) diffs HEAD against the *merge base* — exactly what the PR proposes to
merge. This is what you want.
- `<base>..HEAD` (two dots) can include unrelated changes that landed on base after the fork. Avoid
it for the patch; it is fine for `git log`.
- `git show HEAD` or `git diff HEAD~1` reads **one commit**. Never summarize from these — a branch
that introduces and later fixes an issue must be summarized as it stands at HEAD.
If the base branch is unknown, it is usually `main`, `master`, or `develop`. Confirm with `git remote show origin` or the PR metadata rather than guessing.
When there is no git access
If you only have the working tree (no VCS, or a squashed export you cannot expand), read the changed files directly with Read/Grep and say explicitly in the summary that it was produced from a snapshot, not a `base...HEAD` diff. Do not fabricate a delta you cannot see.
Group changes by area
Before writing prose, bucket every changed file. This structure becomes the skeleton of the summary and makes risk obvious:
| Bucket | What goes here | Attention level | |---|---|---| | **Feature / behavior** | New or changed runtime logic | High — read closely | | **Refactor / mechanical** | Renames, moves, formatting, codemods | Low — collapse to one line | | **Tests** | New/changed test files | Cross-check against feature changes | | **Config / infra** | CI, Dockerfiles, env, dependency manifests | High — silent blast radius | | **Migrations** | Schema/data migration files | Highest — often irreversible | | **Docs / generated** | READMEs, lockfiles, generated code | Low — note but don't dwell |
A useful heuristic: **lines changed is not importance.** A 400-line lockfile churn is low-signal; a 3-line change to an auth check is the headline.
Handling large and rename-heavy diffs
- **Rename detection:** `git diff -M <base>...HEAD` marks moves as renames so a moved file doesn't
read as a full delete+add. This collapses noise dramatically.
- **Ignore whitespace:** `git diff -w <base>...HEAD` when a formatter touched many lines, so you see
the real logic change underneath.
- **Focus a path:** `git diff <base>...HEAD -- path/to/dir` to read one area at a time on a big PR.
- **Numstat for triage:** `git diff --numstat <base>...HEAD` gives machine-readable add/delete
counts per file — feed this shape into `scripts/diff-risk.mjs` to flag oversized or risky files before you read them line by line.
Read the highest-attention buckets in full. Skim mechanical churn only to confirm it *is* mechanical — codemods occasionally smuggle a real behavior change into an otherwise-uniform rename.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Other agents on vanara-agents-skills.
- AGENT
Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing status codes, pagination, filtering, error envelopes, versioning, and idempotency. Produces a reviewable API contract plus an OpenAPI snippet, not
Open agent - review-notes
This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the contract-breakers first. Severity legend: **CRITICAL** (breaks clients / data risk), **HIGH** (real bug or inconsistency), **MEDIUM** (maintainability),
Open agent - contract-and-openapi
The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to structure that document and what `scripts/lint-openapi.mjs` enforces.
Open agent - design-checklist
Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting rules last. Every box is a place real APIs go wrong in production.
Open agent - versioning-and-evolution
APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add without breaking**, and version explicitly when you must break.
Open agent - pr-comment-template
Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.
Open agent

