backend-api-design
Skill2 starsChanged 5 months agoMITView on GitHub
Diseño de APIs HTTP/REST y JSON: recursos, verbos, códigos de estado, versionado, paginación, idempotencia, errores estructurados, contratos documentados. Cargá al diseñar un endpoint nuevo o cambiar un contrato.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
- yueheng-rgb/codex-factorytheir own version, first seen Sep 15, 2026
- Bridev04/clauderailtheir own version, first seen May 17, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- yueheng-rgb/codex-factory★ 100same name
- ZeroTokenClaw/agents-skills★ 1same name
- Bridev04/clauderail★ 0same name
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 repository25 other files it gives its agents.
- accessibility-wcagSkill
- agent-orchestrationSkill
- backend-data-modelingSkill
- backend-observabilitySkill
- backend-performanceSkill
- blossom-carouselSkill
- browser-qaSkill
- commit-hygieneSkill
- discovery-intakeSkill
- frontend-component-patternsSkill
- geo-seoSkill
- gh-cliSkill
- glosario-vivoSkill
- llm-councilSkill
- pedido-claroSkill
- ponytailSkill
- reporte-comprensibleSkill
- sdd-flowSkill
- secure-by-defaultSkill
- security-authn-authzSkill
- security-owaspSkill
- security-secretsSkill
- security-supply-chainSkill
- turtle-protocolSkill
- ui-ux-pro-maxSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
204: No Content — éxito sin cuerpo (típico DELETE).
- Distinctive: line 48
404: Not Found — el recurso no existe.
- Distinctive: line 111
Documentá ejemplos en la spec, no solo tipos.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Backend API design
Cuándo usar
- Crear un endpoint nuevo o cambiar uno existente.
- Diseñar un contrato entre frontend y backend o entre servicios.
- Revisar un PR que toca rutas, payloads o códigos de estado.
Recursos y verbos
Pensá en recursos (sustantivos), no en acciones:
| Acción | Verbo | Ruta |
| Listar | GET | /usuarios |
| Obtener | GET | /usuarios/{id} |
| Crear | POST | /usuarios |
| Reemplazar | PUT | /usuarios/{id} |
| Modificar parcial | PATCH | /usuarios/{id} |
| Borrar | DELETE | /usuarios/{id} |
| Sub-recurso | GET | /usuarios/{id}/sesiones |
Acciones que no son CRUD: POST /usuarios/{id}/activar. No POST /activarUsuario.
Códigos de estado
Los más usados, sin inventar:
- 200 OK — éxito con cuerpo.
- 201 Created — creado, devolvé
Locationcon la URL. - 204 No Content — éxito sin cuerpo (típico
DELETE). - 400 Bad Request — payload o parámetro inválido.
- 401 Unauthorized — falta credencial o es inválida.
- 403 Forbidden — autenticado, pero no autorizado.
- 404 Not Found — el recurso no existe.
- 409 Conflict — conflicto de estado (duplicado, versión).
- 422 Unprocessable — sintaxis ok, semántica no.
- 429 Too Many Requests — rate limit.
- 500 Internal Server Error — bug nuestro.
- 503 Service Unavailable — caído / mantenimiento.
Nunca 200 con { "error": ... }. El estado va en el HTTP.
Errores estructurados
Adoptá un formato único en toda la API. Recomendado: RFC 9457 (Problem Details):
{
"type": "https://api.tu-app.com/errors/usuario-no-encontrado",
"title": "Usuario no encontrado",
"status": 404,
"detail": "No existe un usuario con id 'abc123'.",
"instance": "/usuarios/abc123"
}Incluí campos extras útiles: errors (lista de fallos por campo), traceId.
Nunca devuelvas stack traces ni nombres de tablas a un cliente.
Versionado
- En la URL (
/v1/usuarios) — simple, cacheable, visible. - O en el header (
Accept: application/vnd.tuapp.v1+json) — para puristas. - Subí versión solo en cambio incompatible. Agregar campo opcional no rompe.
Paginación
Siempre paginá listas con potencial de crecer:
GET /usuarios?cursor=eyJpZCI6MTAwfQ&limit=50Respuesta:
{ "items": [...], "next_cursor": "eyJpZCI6MTUwfQ", "limit": 50 }Cursor > offset: offset rompe si entran/salen filas. limit con tope server-side.
Idempotencia
GET,PUT,DELETEdeben ser idempotentes por contrato HTTP.POSTque crea recurso: aceptá headerIdempotency-Keyy deduplicá por N horas. Pagos, mensajes, jobs siempre idempotentes.
Filtros, orden, búsqueda
- Filtros:
?status=active&role=admin. - Orden:
?sort=-created_at(-= desc). - Búsqueda:
?q=.... Diferenciá de filtros exactos.
Validación y contrato
- Defina el contrato en OpenAPI / JSON Schema y generá tipos para el cliente.
- Validá entrada en el borde (DTO/schema), no dentro de la lógica.
- Documentá ejemplos en la spec, no solo tipos.
Reglas duras
- Sin secretos en URLs (van en headers o body).
- Sin verbos en rutas (
/getUser❌ →GET /users/{id}✅). - Sin breaking changes silenciosos. Deprecar primero (header
Deprecation,Sunset), remover después. - Toda mutación loguea quién + qué + cuándo, sin PII completa.
- Rate limit por defecto. 429 con header
Retry-After.
Validación
- Tests por endpoint: happy path + cada código de error.
- Tests E2E del contrato (Pact, Dredd, schemathesis).
- Docs actualizadas en el mismo PR que cambia el contrato.
Relacionadas
[[backend-data-modeling]] · [[backend-observability]] · [[security-authn-authz]] · [[security-owasp]]
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.

