← ClaudeAtlas

hex-restapi-applisted

Use when bootstrapping a FastAPI shell once per project, or changing request handling shared by every route — `restapi/main.py`, `restapi/error_handler.py`, `restapi/schemas/errors.py`, app lifecycle, CORS, middleware, central error translation and the HTTP status each error class maps to. Not one resource's router (`hex-restapi-endpoint`) or its wire models (`hex-restapi-schema`).
wntic/pyhouse · ★ 3 · API & Backend · score 76
Install: claude install-skill wntic/pyhouse
# Hex REST App The shell every route lands inside, and the middleware layers that wrap it. The shell is laid once per project so subsequent work (`hex-restapi-endpoint`, `hex-restapi-schema`) has somewhere to go; a middleware is added whenever a cross-cutting per-request concern appears. After bootstrap, the only file this skill ever touches again is `restapi/main.py` (when a router or a middleware is registered), and a router's line is normally folded into the consuming skill. ## When to use vs. neighbours - Laying the FastAPI entrypoint for the first time, or adding a middleware that wraps every route → this skill. - A new router added afterwards, or logic for one route → `hex-restapi-endpoint`, a thin route over an application handler that also `app.include_router(...)`s itself. - A resource's request/response models added into the `schemas/` package this skill creates → `hex-restapi-schema`. - A new domain exception is plumbed → `exception-catalog` (creates/extends `domain/exceptions.py`); the HTTP status it answers with is this skill's `STATUS_BY_ERROR`, where a refinement needs no entry of its own. - A middleware introducing a new HTTP status → this skill, *Registering a middleware's status* under `## Middleware`. - Authenticating a caller or gating a route on a role → `hex-restapi-auth`; route auth is a FastAPI dependency, not a middleware, and it is optional — this shell is complete without it. - Which error codes a route advertises → `hex-restapi-endpoint`. - Cons