Develops production NuGet libraries with stable public APIs, SemVer, package metadata, multi-targeting, symbols, Source Link, trimming annotations, and package validation. Use for authoring/publishing a library; do not use for auditing third-party dependencies (use dependency-audit).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Nuget Package Development?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/k4ndev-nuget-package-development)
---
name: nuget-package-development
description: Develops production NuGet libraries with stable public APIs, SemVer, package metadata, multi-targeting, symbols, Source Link, trimming annotations, and package validation. Use for authoring/publishing a library; do not use for auditing third-party dependencies (use dependency-audit).
---
# NuGet Package Development
## Purpose
Ship maintainable .NET libraries with intentional public API, compatible versioning, reproducible packages, and clear consumer guidance.
## Scope
Library project setup, public API design, target frameworks, SemVer, package metadata, XML docs, analyzers, API compatibility, Source Link/symbols, trimming/AOT compatibility, and package verification.
## When to use
- User asks to create, evolve, version, or publish a NuGet package.
- A public library API change requires compatibility and release planning.
## Do not use for
- Auditing an application's third-party dependencies: use `dependency-audit`.
- Runtime framework migration: use `dotnet-migration`.
- Internal application project architecture without package consumers: use `clean-architecture`.
## Required context
Identify consumers, supported TFMs/runtimes, public API compatibility policy, package ID/owners/license, release channel, signing/source-link rules, dependencies, and trimming/AOT requirements.
## Workflow
1. Define supported consumers and compatibility promise before selecting public types or target frameworks.
2. Keep public API minimal, immutable where practical, and cancellation-friendly; avoid exposing implementation packages/types unintentionally.
3. Configure package metadata (`PackageId`, version, authors, description, license expression/file, repository URL, README, icon if used) and XML docs appropriately.
4. Use SemVer: breaking public behavior/API -> major, compatible functionality -> minor, compatible fixes -> patch; prerelease labels identify unstable releases. Follow the actual declared policy.
5. Multi-target only when consumer requirements justify it; validate API availability and behavior per TFM.
6. Enable API compatibility checks/analyzers supported by the SDK, deterministic build, Source Link, and symbol package generation; apply trimming annotations only when tested.
7. Build/package, inspect `.nupkg` contents and metadata, test installation from a local feed in a clean consumer project, and run API compatibility tests against the previous release.
8. Document support matrix, configuration, migration/breaking changes, and security/reporting policy; never publish without explicit authorization.
## Decision rules
- Public API is a long-lived contract; avoid exposing mutable collections, provider-specific types, or dependencies unless intentional.
- `PackageValidation`/API compatibility features vary by SDK; verify available properties and baseline package before configuring.
- Licensing and package signing are organization-specific; do not invent approval.
## Expected output format
Provide package/API plan, TFM rationale, versioning impact, exact project properties, package verification steps, consumer migration notes, and actions not performed (especially publishing).
## Common mistakes
- Publishing source-only build success without inspecting the `.nupkg`, using an ambiguous license value, breaking API while incrementing patch, or multi-targeting without testing every TFM.
## Edge cases
- Nullable annotations and default interface members can affect source/binary consumers differently.
- Trimming/AOT warnings are meaningful only with representative consumer publish tests.
- Strong naming, package signing, and Source Link may be mandatory in some feeds; align with consumer policy.
## Examples
See [NuGet package examples](examples.md) for package metadata and a public API compatibility gate.
## Test scenarios
- Positive: “Prepare our first NuGet library with net8.0/net10.0 support, symbols, and API compatibility checks.”
- Negative: “Find a CVE in our transitive dependency graph” routes to `dependency-audit`.
- Boundary: a new package also upgrades a vulnerable dependency; this skill owns the library package, `dependency-audit` owns dependency risk.
## Related skills
`dependency-audit`, `dotnet-migration`, `testing-quality`, `clean-architecture`, `dotnet-code-review`.