← ClaudeAtlas

prune-depslisted

Find and remove unused NuGet packages and stale project references in a .NET solution. Reviews Directory.Packages.props for PackageVersion entries no project references, reviews every .csproj for PackageReference and ProjectReference entries the project's code no longer uses, then removes approved entries and verifies the build. Avoids the false-positive traps (transitive pins, analyzers, runtime-only packages). Triggers on: unused packages, prune dependencies, dead dependencies, remove unused packages, unused package references, unused project references, stale references, clean up Directory.Packages.props, unneeded references, dependency prune, orphaned packages, are these packages still used.
e128/dotnet-reference · ★ 2 · DevOps & Infrastructure · score 74
Install: claude install-skill e128/dotnet-reference
# Prune Dependencies Find unused NuGet packages and stale references, then remove the confirmed-dead ones. Three targets: 1. **Orphaned central packages** — `PackageVersion` in `Directory.Packages.props` that no project references and that isn't a deliberate transitive pin. 2. **Unused `PackageReference`** — a direct package reference whose namespaces/types the project's code never uses. 3. **Unused `ProjectReference`** — a project-to-project reference where the referencing project uses no public type from the referenced project. **The hard part is avoiding false positives.** A package with zero `using` directives is not automatically unused — analyzers, source generators, runtime-only packages, and transitive pins all look "unused" to a naive scan. Read `references/false-positives.md` before flagging anything. ## Usage ``` /prune-deps # Full audit; remove approved findings; verify build /prune-deps --report-only # Read-only — produce findings, never edit /prune-deps --no-mcp # Skip roslyn MCP; grep-only usage analysis /prune-deps --project Core # Scope code-usage analysis to one project ``` ## Autonomy Phase 1–3 are read-only (file reads, grep, `dotnet list`, MCP queries) — pre-approved per the auto-approval policy; proceed without prompting. **Removals (Phase 5) require a single `AskUserQuestion` approval gate** per the repo's "ask before fixing" convention. `--report-only` skips Phases 4–5 entirely. --- ## Phase 1: Inventory Gather t