agentsclimarketplace

Surgical diff

Skill Vix0007/vixero-skills/skills/surgical-diff

Token-efficient Agent Skills for Claude — Pillar 1: meta-skills ≤650t, Pillar 1.5: coding discipline

Install
npx -y skills add Vix0007/vixero-skills --skill surgical-diff

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

One thing to look at

  • 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

Review a code diff for scope creep, drive-by changes, and style drift. Use when the user pastes a diff, asks "review this diff", "did I change too much", "is this change surgical", or wants to audit an AI-generated patch before merging. Returns flagged lines, scope analysis, a minimal-diff proposal, and a verdict.

SKILL.md

4.1 KB, as published. Nobody here has run it

surgical-diff

Audit a diff against its stated intent. Every changed line must trace to the request.

Trigger on

  • "review this diff"
  • "is this surgical"
  • "did I change too much"
  • "audit this patch"
  • "scope-check this PR"
  • User pastes a diff plus a statement of what the change was supposed to do

Input shapes

shapehandling
unified diff + stated intentfull analysis
diff only, no intentask for intent first, do not guess
file-before + file-aftertreat as implicit diff
PR description + diffextract intent from description
commit message + diffextract intent from subject line

Analysis passes

Pass 1 — scope trace

For each changed line: does this line solve the stated request? Mark yes / no / indirect.

Pass 2 — drift detection

Universal drift flags:

drift typeexamples
stylequote style changes, whitespace, trailing commas
type theatretype hints added to unrelated functions
doc theatredocstrings added to unrelated functions
renamevariable / function renames not required by fix
scope creepnew features adjacent to the fix
unauthorized deletepre-existing dead code removed
dependency creepnew import not needed by the fix
test theatreunrelated tests added alongside the fix

Language-specific drift:

languageflag when you see
Pythonf-string conversion of unrelated % or .format() lines; listList type annotation backport on unrelated functions
TypeScriptany → specific type on unrelated signatures; interfacetype or reverse
JavaScriptvarconst/let on unrelated lines; function → arrow on unrelated
Goerror wrap reformat on unrelated errors; interface{}any swap on unrelated
Rustunwrap()? conversion on unrelated call sites
Javavar local-type inference backport on unrelated locals

Pass 3 — orphan check

After the edit, are imports / variables / functions orphaned?

orphan typeaction
Import your edit orphanedremove
Variable your edit orphanedremove
Function your edit orphanedremove
Orphan that pre-existedleave. flag only if user asks about it

Output

stated intent: {one line}
lines changed: {n}
lines tracing to intent: {n} ({pct}%)

drift flags:
  style: {line numbers}
  type-theatre: {line numbers}
  doc-theatre: {line numbers}
  rename: {line numbers}
  scope-creep: {line numbers + description}
  unauthorized-delete: {line numbers}
  dependency-creep: {line numbers}
  language-specific: {type + line numbers}
  orphans-created: {list — remove}
  orphans-untouched: {list — leave, informational}

minimal diff (only lines tracing to intent):
```diff
{the subset}

verdict: {surgical | minor drift | scope creep | rewrite needed} reasoning: {one line}


## Verdict thresholds

| tracing % | verdict |
|-----------|---------|
| ≥ 95 | surgical |
| 80–94 | minor drift (acceptable with flags) |
| 50–79 | scope creep (split into multiple PRs) |
| < 50 | rewrite needed (start from stated intent again) |

## Hard rules
- Never recommend deleting pre-existing dead code unless user asked.
- Style drift is a flag, not an error. Flag it, let the user decide.
- If stated intent is missing, do not analyze. Ask for it first.
- If the diff is under 5 lines, skip and say "too small to drift".
- Type hints on NEW code do not flag. Type hints added to UNRELATED code do.
- Tests added that cover the stated fix do NOT flag. Tests unrelated to the fix do.
- Whitespace-only diffs (reformat commits) are flagged as their own category — suggest splitting into a separate PR.
- Never "fix" the diff yourself. Report and propose. The user decides.

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.