diff-analysis — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited diff-analysis (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use when analyzing git diff, reviewing a patch before commit, or explaining what a changeset does.
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).
| File | Purpose |
|---|---|
skills/diff-analysis/references/repo-diff-patterns.md | Repo-grounded patch examples showing how diff classes map to real changes in this workspace. |
skills/diff-analysis/references/diff-reading-checklist.md | Step-by-step checklist for reading hunks, isolating semantic deltas, and naming blast radius. |
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.
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.
| Owns | Does not own |
|---|---|
| Reading unified diffs and patches | Deciding branch strategy or release flow |
| Separating semantic change from formatting churn | Full review sign-off across correctness/security/performance |
| Mapping changed hunks to probable blast radius | Visual screenshot or image diffs |
| Explaining what changed in plain language | Commit-policy or git-history governance |
Read diffs in this order:
Do not start by reading every added and removed line equally. Start from structure, then meaning.
| Diff part | What it tells you | How to use it |
|---|---|---|
diff --git a/... b/... | File identity | Build the file-level scope list |
index ... | Blob/version change | Usually low-value unless debugging patch application |
--- / +++ | Before and after file path | Confirm rename vs in-place edit |
@@ ... @@ | Hunk location and nearby context | Understand where the change lands before reading lines |
- lines | Removed behavior/content | Ask what guarantee or behavior disappeared |
+ lines | Added behavior/content | Ask what new state, branch, or dependency now exists |
| context lines | Stable neighborhood | Use to infer surrounding intent and call path |
Before reading hunks, tag each changed file.
| Change class | Typical signal | Primary question |
|---|---|---|
| Rename/move | Path changed, little content churn | Is behavior unchanged but references now need updates? |
| Mechanical rewrite | Many lines changed, low semantic delta | Is this formatting or real logic? |
| Local logic edit | Small hunk in one function | What behavior changed here? |
| Contract edit | Types, schemas, API responses, SQL view shape | What downstream consumers now need adjustment? |
| Test-only edit | Only assertions/fixtures changed | Is the test following behavior or masking a regression? |
This classification decides how deeply to inspect the diff.
For each hunk, answer four questions:
| Looks noisy | May still matter because |
|---|---|
| Import reorder | It can hide a new dependency or removal of a side-effect import |
| Rename-only edit | It can change route ownership, dynamic import paths, or symbol meaning |
| Formatting rewrite | It can bury one real branch or condition change |
| Test snapshot update | It can normalize a regression instead of proving a fix |
After understanding the diff itself, ask what else the patch implicitly touches.
| Change type | Likely blast radius |
|---|---|
| Public type/interface change | Callers, tests, route contracts, docs |
| Query/view change | Services, report math, downstream consumers |
| Auth/guard change | Access paths, redirects, error handling |
| Config/env change | Startup paths, deployment docs, feature gates |
| Utility change | Every call site using the helper |
This skill does not require opening every dependent file. It requires naming the probable risk surface correctly.
Compare the stated goal against the actual patch.
| If the stated intent is... | Check whether the diff actually... |
|---|---|
| Fix a bug | Closes the failing path without silently broadening scope |
| Refactor | Preserves behavior while changing structure |
| Add a feature | Includes the necessary contract, UI, and verification changes |
| Clean up | Removes dead weight without deleting active value |
If the diff and stated intent disagree, the patch needs clarification or further work.
A good summary says why the change matters, not just what lines moved.
code-review when you need a full review verdict and comment severity.version-control for branching, rebasing, squash, release, or provenance policy.playwright-cli or visual diff tools for screenshots and pixel comparison.scanning when you need to move from a diff into exact files and line slices efficiently.After applying this skill, verify:
| Instead of this skill | Use | Why |
|---|---|---|
| Full correctness/security review with blocking vs advisory comments | code-review | code-review owns the verdict structure and comment severity |
| Git branching, rebasing, squash, release flow decisions | version-control | version-control owns branch strategy and release governance |
| Visual screenshot or pixel comparison | playwright-cli | playwright-cli owns browser-based visual verification |
| Finding specific code locations from a diff | scanning | scanning owns efficient file and line-slice navigation |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.