← ClaudeAtlas

api-contractlisted

Audit ASP.NET controllers, Minimal API endpoints, and DTOs against their TypeScript/JavaScript consumers (hand-written fetch/axios/HttpClient services or NSwag/OpenAPI clients) for contract drift in both directions: renamed or removed JSON keys, enum values, new required fields, status codes, type changes. Reads source, reports only. Use when checking for breaking API changes, FE/BE contract sync, or a DTO or controller change before merging, including after a refactor ("check breaking change", "API có vỡ không", "FE BE còn khớp không"). Not for query performance behind the endpoint (see mgi-kit:efcore-review).
viettdann/arclight-kit · ★ 0 · API & Backend · score 65
Install: claude install-skill viettdann/arclight-kit
# API Contract Cross-reference the C# API's actual contract (routes, DTOs, status codes) against its TypeScript/JavaScript consumers and report contract drift in both directions before it reaches production. This skill does not modify code. ## Scope - **After a change** (default when the working tree or branch has changes): audit only the endpoints and DTOs the diff touches, plus every endpoint that uses a touched DTO. Get the diff with `git diff HEAD` for uncommitted work or `git diff <base>...HEAD` for a branch. - **Whole surface**: when the user asks for a full audit, or there is no diff to scope by. ## Process 1. **Find the JSON serialization rules.** Check `Program.cs` or `Startup.cs`: - Controllers and Minimal APIs have separate option sets: `AddControllers().AddJsonOptions(...)` for controllers, `ConfigureHttpJsonOptions(...)` for Minimal APIs. A setting in one doesn't apply to the other, so resolve the rules per endpoint kind. - ASP.NET Core with System.Text.Json uses camelCase property names by default. Names stay PascalCase only when `PropertyNamingPolicy = null` is set; Newtonsoft (`AddNewtonsoftJson`) follows its contract resolver. - An explicit `[JsonPropertyName("...")]` or `[JsonProperty("...")]` wins over the policy. Skip properties with `[JsonIgnore]`; `[JsonIgnore(Condition = WhenWritingNull)]` makes only that property optional in the response. - Request binding is case-insensitive by default, so casing alone rarely breaks a request. `Proper