Api

From xoai/sage · View interactive version

Api is an AI agent skill from the GitHub repository xoai/sage. Use when designing, reviewing, or changing an HTTP, REST, or GraphQL API — endpoints, resource naming, error responses, pagination, versioning, idempotency, or API contracts between services.

How to use this skill

Skill file

api

Layer 1 — Domain Foundation (v2.0)

Corrects the 13 most common API design mistakes agents make, grounded in

5 authoritative sources:

What's Included

| Type | Count | Coverage |

|------|-------|----------|

| Patterns | 13 | Error envelope, input validation, cursor pagination, batch queries, auth-first, URL conventions, rate limiting, idempotent writes, separate representation, versioning, HTTP status codes, structured logging, health endpoints |

| Anti-patterns | 9 | Inconsistent errors, trusting input, returning all records, N+1 loops, bolt-on auth, non-idempotent creates, leaking DB internals, 200-with-error-body, no versioning plan |

| Constitution | 11 | principles |

Every pattern includes code examples showing wrong vs right approaches.

Every anti-pattern includes root cause explaining WHY agents default to the wrong behavior.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.