dotnet-centralise-packages
Converts a .NET solution to use Central Package Management (CPM).
Skill by Im5tu
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/im5tu-dotnet-centralise-packages
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/dotnet-centralise-packages
Tools it pre-approves 6
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(dotnet:*),Read,Edit,Write,Glob,AskUserQuestion
What's inside
- Skill name
dotnet-centralise-packages- Description
- Converts a .NET solution to use Central Package Management (CPM). Also use when the user mentions "centralize packages," "CPM," "Directory.Packages.props," "unify package versions," "consolidate NuGet," or "central package management." For updating package versions, see dotnet-update-packages.
- License
- MIT
- Allowed tools
- Bash(dotnet:*),, Read,, Edit,, Write,, Glob,, AskUserQuestion
- Metadata
- author: Im5tu · version: 1.0 · repositoryUrl: https://github.com/im5tu/dotnet-skills
- Instructions
- 87 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (1)
- SKILL.md
SKILL.md (first lines)
Convert the current .NET solution to use Central Package Management, centralizing all package versions in a single `Directory.Packages.props` file.
## Steps
1. **Find the solution file** (*.sln) in the current directory
- If no .sln found, warn and stop
2. **List all packages** (including transitive)
```bash
dotnet package list --include-transitive --format json
```
3. **Parse JSON output** to extract:
- All unique packages across all projects
- Their versions
- Whether each package is **direct** or **transitive**
- If same package has different versions, use the highest version
4. **Check for existing CPM files**
- If `Directory.Packages.props` exists, ask user: overwrite or merge
- Note existing `Directory.Build.props` content if present
5. **Create `Directory.Packages.props`** next to the .sln file:
```xml
<Project>
<ItemGroup>
<PackageVersion Include="PackageName" Version="X.Y.Z" />
<!-- one entry per unique package -->
</ItemGroup>
</Project>
```
6. **Create or update `Directory.Build.props`** next to the .sln file:
- If file exists, add the property to existing content
- If file doesn't exist, create it:
```xml
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
```
7. **Update all .csproj files**:
- Remove `Version` attribute from all `<PackageReference>` elements
- Before: `<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />`
- After: `<PackageReference Include="Newtonsoft.Json" />`
8. **Run build** to verify:
```bash
dotnet build
```
9. **If build fails**, ask the user:
- **Fix automatically**: Review errors and attempt fixes
- **Fix manually**: Show errors and let user handle
10. **Report results**:
- List all created/modified files
- Show package count centralized
- Confirm build status
## Transitive vs Direct Packages
- **Direct packages**: Explicitly in csproj via `<PackageReference>`. These get centralized.
- **Transitive packages**: Pulled in as dependencies. Generally NOT centralized unless:
- User explicitly wants to pin a transitive package version
- A transitive package needs a security update
When centralizing:
- Only add **direct** packages to `Directory.Packages.props` by default
- Report transitive packages separately for awareness
- If user wants to pin a transitive, add it as a `<PackageVersion>` entry
## Version Conflict Resolution
When the same package has different versions across projects:
- Automatically use the highest/latest version
- No user prompt needed
## Error Handling
- If no .sln found: warn about solution-level CPM requirement
- If `Directory.Packages.props` already exists: ask to overwrite or merge
- If build fails after conversion: offer automatic fix or manual interventionFrom Im5tu/claude, MIT.
More from Im5tu/claude
- 0.587score
website-seo
Im5tu
When the user wants SEO strategy, audits, technical SEO, schema markup, content architecture, or search visibility optimization.
SkillBFreshness: B★ 6Claude Code - 0.587score
website-design
Im5tu
When the user wants to design and build a premium multi-page website for any business type.
SkillBFreshness: B★ 6Claude Code - 0.582score
dotnet-json-polymorphic
Im5tu
Configures polymorphic JSON serialization with [JsonPolymorphic] and [JsonDerivedType] attributes.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-json
Im5tu
Configures System.Text.Json source generation for AOT-compatible JSON serialization.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-logging
Im5tu
Converts logging to use the LoggerMessage source generator for high-performance, AOT-compatible logging.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-options-validation
Im5tu
Converts options validation to use the compile-time source generator for AOT-compatible, reflection-free validation.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-regex
Im5tu
Converts Regex instances to use the compile-time source generator.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-update-packages
Im5tu
Lists and updates outdated NuGet packages in .NET projects.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-enable-testing-platform
Im5tu
Enables the Microsoft Testing Platform runner in global.json.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-aot-analysis
Im5tu
Analyzes and configures a .NET project or solution for Native AOT compatibility.
SkillBFreshness: B★ 6Claude Code +9 - 0.548score
plan-feature
Im5tu
Interview user in-depth to create a detailed spec.
SkillBFreshness: B★ 6Claude Code +9 - 0.463score
reprompt
Im5tu
Formats input into Goal, Constraints, Format, Failure structure.
SkillDFreshness: D★ 6Claude Code +9
Signals
- Stars
- 6
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Aug 21, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- MIT
- Repository
- github.com/Im5tu/claude
- Website
- codewithstu.tv
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Im5tu
- 0.587score
website-seo
Im5tu
When the user wants SEO strategy, audits, technical SEO, schema markup, content architecture, or search visibility optimization.
SkillBFreshness: B★ 6Claude Code - 0.587score
website-design
Im5tu
When the user wants to design and build a premium multi-page website for any business type.
SkillBFreshness: B★ 6Claude Code - 0.582score
dotnet-json-polymorphic
Im5tu
Configures polymorphic JSON serialization with [JsonPolymorphic] and [JsonDerivedType] attributes.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-json
Im5tu
Configures System.Text.Json source generation for AOT-compatible JSON serialization.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-logging
Im5tu
Converts logging to use the LoggerMessage source generator for high-performance, AOT-compatible logging.
SkillBFreshness: B★ 6Claude Code +9 - 0.582score
dotnet-source-gen-options-validation
Im5tu
Converts options validation to use the compile-time source generator for AOT-compatible, reflection-free validation.
SkillBFreshness: B★ 6Claude Code +9
Cite this page
dotnet-centralise-packages skill. Agent Mart. https://agentmart.dev/skills/im5tu-dotnet-centralise-packages (last updated 2026-10-24)