py-fastapi-patterns
Skill by aiskillstore
Provides FastAPI API design patterns that an AI assistant can follow. It covers dependencies, response models, error handling, route ordering, middleware and OpenAPI schemas. Aimed at Python developers building FastAPI backends.
Install py-fastapi-patterns
Built from the published package, never by AI.
git clone --depth 1 https://github.com/aiskillstore/marketplace /tmp/marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/marketplace/skills/cjharmath/py-fastapi-patterns ~/.claude/skills/py-fastapi-patternsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/aiskillstore/marketplace /tmp/marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/marketplace/skills/cjharmath/py-fastapi-patterns ~/.gemini/antigravity-cli/skills/py-fastapi-patternsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install py-fastapi-patterns in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
py-fastapi-patterns is an agent skill file of FastAPI coding patterns, published by aiskillstore. Each pattern states a problem, then shows correct and incorrect code. Topics include dependency injection for auth and database sessions, explicit response_model use, HTTP exceptions with custom exception handlers, and route ordering.
It also covers path and query parameters, request body validation with Pydantic, CORS and timing middleware, OpenAPI documentation, and router organization. It includes an HTTP status code table and grep commands to find endpoints missing response_model or possible route ordering issues. The source says the OpenAPI schema drives frontend code generation, so it targets developers whose FastAPI backends serve frontends.
Written from the project's SKILL.md and checked against it.
What it can do
- Dependency injectionShows how to share database sessions, current user and active user checks through Depends.
- Response modelsExplains using response_model to filter output fields and keep internal fields such as password hashes hidden.
- Error handlingShows HTTPException use, custom exception classes with handlers, and a status code reference table.
- Route orderingExplains that specific routes such as /users/me must come before parameterized routes.
- Parameter and body validationCovers path and query parameters, enums, and Pydantic field validators that return 422 on failure.
- MiddlewareShows CORS setup and a custom request timing middleware, with notes on middleware order.
- OpenAPI schemaDescribes documenting endpoints and fields so the generated schema stays clean for client codegen.
- Router organizationShows splitting endpoints into APIRouter modules with prefixes and tags, then including them in the app.
What you need
- Python
- FastAPI
Try asking
- Review my FastAPI endpoints for missing response_model settings.
- Show me how to add a get_current_active_user dependency in FastAPI.
- Check my route definitions for ordering problems like /users/{id} shadowing /users/me.
Good to know
- The source is a set of coding patterns, not a tool that runs code.
- Examples assume SQLModel or SQLAlchemy async sessions and OAuth2 bearer tokens.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/cjharmath/py-fastapi-patterns/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to py-fastapi-patterns
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
py-fastapi-patterns: common questions
What does py-fastapi-patterns help with?
It gives FastAPI API design guidance on endpoints, dependencies, error handling and OpenAPI schemas. The source says the schema affects frontend code generation.
Does it show why route order matters?
Yes. The source says FastAPI matches the first route, so a generic route such as /users/{user_id} placed first will catch /users/me.
Does it include commands to check my code?
Yes. It lists grep commands to find endpoints without response_model and possible route ordering issues, plus a curl command to read the OpenAPI schema.
How do I install py-fastapi-patterns?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is py-fastapi-patterns free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is py-fastapi-patterns safe to use?
It scores 65 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to py-fastapi-patterns?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
