/eng:clean-unused-cpm-packagesfrom eng
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).
Ships in eng. 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.
Read when SKILL.md points to them.
Remove <PackageVersion> entries from Directory.Packages.props files when no project, .props, or .targets file in the repo references the corresponding package. Conservatively compute the unused set by scanning every place a PackageReference could live, then make the smallest edits possible while preserving comments, blank lines, and hand-curated grouping.
This is a destructive operation against tracked source files. Work through the steps carefully, stop at the confirmation checkpoint, and verify with dotnet restore before declaring success.
PackageVersion sources (entries considered for removal):
Directory.Packages.props in the repo, including nested ones.PackageReference sources (anything that "uses" a PackageVersion):
.csproj..props and .targets file other than Directory.Packages.props itself — including Directory.Build.props, Directory.Build.targets, and any custom imports.Excluded from removal:
<GlobalPackageReference> entries. They auto-apply to every project — the entry itself is the reference. Removing one drops an analyzer/generator from every project, which is a deliberate user decision, not something to automate.<PackageVersion ... Condition="..." />): treat them like any other entry. The condition gates when the version applies, not whether the package is referenced — so if no project references the ID, the entry is unused regardless of the condition.Stop and report if any fail.
CPM is in use. At least one Directory.Packages.props exists in the repo:
find . -type f -name 'Directory.Packages.props' \
-not -path '*/node_modules/*' -not -path '*/bin/*' -not -path '*/obj/*'
If none, this isn't a CPM repo — stop and tell the user.
Working tree is clean for the files this skill will touch.
git status --porcelain -- ':(glob)**/Directory.Packages.props'
The :(glob) magic is required so the pathspec crosses directory boundaries — without it, nested Directory.Packages.props files aren't checked. If any have uncommitted edits, ask before mixing in the skill's changes.
dotnet is on PATH. The Step 6 verification depends on it; the skill does not run without it:
dotnet --version
If dotnet is missing or fails, stop and ask the user to install/fix it before re-running.
No .fsproj or .vbproj projects in the repo. This skill only scans .csproj. References held by F#/VB projects won't be counted, and PackageVersion entries used only by them would be wrongly flagged as unused:
find . -type f \( -name '*.fsproj' -o -name '*.vbproj' \) \
-not -path '*/node_modules/*' -not -path '*/bin/*' -not -path '*/obj/*'
If any are found, warn the user that references in those projects won't be detected and ask whether to proceed regardless.
PackageVersion and GlobalPackageReferenceFor each Directory.Packages.props file, read it and record:
<PackageVersion> entry: package ID, version, and source file.<GlobalPackageReference> entry: same, but tagged "global" so Step 3 skips it.Multi-line entries (rare, but valid) span multiple lines — capture the whole block. Conditional entries (Condition="...") are captured like any other.
PackageReference Include across the repoSearch in:
.csproj files..props and .targets files other than Directory.Packages.props files.Exclude build output and dependency directories: bin/, obj/, node_modules/, .git/. Files under those (e.g. obj/*.g.props) hold generated PackageReference entries that don't reflect actual project intent and would mask legitimately-unused entries.
For each remaining file, find every <PackageReference> element and pull its Include (or Update) attribute value. Update modifies metadata of an existing reference and still counts as a reference. Use multiline-aware matching: <PackageReference> attributes can spill across lines.
Build a deduped set of referenced package IDs. Compare case-insensitively: NuGet package IDs are case-insensitive, so a Directory.Packages.props entry of Microsoft.Extensions.Hosting and a project file with microsoft.extensions.hosting describe the same package — they must match. Keep the original casing for any displayed names and for the line edits in Step 5.
For each PackageVersion from Step 1: if its ID is not in the Step 2 set, it's unused.
GlobalPackageReference entries are skipped — they're never proposed for removal.
If the unused set is empty, tell the user there's nothing to remove and stop.
Print the proposed removals grouped by source file, sorted by package ID:
[<path/to/Directory.Packages.props>]
- SomePackage.A (1.2.3)
- SomePackage.B (4.5.6)
[<path/to/other/Directory.Packages.props>]
- SomePackage.C (7.8.9)
3 unused PackageVersion entries.
Ask: Remove these N entries?
Wait for explicit confirmation. Reasons the user might decline:
<Target> — grep won't find that..targets outside the repo.If the user asks for a diff first, produce a unified diff per file and re-prompt. Do not edit anything until confirmed.
For each unused entry, locate the exact line(s) in its source file and remove them with Edit. Preserve:
<!-- SomePackage.A: pinned for compat --> directly above the line). When in doubt, leave the comment.Multi-line entries: remove the whole block.
Do not reformat the rest of the file. The goal is the minimum change that drops the listed entries.
dotnet restoreRun from the repo root (or each affected solution root, if the repo has multiple):
dotnet restore
If restore succeeds, the cleanup is verified. Summarize what was removed and stop.
If restore fails, the cause is almost always one of:
.fsproj/.vbproj (this skill is .csproj-only — Prereq 4 should have surfaced this), an MSBuild SDK imported from outside the repo, .targets generated at build time, or props injected by another NuGet package.PackageReference items added inside a <Target> or via a conditional <ItemGroup> evaluated only at build time. Grep doesn't see those.Re-add the specific wrongly-removed entry by hand. Use git diff <file> to see what was removed and selectively restore just that line. Don't git checkout -- <file> — that discards every correctly-removed entry along with the false positive. Tell the user which package was wrongly flagged so the edge case is visible.
Directory.Packages.props. The file is curated by hand; preserve comments, grouping, and blank lines.GlobalPackageReference entries as unused. They're always used — removing one is a deliberate user decision..fsproj or .vbproj. This skill is .csproj-only by design.[xml] in PowerShell, xml.etree in Python). It loses comments and reformats whitespace. Always use line-targeted edits.dotnet restore fails after a removal, restore the entry — the failure is the signal.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub esond/skills --plugin eng7 skills in this plugin
/inline-reviewFind and address inline code-review comments left in the code, marked with the `rev:` prefix (e.g. `// rev:`, `# rev:`, `-- rev:`). These are a manual code review done inline instead of on GitHub — each comment is a question, suggestion, concern, or change request about the nearby code. Use this skill whenever the user asks you to address, handle, resolve, go through, or respond to their inline review comments, rev comments, or `rev:` comments — even when phrased tersely, like "address my rev comments", "handle the reviews", "go through the rev: notes", "I left some inline comments", "respond to my review", or just "address these" right after leaving such comments. Trigger whenever the request references `rev:` comments in the code./pr-review-resolverAddress outstanding review feedback on a GitHub pull request: unresolved review threads, submitted review bodies, and general PR comments. Triages each critically, fixes what it agrees with, and pushes back on the rest. Use whenever the user wants to address, fix, resolve, or work through PR review comments or feedback, even if they just say "handle the PR comments", "fix what the reviewers said", or "go through the PR", or pastes a PR URL and asks you to act on the feedback there./reorganize-branch-commitsReorganize the commits on a non-default git branch into a clean, logical history by rewriting the branch — `git reset` + re-commit by default, `git rebase -i` when commit boundaries already align. Propose groupings based on the actual work done (features, refactors, tests, fixes, docs), get explicit user approval, back the branch up, then rewrite history. Use this skill whenever the user wants to tidy up, clean up, reorganize, restructure, squash, or curate commits on a feature branch — even if they phrase it as "my branch is a mess", "squash this down", "combine these commits", "fix up the commit log before I open a PR", or "make the commits presentable for review". Trigger proactively when the user is about to open or push a PR and the branch has scrappy/WIP/"fix" commits to collapse. Refuses to operate on default or release-shaped branches (main, master, develop, trunk, production, release, or the repo default) — a feature-branch-only tool./righting-software-system-designOpt-in, collaborative system-design workflow based on Juval Löwy's iDesign methodology in *Righting Software*. Conducts a multi-phase interview (framing → use cases → volatility analysis → components → call-chain validation → report) that surfaces unknown-unknowns and produces a written recommendation at `decompositions/{system-name}/report.md`. **Run only when the user explicitly invites this workflow** — not for general architecture questions, lightweight design conversations, or quick "where should X live?" questions. Valid triggers: the user names the skill directly, references *Righting Software* / Juval Löwy / iDesign / "The Method" / volatility-based decomposition and asks to run a full session, asks for a "deep" or "structured" or "Löwy-style" system design session, or accepts a prior suggestion to run it. Wait for an explicit yes before entering Phase 0. The skill is interrogative — a back-and-forth interview that challenges each volatility candidate and proposes ones the user hasn't considered./sync-core-docsCreate or audit a repo's README.md, AGENTS.md/CLAUDE.md, and REVIEW.md docs./sync-core-repo-docsCreate or audit a repo's three core doc files — README.md, the agent instructions file (AGENTS.md or CLAUDE.md), and REVIEW.md — in that dependency order. If a file is missing, generate it from the codebase; if it exists, audit it against the current code and apply targeted fixes after confirmation. README.md gets a developer from clone to running the project; AGENTS.md captures coding guidance for the agent (delegating to /init or claude-md-improver); REVIEW.md holds guidance for code reviewers, human or automated, without duplicating AGENTS.md. Target files with --readme, --claude, and --review, or run all three. Use whenever the user wants to set up, bootstrap, scaffold, refresh, audit, update, or sync a repo's docs, or says things like "create a README", "is my README still accurate", "write a CLAUDE.md", "write an AGENTS.md", "audit our docs", or "get this repo ready for contributors" — even when only one file is named. Prefer it over claude-md-improver when README or REVIEW are also in scope.