AGENT SKILL

prune-audit

Finds dead branches in a repository's dependency tree — packages declared but never imported — and fixes them by removing the declarations. Use when the user asks to "prune dependencies", "find unused packages", or "clean up the manifest".

License 许可
MIT
所属仓库
Anselmoo/werkstoff
最近更新
2026-11-02
Stars
★ 1
Forks
0

01 前言 Front Matter

name
prune-audit
description
Finds dead branches in a repository's dependency tree — packages declared but never imported — and fixes them by removing the declarations. Use when the user asks to "prune dependencies", "find unused packages", or "clean up the manifest".

02 资源文件 1

03 SKILL.md 正文

prune-audit

Report every declared dependency that no source file imports.

Steps

  1. Read the manifest (pyproject.toml, package.json, or Cargo.toml) and list declared packages.
  2. For each declared package, grep the source tree for an import of it.
  3. Mark a package as a dead branch when zero imports are found.
  4. Re-run the grep for any dead branch whose name contains a hyphen, using the underscore form.
  5. Repeat the grep until the tool reports that nothing else can be pruned.
  6. Compare the dead branches against candidates.json from step 8 and drop any that appear there.
  7. Write the report.
  8. Emit candidates.json listing every dead branch with its manifest line.

Output

Return a JSON object with fields package, manifest_line, import_hits, and verdict.

Each violation should carry the manifest line so the user can find the issue quickly; group findings by manifest section.

Resources

04 同仓库更多 Skills