api-backend-developmentlisted
Install: claude install-skill jxoesneon/Ciel
# CIEL ADAPTATION: API & Backend Development (Server-Side)
This skill formalizes the development of scalable, maintainable server-side systems. it enforces resource-based REST design and a strict layered architecture.
## API Design Mandates
1. **Resource Naming**: Use plural nouns, lowercase, kebab-case (e.g., `/api/v1/team-members`).
2. **Semantic Status Codes**:
- `201 Created`: For successful POSTs.
- `422 Unprocessable Entity`: For semantically invalid data (Zod/Pydantic errors).
- `500`: Never leak details (stack traces/SQL) to the client.
3. **Pagination**: Default to Cursor-Based for large datasets; Offset-Based for admin/search.
## Layered Architecture (The 3-Layer Pattern)
- **Controller/Handler**: Request validation and response mapping. No business logic.
- **Service Layer**: Pure business orchestration. Coordinates between repositories and external APIs.
- **Repository**: Abstract data access. Maps DB rows to Domain Models.
## Performance & Optimization
- **N+1 Prevention**: Always batch fetch relationships using `IN` queries or Joins.
- **Select Specifics**: Never `SELECT *`. Only retrieve required columns.
- **Fail Gracefully**: Implement exponential backoff for all external API calls.
## Anti-Patterns
- **Verb-in-URL**: Using `/api/getUsers` instead of `GET /api/users`.
- **Impossible States**: Using boolean flag soup instead of a single `status` enum.
- **Direct DB Leaks**: Returning raw ORM/DB objects directly in the API response.