clean-unused-cpm-packages
Remove unused PackageVersion entries from Directory.Packages.props files in a .NET repo using Central Package Management (CPM). Scans every .csproj, .props, and .targets file for PackageReference includes, computes which PackageVersion IDs aren't referenced anywhere, removes the unused entries with line-targeted edits that preserve formatting and comments, then verifies with dotnet restore. Use this skill whenever the user wants to clean up, prune, or remove unused entries from Directory.Packages.props, or says things like "clean up CPM", "remove unused packages from central package management", "the props file has stale entries", "prune Directory.Packages.props", or "dead packages in the central versions file" — even if they don't literally say "CPM". Trigger proactively when the user mentions Directory.Packages.props alongside cleanup, removal, dead, stale, or unused. Refuses to run on repos without a Directory.Packages.props (CPM not in use).
Pinned to revision a943fbd893c9, so it is the text this page describes rather than whatever the author pushed since.
Files
Every link opens the file at its source, pinned to the revision this page describes.