NuGet Manager

NuGet Manager

Manages NuGet packages in .NET projects by enforcing dotnet CLI use for adding or removing and a verified workflow for version updates.

Skill files1 file
SKILL.md69 lines
1
---
2
name: nuget-manager
3
description: 'Manage NuGet packages in .NET projects/solutions. Use this skill when adding, removing, or updating NuGet package versions. It enforces using `dotnet` CLI for package management and provides strict procedures for direct file edits only when updating versions.'
4
---
5
6
# NuGet Manager
7
8
## Overview
9
10
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.
11
12
## Prerequisites
13
14
- .NET SDK installed (typically .NET 8.0 SDK or later, or a version compatible with the target solution).
15
- `dotnet` CLI available on your `PATH`.
16
- `jq` (JSON processor) OR PowerShell (for version verification using `dotnet package search`).
17
18
## Core Rules
19
20
1. **NEVER** directly edit `.csproj`, `.props`, or `Directory.Packages.props` files to **add** or **remove** packages. Always use `dotnet add package` and `dotnet remove package` commands.
21
2. **DIRECT EDITING** is ONLY permitted for **changing versions** of existing packages.
22
3. **VERSION UPDATES** must follow the mandatory workflow:
23
- Verify the target version exists on NuGet.
24
- Determine if versions are managed per-project (`.csproj`) or centrally (`Directory.Packages.props`).
25
- Update the version string in the appropriate file.
26
- Immediately run `dotnet restore` to verify compatibility.
27
28
## Workflows
29
30
### Adding a Package
31
Use `dotnet add [<PROJECT>] package <PACKAGE_NAME> [--version <VERSION>]`.
32
Example: `dotnet add src/MyProject/MyProject.csproj package Newtonsoft.Json`
33
34
### Removing a Package
35
Use `dotnet remove [<PROJECT>] package <PACKAGE_NAME>`.
36
Example: `dotnet remove src/MyProject/MyProject.csproj package Newtonsoft.Json`
37
38
### Updating Package Versions
39
When updating a version, follow these steps:
40
41
1. **Verify Version Existence**:
42
Check if the version exists using the `dotnet package search` command with exact match and JSON formatting.
43
Using `jq`:
44
`dotnet package search <PACKAGE_NAME> --exact-match --format json | jq -e '.searchResult[].packages[] | select(.version == "<VERSION>")'`
45
Using PowerShell:
46
`(dotnet package search <PACKAGE_NAME> --exact-match --format json | ConvertFrom-Json).searchResult.packages | Where-Object { $_.version -eq "<VERSION>" }`
47
48
2. **Determine Version Management**:
49
- Search for `Directory.Packages.props` in the solution root. If present, versions should be managed there via `<PackageVersion Include="Package.Name" Version="1.2.3" />`.
50
- If absent, check individual `.csproj` files for `<PackageReference Include="Package.Name" Version="1.2.3" />`.
51
52
3. **Apply Changes**:
53
Modify the identified file with the new version string.
54
55
4. **Verify Stability**:
56
Run `dotnet restore` on the project or solution. If errors occur, revert the change and investigate.
57
58
## Examples
59
60
### User: "Add Serilog to the WebApi project"
61
**Action**: Execute `dotnet add src/WebApi/WebApi.csproj package Serilog`.
62
63
### User: "Update Newtonsoft.Json to 13.0.3 in the whole solution"
64
**Action**:
65
1. Verify 13.0.3 exists: `dotnet package search Newtonsoft.Json --exact-match --format json` (and parse output to confirm "13.0.3" is present).
66
2. Find where it's defined (e.g., `Directory.Packages.props`).
67
3. Edit the file to update the version.
68
4. Run `dotnet restore`.
69

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…