api-contracts

api-contracts is a skill for Claude Code from Kin9Zeus/senior-engineer-skills. It costs 148 tokens per session (2,679 once invoked), scanned A, original, MIT.

A guide to designing and documenting APIs, the interfaces that let software systems exchange data. It covers REST, GraphQL, OpenAPI, versioning, errors, pagination, retries, webhooks, and contract tests.

In plain words
What is it for?
Use it to model resources, define validation and error responses, control access, paginate and filter results, make operations safe to retry, document endpoints, limit traffic, and test compatibility.
Why use it?
It helps prevent integrations from breaking when clients depend on an endpoint's data format or behaviour, including during failures and retries.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the senior-engineer-skills plugin — 15 skills, 7 commands, 4 agents shipped together

Good fit Use it to model resources, define validation and error responses, control access, paginate and filter results, make operations safe to retry, document endpoints, limit traffic, and test compatibility.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kin9zeus/senior-engineer-skills/api-contracts
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 Kin9Zeus/senior-engineer-skills --skill api-contracts
Clone the repo
git clone --depth 1 https://github.com/Kin9Zeus/senior-engineer-skills

Made for: Claude Code.

Or install senior-engineer-skills, the plugin that ships this one along with the rest of its 15 skills, 7 commands, 4 agents.

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-contracts

README.md
[![agentmods](https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/api-contracts/github.svg)](https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/api-contracts)
Your own site
<a href="https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/api-contracts"><img src="https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/api-contracts/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-contracts

Your own site · 80×15
<a href="https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/api-contracts"><img src="https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/api-contracts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 148 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,679 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.00148 $0.02679
Opus 5 $0.00074 $0.01340
Sonnet 5 $0.00030 $0.00536
Haiku 4.5 $0.00015 $0.00268

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

Security

Grade A, and why

api-contracts 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-contracts/SKILL.md · 279 lines

How it starts

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

API Contracts

An API is a promise you cannot take back. Internal APIs can be refactored; anything a second party consumes becomes a compatibility obligation the moment the first integration ships.

Design for the consumer who is not in the room, does not read your changelog, and will retry on failure.


The seven properties of a good endpoint

Every endpoint should be:

  1. Predictable — its shape is inferable from the others.
  2. Authorised — per object, not merely authenticated.
  3. Validated — with a schema, at the boundary, rejecting unknown fields.
  4. Idempotent where it can be — safe to retry.
  5. Bounded — pagination capped, payload size capped, response time bounded.
  6. Observable — logged with a correlation id, latency and error rate measured.
  7. Documented — from the code, so it cannot drift.

An endpoint missing any of these is a finding, whatever it returns.


REST essentials

Resources are nouns; HTTP verbs are the operations.

GET    /v1/invoices                list
POST   /v1/invoices                create
GET    /v1/invoices/{id}           read
PATCH  /v1/invoices/{id}           partial update
DELETE /v1/invoices/{id}           delete
POST   /v1/invoices/{id}/void      a state transition that is not CRUD

Actions that are genuinely not CRUD get a sub-resource with POST. Do not contort them into PATCH with a magic status field, and do not invent /getInvoices.

Status codes people actually need to distinguish

Use for
200 / 201 / 204 Success; 201 with a Location on create; 204 for an empty response
202 Accepted for async processing — return a status URL
400 Malformed request
401 Not authenticated
403 Authenticated, not permitted — only when the resource's existence is not secret
404 Not found, or found but not visible to you (prefer this over 403 for other users' data)
409 Conflict — duplicate, or a state transition that is not valid now
410 Gone — removed permanently; useful in deprecation
422 Well-formed but semantically invalid (validation failures)
429 Rate limited — always with Retry-After
5xx Your fault. Never use a 4xx to hide a server error, and never a 200 with {"error": ...}

Read the full file on GitHub · 279 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 279 lines · 148 tokens per session scan A 85f6233e33a9

Subscribe to this mod's changes

api-contracts is a skill published in the GitHub repository Kin9Zeus/senior-engineer-skills (3 stars, last pushed 15d ago), licensed MIT. It adds 148 tokens to every session and 2,679 once invoked, about $0.0007 per session on Opus 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-08-31.

Related

Other skills, from other repositories

fastify-best-practices

This skill should be used when working on any Fastify project or when the user asks about Fastify best practices, conventions, or patterns. Trigger when: working on a Fastify project, creating Fastify plugins, registering routes, using decorators, organizing Fastify application structure, using @fastify/autoload…

RadOrigin-LLC/RAD-Claude-Skills · 110 tokens

fastify-hooks-lifecycle

This skill should be used when implementing Fastify hooks, understanding hook execution order, using onRequest/preParsing/preValidation/preHandler/preSerialization/onError/onSend/onResponse hooks, using onReady/onListen/onClose/onRoute/onRegister application hooks, debugging hook chain issues, adding authentication…

RadOrigin-LLC/RAD-Claude-Skills · 85 tokens

fastify-production

This skill should be used when deploying Fastify to production, configuring Fastify security headers, setting up reverse proxy with Fastify, implementing graceful shutdown, configuring @fastify/helmet, @fastify/cors, @fastify/rate-limit, trustProxy settings, Kubernetes Fastify deployment, Fastify performance tuning…

RadOrigin-LLC/RAD-Claude-Skills · 97 tokens

fastify-schemas-validation

This skill should be used when writing Fastify JSON schemas, configuring Ajv validation, using fast-json-stringify serialization, defining request body/querystring/params/headers schemas, sharing schemas with addSchema and $ref, using fluent-json-schema, configuring response schemas, handling validation errors…

RadOrigin-LLC/RAD-Claude-Skills · 87 tokens

fastify-troubleshooting

This skill should be used when debugging Fastify issues, identifying Fastify anti-patterns, diagnosing common Fastify mistakes, performing Fastify error troubleshooting, investigating request.body undefined in hook, fixing decorator shared across requests, resolving hook executing twice, handling reply already sent…

RadOrigin-LLC/RAD-Claude-Skills · 103 tokens

fastify-logging

This skill should be used when configuring Fastify logging, setting up Pino logger, using child loggers, implementing log redaction, configuring log transports, using pino-pretty for development, async logging with sonic-boom, structured JSON logging, request correlation IDs, log levels, configuring pino.final for…

RadOrigin-LLC/RAD-Claude-Skills · 81 tokens