api-designer
Installation
SKILL.md
api-designer {Architecture} (v1.0)
"An API is a contract. Design it before you code it."
Purpose
Designs REST or GraphQL APIs implemented as Firebase Cloud Functions HTTP triggers. Produces OpenAPI specs, defines versioning, and establishes rate limiting patterns. [EXPLICIT] When to use:
- Designing Cloud Functions HTTP endpoints
- Creating API contracts before implementation
Core Principles
- Law of Contract-First: OpenAPI/GraphQL schema BEFORE code. No coding without a spec. [EXPLICIT]
- Law of Versioning: URL-based versioning (
/v1/,/v2/). Never break existing consumers. [EXPLICIT] - Law of Functions: Each endpoint = one Cloud Function. Shared middleware via middleware chain. [EXPLICIT]
Core Process
Phase 1: Design
- Map FR-XXX to endpoints (CRUD operations). [EXPLICIT]
- Define request/response schemas. [EXPLICIT]
- Design auth middleware (Firebase ID token verification). [EXPLICIT]
Phase 2: Document
- Generate OpenAPI 3.0 spec or GraphQL schema. [EXPLICIT]
- Define error response format (code, message, details). [EXPLICIT]
- Document rate limiting strategy. [EXPLICIT]