api-design
Use when designing or reviewing a public API, exported function signature, module boundary, exported type/interface, or any contract other code depends on
npx skills add majiayu000/claude-skill-registry --skill api-design-oribarilan-97 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API and Interface Design ## Overview The headline rule, from Scott Meyers (97/55), governs everything else: **make interfaces easy to use correctly and hard to use incorrectly.** Every other decision below is a tactic for that rule — encapsulate behavior so callers can't reach past the contract, lean on the type system so wrong calls fail at compile time. This is a **rigid** skill. Run the decisions in order. If you can't satisfy one, stop and tell the user what's blocking you. ## When to invoke Invoke when you're about to: - Add or change a function/method that will be called from another module, package, service, or repo - Export a new type, interface, trait, protocol, or class - Define a request/response schema, RPC method, or message format - Publish a library, SDK, or plugin contract - Change an existing public signature (parameter order, optionality, return type, thrown errors) - Add or remove a configuration flag, CLI option, or env-var contract that other code reads - Decide what to make `public`, `internal`, `final`, `sealed`, or `private` - Review an API design, interface, or public contract for usability, correctness, or ergonomics If you're not sure whether a change i
- Overview
- When to invoke
- Non-triggers — do NOT invoke for
- API design decisions
- Make wrong code look wrong
- Encapsulate
- Use the type system
- API ergonomics
- Polymorphism over conditionals
- Red Flags
- What "done" looks like
- Principles in this skill
What does the api-design skill do?
Use when designing or reviewing a public API, exported function signature, module boundary, exported type/interface, or any contract other code depends on
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-design-oribarilan-97 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
