design-an-api

A structured guide for planning an API change inside one codebase. Here, an API means the agreed way that software parts communicate, such as function arguments, component properties, URLs, events, or module boundaries.

In plain words
What is it for?
Use it when changing a function or component interface, URL or query parameters, event data, or the boundary between modules.
Why use it?
It helps reveal existing project constraints, compare design choices, recommend one option, and test that choice for overlooked problems before implementation.

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

Made for: Claude Code, Codex.

Per session 203 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,266 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.00203 $0.06266
Opus 5 $0.00102 $0.03133
Sonnet 5 $0.00041 $0.01253
Haiku 4.5 $0.00020 $0.00627

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

Security

Grade A, and why

design-an-api 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 2d 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.

han-coding/skills/design-an-api/SKILL.md · 383 lines

How it starts

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

Project Context

  • git installed: !which git 2>/dev/null || echo "not installed"
  • current branch: !git branch --show-current 2>/dev/null || echo "no git branch"
  • default branch: !git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || echo unknown
  • CLAUDE.md: !find . -maxdepth 1 -name "CLAUDE.md" -type f
  • project-discovery.md: !find . -maxdepth 3 -name "project-discovery.md" -type f
  • personal config directory: !bash "${CLAUDE_PLUGIN_ROOT}/scripts/han-config-dir.sh" 2>/dev/null || echo "$HOME/.claude"
  • project .han/config.md: !cat .han/config.md 2>/dev/null || echo ""

As your first action, use the Read tool on .han/config.md inside the personal config directory path above. A read that returns no file is no personal configuration: continue silently. When that file or the project .han/config.md probe supplies content, apply it per config-rule.md, which governs precedence between the two files, relative-path resolution, and what to do with a file that reads but cannot be used.

Operating Principles

Read these before dispatching anything. They constrain every step below.

  • A stated goal is required, and it is the scope governor. This skill designs a contract in service of one named goal: a ticket, an issue, a written requirement, or a described capability. If no goal resolves, stop and ask for one BECAUSE without a goal there is nothing to justify the design against, and the run degrades into designing a general-purpose framework for a single consumer.
  • Every element of the contract carries a justification. Each named parameter, field, type, default, precedence rule, and failure behavior states exactly one of two things: the part of the stated goal it descends from, quoted or named; or the asked-for behavior it is a necessity of. An element that can fill neither does not enter the design. It moves to the cut list with what it would have done and why it was cut.
  • Silence never cuts a necessity. The goal is short and does not enumerate what it depends on. A goal that never mentions a caching layer justifies cutting one. The same goal's silence about invalid input, error behavior, and types does not cut those, because they are necessities of the surface it did ask for.
  • The agents own the judgment; the skill orchestrates. The skill resolves the goal and the interface, classifies size, selects the roster, fans agents out and in, runs the two human gates, and renders the design document. It produces no design content of its own.
  • The four-agent spine always runs; specialists are signal-selected. han-core:codebase-explorer, han-core:software-architect, han-core:junior-developer, and han-core:adversarial-validator run at every size BECAUSE evidence, design, questioning, and attack are the irreducible core of a contract that survives contact. Every other specialist is added only when the interface's signals warrant it and the band allows it, BECAUSE dispatching an agent whose domain the contract never touches burns tokens and pulls the design toward concerns the goal did not ask for.
  • Default to small. Start classification at small and escalate only when a higher-band signal is clearly present. Borderline signals stay at the smaller band. Under-dispatching is recoverable by re-running at a larger size; over-dispatching is not.
  • This skill changes no code. It produces a design document. Implementation is a separate, later step, normally a tdd run against this document.
  • Options before commitment. The architect produces two or three real options with one recommendation, not a single design with alternatives invented afterward to justify it. The user picks before three further agent rounds are spent refining one.
  • The design document template lives at references/api-design-template.md. The skill renders that template by filling its sections. It does not invent a structure inline.
  • The document is written for a named reader. As the skill writes the design document's synthesized prose, it sources the shared standard by invoking han-communication:readability-guidance and applies it, holding one audience above the writing: the engineer who will implement this contract and the reviewer who will approve it. Scope that frame per section so the specifics that reader needs — exact signatures, types, precedence rules, file paths — are preserved, never simplified away.

Read the full file on GitHub · 383 lines

Files

What ships with it

1 file 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. 2d ago First seen · 383 lines · 203 tokens per session scan A 6cbba93e5d9f

Subscribe to this mod's changes

design-an-api is a skill published in the GitHub repository testdouble/han (247 stars, last pushed 4d ago), licensed MIT. It adds 203 tokens to every session and 6,266 once invoked, about $0.0010 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-30.