api-and-interface-design
Skill1 starsChanged 30 days agoMITView on GitHub
Guides stable API and interface design. Use when designing or changing API endpoints, contracts between the website and the API, module boundaries, or any public interface.
72 other projects use a version of this.
Adopted by
Most recently taken up by
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- TheAstroByte/astrobyte-agent-skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- steven123397/nexuskit-skillstheir own version, first seen Nov 1, 2026
- AgnesAI-Labs/agnet-skills-cntheir own version, first seen Nov 1, 2026
Used with
Projects with it also use constraint-driven-development, deprecation-and-migration and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 17 projects that use this
HK-hubSkilldeprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
Also in 40 projects that use this
seikaikyoSkilldoubt-driven-development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
Also in 47 projects that use this
HK-hubSkillsource-driven-development
Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
Also in 42 projects that use this
skytiger6724Skillbrainstorm-experiments-existing
Design experiments to test assumptions for an existing product — prototypes, A/B tests, spikes, and other low-effort validation methods. Use when validating assumptions, testing feature ideas cheaply, or planning product experiments.
Also in 4 projects that use this
skytiger6724Skillprioritize-assumptions
Prioritize assumptions using an Impact × Risk matrix and suggest experiments for each. Use when triaging a list of assumptions, deciding what to test first, or applying the assumption prioritization canvas.
Also in 4 projects that use this
- +2 more from skytiger6724
Other versions72 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 72
- addyosmani/agent-skills★ 114ksame name
- ollaya-dev/ollaya★ 1.4ksame name
- shashankswe2020-ux/whoop-mcp★ 174same name
- drvoss/everything-copilot-cli★ 48same name
- vinvcn/addyosmani-agent-skills-zh★ 46same name
- jmxt3/gitscape.ai★ 33same name
- sampleXbro/agentsmesh★ 27same name
- jaskirat1616/grok-skills★ 22same name
- ishandutta2007/Awesome-Agent-Skills★ 21same name
- JPeetz/agent-skills★ 14same name
62 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- browser-testing-with-devtoolsSkill
- buildSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- debugging-and-error-recoverySkill
- deploySkill
- design-motion-principlesSkill
- exploreSkill
- flow-documentSkill
- front-end-designSkill
- frontend-ui-engineeringSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- planSkill
- playwright-cliSkill
- publishSkill
- pushSkill
- security-and-hardeningSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 67 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Project rules first: If the project has .agents/rules/ (installed with the SaaS playbook), read .agents/rules/backend.md and …
- Distinctive: line 30
When database, API and website deploy one after another, the live website briefly talks to the new API.
- Distinctive: line 31
Every API change must keep working with the website that's live now.
- Distinctive: line 32
Remove or rename in two deploys: (1) add the new thing and switch the website to it.
- Distinctive: line 39
Contract first: Write the request/response schemas before the logic, so the spec and generated client exist first.
- Very specific: line 41
One response shape per endpoint: Don't return different shapes depending on conditions.
- Distinctive: line 60
Don't validate between internal functions that share types, in utilities called by validated code, or on data from your own database.
“Common” is measured: kept by at least 6 in 10 of the 67 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Adapted from addyosmani/agent-skills@1401c8b (MIT, see licenses/). Changes: default conventions (camelCase, <domain>/api/<resource>, no versioning, OpenAPI + generated client), deploy-window compatibility, auth/health rules, language-agnostic, trimmed; layered: general guidance here, playbook decisions in .agents/rules/. -->Project rules first. If the project has .agents/rules/ (installed with the SaaS playbook), read .agents/rules/backend.md and .agents/rules/deployment.md and follow them: they override this skill where they differ. Without them, follow this skill as written.
API and Interface Design
Design interfaces that are stable and hard to misuse. Applies to the website's API, module boundaries, UI component inputs, and any surface where one piece of code calls another. Internal callers are still callers: give them a contract too.
Defaults (a project's rules override these)
| Topic | Default |
| Base URL | https://<domain>/api/<resource>, same address as the website (no subdomain, no CORS) |
| Versioning | None. One version, changed only by adding. /v1 only if outside customers call the API directly |
| Casing | JSON fields and query params camelCase; enums and error codes UPPER_SNAKE; booleans is/has/can prefix |
| Contract | OpenAPI spec generated from the code's request/response schemas, committed |
| Website client | Types and client generated from the spec, never hand-written. Regenerate on every API change |
| Auth | Every endpoint declares who may call it. Default deny. Public endpoints explicitly marked public |
| Health | GET /api/health, no auth, OK when the API can serve requests. Deploy smoke checks use it |
| Errors | One shape: { "error": { "code", "message", "details?" } } |
| Lists | Paginated from the start, pageSize capped |
The deploy window
When database, API and website deploy one after another, the live website briefly talks to the new API.
- Every API change must keep working with the website that's live now. Add fields and endpoints; never rename, remove or change the type of anything the live website uses in the same deploy.
- Remove or rename in two deploys: (1) add the new thing and switch the website to it; (2) once live, check nothing still calls the old one (logs or code search), then remove it.
- Migrations follow the same rule: the old API must still work with the migrated schema.
Principles
- Every observable behaviour is a contract (Hyrum's Law): error text, ordering, timing, quirks. Expose only what you mean to; don't leak implementation details.
- One version at a time. Extend, don't fork.
- Contract first. Write the request/response schemas before the logic, so the spec and generated client exist first.
- Addition over modification. New input fields are optional. Never remove a field or change its type in place.
- One response shape per endpoint. Don't return different shapes depending on conditions. Don't mix throwing, returning null and returning
{ error }.
Errors
| Status | Meaning |
| 400 | Malformed request |
| 401 | Not authenticated |
| 403 | Authenticated but not allowed |
| 404 | Not found, including a resource that belongs to someone else |
| 409 | Conflict: duplicate, version mismatch, in-flight idempotent request |
| 422 | Validation failed (code: "VALIDATION_ERROR", field errors in details) |
| 429 | Rate limited |
| 500 | Server error; never expose internal details |
Validate at boundaries only
Validate at: API route handlers; website forms (for UX only, the API still validates); outside-service responses (always untrusted: check shape and content before using them in logic or rendering); config loading (fail fast on missing required settings).
Don't validate between internal functions that share types, in utilities called by validated code, or on data from your own database. After validation, internal code trusts the typed value.
REST patterns
- Plural nouns, no verbs:
GET/POST /api/tasks,GET/PATCH/DELETE /api/tasks/{id}, sub-resources as/api/tasks/{id}/comments. - Scope user-owned resources to the caller: someone else's
{id}returns 404, lists return only the caller's data. Add a test that proves it. - Pagination: page-based by default (
?page=1&pageSize=20&sortBy=createdAt&sortOrder=desc→{ data, pagination: { page, pageSize, totalItems, totalPages } }). Use cursors (?cursor=→nextCursor) for very large or constantly changing lists. - Filters are query params:
?status=IN_PROGRESS&createdAfter=2025-01-01. - Updates use PATCH with partial objects: only provided fields change.
DELETEis idempotent: succeeds even if already deleted.
Types
- Model distinct states as explicit variants (tagged union or a
typefield), not one shape full of optional fields. Code handling them must cover every variant; a compiler or test catches a missing case. - Separate input from output types. Never accept server-owned fields (
id,createdAt,ownerId) from the caller. - Give each kind of ID its own type where the language allows, so a
UserIdcan't pass as aTaskId.
Idempotency
State-changing endpoints either honour an idempotency key or are documented as unsafe to retry. Design for at-least-once delivery: no queue gives exactly-once across a consumer crash. When implementing an idempotency key (payments, external side effects, queue consumers), read references/idempotency.md.
Done when
- OpenAPI spec regenerated and committed; website client regenerated from it.
- Changes are additive; the live website still works with the new API.
GET /api/healthstill works.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

