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 — 20 skills, 14 commands, 8 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 20 skills, 14 commands, 8 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.5 $0.00059 $0.01072
Sonnet 5.5 $0.00030 $0.00536
Haiku 4.5 $0.00015 $0.00268

Measured 1mo ago against content hash 85f6233e33a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 2d ago), licensed MIT. It adds 148 tokens to every session and 2,679 once invoked, about $0.0006 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-08-31.

Related

Other skills, from other repositories

best-practices

Apply modern web development best practices for security, compatibility, and code quality. Use when asked to "apply best practices", "security audit", "modernize code", "code quality review", or "check for vulnerabilities".

addyosmani/web-quality-skills · 49 tokens

tactical-ddd

Design, refactor, analyze, and review code by applying the principles and patterns of tactical domain-driven design. Triggers on: domain modeling, aggregate design, 'entity', 'value object', 'repository', 'bounded context', 'domain event', 'domain service', code touching domain/ directories, rich domain model…

NoesisVision/nasde-toolkit · 70 tokens

api-security-scan

Review a REST/HTTP API — from its OpenAPI spec or route code — for security gaps like missing auth, broken object-level authorization, no rate limiting, and verbose errors. Reports file:line. Pure Claude Code, no signup.

Quality-Max/free-qa-skills · 53 tokens

api-security

OWASP API Security Top 10 (2023) with production Next.js App Router code — access control, authentication, input validation, rate limiting, security headers, data exposure, supply chain, SSRF, and AI tools on those APIs.

LeahyCC/claude-skills · 51 tokens

gotchas

Catches silent bugs that look right in a diff, compile clean, and pass happy-path tests: 200 OK HTML stand-ins, swallowed exceptions, state written before the async point of no return, module singletons shared across requests, Web APIs that fail without throwing, fresh-clone gaps, and tests that pass for the wrong…

LeahyCC/claude-skills · 153 tokens

code-readability

Makes code readable at the point of use: no floating (magic) numbers or strings without a name or a unit-and-why note nearby, names that carry units and meaning, small functions, shallow nesting, honest comments, and no dead code. Balanced by default: 0, 1, -1, named object properties, tests, and self-evident math are…

LeahyCC/claude-skills · 146 tokens