·
Last changedVersion:
This version passed the hardening gate. Hardening applied 7 targeted changes and preserved all other text. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 16. Review findings remaining: 1.
None
None
Expand | File | Group | Subtype | Severity | Status |
|---|
No findings available
0 findings
This skill ensures consistent and safe management of NuGet packages across .NET projects. It prioritizes using the dotnet CLI to maintain project integrity and enforces a strict verification and restoration workflow for version updates.
dotnet CLI available on your PATH.jq (JSON processor) OR PowerShell (for version verification using dotnet package search)..csproj, .props, or Directory.Packages.props files to add or remove packages. Always use dotnet add package and dotnet remove package commands..csproj) or centrally (Directory.Packages.props).dotnet restore to verify compatibility.dotnet restore and dotnet add (which also restores) run build logic and use package sources defined by the repository. Run them only in workspaces the user trusts. Before running, review the shared build property and target files and the NuGet configuration files for unexpected targets or package sources, and ask the user first if the repository is unfamiliar or anything looks unusual.Use dotnet add [<PROJECT>] package <PACKAGE_NAME> [--version <VERSION>].
Example: dotnet add src/MyProject/MyProject.csproj package Newtonsoft.Json
Before adding:
--version.After adding, report any vulnerability or deprecation warnings the tools show.
Use dotnet remove [<PROJECT>] package <PACKAGE_NAME>.
Example: dotnet remove src/MyProject/MyProject.csproj package Newtonsoft.Json
When updating a version, follow these steps:
Verify Version Existence:
Check if the version exists using the dotnet package search command with exact match and JSON formatting.
Using jq:
dotnet package search <PACKAGE_NAME> --exact-match --format json | jq -e '.searchResult[].packages[] | select(.version == "<VERSION>")'
Using PowerShell:
(dotnet package search <PACKAGE_NAME> --exact-match --format json | ConvertFrom-Json).searchResult.packages | Where-Object { $_.version -eq "<VERSION>" }
Fill these placeholders only with values that passed the input validation rule. Confirm that the matching result comes from the feed the user intends, and treat a match from an unexpected or unfamiliar source as unverified and ask the user. The search hides prerelease versions by default, so if a prerelease target does not appear, tell the user and ask them to confirm the version before editing.
Determine Version Management:
Directory.Packages.props in the solution root. If present, versions should be managed there via <PackageVersion Include="Package.Name" Version="1.2.3" />..csproj files for <PackageReference Include="Package.Name" Version="1.2.3" />.Apply Changes: Modify the identified file with the new version string.
Verify Stability:
Run dotnet restore on the project or solution. If errors occur, revert every file touched by the change and investigate.
A clean restore alone does not confirm safety: report to the user any security audit, vulnerability or deprecation warnings printed during restore, and suggest listing vulnerable and deprecated packages with the dotnet list package command.
Action: Execute dotnet add src/WebApi/WebApi.csproj package Serilog after confirming the package name with the user; when no version is given, show the resolved latest stable version and pass it with --version.
Action:
dotnet package search Newtonsoft.Json --exact-match --format json (and parse output to confirm "13.0.3" is present).Directory.Packages.props).dotnet restore.Get started with chainctlchainctl skill install public/github/nuget-manager:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/github/skills/nuget-manager:latest
MIT
HARDENING.md
LICENSE
SKILL.md