AGENT SKILL

dep-diff-review

Review what a change or pull request introduces into the dependency tree - new packages, version bumps, typosquats, install scripts, vulnerabilities - using postmortem diff plus mlab.sh enrichment. Use when reviewing a PR that touches a lockfile, comparing two branches' dependencies, or gating dependency changes in CI.

License 许可
MIT
最近更新
2026-10-22
Stars
★ 1
Forks
0

01 前言 Front Matter

name
dep-diff-review
description
Review what a change or pull request introduces into the dependency tree - new packages, version bumps, typosquats, install scripts, vulnerabilities - using postmortem diff plus mlab.sh enrichment. Use when reviewing a PR that touches a lockfile, comparing two branches' dependencies, or gating dependency changes in CI.

03 SKILL.md 正文

Dependency Diff Review

CLI details and preflight: ${CLAUDE_PLUGIN_ROOT}/docs/postmortem-reference.md. mlab output shapes: ${CLAUDE_PLUGIN_ROOT}/docs/tool-reference.md.

The question is never "is this project healthy" but "what does THIS CHANGE introduce". Cost scales with the diff, so --online --vulns are cheap here - use them.

Workflow

1. Preflight and target

postmortem --version. Then one of:

  • GitHub PR: postmortem diff https://github.com/<owner>/<repo>/pull/<n> --online --vulns --json -o - (both sides come from the PR)
  • Two local states: postmortem diff <old-dir> <new-dir> --online --vulns --json -o - (e.g. two worktrees/checkouts)
  • Production focus: add --omit dev when the review only gates what ships.

2. Read the diff

Three buckets: added, removed, version-changed. For each ADDED or version-changed package, the online pass already carries reputation and provenance. Escalate on:

  • brand-new or recently transferred packages (postmortem timeline <pkg> for npm: handovers, install-script appearance)
  • packages that gain an install script in this change (postmortem scripts <new-dir> and compare)
  • names one edit away from popular packages (typosquat suspicion)
  • vulnerabilities the change INTRODUCES (ignore pre-existing ones here; they belong to sbom-audit)

3. Enrich what deserves it

Suspicious added package → postmortem why <pkg> <new-dir> --blast for what a compromise would reach. Registry/homepage domains that look off → mlab domain/URL scans. Introduced CVEs → KEV/EPSS triage from the results, actors_by_cve on anything KEV.

4. Verdict for the review

## Dep review: <PR/change> - <approve | approve with comments | block>

| Package | Change | Risk | Why |
|---|---|---|---|

### Blocking
<findings that must be resolved, each with the evidence>

### Non-blocking
<worth a comment>

Introduced vulns: <n> (<worst>) | New install scripts: <n> | New maintainers reached: <n>

For CI use, point the user at postmortem scan --sarif (GitHub Code Scanning) and postmortem ci for pipeline templates; a review skill run is the interactive complement, not the gate itself.

Rules

  • Judge the delta, not the repo: pre-existing debt is out of scope and saying so keeps reviews fast.
  • "block" needs evidence tied to the change; suspicion without evidence is a comment, not a block.
  • Never install or execute the changed dependencies to inspect them.

04 同仓库更多 Skills

mlab-sh
mlab-sh/mlab-claude

threat-watch

Generate a threat landscape digest from mlab.sh - recent critical/KEV CVEs filtered to a declared technology stack, with actor attribution. Use when the user asks what is new in vulnerabilities, wants a daily/weekly threat brief, asks about recent CVEs for a product, or sets up a recurring watch on their stack.

★ 1
mlab-sh
mlab-sh/mlab-claude

supply-chain-audit

Full supply-chain audit of a project - postmortem detects malicious code, install hooks and risky dependencies locally, then mlab.sh enriches what it finds (hashes, endpoints, actors, CVEs). Use when the user asks to audit a project's dependencies or supply chain, check a repo for malicious packages, or vet a codebase before adoption or deployment.

★ 1
mlab-sh
mlab-sh/mlab-claude

smishing-campaign

Analyze a batch of reported SMS/text messages through mlab.sh - score each for smishing, cluster them into campaigns, and extract the shared infrastructure (URLs, callback numbers, sender patterns). Use when the user has multiple reported SMS from users/employees, or investigates an SMS phishing wave. For a single message, phishing-triage does the job.

★ 1
mlab-sh
mlab-sh/mlab-claude

script-triage

Statically analyze a suspicious shell script through mlab.sh - install.sh, cron payloads, CI steps, curl-pipe-sh one-liners. Flags dangerous constructs (download-piped-to-shell, base64 decoding, reverse shells, persistence, anti-forensics, destructive deletes), extracts every IOC and enriches them. Use when the user pastes shell code and asks if it is safe/malicious, or provides a .sh file to vet before running it.

★ 1
mlab-sh
mlab-sh/mlab-claude

sbom-export

Generate a CycloneDX SBOM locally with postmortem and push it through mlab.sh vulnerability scanning - for projects or container images where no single lockfile can be pasted. Use when the user asks for an SBOM, needs vuln scanning of a container image or a multi-ecosystem repo, or when sbom-audit lacks a usable lockfile.

★ 1
mlab-sh
mlab-sh/mlab-claude

sbom-audit

Audit a dependency lockfile or SBOM for known vulnerabilities via mlab.sh, prioritize findings by KEV status and EPSS, and attribute actively exploited CVEs to threat actors. Use when the user provides a lockfile (package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, requirements.txt, poetry.lock, uv.lock, Pipfile.lock, go.sum, composer.lock, Gemfile.lock, pom.xml, gradle.lockfile, packages.lock.json, pubspec.lock, mix.lock) or a CycloneDX / SPDX SBOM, or asks to check dependencies for vulnerabilities.

★ 1