dotnet-api-surface-validation

Validate .NET public API surface changes with PublicApiAnalyzers and Verify snapshots.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-api-surface-validation-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-api-surface-validation
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-api-surface-validation
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-api-surface-validation-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps .NET developers detect and manage changes to their library's public API surface, preventing accidental breaking changes and ensuring API stability across releases.

Core Features & Use Cases

  • API Surface Tracking: Uses PublicApiAnalyzers to track shipped and unshipped APIs in text files.
  • Snapshot Testing: Employs the Verify library to create and compare reflection-based API surface snapshots.
  • CI Enforcement: Integrates ApiCompat to gate pull requests on API compatibility.
  • Use Case: Ensure that a new version of your .NET library does not introduce any unintended breaking changes to its public API before it's released to consumers.

Quick Start

Configure your .NET project to use PublicApiAnalyzers by adding the necessary NuGet package and tracking files.

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 detect breaking changes in a .NET library's public API?

To detect breaking changes in a .NET public API, you can use PublicApiAnalyzers to track shipped and unshipped APIs in text files. This prevents accidental breaking changes by catching unintended modifications before release.

What is the best way to track public API surface changes in .NET 8.0?

The best way to track public API surface changes in .NET 8.0 is using the Verify snapshot pattern. It creates and compares reflection-based API surface snapshots to validate API stability across library releases.

How do I gate pull requests on API compatibility in .NET CI pipelines?

You can gate pull requests on API compatibility in .NET CI pipelines by integrating ApiCompat. This enforces API compatibility rules and prevents breaking changes from being merged into the main branch.

Does PublicApiAnalyzers work with Roslyn diagnostics for API surface validation?

Yes, PublicApiAnalyzers works with Roslyn diagnostics for API surface validation. It uses Roslyn diagnostics and reflection-based analysis to provide comprehensive public API surface management in .NET projects.

Can I use snapshot testing to validate API stability without manual inspection?

Yes, you can use snapshot testing to validate API stability without manual inspection. The Verify library automatically generates and compares reflection-based API surface snapshots to highlight differences.

When do I need to track shipped and unshipped APIs in .NET libraries?

You need to track shipped and unshipped APIs in .NET libraries when you want to manage API stability across releases. This tracking prevents accidental breaking changes and ensures consumers are not affected by unintended modifications.