Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Api Design?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/andersseen-api-design)
---
name: api-design
description: Small explicit contracts and useful errors. Use when adding or changing a public function, CLI flag, file format, endpoint or exported type.
---
# API design
Treat every public function, command flag, file format, and exported type as a contract.
## Surface
Expose the smallest surface that solves the current need. Keep helpers private until a real caller
appears. Avoid making implementation details part of the contract.
## Behavior
Make inputs, outputs, ordering, defaults, and failure modes predictable. If behavior is conditional,
name the condition directly instead of hiding it behind a vague option.
## Compatibility
When changing an existing contract, look for callers, tests, generated artifacts, and docs. Decide
whether compatibility matters for the version you are working on, then migrate the whole surface
consistently.
## Errors
Errors are part of the API. Give expected failures stable types or codes, clear messages, and enough
context for the caller to recover.