api-contract

api-contract is a skill for Claude Code from zdanovichnick/dotnet-pilot. It costs 48 tokens per session (1,331 once invoked), scanned A, original, MIT.

A guide for defining the agreement between an ASP.NET Core API and its TypeScript client. It describes requests, responses, errors, required fields and generated TypeScript types from an OpenAPI document.

In plain words
What is it for?
Use it to specify API endpoints, document status codes, generate client types and keep frontend code using one central set of contract types.
Why use it?
It prevents the server and client from making different assumptions about names, optional values and error cases. Shared types make mismatches easier to catch while the API is being built.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the dotnet-pilot plugin — 19 skills, 10 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it to specify API endpoints, document status codes, generate client types and keep frontend code using one central set of contract types.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zdanovichnick/dotnet-pilot/api-contract
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zdanovichnick/dotnet-pilot --skill api-contract
Clone the repo
git clone --depth 1 https://github.com/zdanovichnick/dotnet-pilot

Made for: Claude Code.

Or install dotnet-pilot, the plugin that ships this one along with the rest of its 19 skills, 10 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-contract

README.md
[![agentmods](https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/api-contract/github.svg)](https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/api-contract)
Your own site
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/api-contract"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/api-contract/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-contract

Your own site · 80×15
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/api-contract"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/api-contract.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,331 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01331
Opus 5.5 $0.00019 $0.00532
Sonnet 5.5 $0.00010 $0.00266
Haiku 4.5 $0.00005 $0.00133

Measured 9d ago against content hash ecaae77da8a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-contract scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/api-contract/SKILL.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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>

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 101 lines · 48 tokens per session scan A ecaae77da8a3

Subscribe to this mod's changes

api-contract is a skill published in the GitHub repository zdanovichnick/dotnet-pilot (5 stars, last pushed 7d ago), licensed MIT. It adds 48 tokens to every session and 1,331 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-21.

Related

api-contract compared with skills from other repositories

api-contract next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-contractzdanovichnick/dotnet-pilotSkill57d agoMITA48Claude Code
azure-identity-tsmicrosoft/skillsSkill3.3ktodayMITA41Claude Code
nestjsericrisco/rsc-harnessSkill6915d agoMITA81Claude Code, Codex
chat-sdkvercel-labs/open-agentsSkill5.9k3mo agoMITA191Claude Code, Codex
better-authsecondsky/claude-skillsSkill257todayMITA53Claude Code
hono-routingsecondsky/claude-skillsSkill257todayMITA41Claude Code
agent-typescript-experttravisjneuman/.claudeSkill115yesterdayMITA12Claude Code