api-contract
Skill5 starsChanged 22 days agoMITView on GitHub
The seam between an ASP.NET Core API and its TypeScript client — the contract format, generating TypeScript types from the API's OpenAPI document, and the C#-to-JSON mismatches that break the client.
20 other projects use a version of this.
Adopted by
Most recently taken up by
- Vacayy/explorertheir own version, first seen Nov 29, 2026
- Reactive-Skills/skillstheir own version, first seen Nov 29, 2026
- AmirAzy/HoNspottheir own version, first seen Nov 29, 2026
- TomorrowLM/lm-skilltheir own version, first seen Nov 22, 2026
- chatquill/claude-code-websitestheir own version, first seen Nov 22, 2026
- jDxve/avengers-kittheir own version, first seen Nov 8, 2026
Used with
Projects with it also use design-system, release-notes and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnthropicSkilldesign-system
Audit, document, or extend your design system. Use when checking for naming inconsistencies or hardcoded values across components, writing documentation for a component's variants, states, and accessibility notes, or designing a new pattern that fits the existing system.
Also in 4 projects that use this
Microsoft AzureSkillrelease-notes
Author and update release notes for Azure App Configuration libraries and providers. USE FOR: write release notes, add release note entry, update release notes, draft release notes, new version release notes, format release notes. DO NOT USE FOR: generating changelogs from git history, writing internal engineering notes.
Also in 4 projects that use this
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 3 projects that use this
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 5 projects that use this
MicrosoftSkillrelease
Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).
Also in 3 projects that use this
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- ChenyCHENYU/Robot_Admin★ 1ksame name
- Eliahhango/nullbyte-security★ 4same name
- gonimar/claude-web-studio★ 4same name
- digitaldreams/tuhin★ 3same name
- PatriotAgenticLLC/better_claude_skillz★ 3same name
- vndee/engineering-skills★ 3same name
- 1398281322-a11y/java-backend-guardrails★ 2same name
- AmirAzy/HoNspot★ 2same name
- Echo-Scion/orioncortex★ 2same name
- Echo-Scion/portable-brainvibing★ 2same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- aspnet-api-patternsSkill
- authenticationSkill
- cachingSkill
- clean-architectureSkill
- convention-learnerSkill
- dddSkill
- dotnet-project-initSkill
- ef-core-patternsSkill
- error-handlingSkill
- lean-dotnetSkill
- loggingSkill
- modern-csharpSkill
- opentelemetrySkill
- react-typescriptSkill
- resilienceSkill
- testing-dotnetSkill
- ui-ux-designSkill
- vertical-sliceSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
When the project has none, the build-time document plus openapi-typescript is the default:
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Contract
One contract, written before either side is coded. The server implements it, the client consumes it, and generated types prove afterwards that the two agree.
Contract format
State every point; a point left out is a point the two sides will guess differently.
POST /api/orders/{orderId}/notes auth: Bearer, policy "Orders.Write"
Request { "text": string (1..2000), "pinned": boolean? }
201 { "id": string (guid), "text": string, "pinned": boolean, "createdAt": string (ISO 8601) }
400 ProblemDetails + errors: { "text": ["..."] } validation failed
404 ProblemDetails order not found
409 ProblemDetails, type ".../order-closed" order is closed- Property names are the wire names (camelCase by default), not the C# names.
- Mark each property required, optional (may be absent) or nullable (present, may be
null). - List every status code the client must handle. Each one needs a UI answer.
The seam module
The client declares the contract's types in one module (for example src/api/orders.ts) and
every component imports them from there. While the API is being built, the types are written by
hand from the contract. Afterwards the module re-exports the generated types, so a mismatch is a
compiler error in one known file and not a runtime surprise in a component.
import type { components } from './schema';
export type OrderNote = components['schemas']['OrderNoteResponse'];
export type CreateOrderNote = components['schemas']['CreateOrderNoteRequest'];Generating the types
An existing script in the client's package.json wins. Use it and do not add a second generator
(openapi-typescript, orval, NSwag and hand-written fetch types do not mix).
When the project has none, the build-time document plus openapi-typescript is the default:
<!-- API .csproj -->
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="..." PrivateAssets="all" />
<PropertyGroup>
<OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>
<OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)/openapi</OpenApiDocumentsDirectory>
</PropertyGroup>dotnet build <Api.csproj>
npx openapi-typescript <path>/<ApiProject>.json -o <frontend>/src/api/schema.d.ts
npx tsc --noEmit -p <frontend>- Without
OpenApiDocumentsDirectorythe document lands inobj/, named after the project. - Adding the package is a package decision. Ask before adding it.
- Build-time generation runs the app's startup code. An API whose startup needs a live database or a secret store can fail to generate. Guard that code on the entry assembly, or fall back to the existing script.
- Generate from the document the local build produced. A script that downloads the document from a deployed environment cannot see an endpoint that is not deployed yet.
- With
openapi-fetch,createClient<paths>()types the routes too, so a wrong URL or verb is also a compiler error.
Server-side OpenAPI setup (AddOpenApi, transformers, one document per API version) is in
skills/aspnet-api-patterns/SKILL.md.
Mismatches that bite
| C# side | On the wire | TypeScript consequence |
PascalCase property | camelCase by default | A hand-typed OrderId reads undefined. A [JsonPropertyName] or a naming-policy change renames the wire field |
enum | number by default | status === 'Shipped' is never true. A string union is correct only when JsonStringEnumConverter is registered |
DateTime, DateTimeOffset, DateOnly | ISO 8601 string | The type is string, not Date. Parse at the seam. DateTime with Kind=Unspecified carries no offset, so the browser reads it as local time |
long, ulong | JSON number | Values above 2^53 lose precision in JavaScript. Send identifiers of that size as strings |
decimal | JSON number | Becomes a binary float. Do not do money arithmetic on it in the client |
Guid | string | No client-side type check beyond string |
string? vs string | nullable vs required | Follows nullable reference types. A project with nullable disabled reports everything as optional |
T? property that is omitted when null | absent, not null | prop?: T and prop: T | null are different types. Match the serializer's DefaultIgnoreCondition |
Dictionary<string, T> | object | Record<string, T>. Keys keep their original casing; the naming policy does not touch them |
| Error result | application/problem+json | The error body is ProblemDetails (type, title, status, detail, plus errors for validation), not the success type. Type both branches |
A 200 with an empty body, a 204, and a 201 with a Location header are three different
client code paths. The contract says which one.
Contract changes
The contract is fixed once both sides start. A side that needs a change stops and reports it; it does not edit its own half and continue. The other side is working from the old text.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

