From claude-fastapi-guide-plugin
Trace a concrete request through the FastAPI framework from ASGI receipt to response, naming every transformation step with file/line citations. Use when the user asks "what happens when I call X", "follow the path of a POST to /items", "how does a query parameter become a function argument", or any end-to-end runtime walkthrough of a specific request.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-fastapi-guide-plugin:trace-data-flowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The user wants to follow **one specific request** through the framework end-to-end: parsing, validation, dependency resolution, handler invocation, response serialization. Triggers:
The user wants to follow one specific request through the framework end-to-end: parsing, validation, dependency resolution, handler invocation, response serialization. Triggers:
/items with a JSON body?"Query(...) parameter become a function argument at runtime?"Do not use this skill for static feature explanations (no concrete request) — use explain-feature instead. Do not use it for code changes.
Reply with a numbered timeline. One step per transformation, each in this form:
N. Stage name —
path:linein: shape of the data entering the step out: shape leaving the step note: one sentence on what changed or why
Then a closing one-liner: "Validation gates" — which step rejects which kind of bad input (path coercion error vs body schema error vs dependency error). This is the most-asked follow-up; pre-answer it.
The canonical pipeline (skip stages that don't apply to the user's request):
APIRoute match in fastapi/routing.pyAPIRoute.get_route_handlersolve_dependencies — sub-deps + path/query/header/cookie extractionModelField (from _compat)await vs run_in_threadpool bridge)serialize_response → jsonable_encoder → response_classFastAPI.__call__ and middleware stackAPIRoute.get_route_handler is the heart of the per-request pipelinesolve_dependencies, request_params_to_args, request_body_to_argsget_dependant produced at startupjsonable_encoder@app.<method>("<path>") if no app was given. Note the handler signature — it determines which solve_dependencies branches matter.APIRoute.get_route_handler in fastapi/routing.py. Every step from here is one entry in the timeline.function-name @ path:line.solve_dependencies, only expand sub-dependant recursion if this request has sub-deps; otherwise write "no sub-deps" and move on.serialize_response → jsonable_encoder. Note where Pydantic model_dump is invoked through _compat (the boundary).grep -rln in tests/ for a test issuing a similar request. Cite it so the user can re-run.await request.body() enters Starlette; model.model_validate(...) enters Pydantic. Cite the call site and stop.path:line per step. A timeline without line numbers is prose, not a trace.run_in_threadpool bridge is its own step — don't elide it.solve_dependencies hits dependency_cache for a sub-dep, that's a step (and a perf-relevant detail).skills/explain-feature/SKILL.md — sibling skill for static feature explanationsskills/fastapi-dependencies-internals/SKILL.md — execution dispatch table (async-gen / sync-gen / coroutine / sync), two-phase build/solve patternCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub x1nzhe/claude-fastapi-guide-plugin --plugin claude-fastapi-guide-plugin