--- name: public-api-management description: 'Manage Examine public API tracking using the PublicAPI Roslyn analyzer workflow. Generate change reports (Get-PublicApiReport.ps1) and merge unshipped APIs into shipped after a release (Merge-PublicApiFiles.ps1). Use when the user wants to review API changes, generate a compatibility report, prepare for a release, or merge unshipped APIs into shipped.' compatibility: 'Requires PowerShell and dotnet SDK. Must be run from the Examine workspace root.' metadata: author: Examine version: "1.0" --- # Public API Management Skill Manages the Examine public API tracking workflow powered by the Roslyn `RS0016`/`RS0017` analyzers and two companion PowerShell scripts. ## When to Use This Skill - User asks to "generate an API report", "show API changes", "what APIs changed", or "review public API" - User asks to "merge unshipped APIs", "ship the APIs", "finalize APIs for release", or "move unshipped to shipped" - User asks "how do I use the PublicAPI scripts?" or "how does API tracking work?" - Before a release, to audit and document all API surface changes - After a release, to promote unshipped entries into shipped ## Background: How PublicAPI Tracking Works Examine uses the Roslyn **PublicAPI analyzers** (`Microsoft.CodeAnalysis.PublicApiAnalyzers`). Each project that participates contains two files: | File | Purpose | |------|---------| | `PublicAPI.Shipped.txt` | APIs that have been released in a prior version. **Do not edit by hand** — use the merge script. | | `PublicAPI.Unshipped.txt` | APIs that are new or removed since the last release. The build populates these via RS0016 (missing entry) and RS0017 (removed entry) analyzer warnings. | ### Entry format ``` #nullable enable Examine.SomeType Examine.SomeType.SomeMethod(string! arg) -> void *REMOVED*Examine.SomeType.OldMethod() -> void ``` - Lines without `*REMOVED*` are **additions** (new public API surface). - Lines starting with `*REMOVED*` are **removals** (breaking changes). - `#nullable enable` is a directive, not an API entry — both scripts ignore it. ## Available Scripts Both scripts live under `build/` at the workspace root. ### 1. `Get-PublicApiReport.ps1` — Generate a Change Report Scans all `PublicAPI.Shipped.txt` and `PublicAPI.Unshipped.txt` files under `src/`, then produces a markdown report documenting every addition and removal, grouped by project and API kind. #### Usage ```powershell # From the workspace root (default paths) .\build\Get-PublicApiReport.ps1 # Custom output location .\build\Get-PublicApiReport.ps1 -OutputPath "C:\Reports\api-changes.md" # Custom source path .\build\Get-PublicApiReport.ps1 -SourcePath "D:\Other\src" ``` #### Parameters | Parameter | Default | Description | |-----------|---------|-------------| | `-SourcePath` | `