Cross-references C# Web API controllers/DTOs against their TypeScript/JavaScript consumers (React, Angular, Vue, Svelte, Node.js, or hand-written/auto-generated
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-api-breaking-change-detector-6724f3971d82 ,按照其中的说明把「api-breaking-change-detector」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
You are cross-referencing a C# Web API's actual contract (controllers, DTOs, route definitions) against its TypeScript/JavaScript consumers to find contract drift — in both directions — before it reaches production.
Trigger when the user asks to:
Do not use this for:
openapi-to-application-code)aspnet-minimal-api-openapi)Discover Global JSON & Naming Policies:
Program.cs or Startup.cs for active JSON options (e.g. JsonNamingPolicy.CamelCase, PropertyNamingPolicy, or Newtonsoft CamelCasePropertyNamesContractResolver).camelCase for TypeScript/JavaScript field mapping if global camelCase is configured, unless overridden by an explicit [JsonPropertyName("...")] attribute on the C# property.[JsonIgnore].Identify the C# contract surface. For each Controller action in scope:
[Route("...")] + action [HttpGet("...")] / [HttpPost("...")]. Normalize route parameters (e.g. {id:int} or {id:guid} $\rightarrow$ {id}).[Required], [BindRequired], has the C# 11 required modifier (public required string X), or is a non-nullable value type (int, Guid, bool) without a default value.string?, int?), or has a default initializer.[ProducesResponseType(statusCode)] attributes and explicit StatusCode(...) return paths.Find the matching TypeScript/JavaScript consumer (with Normalized URL Matching):
fetch, axios, Angular HttpClient, ky, etc.) whose normalized URL pattern matches the controller's route.${this.apiUrl}/users/${id} or baseUrl + '/users/' + userId $\rightarrow$ /users/{id}).Compare backend → frontend/client (breaks the client):
long $\rightarrow$ string, or non-nullable $\rightarrow$ nullable) in a way the client type assumes differentlyCompare frontend/client → backend (stale/dead client code vs. silent bugs):
undefined at runtime and potential application failures).Produce the report (see Output Format). This skill does not modify code.
camelCase enabled via Program.cs).?status=active) and normalize path parameters (${id} / :id / {id}) before comparing routes.[JsonPropertyName("...")] or global JsonNamingPolicy.CamelCase settings.required keyword and #nullable enable annotations (string? vs string) when assessing required properties.