跳到主要内容

api-breaking-change-detector 精选

Cross-references C# Web API controllers/DTOs against their TypeScript/JavaScript consumers (React, Angular, Vue, Svelte, Node.js, or hand-written/auto-generated HTTP clients like Fetch, Axios, NSwag) to catch contract drift in both directions: backend changes that break client applications (renamed/removed JSON keys, new required parameters, status code shifts) and frontend code sending fields the backend no longer reads. Works directly against source code, not exported OpenAPI spec files. Use when the user asks to check for breaking API changes, verify frontend/backend contract sync, or audit a DTO/controller change against its TypeScript/JS consumers before merging. Not for generating new API code from a spec (see openapi-to-application-code) or scaffolding new endpoints (see aspnet-minimal-api-openapi).

在 GitHub 打开

安装方式

cp -r skills/api-breaking-change-detector ~/.claude/skills/api-breaking-change-detector

把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/

整仓一次性获取:git clone --depth 1 https://github.com/github/awesome-copilot.git

依赖与权限

  • 无需 API Key
  • 需要联网访问外部服务
  • 依赖外部命令:node
  • 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
触发场景
or

SKILL.md 正文

来源 github/awesome-copilot@70ddff7 · 许可 MIT · 内容未修改

API Breaking Change Detector

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.

When to use this

Trigger when the user asks to:

  • Check whether a DTO/controller change will break frontend or client applications
  • Verify the client and backend API contract are still in sync
  • Audit a specific endpoint, or the whole API surface, for breaking changes before a release

Do not use this for:

  • Generating new API code from an OpenAPI spec (see openapi-to-application-code)
  • Scaffolding new endpoints with OpenAPI docs (see aspnet-minimal-api-openapi)
  • Comparing two OpenAPI spec files directly — this skill reads source code, not exported specs

Process

  1. Discover Global JSON & Naming Policies:
  • Check Program.cs or Startup.cs for active JSON options (e.g. JsonNamingPolicy.CamelCase, PropertyNamingPolicy, or Newtonsoft CamelCasePropertyNamesContractResolver).
  • Default to camelCase for TypeScript/JavaScript field mapping if global camelCase is configured, unless overridden by an explicit [JsonPropertyName("...")] attribute on the C# property.
  • Ignore C# properties annotated with [JsonIgnore].
  1. Identify the C# contract surface. For each Controller action in scope:
  • Route: Base [Route("...")] + action [HttpGet("...")] / [HttpPost("...")]. Normalize route parameters (e.g. {id:int} or {id:guid} $\rightarrow$ {id}).
  • Request DTO: Extract property names, types, and requirement rules:
  • Required if: annotated with [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.
  • Optional if: nullable (string?, int?), or has a default initializer.
  • Response DTO: Property names, types, and nullability.
  • Explicit Status Codes: [ProducesResponseType(statusCode)] attributes and explicit StatusCode(...) return paths.
  1. Find the matching TypeScript/JavaScript consumer (with Normalized URL Matching):
  • Auto-generated client match (high confidence): look for generated client files (NSwag/OpenAPI Generator output) and match by generated method/interface name directly.
  • Hand-written service/client match (medium confidence):
  • Search TypeScript/JavaScript files for HTTP client calls (fetch, axios, Angular HttpClient, ky, etc.) whose normalized URL pattern matches the controller's route.
  • Normalize template strings and concatenations (e.g., ${this.apiUrl}/users/${id} or baseUrl + '/users/' + userId $\rightarrow$ /users/{id}).
  • Match normalized routes against C# routes regardless of variable naming in TypeScript/JS.
  • No match found: report as "no client consumer located" rather than guessing — do not assume an endpoint is unused just because a match wasn't found statically.
  • Label every finding with which of these three methods was used to locate it.
  1. Compare backend → frontend/client (breaks the client):
  • A DTO property renamed or removed that the TypeScript/JS interface or object model still expects
  • A new required request field the client never sends
  • A response status code the client doesn't handle (e.g. controller now returns 409 Conflict, but client error handler only handles 400/500)
  • A response field's type changed (e.g. long $\rightarrow$ string, or non-nullable $\rightarrow$ nullable) in a way the client type assumes differently
  1. Compare frontend/client → backend (stale/dead client code vs. silent bugs):
  • Harmless dead field: Client sends a payload property the backend ignores without error.
  • Silently broken bug (High Severity): Client logic reads a response property that the backend no longer returns (resulting in undefined at runtime and potential application failures).
  1. Produce the report (see Output Format). This skill does not modify code.

Output Format

  1. Scope Audited — Controllers, DTOs, and TypeScript/JavaScript files audited, along with detected JSON naming policies (e.g. camelCase enabled via Program.cs).
  2. Backend → Client Breaks — Grouped by endpoint: what changed, match method used (Auto-generated / Normalized Route Match), exact impact on the client, and severity (Compilation Error vs. Silent Runtime Failure).
  3. Client → Backend Drift — Stale fields sent or expected, explicitly distinguishing harmless dead fields from silently broken client UI logic.
  4. No Consumer Found — Unmatched backend DTOs/endpoints requiring manual confirmation.
  5. Match Confidence Summary — Breakdown of findings derived from auto-generated clients vs. normalized hand-written routes vs. unmatched routes.

Guidelines

  • URL Normalization: Always strip query parameters (?status=active) and normalize path parameters (${id} / :id / {id}) before comparing routes.
  • Naming Policies: Never assume a C# property name matches a TypeScript/JS property verbatim without checking for [JsonPropertyName("...")] or global JsonNamingPolicy.CamelCase settings.
  • Modern C# Nuances: Check for C# 11 required keyword and #nullable enable annotations (string? vs string) when assessing required properties.
  • Framework Agnostic: Apply contract matching across any TypeScript or JavaScript client (Fetch, Axios, Angular, React, Vue, Svelte, Node.js).
  • Never Fabricate: If no matching client service or DTO is found, report "No consumer located via static search" — never guess a pairing based purely on loose class names.
  • Reporting Only: Do not modify code; output a scannable, actionable audit report.

质量与来源

所属仓库
github/awesome-copilot
仓库星标
4.0 万
最近更新
今天
采集时间
今天
commit
70ddff7fab9d
内容指纹
sha256:1fcd27dcb533c23
文件路径
skills/api-breaking-change-detector/SKILL.md

同仓库其它 Skill

查看全部 50 个
agentic-workflows
Route gh-aw workflow design/create/debug/upgrade requests to the right prompts.
精选 github/awesome-copilot 4.0 万 原文
Codex CLIMCP 客户端
code-review
Review pull requests for repository fit, meaningful value, trustworthy provenance, differentiation, and maintainability in awesome-copilot.
精选 github/awesome-copilot 4.0 万 原文
Codex CLIMCP 客户端
create-canvas-extension
Create or register a canvas extension in the awesome-copilot repository. Use when asked to scaffold a new canvas extension, create its plugin.json, add a reusable extension to one or more plugins, or migrate extension metadata. Extensions are reusable source under extensions/; shippable plugin manifests belong under plugins/.
精选 github/awesome-copilot 4.0 万 原文
Codex CLIMCP 客户端
acquire-codebase-knowledge
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.
精选 github/awesome-copilot 4.0 万 原文
Codex CLIMCP 客户端
acreadiness-assess
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc readiness` and hands off rendering to the @ai-readiness-reporter custom agent. Supports policies (--policy) for org-specific scoring. Use when asked to assess, audit, or score the AI readiness of a repo.
精选 github/awesome-copilot 4.0 万 原文
Codex CLIMCP 客户端
acreadiness-generate-instructions
Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS Code) plus optional per-area .instructions.md files with applyTo globs for monorepos. Use after running /acreadiness-assess to close gaps in the AI Tooling pillar.
精选 github/awesome-copilot 4.0 万 原文
Codex CLIMCP 客户端

相似 Skill

更多「编码」
access
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how do I set this up" or "who can reach me," or wants to check channel status.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
access
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the iMessage channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Check iMessage channel setup and review access policy. Use when the user asks to configure iMessage, asks "how do I set this up" or "who can reach me," or wants to know why texts aren't reaching the assistant.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
access
Manage Telegram channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Telegram channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Set up the Telegram channel — save the bot token and review access policy. Use when the user pastes a Telegram bot token, asks to configure Telegram, asks "how do I set this up" or "who can reach me," or wants to check channel status.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端