packages-and-dependencies
How NuGet packages are managed with Central Package Management and a monthly update, and which packages are not allowed. Use when adding, updating or removing a package.
Install
npx skills add https://github.com/LeanMeanCleanApps/CleanMinimalApi/tree/main/.agents/skills/packages-and-dependencies
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install leanmeancleanapps-cleanminimalapi@llmmart
git clone https://github.com/LeanMeanCleanApps/CleanMinimalApi.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole leanmeancleanapps/cleanminimalapi collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Packages and dependencies
The rule
Versions live in one file, Directory.Packages.props, and project files only name the package. Packages are updated once a month, all together in one pull request. If the repository has .github/dependabot.yml, Dependabot opens that pull request. If it doesn't, update by hand: dotnet list package --outdated lists what's behind. Every package must be free and open source, with no paid or commercial licence tier.
Steps
- Look for something already in the solution or in the .NET base libraries first.
- Check the licence. MIT, Apache 2.0 and BSD are fine. Anything that needs a paid licence for some users is out.
- Add
<PackageVersion Include="Name" Version="x.y.z" />toDirectory.Packages.props, in alphabetical order. - Add
<PackageReference Include="Name" />(no version) to the project that needs it. Analysers and build-only tools getPrivateAssetsall. - A package used by Application or Infrastructure is shared code; in the template repository it must be added to all five templates.
- Build and test. The pipeline's dependency review fails on known vulnerabilities and disallowed licences.
Don't
- Put
Version=on aPackageReference. - Add MediatR, MassTransit (v9 and later), AutoMapper, FluentAssertions (v8 and later), or any other library that moved to a commercial licence. Use
Mediator,Riok.MapperlyandShouldly. - Add a package to quiet a warning or save a few lines.
- Update one package on its own between the monthly updates unless it fixes a vulnerability.
Check
dotnet restore
dotnet build
dotnet list package --vulnerable
dotnet list package --outdated
Files (cleanminimalapi)
-
SKILL.md 1.9 KB
--- name: packages-and-dependencies description: How NuGet packages are managed with Central Package Management and a monthly update, and which packages are not allowed. Use when adding, updating or removing a package. metadata: scope: shared --- # Packages and dependencies ## The rule Versions live in one file, `Directory.Packages.props`, and project files only name the package. Packages are updated once a month, all together in one pull request. If the repository has `.github/dependabot.yml`, Dependabot opens that pull request. If it doesn't, update by hand: `dotnet list package --outdated` lists what's behind. Every package must be free and open source, with no paid or commercial licence tier. ## Steps 1. Look for something already in the solution or in the .NET base libraries first. 2. Check the licence. MIT, Apache 2.0 and BSD are fine. Anything that needs a paid licence for some users is out. 3. Add `<PackageVersion Include="Name" Version="x.y.z" />` to `Directory.Packages.props`, in alphabetical order. 4. Add `<PackageReference Include="Name" />` (no version) to the project that needs it. Analysers and build-only tools get `PrivateAssets` `all`. 5. A package used by Application or Infrastructure is shared code; in the template repository it must be added to all five templates. 6. Build and test. The pipeline's dependency review fails on known vulnerabilities and disallowed licences. ## Don't - Put `Version=` on a `PackageReference`. - Add MediatR, MassTransit (v9 and later), AutoMapper, FluentAssertions (v8 and later), or any other library that moved to a commercial licence. Use `Mediator`, `Riok.Mapperly` and `Shouldly`. - Add a package to quiet a warning or save a few lines. - Update one package on its own between the monthly updates unless it fixes a vulnerability. ## Check ``` bash dotnet restore dotnet build dotnet list package --vulnerable dotnet list package --outdated ```
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.