Token导航 LogoToken导航

Agent Skill · 研究检索

dotnet-library-api-compat(dotnet library API compat 搜索)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

dotnet-library-api-compat 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 65,351。

总安装 282周安装 12GitHub Stars 15下载 99核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dotnet-library-api-compat(dotnet library API compat 搜索)
来源仓库:https://github.com/wshaddix/dotnet-skills
仓库路径:skills/dotnet-library-api-compat
安装命令:
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-library-api-compat
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-library-api-compat

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助 API 设计与接口文档梳理。适合生成 OpenAPI 草稿、检查字段命名或错误码。使用时需确认真实业务语义与鉴权规则。dotnet-library-api-compat 属于研究检索类 Skill,可作为该场景下的辅助能力补充。涉及接口文档时应从现有代码中提取事实。注意:不覆盖 NuGet 包版本策略等内容。

来源仓库内路径:skills/dotnet-library-api-compat

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-library-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dotnet-library-api-compat 怎么安装?

在终端执行 npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-library-api-compat。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dotnet-library-api-compat 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dotnet-library-api-compat 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dotnet-library-api-compat 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dotnet-library-api-compat 用的人多吗?

公开数据是累计安装 282 次,近一周安装 12 次,下载 99 次,GitHub 15 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dotnet-library-api-compat 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dotnet-library-api-compat

dotnet library API compat 搜索 · 本页

28215需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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)

ChangeWhy Safe
Add new public typeExisting code never references it
Add new public method to non-sealed classExisting call sites resolve to their original overload
Add new overload with different parameter countExisting binaries bind to the original method token
Add optional parameter to existing methodCallers 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 implementationExisting implementors inherit the default; no TypeLoadException
Remove sealed from classRemoves a restriction; existing code never subclassed it
Add new enum memberExisting binaries that switch on the enum simply fall through to default

Breaking Changes (Binary Incompatible)

ChangeRuntime FailureExample
Remove public typeTypeLoadExceptionDelete public class Widget
Remove public methodMissingMethodExceptionRemove Widget.Calculate()
Change method return typeMissingMethodExceptionint Calculate() to long Calculate()
Change method parameter typesMissingMethodExceptionvoid Process(int id) to void Process(long id)
Change field typeMissingFieldExceptionpublic int Count to public long Count
Reorder struct fieldsMemory layout changeBreaks interop and Unsafe.As<> consumers
Add abstract member to public classTypeLoadExceptionExisting subclasses lack the implementation
Add interface member without default implementationTypeLoadExceptionExisting implementors lack the member
Change virtual method to non-virtualMissingMethodException for overridersOverriders compiled expecting virtual dispatch
Seal a previously unsealed classTypeLoadExceptionExisting subclasses cannot load
Change namespace of public typeTypeLoadExceptionUnless a type forwarder is added (see below)
Remove virtual from a methodMissingMethodExceptionConsumers 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

ChangeCompiler ImpactExample
Add overload causing ambiguityCS0121 (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 methodNew extension hides or conflictsAdding Where() extension in a namespace the consumer imports
Change optional parameter default valueSilent behavior changevoid Log(string level = "info") to "debug" -- recompiled callers get new default
Add member to interface (even with DIM)CS0535 if consumer explicitly implements all membersConsumer using explicit interface implementation must add the new member
Remove default value from parameter (make required)CS7036 (required argument missing)Callers relying on default value must now pass it explicitly
Add required namespace importCS0246 if consumer does not importNew public types in consumer's namespace collide
Change parameter nameBreaks callers using named argumentsProcess(id: 5) fails if parameter renamed to identifier
Change class to struct (or vice versa)Breaks new() constraints, is null checks, boxing behaviorFundamental semantic change
Add new namespace that collides with existing type namesCS0104 (ambiguous reference)Adding MyLib.Tasks namespace conflicts with System.Threading.Tasks

Overload Resolution Pitfalls

Adding overloads is the most common source of source-breaking changes in libraries. The C# compiler picks the "best" overload at compile time, and a new overload can change which method wins:

// V1 -- only overload
public void Send(object message) { }

// V2 -- new overload; ALL callers passing string now bind here
public void Send(string message) { }

This is source-breaking (callers silently rebind) but binary-compatible (old compiled code still calls the object overload token).

Mitigation: When adding overloads to public APIs, prefer parameter types that do not create implicit conversion paths from existing parameter types. Use [EditorBrowsable(EditorBrowsableState.Never)] on compatibility shims that must remain for binary compatibility but should not appear in IntelliSense.

Extension Method Conflicts

Extension methods resolve at compile time based on imported namespaces. Adding a new extension method can shadow an existing instance method or conflict with extensions from other libraries:

// Library V1 ships in namespace MyLib.Extensions
public static class StringExtensions
{
    public static string Truncate(this string s, int maxLength) =>
        s.Length <= maxLength ? s : s[..maxLength];
}

// Library V2 adds to SAME namespace -- safe
// Library V2 adds to DIFFERENT namespace -- may conflict
// if consumer imports both namespaces

Mitigation: Keep extension methods in the same namespace across versions. Document any namespace additions in release notes.


Type Forwarders

Type forwarders allow moving a public type from one assembly to another without breaking existing compiled references. The original assembly contains a forwarding entry that redirects the runtime type resolver to the new location.

When to Use Type Forwarders

  • Splitting a large assembly into smaller, focused assemblies
  • Merging assemblies for packaging simplification
  • Reorganizing namespaces across assembly boundaries
  • Moving types to a shared assembly consumed by multiple packages

Adding Type Forwarders

In the original assembly (the one types are moving FROM), add forwarding attributes after moving the types to the new assembly:

// In the ORIGINAL assembly's AssemblyInfo.cs or a dedicated TypeForwarders.cs
// This tells the runtime: "Widget now lives in MyLib.Core"
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(MyLib.Core.Widget))]
[assembly: TypeForwardedTo(typeof(MyLib.Core.IWidgetFactory))]
[assembly: TypeForwardedTo(typeof(MyLib.Core.WidgetOptions))]

The original assembly must reference the destination assembly so that typeof() resolves correctly.

Receiving Type Forwarders

The destination assembly (the one types are moving TO) contains the actual type definitions. No special attributes are needed on the destination side. The [TypeForwardedFrom] attribute is optional metadata that records where the type originally lived -- useful for serialization compatibility:

// In the DESTINATION assembly -- optional but recommended for
// types that participate in serialization
using System.Runtime.CompilerServices;

namespace MyLib.Core;

[TypeForwardedFrom("MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
public class Widget
{
    public string Name { get; set; } = string.Empty;
    public decimal Price { get; set; }
}

[TypeForwardedFrom] is critical for types deserialized by BinaryFormatter, DataContractSerializer, or any serializer that encodes assembly-qualified type names. Without it, deserialization of data written by older versions will fail with TypeLoadException.

Type Forwarder Chain

Type forwarders can chain: Assembly A forwards to Assembly B, which forwards to Assembly C. The runtime follows the chain. However, keep chains short (ideally one hop) to minimize assembly loading overhead.

Multi-TFM Type Forwarder Pattern

When restructuring assemblies in a multi-TFM library, the forwarding assembly must target all TFMs that consumers might use. A common pattern:

<!-- Original assembly (MyLib.csproj) -- now just a forwarding shim -->
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
  </PropertyGroup>
  <ItemGroup>
    <ProjectReference Include="../MyLib.Core/MyLib.Core.csproj" />
  </ItemGroup>
</Project>

See [skill:dotnet-multi-targeting] for multi-TFM packaging mechanics and [skill:dotnet-nuget-authoring] for NuGet packaging of forwarding shims.


SemVer Impact Summary

Map API changes to Semantic Versioning increments. For full SemVer rules and NuGet versioning strategies, see [skill:dotnet-nuget-authoring].

Change CategorySemVerReason
Remove public type or memberMajorBinary-breaking
Change method signature (return type, parameters)MajorBinary-breaking
Add abstract member to public classMajorBinary-breaking for subclasses
Add interface member without DIMMajorBinary-breaking for implementors
Add sealed to a previously unsealed classMajorBinary-breaking for subclasses
Change struct field layoutMajorBinary-breaking for interop consumers
Change namespace without type forwarderMajorBinary-breaking
Mark member [Obsolete] (warning or error)MinorBinary-compatible; signals deprecation
Add new public typeMinorAdditive, no breaking impact
Add overload (may be source-breaking)MinorBinary-compatible; source impact is accepted at minor
Add optional parameterMinorBinary-compatible; recompilation picks up new default
Add DIM to interfaceMinorBinary-compatible; additive
Change namespace WITH type forwarderMinorBinary-compatible via forwarding
Widen access modifierMinorBinary-compatible; additive
Bug fix with no API changePatchNo public API impact
Documentation or metadata-only changePatchNo public API impact
Performance improvement with same APIPatchNo public API impact

Deprecation Lifecycle with [Obsolete]

The standard workflow for removing public API members across major versions:

ReleaseActionEffect
v2.1 (Minor)Add [Obsolete("Use Widget.CalculateAsync() instead.")]Compiler warning CS0618; existing code compiles and runs
v2.3 (Minor)Change to [Obsolete("Use Widget.CalculateAsync() instead.", error: true)]Compiler error CS0619; existing binaries still run (binary-compatible)
v3.0 (Major)Remove the member entirelyBinary-breaking; consumers must migrate
// v2.1 -- warn consumers
[Obsolete("Use CalculateAsync() instead. This method will be removed in v3.0.")]
public int Calculate() => CalculateAsync().GetAwaiter().GetResult();

// v2.3 -- block new compilation against this member
[Obsolete("Use CalculateAsync() instead. This method will be removed in v3.0.", error: true)]
public int Calculate() => CalculateAsync().GetAwaiter().GetResult();

// v3.0 -- remove the member (Major version bump)

Always include the replacement API and the planned removal version in the obsolete message so both humans and agents can migrate proactively.

Multi-TFM Binary Compatibility

Adding or removing target frameworks affects binary compatibility for consumers:

  • Adding a new TFM (e.g., adding net9.0 to an existing net8.0 package): Minor version bump. Existing consumers on net8.0 are unaffected; new consumers on net9.0 gain optimized code paths.
  • Removing a TFM (e.g., dropping netstandard2.0): Major version bump. Consumers targeting the removed TFM can no longer resolve a compatible assembly.
  • Changing the lowest supported TFM (e.g., net6.0 to net8.0): Major version bump. Consumers on the dropped TFM lose compatibility.

See [skill:dotnet-multi-targeting] for practical guidance on managing TFM additions and removals.


Compatibility Verification

Use EnablePackageValidation in your .csproj to automatically compare the current build against the previously shipped package and detect binary/source-breaking changes:

<PropertyGroup>
  <EnablePackageValidation>true</EnablePackageValidation>
  <!-- Compare against the last shipped version -->
  <PackageValidationBaselineVersion>1.2.0</PackageValidationBaselineVersion>
</PropertyGroup>

Build output flags breaking changes:

error CP0002: Member 'MyLib.Widget.Calculate()' was removed
error CP0006: Cannot change return type of 'MyLib.Widget.GetName()'

To suppress known intentional breaks, generate a suppression file:

dotnet pack /p:GenerateCompatibilitySuppressionFile=true

This produces a CompatibilitySuppressions.xml file that can be checked in. If unspecified, the SDK reads CompatibilitySuppressions.xml from the project directory automatically. To specify explicit suppression files:

<ItemGroup>
  <ApiCompatSuppressionFile Include="CompatibilitySuppressions.xml" />
</ItemGroup>

Note: ApiCompatSuppressionFile is an ItemGroup item, not a PropertyGroup property. Multiple suppression files can be included.

For deeper API surface tracking with PublicApiAnalyzers and CI enforcement workflows, see [skill:dotnet-api-surface-validation].


Agent Gotchas

  1. Do not assume adding an overload is always safe -- it is binary-compatible but can be source-breaking due to overload resolution changes. Always check for implicit conversion paths between existing and new parameter types.
  2. Do not remove public members without a major version bump -- even [Obsolete] members must be preserved until the next major version to maintain binary compatibility.
  3. Do not forget type forwarders when moving types between assemblies -- without [TypeForwardedTo], consumers get TypeLoadException at runtime. Always add forwarders in the original assembly.
  4. Do not change optional parameter default values in patch releases -- this silently changes behavior for recompiled consumers while old binaries retain the old default, creating version-dependent behavior divergence.
  5. Do not confuse binary compatibility with source compatibility -- a change can be binary-safe but source-breaking (new overload) or source-safe but binary-breaking (changing return type from int to long). Test both.
  6. Do not skip [TypeForwardedFrom] on serializable types -- serializers that encode assembly-qualified type names (DataContractSerializer, legacy BinaryFormatter) will fail to deserialize data written by older versions.
  7. Do not put ApiCompatSuppressionFile in a PropertyGroup -- it is an ItemGroup item (<ApiCompatSuppressionFile Include="..." />), not a property. Using PropertyGroup syntax silently does nothing.
  8. Do not remove a TFM from a library package without a major version bump -- consumers on the removed TFM lose compatibility with no fallback.

Prerequisites

  • .NET 8.0+ SDK
  • EnablePackageValidation MSBuild property for automated compatibility checking
  • Understanding of SemVer 2.0 conventions (see [skill:dotnet-nuget-authoring])
  • Familiarity with assembly loading and binding (strong naming concepts)

References

平台分布

Codex

37.34%
按下载量换算37

Claude

28.39%
按下载量换算28

Cursor

19.04%
按下载量换算19

Gemini CLI

10.29%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills