rm-nuget-manager

Automate NuGet package additions, removals, and version updates via dotnet CLI.

Updated Nov 11, 2023
One-click install
npx skills add https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb --skill rm-nuget-manager
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rm-nuget-manager
Source: https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb/tree/main/.opencode/skills/rm-nuget-manager
Command: npx skills add https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb --skill rm-nuget-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill prevents inconsistent or unsafe NuGet dependency changes by centralizing package modifications through the dotnet CLI workflow described in the SKILL entry.

Core Features & Use Cases

  • Workflow Enforcement: Always use dotnet add/remove commands for package lifecycle changes and only edit manifests for version bumps.
  • Version Validation: Confirm target versions exist using dotnet package search and jq before updating Directory.Packages.props or csproj entries.
  • Restoration Assurance: Run dotnet restore immediately after edits to catch compatibility issues.
  • Use Case: Update Newtonsoft.Json to a new release by verifying the version, locating its definition in Directory.Packages.props, changing the version, and restoring the solution.

Quick Start

Ask the NuGet manager to add Serilog to src/WebApi/WebApi.csproj using dotnet add package Serilog to keep dependencies consistent.

Frequently Asked Questions about rm-nuget-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely update NuGet package versions in a .NET project?

To safely update NuGet package versions, verify the target version exists using dotnet package search, update the version in Directory.Packages.props or csproj files, and run dotnet restore immediately after to catch compatibility issues.

What is the best way to add or remove NuGet dependencies in Blazor applications?

The best way to manage NuGet dependencies in Blazor is by using dotnet add package and dotnet remove package commands to ensure project consistency, rather than manually editing the manifest files.

Do I need jq to manage NuGet packages via the dotnet CLI?

Yes, jq is required to parse the output from dotnet package search when validating that a specific target package version exists before applying it to your .NET project manifests.

How does centralized package management work with Directory.Packages.props?

Centralized package management with Directory.Packages.props involves updating version numbers in a single file rather than individual csproj files, followed by a dotnet restore to verify all dependencies are compatible.

Why should I run dotnet restore after changing NuGet package versions?

Running dotnet restore after changing NuGet package versions is necessary to immediately catch dependency compatibility issues and ensure the solution builds correctly with the new package references.

Can I use dotnet CLI to manage dependencies across multiple .NET projects?

Yes, the dotnet CLI supports managing dependencies across multiple .NET projects by applying add and remove commands per project or updating centralized manifests like Directory.Packages.props for solution-wide consistency.