From engineering
Use when building FastAPI applications, async Python REST APIs, Pydantic V2 schemas, SQLAlchemy async database operations, JWT/OAuth2 authentication, async pytest testing, RFC 9457 error handling, cursor pagination, or API versioning strategies.
How this skill is triggered — by the user, by Claude, or both
Slash command
/engineering:fastapi-expertThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Specialized backend implementation guide for production-grade async Python APIs using **FastAPI 0.115+**, **Pydantic V2**, **SQLAlchemy 2.0 async**, and **Python 3.12+**.
Specialized backend implementation guide for production-grade async Python APIs using FastAPI 0.115+, Pydantic V2, SQLAlchemy 2.0 async, and Python 3.12+.
model_config, field_validator, ConfigDict)Annotated[T, Depends()] type alias pattern for all dependencieslifespan context manager — never @app.on_event (deprecated, has a double-fire bug)async def for all I/O routes; def for CPU-bound routes (FastAPI runs those in a threadpool)PyJWT for JWT — never python-jose (CVE-2024-33663, abandoned since 2022)uv for dependency management, ruff for lintingapplication/problem+json) for all error responses — see references/error-responses.mdreferences/pagination.md/v1/) — never ship unversioned public endpointsIdempotency-Key header support for non-idempotent POST/PATCH operationsRetry-After on all 429 and 503 responses| ❌ Avoid | ✅ Use Instead |
|---|---|
@app.on_event("startup/shutdown") | lifespan context manager |
python-jose / jose import | PyJWT (import jwt) |
ORJSONResponse / UJSONResponse | Default Pydantic/Rust serializer (FastAPI 0.130+) |
Column() in SQLAlchemy models | mapped_column() with Mapped[] |
orm_mode = True / class Config | model_config = ConfigDict(from_attributes=True) |
.dict() / .json() | .model_dump() / .model_dump_json() |
@pytest.mark.asyncio on every test | asyncio_mode = "auto" in pyproject.toml |
TestClient in async tests | httpx.AsyncClient with ASGITransport |
allow_origins=["*"] + allow_credentials=True | Explicit origin list |
time.sleep() in async def | await asyncio.sleep() or use def route |
pip / poetry | uv |
Optional[X] | X | None (Python 3.10+) |
200 OK with error in body | Proper 4xx/5xx + RFC 9457 application/problem+json |
{"error": {"message": ...}} custom format | RFC 9457 Problem Details |
?page=N offset pagination by default | Cursor pagination (?cursor=...) |
Verb URIs (/getUsers, /createUser) | Noun resource URIs (/users) |
| Unversioned public endpoints | /v1/ URI prefix on all routes |
| File | Contents |
|---|---|
| references/pydantic-v2.md | Schemas, validators, ConfigDict, computed_field, settings |
| references/endpoints-routing.md | Router setup, CRUD, query parameter models (0.115+), dependencies |
| references/authentication.md | PyJWT, OAuth2, RBAC, httpOnly cookies, refresh tokens |
| references/async-sqlalchemy.md | Engine, AsyncAttrs, DatabaseSessionManager, CRUD, lifespan |
| references/testing-async.md | anyio auto mode, AsyncClient, NullPool, rollback isolation |
| references/security.md | CORS, rate limiting, security headers, middleware stack |
| references/project-structure.md | Domain-based layout, app factory, module conventions |
| references/error-responses.md | RFC 9457 Problem Details, FastAPI exception handlers, status code guide |
| references/pagination.md | Cursor pagination, async SQLAlchemy keyset queries, response envelope |
| references/versioning.md | URI versioning, APIRouter prefix, breaking changes, Sunset headers |
npx claudepluginhub corticalstack/engineering --plugin engineeringProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.