convert-to-cpm

Convert .NET projects to NuGet Central Package Management using Directory.Packages.props.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill convert-to-cpm-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convert-to-cpm
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/convert-to-cpm
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill convert-to-cpm-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Package versions scattered across many .csproj, .fsproj, and .vbproj files drift out of sync, causing version conflicts and making upgrades painful. This Skill centralizes all NuGet package versions into a single Directory.Packages.props file with build validation and a structured conversion report. ## Core Features & Use Cases - CPM Migration Workflow: Audits package references, creates Directory.Packages.props, strips Version attributes from PackageReference items, and handles VersionOverride and conditional versions. - Baseline Validation: Captures pre- and post-conversion binlogs and package lists, then compares resolved versions to confirm the conversion is version-neutral. - Conflict Resolution & Reporting: Detects version conflicts, MSBuild property-based versions, and security advisories, then produces a shareable convert-to-cpm.md report with risk assessment and follow-up items. - Use Case: A solution with 15 projects has mismatched Newtonsoft.Json versions. Use this Skill to centralize all package versions, resolve each conflict with your chosen strategy, and receive a PR-ready report documenting every change. ## Quick Start Convert my solution MyApp.sln to NuGet Central Package Management and generate a conversion report.

Frequently Asked Questions about convert-to-cpm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a .NET solution to Central Package Management?

Central Package Management conversion creates a Directory.Packages.props file with ManagePackageVersionsCentrally enabled, adds a PackageVersion entry per package, and removes Version attributes from PackageReference items. The Skill validates with a clean restore and build, then compares package lists before and after.

How do I resolve NuGet package version conflicts across multiple projects?

Version conflicts are resolved by aligning to the highest version in use, aligning to the lowest, or using VersionOverride for projects that must keep a different version. Each conflict is presented individually with affected projects and trade-offs, and no package is upgraded beyond the highest version already in use.

Can I use Central Package Management with packages.config projects?

No, CPM only works with PackageReference-based projects. Projects using packages.config must first be migrated to PackageReference using Visual Studio's built-in migration or dotnet migrate tooling before CPM conversion can proceed.

What do NuGet errors NU1008 and NU1010 mean during CPM migration?

NU1008 means a PackageReference still has a Version attribute while CPM is enabled; remove it or use VersionOverride. NU1010 means a PackageReference lacks a corresponding PackageVersion entry in Directory.Packages.props; add the missing entry.

How are MSBuild version properties handled in Directory.Packages.props?

Properties used only for package versions can be inlined as literal versions in Directory.Packages.props and then removed after validation. Properties used elsewhere are kept, and Directory.Packages.props can reference them since Directory.Build.props is imported first.

When should I not convert a repository to Central Package Management?

Skip conversion when CPM is already fully enabled for all in-scope projects, when projects still use packages.config, or when versions are intentionally managed through a custom MSBuild property file without CPM.