microsoft/nuget-package-upgrade
> Upgrade one or more NuGet packages from their current version to a target version across a project, several projects, a folder, a solution, or the whole repository. Use when the user wants to bump, update, or upgrade a specific NuGet package (or packages) to a given version or to the latest supported version, detect breaking API changes introduced by the new version, and fix the resulting code. User-initiated — match the user's stated package(s) and version intent.
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill nuget-package-upgrade
Upgrade one or more NuGet packages to a target version across a chosen scope, detect
source-breaking public API changes introduced between the old and new versions, and fix the
affected code.
Goal: Move the named package(s) from their current version to a target version while keeping
the scoped projects compiling and their tests passing.
This scenario is user-initiated. The user names the package(s) to upgrade and, optionally,
the target version. Do not auto-discover packages to upgrade — act on what the user asked for.
Run these stages in order:
apidiff/*.md + assessment.md; full scan is opt-in. Tool: generate_package_upgrade_assessment.plan-generation system skill to create plan.md, tasks.md, and scenario-instructions.md.This section is consumed during pre-initialization by the scenario-initializer worker. It defines the
scenario-specific parameters for this scenario.
Step 1 — Scope. Determine the scope from the user's request and normalize it to a
concrete set of projects:
.sln/.slnx) → its projects.Use get_solution_path / get_projects_info to discover and confirm the project set. Pass the
scope to the assessment tool as inputMode (solution | projects | folder) and paths.
Step 2 — Packages. Collect the package name(s) the user wants to upgrade. The user must
name at least one package. If the request is ambiguous (e.g. "update my packages"), ask the user
which specific package(s) to upgrade — do not upgrade everything implicitly.
Step 3 — Version policy. For each package, decide the target version:
version supports each scoped project's target framework and flags any project where it does
not.)
single source of truth for version selection: it resolves the newest supported version per
scoped project and reconciles across them. Run the assessment and use the version it reports — do
not call get_supported_package_version to pre-pick or preview a version for the decision.
(preview / beta / rc) versions when the user explicitly asks for a preview/prerelease — in that
case pass includePrerelease=true to the assessment tool. When the user says "latest", "newest",
or "latest stable" (or says nothing about previews), leave includePrerelease=false so a preview
is never selected. If the user named an explicit preview version, pass it as the package version
(that is always honored regardless of the flag).
Step 4 — Proceed with the confirmed scope, package list, and any user-specified versions,
passing them to initialize_scenario and then to the assessment stage.
Source branch = whatever the repo is currently on — do not substitute another branch.
A package bump is a lightweight change that belongs on whatever the user is working on now. When
computing source-control defaults during initialization, always set the source branch to the
branch the repo is currently checked out on (git branch --show-current; if HEAD is detached on a
tag/commit, use that ref) — whatever that branch is, including main/master if that is
genuinely where the user is. The point is: do not switch the source to main/master (or any
other branch) when the user is on a different branch. Only use a source branch other than the
current one if the user explicitly asks for it. The working-branch selection (new branch vs.
current branch) follows the normal pre-initialization defaults.
IMPORTANT: Load each stage's instructions file only when entering that stage (not all
upfront).
When entering this stage, load: assessment.md
Resolves and reconciles versions across the scoped projects and diffs the old→new public API of each
package into per-package apidiff/{packageId}.apidiff.md artifacts. Quick by default: skips the
expensive semantic scan (no PkgApi.* incidents) — the apidiff files plus Pkg.0001 presence
findings are the breaking-change reference. A full code scan that pinpoints exact breaking-change
locations is opt-in (fullScan=true) — always offer it to the user. Findings are written to
assessment.md (+ JSON).
When entering this stage, load: planning.md
Triages the assessment: resolves version divergence across projects (if any) and decides how to
handle each breaking change. Uses the plan-generation system skill for file format to produce
plan.md and tasks.md, and persists execution constraints in scenario-instructions.md.
When entering this stage, load: execution.md
Applies the version changes (CPM-aware) and fixes the flagged code usages, validating with builds.
User-provided version is incompatible with a project's target framework:
upgrade-options/version-reconciliation.md): pick the highest commoncompatible version, upgrade the lagging project's TFM first, or exclude that project.
Projects require different versions of the same package (divergence):
Take microsoft/nuget-package-upgrade from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.