fastapi-dev
FastAPI engineering choices. To be used when asked to "create router", "create crud router", "add new endpoint" or similar in a fastapi codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
FastAPI engineering choices. To be used when asked to "create router", "create crud router", "add new endpoint" or similar in a fastapi codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
This skill should be used when the user asks to "update the PR", "update PR body", "update PR title", "sync PR description", "update pull request", or wants the pull request title and body to reflect the actual changes on the current branch.
Use when the user asks to implement a feature, add functionality, or build something new.
This skill should be used when the user asks to "open a browser", "navigate to a URL", "test the UI", "check a page", "browse a website", "take a screenshot", "fill a form", "click a button", or any browser automation task. Also triggered by CLAUDE.md directives like "Use 'agent-browser' when navigating".
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
This skill should be used when the user asks to "investigate something incrementally", "start a discovery journal", "journal my findings", "explore this step by step and write it down", "create a research journal", or wants to build understanding of a problem through guided, step-by-step investigation with findings persisted to a journal file.
Knowledge on how to work with Github projects. To be used when asked to "create a task in github project" or "add ticket to gh project" or similar.
| name | fastapi-dev |
| description | FastAPI engineering choices. To be used when asked to "create router", "create crud router", "add new endpoint" or similar in a fastapi codebase. |
create_app) in <module>/__init__.py or <module>/main.py (prefer the former).app.include_router. Define a helper _register_routers function colocated with create_app.<module>/exceptions.py with a base application error. Then register an exception handler via @app.exception_handler(BaseAppError) to return proper JSON responses.RequestValidationError and ValidationError are handled too and transformed to a consistent error response format.APIResponse[T], APIListResponse[T], APIErrorResponse) so the OpenAPI spec surfaces the wrapping. See references/response-schemas.md.Routers are thin HTTP boundaries. They handle authentication, authorization, query parameter parsing, and response shaping, nothing else. Business logic lives in plain functions called "operations".
UseDBSession = t.Annotated[Session, Depends(get_db_session)] — SQLAlchemy sessionUseSettings = t.Annotated[Settings, Depends(get_settings)] — Pydantic settings objectAppContext dataclass injected via Depends. Adding new cross-cutting concerns (e.g. request ID) means updating the dataclass and its factory, not every operation signature.UseX. If routers start to have many different dependencies, refactor the most common ones to a UseAppContext.Operations are plain functions (or coroutines) that receive:
ctx: AppContext as the first argument (or session and settings)They handle business logic and external service calls.
app.dependency_overridesAppContext