api-design

api-design is a skill for Claude Code, Codex from jdanigo/hydraia. It costs 62 tokens per session (636 once invoked), scanned A, original, MIT.

An API design guide for defining how software services communicate, using REST, GraphQL, or gRPC. It requires the agreed interface to be written down before implementation.

In plain words
What is it for?
Use it to design or review public, partner, frontend, or internal service APIs. It covers contracts such as OpenAPI files, GraphQL schemas, and protocol buffer definitions.
Why use it?
It prevents code and documentation from describing different interfaces. It also helps teams choose one communication style and review the interface early.

Skill for Claude CodeCodex

Part of the hydraia plugin — 16 skills, 15 commands, 26 agents, 4 hooks shipped together

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/jdanigo/hydraia/api-design
Any agent
npx skills add jdanigo/hydraia --skill api-design
Clone the repo
git clone --depth 1 https://github.com/jdanigo/hydraia

Made for: Claude Code, Codex.

Or install hydraia, the plugin that ships this one along with the rest of its 16 skills, 15 commands, 26 agents, 4 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jdanigo/hydraia/api-design.svg)](https://agentmods.dev/skills/jdanigo/hydraia/api-design)
Your own site
<a href="https://agentmods.dev/skills/jdanigo/hydraia/api-design"><img src="https://agentmods.dev/badge/skills/jdanigo/hydraia/api-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 636 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00062 $0.00636
Opus 5 $0.00031 $0.00318
Sonnet 5 $0.00012 $0.00127
Haiku 4.5 $0.00006 $0.00064

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

Security

Grade A, and why

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

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-design/SKILL.md · 46 lines

How it starts

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

API Design — the contract IS the spec

Contract-first: write the machine-readable contract, review it like code, implement to it. Never code-first with docs generated after.

Style selection (decision table — pick ONE, record an ADR)

Use case Style
Public/partner API, resource-shaped, broad client base REST + OpenAPI 3.1
Product frontend with many views over the same graph, client-driven field selection GraphQL + SDL
Internal service-to-service, low latency, strong typing across languages gRPC + proto3

Ambiguous → one question to the human with the trade-off, never two styles at once without justification.

REST rules (OpenAPI 3.1)

  • Contract file in-repo: api/openapi.yaml (or the repo's existing convention). Reviewed in the same PR discipline as code.
  • Resources are plural nouns; no verbs in paths (POST /orders, not /createOrder). Consistent casing (pick kebab or snake for paths, camel for JSON; record it).
  • Methods carry semantics: GET safe, PUT/DELETE idempotent, POST for creation/actions. Idempotency keys for payment-shaped POSTs.
  • Errors: RFC 9457 application/problem+json — every operation lists its error responses in the contract. No bare 500s as design.
  • Pagination: cursor-based by default; offset only with a written justification (deep-page cost). Filtering/sorting as documented query params.
  • Versioning: choose URL prefix (/v1) or header once, record the ADR, never mix.
  • AuthN/authZ in the contract: securitySchemes + per-operation scopes/roles. An operation without a declared auth requirement is a finding, not an oversight.

GraphQL rules (SDL)

  • Schema file in-repo. Nullability is design: non-null by intent, not by default.
  • Typed errors (union results or errors interface) over throwing strings.
  • Pagination: Relay-style connections. N+1: name the dataloader plan at design time.
  • Depth/complexity limits stated in the contract docs (abuse surface).

gRPC rules (proto3)

  • Proto files versioned in-repo; packages versioned (v1).
  • Field numbers are forever: reserve removed numbers, never reuse.
  • Deadlines/timeouts and idempotency noted per RPC; streaming only with a stated reason.

Read the full file on GitHub · 46 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 · 46 lines · 0 tokens per session scan A fd11db1d17b4

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository jdanigo/hydraia (8 stars, last pushed 14d ago), licensed MIT. It adds 62 tokens to every session and 636 once invoked, about $0.0003 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.