/claude-leverage:explain-diff [ref-range, default HEAD] [--for pr|review|self]from claude-leverage
Reads a git diff and generates plain-English narration for PR descriptions, code reviews, or self-orientation. Automatically adjusts output for PR bodies, reviewer guidance, or personal context-switching.
Ships in claude-leverage. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reads a git diff and produces a tight English narration of what
changed, why a reviewer should care, and where the risk concentrates.
Lives next to the vanilla commit workflow (mechanical Conventional
Commits message) and /security-review (structured security audit) —
covers the "narrative" niche neither does.
Three audience modes:
--for pr (default) — output is a PR-description-shaped block:
## Summary, ## Why, ## How to verify. Copy-pasteable into the
PR body.--for review — emphasizes what's load-bearing and what's mechanical;
flags non-obvious decisions that the reviewer might miss without
the author's voice ("the new IF EXISTS clause on line 47 is
load-bearing — without it the migration is non-idempotent").--for self — terse 3–5 bullet self-narration; useful before
switching context or coming back to a branch later.Resolve diff range.
git diff HEAD (working tree + staged vs last commit).$ARGUMENTS starts with ^ or contains .. or ..., treat
as a ref range and use git diff <range>.--for pr and the current branch has commits beyond main,
use git diff main...HEAD instead (covers the whole branch).Get supporting context (parallel-OK):
git status --short for file-state breakdown.git log --oneline -10 for repo style of commit messages.git rev-parse --abbrev-ref HEAD for branch name.Read the diff in full. If the diff is enormous (>50k tokens
estimated), STOP and report: "diff is too large — narrow with
--paths <pattern> or <file>...". Don't try to chunk and
summarize partial diffs; the result would be incoherent.
Walk the diff and identify:
*_test.*, *.test.*,
tests/, etc.).auth*, crypto*,
*.env*, routes/, etc.) — surface as a "consider /security-review"
reminder, not a substitute for it.AIDEV- anchor (only in
--for review). A load-bearing hunk that encodes a non-obvious choice —
an ordering dependency, a perf carve-out, an idempotency trick, a
deliberate rejection of the obvious approach — and carries no
AIDEV-NOTE: / AIDEV-TODO: / AIDEV-QUESTION: in the added lines is
a memory the next agent won't inherit. This is the review-boundary
backstop for the ai-first-nudge hook, which only fires on ≥50-LOC
single writes and so misses decisions built up incrementally.Emit narration in the requested shape.
--for pr output template## Summary
- <one sentence per key change, ordered by importance>
## Why
<one paragraph: the motivation. If the diff doesn't make the motivation
obvious, say so explicitly — "motivation not inferable from the diff;
add to PR body".>
## How to verify
- [ ] <reviewer step 1>
- [ ] <reviewer step 2>
- <commands to run if applicable>
--for review output template## What changed (load-bearing)
- `file:line` — <description of load-bearing change>
- ...
## What changed (mechanical, low-risk)
- <bulk list, less detail>
## What to look at first
<top 1–2 things the reviewer should NOT skip>
## What's untested
- <files modified without corresponding test changes, IF the language
conventionally tests, IF the file is non-trivial>
## Load-bearing but un-anchored
- `file:line` — <the non-obvious decision that has no AIDEV anchor;
suggest the anchor to add, e.g. "AIDEV-NOTE: retry order matters —
webhook must land before the DB commit">
- <omit this section entirely if every load-bearing hunk is either
self-evident or already anchored — don't manufacture findings>
--for self output template- <bullet 1, ≤80 chars>
- <bullet 2>
- <bullet 3>
[max 5]
routes/auth/... — consider
/security-review". Don't try to be that skill.services/old/*
to services/new/*").--for pr output into the PR body.--for review to make sure the diff is honestly readable.--for self to
re-orient./security-review do the actual audit.main automatically in --for self / --for review
modes. Default is HEAD (working tree vs last commit). User
picks the range explicitly when they want branch-wide.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/adr-newUSE WHEN a load-bearing architectural decision is being made in conversation (database / framework / auth model / integration choice, or explicit rejection of an alternative) — one likely to be re-litigated in 6 months without the rationale. Bootstraps a numbered MADR ADR in `docs/adr/`, asks for context + decision + alternatives, updates the index. Immutable status once accepted. See `docs/adr/README.md` for the convention; full Do/Don't list in this SKILL body.
/arch-mapUSE WHEN setting up a repo for AI-first work, after a major directory restructure, or when an agent needs structured answers like "which modules are stable?" / "what's the public surface of X?" that the prose AGENTS.md doesn't give cheaply. Bootstraps or refreshes `architecture.yml` at repo root — machine-readable module metadata (path / role / stability / public_surface / depends_on / paired_with / owners). Hand-curated; the skill drafts, the user confirms. See ADR 0005 for why this file lives at root and why YAML over JSON.
/codex-sandboxUSE WHEN setting up Codex CLI in a project, tightening sandbox for prod/CI, or when user asks about Codex permissions. Interactive helper for per-project `.codex/config.toml`: `dev` / `prod` / `custom` profiles, idempotent via markers, preserves unmanaged config below the block. Codex-only artifact.
npx claudepluginhub filip-podstavec/claude-leverage --plugin claude-leverageOther plugins' skills for the same job