Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dotnet-library-api-compat

БесплатноБез исполняемых скриптовНе проверен

Maintaining library compatibility. Binary/source compat rules, type forwarders, SemVer impact.

wshaddixот wshaddix★ 94 звезды на GitHub

Об этом скилле

dotnet-library-api-compat

Binary and source compatibility rules for .NET library authors. Covers which API changes break consumers at the binary level (assembly loading, JIT resolution) versus at the source level (compilation), how to use type forwarders for assembly reorganization without breaking consumers, and how versioning decisions map to SemVer major/minor/patch increments.

Version assumptions: .NET 8.0+ baseline. Compatibility rules apply to all .NET versions but examples target modern SDK-style projects.

Out of scope: HTTP API versioning -- see [skill:dotnet-api-versioning]. NuGet package metadata, signing, and publish workflows -- see [skill:dotnet-nuget-authoring]. Multi-TFM packaging mechanics (polyfill strategy, conditional compilation) -- see [skill:dotnet-multi-targeting]. PublicApiAnalyzers and API surface validation tooling -- see [skill:dotnet-api-surface-validation]. Roslyn analyzer configuration -- see [skill:dotnet-roslyn-analyzers].

Cross-references: [skill:dotnet-api-versioning] for HTTP API versioning, [skill:dotnet-nuget-authoring] for NuGet packaging and SemVer rules, [skill:dotnet-multi-targeting] for multi-TFM packaging and ApiCompat tooling.


Binary Compatibility

Binary compatibility means existing compiled assemblies continue to work at runtime without recompilation. A binary-breaking change causes TypeLoadException, MissingMethodException, MissingFieldException, or TypeInitializationException at runtime.

Safe Changes (Binary Compatible)

Change Why Safe
Add new public type Existing code never references it
Add new public method to non-sealed class Existing call sites resolve to their original overload
Add new overload with different parameter count Existing binaries bind to the original method token
Add optional parameter to existing method Callers compiled against the old signature have default values embedded in their IL; the runtime resolves the same method token regardless of whether the optional parameter is supplied
Widen access modifier (protected to public) Existing references remain valid at higher visibility
Add non-abstract interface member with default implementation Existing implementors inherit the default; no TypeLoadException
Remove sealed from class Removes a restriction; existing code never subclassed it
Add new enum member Existing binaries that switch on the enum simply fall through to default

Breaking Changes (Binary Incompatible)

Change Runtime Failure Example
Remove public type TypeLoadException Delete public class Widget
Remove public method MissingMethodException Remove Widget.Calculate()
Change method return type MissingMethodException int Calculate() to long Calculate()
Change method parameter types MissingMethodException void Process(int id) to void Process(long id)
Change field type MissingFieldException public int Count to public long Count
Reorder struct fields Memory layout change Breaks interop and Unsafe.As<> consumers
Add abstract member to public class TypeLoadException Existing subclasses lack the implementation
Add interface member without default implementation TypeLoadException Existing implementors lack the member
Change virtual method to non-virtual MissingMethodException for overriders Overriders compiled expecting virtual dispatch
Seal a previously unsealed class TypeLoadException Existing subclasses cannot load
Change namespace of public type TypeLoadException Unless a type forwarder is added (see below)
Remove virtual from a method MissingMethodException Consumers compiled with callvirt find no virtual slot

Default Interface Members

Default interface members (DIM) added in C# 8 allow adding members to interfaces without breaking existing implementors -- but only at the binary level:

public interface IWidget
{
    string Name { get; }

    // Binary-safe: existing implementors inherit this default
    string DisplayName => Name.ToUpperInvariant();
}

However, if a consumer explicitly casts to the interface and the runtime cannot find the default implementation (older runtime), this fails. All runtimes in the .NET 8.0+ baseline support DIMs.


Source Compatibility

Source compatibility means existing consumer code continues to compile without changes. A source-breaking change causes compiler errors or changes behavior silently (which is worse).

Common Source-Breaking Changes

Change Compiler Impact Example
Add overload causing ambiguity CS0121 (ambiguous call) Add Process(long id) when Process(int id) exists; callers passing int literal now have two candidates
Add extension method conflicting with instance method New ext
Полный SKILL.md на GitHub

Установить dotnet-library-api-compat в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл dotnet-library-api-compat?

Maintaining library compatibility. Binary/source compat rules, type forwarders, SemVer impact.

Как установить скилл dotnet-library-api-compat?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dotnet-library-api-compat запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dotnet-library-api-compat с