principle-api-design

principle-api-design is a skill for Claude Code from lugassawan/swe-workbench. It costs 69 tokens per session (1,218 once invoked), scanned A, original, MIT.

Guidance for designing APIs as clear contracts between software systems. It covers how interfaces evolve, how requests can be safely retried, and how data is shaped and delivered.

In plain words
What is it for?
Use it when designing REST, RPC, or event-based APIs, choosing versions, adding pagination, defining errors, or handling retries.
Why use it?
It helps prevent changes that unexpectedly break existing users and makes API behavior clearer before implementation begins.

Skill for Claude Code

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

Part of the swe-workbench plugin — 62 skills, 26 commands, 23 agents, 5 hooks shipped together

Good fit Use it when designing REST, RPC, or event-based APIs, choosing versions, adding pagination, defining errors, or handling retries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lugassawan/swe-workbench/principle-api-design
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 lugassawan/swe-workbench --skill principle-api-design
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 62 skills, 26 commands, 23 agents, 5 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 principle-api-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-api-design/github.svg)](https://agentmods.dev/skills/lugassawan/swe-workbench/principle-api-design)
Your own site
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-api-design"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-api-design/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 principle-api-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-api-design"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,218 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.00069 $0.01218
Opus 5.5 $0.00028 $0.00487
Sonnet 5.5 $0.00014 $0.00244
Haiku 4.5 $0.00007 $0.00122

Measured 3mo ago against content hash 3e5e8f175d4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

principle-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 3mo 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/principle-api-design/SKILL.md · 94 lines

How it starts

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

API Design

An API is a contract. Breaking it breaks callers. Design for evolvability from day one.

Contract-First

Design the interface before the implementation. Write the schema or proto before any code.

  • Contracts force clarity on resource modeling, field names, and error cases early.
  • If the design is painful to describe, the implementation will be painful to use.
  • API review at design time is cheap; API review after clients exist is very expensive.

Versioning

Every breaking change requires a new version. Communicate it, window it, enforce the schedule.

  • Breaking: removing a field, changing a field type, changing semantics of a status code, renaming a resource.
  • Additive (non-breaking): new optional fields, new endpoints, new enum values in response.
  • URL-path versioning (/v1/orders) — visible, cacheable, easy to route; good for major versions.
  • Header versioning (API-Version: 2024-01-01) — cleaner URLs; common for date-based schemes.
  • Set a deprecation window (minimum 6 months for external APIs) and enforce it; sunset headers signal the date.

Idempotency

Operations must be safe to retry. Network failures happen; callers will retry.

  • Safe (GET, HEAD, OPTIONS) — no side effects.
  • Idempotent (PUT, DELETE) — repeating produces the same result.
  • Non-idempotent (POST) — accept an idempotency key header; server deduplicates by key.
  • Key scope: client-generated UUID, tied to the logical operation, expires after a defined window.
  • Return the same response for a duplicate key — do not create twice, do not error.

Pagination

Never return unbounded collections. Choose the model based on query patterns.

  • Offset pagination — simple; breaks when records insert or delete during traversal; fine for small, stable sets.
  • Cursor pagination — stable under concurrent writes; opaque cursor encodes position; cannot jump to page N.
  • Always cap page size server-side; document the default and maximum.
  • Return a next_cursor or next_page token — do not expose the underlying query offset or row ID.

Read the full file on GitHub · 94 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. 3mo ago First seen · 94 lines · 69 tokens per session scan A 3e5e8f175d4d

Subscribe to this mod's changes

principle-api-design is a skill published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 1,218 once invoked, about $0.0003 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-09-03.

Related

principle-api-design compared with skills from other repositories

principle-api-design next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
principle-api-designlugassawan/swe-workbenchSkill32d agoMITA69Claude Code
code-forgetechygarg/latticeSkill219todayMITA81Claude Code
functions-developmentCrowdStrike/foundry-skillsSkill40yesterdayMITA124Claude Code
zogxobotyi/cc-foundrySkill232d agoMITB45Claude Code
dddzdanovichnick/dotnet-pilotSkill55d agoMITA36Claude Code
error-handlingzdanovichnick/dotnet-pilotSkill55d agoMITA36Claude Code
loggingzdanovichnick/dotnet-pilotSkill55d agoMITA29Claude Code