dotnet-nuget-update
Skill3 starsChanged 40 days agoMITView on GitHub
Use when the user wants to update, audit, or check NuGet package dependencies in a .NET repository. Handles both central package management (Directory.Packages.props) and project-level PackageReference. Invoke as "dotnet-nuget-update" for interactive normal mode (auto-applies patch/minor, asks about majors) or "dotnet-nuget-update yolo" for silent patch/minor-only mode. Use any time packages need updating, versions need auditing, or the user asks about outdated dependencies.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-smithSkill
- dotnet-benchmarkSkill
- dotnet-change-impactSkill
- dotnet-docfx-digestSkill
- dotnet-new-app-slnxSkill
- dotnet-new-lib-slnxSkill
- dotnet-remote-testingSkill
- dotnet-segregated-assetsSkill
- dotnet-strong-name-signingSkill
- dotnet-testSkill
- git-keep-a-changelogSkill
- git-nuget-readmeSkill
- git-nuget-release-notesSkill
- git-remote-prSkill
- git-remote-releaseSkill
- git-repo-digestSkill
- git-visual-commitsSkill
- git-visual-squash-summarySkill
- markdown-illustratorSkill
- skill-creator-agnosticSkill
- trunk-first-repoSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 20 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Use this skill when a .NET repository needs a complete dependency audit or a controlled package update pass.
- Very specific: line 29
Use scripts/Get-DependencyAudit.ps1 -RepoRoot <path> to enumerate every declaration before touching anything.
- Distinctive: line 51
Do not interrupt the user for each package.
- Distinctive: line 84
Do not report the repository as updated unless every declaration is in exactly one bucket.
- Distinctive: line 90
If a declaration lives under a modern .NET TFM condition and its pinned major matches that band, keep resolution inside that band.
- Distinctive: line 105
If the pinned version is stable, prefer stable candidates only.
- Distinctive: line 106
If the pinned version is prerelease, allow prerelease candidates for that package.
- Very specific: line 107
If the caller explicitly requests prerelease review, use -IncludePrerelease.
- Distinctive: line 114
Before changing a held or surprising pin, inspect its context.
- Very specific: line 116
Read the adjacent XML comment through the audit note field.
- Distinctive: line 117
Treat comments as maintainer intent, not decoration.
- Very specific: line 119
If an auto candidate has a note, pause and read it before applying the update.
- Very specific: line 136
Do not rewrite the file wholesale.
- Distinctive: line 152
When the repository does not use central package management:
- Very specific: line 155
update only the affected .csproj files,
- Distinctive: line 158
Do not invent central package management for a repository that does not already use it.
- Distinctive: line 162
Treat in-place dependency work as a surgical edit in a potentially dirty repository.
- Very specific: line 164
Do not overwrite a declaration whose current file value no longer matches the audited from version.
- Very specific: line 165
If scripts/Apply-PackageUpdates.ps1 reports conflict, stop and report it instead of guessing.
- Distinctive: line 166
Leave unrelated dirty files alone.
- Distinctive: line 173
Prefer the smallest deterministic validation that proves the update is safe.
- Very specific: line 177
If source selection matters, inspect feeds with scripts/Get-NuGetSources.ps1.
- Distinctive: line 178
Run the narrowest restore, build, or test command that covers the affected projects and target frameworks.
- Distinctive: line 179
If the repository already has a targeted test or validation command, use it rather than inventing one.
- Distinctive: line 181
If no code changed because every declaration was already current, say so and report the audit summary anyway.
- Distinctive: line 189
Every package actually updated, including condition or file context.
- Distinctive: line 190
Every major candidate held for approval or yolo holdback.
- Distinctive: line 192
Every note-bearing declaration that was held or required human review.
- Distinctive: line 196
If nothing changed, say that explicitly and still include the complete audit summary.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
.NET NuGet Update
Use this skill when a .NET repository needs a complete dependency audit or a controlled package update pass.
Start with the audit, not intuition
Your first deterministic step is:
pwsh -NoProfile -File "<skill-root>/scripts/Get-DependencyAudit.ps1" -RepoRoot "<repo-root>" -MaxConcurrency 8 -TimeoutSec 15For yolo runs, keep the default bounded fan-out unless the feed or repository imposes a stricter limit. Do not resolve package IDs one at a time. All independent NuGet index requests should be issued through the audit's batch lookup; only declaration classification and file edits remain ordered.
Use scripts/Get-DependencyAudit.ps1 -RepoRoot <path> to enumerate every declaration before touching anything. The skill is complete only when every declared package version is accounted for.
The bundled scripts do the mechanical work:
scripts/Get-DependencyAudit.ps1enumerates and classifies each declaration.scripts/Get-PackageGraph.ps1exposes the central-package condition graph.scripts/Get-TargetFrameworks.ps1exposes the repository TFM matrix.scripts/Resolve-NuGetVersion.ps1andscripts/Compare-Version.ps1investigate one package or version pair.scripts/Apply-PackageUpdates.ps1performs the minimal structural edit.scripts/Update-NuGetPackages.ps1keeps the audit, in-memory safe-update plan, and structural apply in one orchestration command for yolo or attended auto-update runs.scripts/Get-NuGetSources.ps1shows configured package feeds without exposing secrets.
The agent orchestrates. The scripts own the deterministic enumeration, comparison, and file edits. Dependency audits deduplicate package IDs and resolve independent NuGet version indexes with bounded parallel lookups (default concurrency: 8); repeated conditional declarations reuse the same response. Results are merged in declaration/source order, so concurrency changes elapsed time, not audit semantics. Network lookups use a bounded timeout and record failures as unresolved rows rather than retrying indefinitely.
Two modes
Normal mode
Normal mode is for an attended update run.
- Audit the whole graph first, using the audit's deduplicated bounded-parallel feed lookup.
- Auto-apply only
revision,patch,minor, and same-majorprereleasesteps. - Do not interrupt the user for each package.
- Batch all
majorcandidates into one approval question after the full audit is complete. - Preserve any deliberately held pins and explain why they were held.
Yolo mode
Yolo mode means no approval prompts, not broader authority.
- Audit the whole graph first, using the audit's deduplicated bounded-parallel feed lookup.
- Auto-apply only
revision,patch,minor, and same-majorprereleasesteps. - Hold all
majorcandidates. - Report the held majors explicitly at the end.
Yolo never means “apply majors silently,” and it never means commit or push anything.
The complete-audit invariant
The audit is not optional scaffolding. It is the work list.
For every run, ensure the summary closes:
declaredcurrentautoapprovalunresolved
The invariant is:
current + auto + approval + unresolved == declaredDo not report the repository as updated unless every declaration is in exactly one bucket. A package that appears under two different conditions is two declarations and must produce two audit rows.
TFM-band rule
Conditional central package graphs are load-bearing. Never flatten them.
If a declaration lives under a modern .NET TFM condition and its pinned major matches that band, keep resolution inside that band.
Examples:
$(TargetFramework.StartsWith('net9'))+Microsoft.Extensions.Logging9.0.0→ resolve within9.x$(TargetFramework.StartsWith('net10'))+Microsoft.EntityFrameworkCore10.0.0→ resolve within10.x$(TargetFramework.StartsWith('net9'))+Asp.Versioning.Http8.1.0→ no band restriction, because package major8does not match band9$(TargetFramework.StartsWith('net10')) OR $(TargetFramework.StartsWith('net11'))+10.0.0→ resolve within10.x, because10is one of the declared bands and matches the pinned major
The band rule is a compatibility safeguard, not a guess about package policy.
Stable versus prerelease intent
Infer package intent from the pin unless the user asks for something else.
- If the pinned version is stable, prefer stable candidates only.
- If the pinned version is prerelease, allow prerelease candidates for that package.
- If the caller explicitly requests prerelease review, use
-IncludePrerelease. - Same-major prerelease movement is an
autoclass, not an approval class.
That means 1.0.0-rc.1 → 1.0.0-rc.2 is a prerelease bump and may be auto-applied, while 13.0.3 → 14.0.0 remains approval.
History first: comments and past decisions
Before changing a held or surprising pin, inspect its context.
- Read the adjacent XML comment through the audit
notefield. - Treat comments as maintainer intent, not decoration.
- Review file or repository history when the pin looks deliberate or compatibility-sensitive.
- If an
autocandidate has a note, pause and read it before applying the update.
A version comparison can tell you what is newer. It cannot tell you why a repository deliberately stayed behind.
Structural editing only
NuGet props files and project files are structured XML, so edit them structurally and minimally.
Use scripts/Update-NuGetPackages.ps1 -RepoRoot <path> -Yolo for a yolo update pass. It applies only safe auto candidates without prompting, holds note-bearing auto candidates for review, holds majors, and reports unresolved rows. Use -DryRun to inspect the structural apply plan without writing. For manual or targeted edits, use scripts/Apply-PackageUpdates.ps1 to update only the targeted declaration. Preserve:
- conditions and item-group boundaries,
- comments and blank lines,
- package ordering,
- indentation,
- encoding,
- existing line endings.
Do not rewrite the file wholesale. Change only the relevant Version attribute or project-level <PackageReference Version="..."> value.
Central package management and project-level references
Handle both repository styles.
Central package management
When Directory.Packages.props exists:
- inspect it with
scripts/Get-PackageGraph.ps1, - audit it with
scripts/Get-DependencyAudit.ps1, - apply updates through
scripts/Apply-PackageUpdates.ps1.
Project-level package references
When the repository does not use central package management:
- audit explicit project-level
PackageReferenceversions, - update only the affected
.csprojfiles, - preserve unrelated project content.
Do not invent central package management for a repository that does not already use it.
Dirty working trees and conflicts
Treat in-place dependency work as a surgical edit in a potentially dirty repository.
- Do not overwrite a declaration whose current file value no longer matches the audited
fromversion. - If
scripts/Apply-PackageUpdates.ps1reportsconflict, stop and report it instead of guessing. - Leave unrelated dirty files alone.
- Re-run the audit after applying updates when the repository state changed materially.
A conflict is evidence that the file changed after the audit. Respect that evidence.
Validation
Prefer the smallest deterministic validation that proves the update is safe.
- Discover target frameworks with
scripts/Get-TargetFrameworks.ps1 -RepoRoot <path>. The static scanner resolves project properties through the nearest Directory.Build.props/targets and recursive explicit imports. It inventories declarations without evaluating MSBuild conditions or SDK imports; verify conditional results and unresolved tokens with project-specific MSBuild evaluation before selecting validation commands. - If source selection matters, inspect feeds with
scripts/Get-NuGetSources.ps1. - Run the narrowest restore, build, or test command that covers the affected projects and target frameworks.
- If the repository already has a targeted test or validation command, use it rather than inventing one.
If no code changed because every declaration was already current, say so and report the audit summary anyway.
Reporting
The final report must contain:
- Repository path and whether it used central or project-level package management.
- Audit summary with
declared/current/auto/approval/unresolvedcounts. - Every package actually updated, including condition or file context.
- Every major candidate held for approval or yolo holdback.
- Every unresolved package.
- Every note-bearing declaration that was held or required human review.
- Validation commands run and their outcomes.
- Any conflicts or manual follow-up required.
If nothing changed, say that explicitly and still include the complete audit summary.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

