dotnet-api-surface-validation

Validate .NET library API surfaces with PublicApiAnalyzers, Verify snapshots, and ApiCompat gating.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-api-surface-validation-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-api-surface-validation
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/dotnet-api-surface-validation
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-api-surface-validation-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

API surface changes in libraries can slip through unnoticed, causing breaking changes in downstream projects and destabilizing releases.

Core Features & Use Cases

  • PublicApiAnalyzers tracking for shipped/unshipped APIs
  • Verify API surface snapshots for runtime validation
  • ApiCompat CI gating to block PRs with API changes
  • Multi-targeting and cross-repo usage across .NET libraries
  • PR labeling and release-note integration for API changes

Quick Start

Install the PublicApiAnalyzers package, create PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt with a #nullable enable header, and enable API validation in CI to gate breaking changes.

Frequently Asked Questions about dotnet-api-surface-validation

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

FAQPage Schema
How do I prevent breaking API surface changes in .NET libraries during CI?

Validate your .NET API surface across CI by installing the PublicApiAnalyzers package, creating PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files with a #nullable enable header, and configuring your CI pipeline to gate breaking changes using ApiCompat.

What is the best way to track shipped vs unshipped APIs in a multi-targeted .NET project?

The best way to track shipped versus unshipped APIs in a multi-targeted .NET project is using PublicApiAnalyzers to manage PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files, ensuring API compatibility across different framework targets and repositories.

Does .NET API surface validation work with snapshot testing tools?

Yes, .NET API surface validation works with snapshot testing by using Verify API surface snapshots for runtime validation, capturing the current public API state and failing tests if undocumented changes are introduced to the library.

Do I need the .NET 8.0 SDK to use Roslyn analyzers for API compatibility tracking?

Yes, you need the .NET 8.0+ SDK to use PublicApiAnalyzers for API compatibility tracking. You also need the PublicApiAnalyzers package installed and CI configuration to manage the shipped and unshipped API files effectively.

Why should I use ApiCompat gating for public API changes instead of just unit testing?

You should use ApiCompat gating because unit tests often miss public API surface changes that break downstream consumers. ApiCompat enforces compatibility by blocking PRs with unauthorized API modifications before they destabilize releases.