api-contract-design

api-contract-design is a skill for Claude Code, Codex from chadixearth/graphyloop. It costs 79 tokens per session (1,487 once invoked), scanned A, original, MIT.

A guide for defining the agreement between a backend and the applications that call it. An API contract records request and response formats, status codes, errors, authentication, pagination, and other endpoint rules.

In plain words
What is it for?
Use it before building a feature with a backend and client, when adding or changing an endpoint, or when changing fields, errors, filtering, pagination, or versioning rules.
Why use it?
It prevents the backend, frontend, and tests from assuming different data shapes or behaviors. This is especially important when several people work on connected parts at the same time.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/chadixearth/graphyloop/api-contract-design
Any agent
npx skills add chadixearth/graphyloop --skill api-contract-design
Clone the repo
git clone --depth 1 https://github.com/chadixearth/graphyloop

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/chadixearth/graphyloop/api-contract-design.svg)](https://agentmods.dev/skills/chadixearth/graphyloop/api-contract-design)
Your own site
<a href="https://agentmods.dev/skills/chadixearth/graphyloop/api-contract-design"><img src="https://agentmods.dev/badge/skills/chadixearth/graphyloop/api-contract-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,487 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00079 $0.01487
Opus 5 $0.00039 $0.00744
Sonnet 5 $0.00016 $0.00297
Haiku 4.5 $0.00008 $0.00149

Measured 3d ago against content hash b3b2d7a6e663, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-contract-design scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- `curl` the real endpoint and diff the body against the contract for the fields
skills/api-contract-design/SKILL.md · 128 lines

How it starts

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

API contract design

Parallel lanes fail at the seam: the backend returns {data: {...}}, the frontend was written against {...}, and the tests mock a third shape. Freezing the contract first is what makes wave-style parallel work safe (see graphyloop-waves) — this skill is what "frozen" means in practice.

When to activate

  • Wave 0 / contract stage of any feature with a backend and a client.
  • Adding an endpoint, or changing one that already has callers.
  • A field rename, a nullable-to-required change, an error-shape change.
  • "The frontend is broken but the API works" — usually a contract drift.

The contract artifact

A contract is a file in the repo, not a paragraph in chat. One of:

  • OpenAPI/JSON Schema (openapi.yaml) — best when clients are generated from it.
  • A shared schema module (zod/valibot/pydantic) imported by both handler and client — the type checker becomes the enforcer.
  • A typed client + a fixtures file consumed by the tests.

Whichever you pick, it must state per endpoint: method + path · auth + required role/scope · path/query params with types and defaults · request body schema · success status + response schema · every error status with its code · idempotency and rate-limit behavior. Anything not written down is not part of the contract and will be implemented differently by each lane.

Shapes and naming

  • One envelope for the whole API, chosen once: either bare resources ({"id": ...}) or wrapped ({"data": ..., "meta": ...}). Mixing them per endpoint is the single most common drift.
  • Consistent casing (snake_case or camelCase) across every payload — including nested objects and error fields. Pick one; a mapper at the boundary if the database disagrees.
  • Timestamps: ISO 8601 UTC strings (2026-08-16T14:03:00Z). Money: integer minor units or a decimal string plus a currency — never a float. Ids: string in JSON even when numeric in the database.
  • Nullable vs absent is a decision, not an accident: prefer explicit null for "known empty", omit only for "not requested" (sparse fieldsets).
  • Collections always return an object, never a bare top-level array — you will need to add meta later, and an array cannot grow.
  • Enums are closed and documented; clients must tolerate an unknown value without crashing (render a fallback).

Read the full file on GitHub · 128 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. 3d ago First seen · 128 lines · 79 tokens per session scan A b3b2d7a6e663

Subscribe to this mod's changes

api-contract-design is a skill published in the GitHub repository chadixearth/graphyloop (2 stars, last pushed 17d ago), licensed MIT. It adds 79 tokens to every session and 1,487 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

agent-code-analyzer

Agent skill for code-analyzer - invoke with $agent-code-analyzer.

ruvnet/ruflo · 19 tokens

agui-dotnet-streaming-chat

Get started with the AG-UI .NET SDK: bootstrap and run your first streaming-chat app (client + server) with the AG-UI .NET NuGet packages (AGUI.Client, AGUI.Server, AGUI.Formatting, AGUI.Abstractions). USE FOR: which packages to install and how to wire them; constructing an AGUIChatClient against an endpoint and…

ag-ui-protocol/ag-ui · 223 tokens

agui-dotnet-sample-step

Add a GettingStarted sample Step (a Server/Client pair) to the AG-UI .NET SDK that demonstrates one protocol feature the way we want users to write it. USE FOR: adding a new samples/GettingStarted/StepNN Server+Client pair, wiring it into AGUI.slnx and the integration-test project, giving it a deterministic…

ag-ui-protocol/ag-ui · 168 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

revdiff-plan

Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…

umputun/revdiff · 84 tokens

flow-next-tracker-sync

Project a flow-next spec to a tracker issue (Linear, GitHub, GitLab, Jira) and reconcile two-way. Use when asked to sync to a tracker. NOT plan-sync.

gmickel/flow-next · 44 tokens