From SoMi
Use when adding or changing an HTTP/gRPC/library API. Covers resource modeling, error shapes, versioning, idempotency, pagination, and backward compatibility. Optimizes for callers, not implementers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/somi:api-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are about to expose an interface — HTTP endpoint, gRPC method, library function. Once it has one
You are about to expose an interface — HTTP endpoint, gRPC method, library function. Once it has one caller you don't control, it's expensive to change. Design it for the caller's life, not your morning's convenience.
POST /orders to create. POST /orders/{id}/cancel only if "cancel" is a
workflow that doesn't reduce to PATCH.GET /orders (list), GET /orders/{id} (item), POST /orders (create),
PATCH /orders/{id} (partial update), DELETE /orders/{id} (remove or soft-remove).GET /orders/{id}/line-items. Stop nesting at depth 2 unless deeper is
semantically required.POST /orders/{id}/cancel if cancel isn't a state field update.Idempotency-Key header and dedupe server-side for a TTL.Pick one error envelope and use it everywhere:
{
"error": {
"code": "ORDER_NOT_FOUND",
"message": "Order with id ord_123 not found.",
"details": { "id": "ord_123" }
}
}
ORDER_NOT_FOUND — clients branch on this.{"error": ...}.| Code | When |
|---|---|
| 200 | OK (GET, PUT/PATCH that returned the resource) |
| 201 | Created (POST that created a resource — include Location header) |
| 204 | No Content (DELETE, or PUT with no body) |
| 400 | Caller sent malformed/invalid input |
| 401 | Unauthenticated |
| 403 | Authenticated but not allowed |
| 404 | Resource doesn't exist OR caller can't see it (don't leak existence) |
| 409 | Conflict — concurrent modification, duplicate, state mismatch |
| 422 | Validation failure (sometimes preferred over 400) |
| 429 | Rate limited (include Retry-After) |
| 5xx | Server fault |
Don't get cute (418). Don't reinvent (299).
Pick one and stick to it across the API:
?cursor=<opaque>&limit=N → response includes next_cursor
(or null at end).?offset=N&limit=N. Bad for inserts/deletes during iteration.?page=N&per_page=N. Same caveats as offset.Always include the next pointer in the response, not just a flag. Callers shouldn't construct pages.
?status=active&owner=u_123. Document allowed fields.?sort=created_at,-priority (prefix - for descending). Allowlist sortable fields.?fields=id,name,status for bandwidth-sensitive clients. Optional.Choose one path:
/v1/orders. Coarse but unambiguous.Accept: application/vnd.example.v1+json. Cleaner URIs, harder caching.Breaking changes require either a new version or a deprecation cycle (announce → warn → remove with months of overlap).
Document a deprecation policy: Deprecation: true header, sunset date, alternative.
2026-05-20T18:42:11Z). Never bare timestamps without timezone.ord_8f3a..., usr_2c91.... Bug reports cite IDs all the time;
prefixed IDs prevent confusion across types.429 Too Many Requests with Retry-After (seconds) and ideally X-RateLimit-Remaining,
X-RateLimit-Reset.API design is half security design. Cross-reference owasp-defense:
architecture-reviewernpx claudepluginhub skathio/somi --plugin somiCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.