Tooluck logoTooluck
SKILL.md

package-management

Agent skill fromAaronontheweb/dotnet-skills

Manage NuGet packages using Central Package Management (CPM) and dotnet CLI commands. Never edit XML directly - use dotnet add/remove/list commands. Use shared version variables for related packages.

How to install package-management

install package-management
# install the dotnet-skills pack with the skills CLI
npx skills add Aaronontheweb/dotnet-skills

# or add only this skill to Claude Code: copy the folder

skills/package-management/

# into

~/.claude/skills/package-management/ (all projects)

.claude/skills/package-management/ (one project)

skills/package-management/SKILL.md

MITFull file
1# NuGet Package Management
2
3## When to Use This Skill
4
5Use this skill when:
6- Adding, removing, or updating NuGet packages
7- Setting up Central Package Management (CPM) for a solution
8- Managing package versions across multiple projects
9- Troubleshooting package conflicts or restore issues
10
11---
12
13## Golden Rule: Never Edit XML Directly
14
15**Always use `dotnet` CLI commands to manage packages.** Never manually edit `.csproj` or `Directory.Packages.props` files.
16
17```bash
18# DO: Use CLI commands
19dotnet add package Newtonsoft.Json
20dotnet remove package Newtonsoft.Json
21dotnet list package --outdated
22
23# DON'T: Edit XML directly
24# <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
25```
26
27**Why:**
28- CLI validates package exists and resolves correct version
29- Handles transitive dependencies correctly
30- Updates lock files if present
31- Avoids typos and malformed XML
32- Works correctly with CPM
33
34---
35
36## Central Package Management (CPM)
37
38CPM centralizes all package versions in one file, eliminating version conflicts across projects.
39
40### Enable CPM
41
42Create `Directory.Packages.props` in solution root:
43
44```xml
45<Project>
46 <PropertyGroup>
47 <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
48 </PropertyGroup>
49
50 <ItemGroup>
51 <PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
52 <PackageVersion Include="Serilog" Version="4.0.0" />
53 <PackageVersion Include="xunit" Version="2.9.2" />
54 </ItemGroup>
55</Project>
56```
57
58### Project Files with CPM
59…

Excerpt shown under the repository's MIT license.

More skills in dotnet-skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates