agentsclimarketplace

Diff analysis

Skill jacob-balslev/skill-graph/marketplace/skills/diff-analysis

Skills that know your codebase. Repo-grounded, contract-validated, agent-routable.

Install
npx -y skills add jacob-balslev/skill-graph --skill diff-analysis

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when analyzing `git diff`, reviewing a patch before commit, or explaining what a changeset does. Covers unified diff anatomy, hunk interpretation, semantic-vs-formatting separation, blast-radius tracing, hidden-risk scanning, and intent-vs-diff comparison. Do NOT use for full code-review verdicts (use `code-review`), git workflow decisions (use `version-control`), or visual diffs.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

11.5 KB, ~2.2k tokens by cl100k_base, as published. Nobody here has run it

Diff Analysis

Concept of the skill

Use when analyzing git diff, reviewing a patch before commit, or explaining what a changeset does.

Domain Context

What is this skill? This skill provides disciplined diff analysis for AI agents: reading code changes as a structured before/after artifact, isolating semantic changes from formatting noise, tracing blast radius across files, and extracting review-ready findings from a patch. Covers unified diff anatomy, hunk-by-hunk interpretation, scope validation, hidden-risk scanning, and intent-vs-diff comparison. Use when analyzing git diff, reviewing a patch before commit, or explaining what a changeset actually does. Do NOT use for full code-review verdicts (use code-review), git workflow decisions (use version-control), or pixel/image comparison (use playwright-cli or visual diff tooling).

Key Files

FilePurpose
skills/diff-analysis/references/repo-diff-patterns.mdRepo-grounded patch examples showing how diff classes map to real changes in this workspace.
skills/diff-analysis/references/diff-reading-checklist.mdStep-by-step checklist for reading hunks, isolating semantic deltas, and naming blast radius.

Coverage

This skill covers reading and interpreting unified diffs and patches: the anatomy of diff --git output, hunk-by-hunk semantic extraction, file-level change classification (rename, mechanical rewrite, local logic edit, contract edit, test-only edit), separating signal from formatting noise, blast radius estimation for changed contracts and types, intent-vs-diff mismatch detection, and writing concise behavior-focused diff summaries. Does not cover full code review verdicts, git workflow/branching decisions, or visual/pixel comparison.

Philosophy of the skill

Agents that skim diffs miss hidden behavior changes buried in formatting churn. A one-line guard removal inside a 300-line reformat can silently widen access. This skill exists because agents need a repeatable reading discipline -- structure first, meaning second, risk last -- instead of narrating every added and removed line equally. Without it, agents produce line-by-line restatements that miss the semantic delta and say "looks safe" without naming the blast radius.

A diff is not just a list of changed lines. It is a compact representation of intent, scope, and risk. This skill helps agents read a patch accurately, separate real behavior changes from noise, and turn raw hunks into useful conclusions.

For real repo-grounded examples, read references/repo-diff-patterns.md and references/diff-reading-checklist.md when you need concrete patch shapes instead of the general rubric.

1. What This Skill Owns

OwnsDoes not own
Reading unified diffs and patchesDeciding branch strategy or release flow
Separating semantic change from formatting churnFull review sign-off across correctness/security/performance
Mapping changed hunks to probable blast radiusVisual screenshot or image diffs
Explaining what changed in plain languageCommit-policy or git-history governance

2. The Diff Reading Loop

Read diffs in this order:

  1. Identify the file set.
  2. Classify each file by change type.
  3. Read hunk headers before line edits.
  4. Extract semantic change from each hunk.
  5. Check for scope mismatch or hidden blast radius.
  6. Summarize intent, risk, and verification needs.

Do not start by reading every added and removed line equally. Start from structure, then meaning.

3. Diff Anatomy

Diff partWhat it tells youHow to use it
diff --git a/... b/...File identityBuild the file-level scope list
index ...Blob/version changeUsually low-value unless debugging patch application
--- / +++Before and after file pathConfirm rename vs in-place edit
@@ ... @@Hunk location and nearby contextUnderstand where the change lands before reading lines
- linesRemoved behavior/contentAsk what guarantee or behavior disappeared
+ linesAdded behavior/contentAsk what new state, branch, or dependency now exists
context linesStable neighborhoodUse to infer surrounding intent and call path

4. File-Level Change Classification

Before reading hunks, tag each changed file.

Change classTypical signalPrimary question
Rename/movePath changed, little content churnIs behavior unchanged but references now need updates?
Mechanical rewriteMany lines changed, low semantic deltaIs this formatting or real logic?
Local logic editSmall hunk in one functionWhat behavior changed here?
Contract editTypes, schemas, API responses, SQL view shapeWhat downstream consumers now need adjustment?
Test-only editOnly assertions/fixtures changedIs the test following behavior or masking a regression?

This classification decides how deeply to inspect the diff.

5. Semantic Extraction Per Hunk

For each hunk, answer four questions:

  1. What behavior or contract existed before?
  2. What behavior or contract exists now?
  3. Is the change additive, restrictive, or substitutive?
  4. What adjacent path could now behave differently?

Hunk interpretation rules

  • A one-line edit can still be a contract break.
  • Large churn can still be mostly noise.
  • Added guards often narrow behavior; removed guards widen risk.
  • Type-only changes can imply runtime consequences if APIs or assumptions shift.

6. Noise vs Signal

Looks noisyMay still matter because
Import reorderIt can hide a new dependency or removal of a side-effect import
Rename-only editIt can change route ownership, dynamic import paths, or symbol meaning
Formatting rewriteIt can bury one real branch or condition change
Test snapshot updateIt can normalize a regression instead of proving a fix

Signal extraction rules

  • First identify files with likely semantic impact.
  • Then ignore purely cosmetic churn only after proving it is cosmetic.
  • If one hunk mixes formatting and behavior, rewrite the summary around the behavior change only.

7. Blast Radius Checks

After understanding the diff itself, ask what else the patch implicitly touches.

Change typeLikely blast radius
Public type/interface changeCallers, tests, route contracts, docs
Query/view changeServices, report math, downstream consumers
Auth/guard changeAccess paths, redirects, error handling
Config/env changeStartup paths, deployment docs, feature gates
Utility changeEvery call site using the helper

This skill does not require opening every dependent file. It requires naming the probable risk surface correctly.

8. Intent vs Diff

Compare the stated goal against the actual patch.

If the stated intent is...Check whether the diff actually...
Fix a bugCloses the failing path without silently broadening scope
RefactorPreserves behavior while changing structure
Add a featureIncludes the necessary contract, UI, and verification changes
Clean upRemoves dead weight without deleting active value

If the diff and stated intent disagree, the patch needs clarification or further work.

9. Good Diff Summaries

A good summary says why the change matters, not just what lines moved.

Use this format

  • File scope: which files changed and what kinds of changes they represent
  • Semantic delta: what behavior or contract changed
  • Risk surface: where regressions could now appear
  • Verify next: what should be tested or re-read next

Avoid

  • line-by-line narration of the whole patch
  • repeating obvious rename churn
  • calling a diff safe without naming the risk surface

10. Boundaries

  • Use code-review when you need a full review verdict and comment severity.
  • Use version-control for branching, rebasing, squash, release, or provenance policy.
  • Use playwright-cli or visual diff tools for screenshots and pixel comparison.
  • Use scanning when you need to move from a diff into exact files and line slices efficiently.

Verification

After applying this skill, verify:

  • I classified the file set before reading hunks deeply.
  • I used hunk context, not only added/removed lines.
  • I separated semantic change from cosmetic noise.
  • I identified the likely blast radius of the patch.
  • I compared the diff against the claimed intent.
  • My summary explains behavior change, risk, and next verification step.
  • I did not produce a line-by-line narration of the whole patch.
  • I named the risk surface explicitly, not just "looks safe."

Do NOT Use When

Instead of this skillUseWhy
Full correctness/security review with blocking vs advisory commentscode-reviewcode-review owns the verdict structure and comment severity
Git branching, rebasing, squash, release flow decisionsversion-controlversion-control owns branch strategy and release governance
Visual screenshot or pixel comparisonplaywright-cliplaywright-cli owns browser-based visual verification
Finding specific code locations from a diffscanningscanning owns efficient file and line-slice navigation

Skill Graph context

<!-- skill-graph-context:start (generated — do not edit by hand) -->

Classification

  • Subject: quality-assurance
  • Public: true
  • Domain: quality/doctrine
  • Scope: Use when analyzing git diff, reviewing a patch before commit, or explaining what a changeset does. Covers unified diff anatomy, hunk interpretation, semantic-vs-formatting separation, blast-radius tracing, hidden-risk scanning, and intent-vs-diff comparison. Do NOT use for full code-review verdicts (use code-review), git workflow decisions (use version-control), or visual diffs.

When to use

  • Triggers: diff-skill

Related skills

  • Verify with: refactor, snapshot-testing
  • Related: version-control, semantics

Keywords

  • git diff, unified diff, patch analysis, changeset review, diff analysis, read a diff
<!-- skill-graph-context:end -->

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.