fastapi-templates
Skill by wshobson · updated · ★ 42k
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. fastapi-templates is published by wshobson on GitHub.
Install fastapi-templates
Built from the published package, never by AIgit clone --depth 1 https://github.com/wshobson/agents /tmp/agents && mkdir -p ~/.claude/skills && cp -r /tmp/agents/plugins/api-scaffolding/skills/fastapi-templates ~/.claude/skills/fastapi-templatesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/wshobson/agents /tmp/agents && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agents/plugins/api-scaffolding/skills/fastapi-templates ~/.gemini/antigravity-cli/skills/fastapi-templatesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
Last commit in the past day
MIT: permissive, fine for commercial use
Clear description, installs from GitHub, 41,623 stars, original repository
No risky patterns in the files we checked
About fastapi-templates
This skill gives an AI assistant guidance for building new FastAPI projects. It proposes a recommended layout with separate folders for API routes, core configuration, models, Pydantic schemas, services, and repositories. It also covers FastAPI's built-in dependency injection through Depends, along with async route handlers, async database operations, and async background tasks.
The skill lists the packages its examples use, including fastapi, uvicorn, pydantic-settings, SQLAlchemy with asyncio, asyncpg for PostgreSQL, and PyJWT. It includes a pytest setup that uses pytest-asyncio, httpx, and an in-memory SQLite test database with dependency overrides. It is aimed at developers who want a structured starting point for async Python web APIs.
Written from the project's SKILL.md and checked against it.
What fastapi-templates can do
- Project structureSuggests a recommended folder layout for a FastAPI app with routes, services, and repositories.
- Dependency injectionUses FastAPI's Depends for database sessions, authentication, and shared logic.
- Async patternsCovers async route handlers, async database operations, background tasks, and middleware.
- Dependency listLists the pip packages used in the examples, with notes on PostgreSQL and login support.
- Async test setupProvides pytest fixtures with an async client and a dependency override for the database.
What you need
- Python with pip
- Packages from requirements.txt and requirements-dev.txt
- PostgreSQL, if using the asyncpg driver example
Weekly newsletter
Like fastapi-templates? Get the best new skills every week
The best new tools, security warnings before you install something risky, and one practical tip. Free, three minute read.
Try asking
- Set up a new FastAPI project with async SQLAlchemy and a users router
- Show me how to inject a database session into FastAPI routes with Depends
- Create pytest-asyncio tests for a FastAPI endpoint using httpx
Good to know
- Detailed worked examples are in references/details.md, which is not included in the text shown here
- The test example uses an in-memory SQLite database rather than PostgreSQL
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: plugins/api-scaffolding/skills/fastapi-templates/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md4 KB -
references/details.md13 KB
Alternatives to fastapi-templates
All alternatives →7-stage super workflow for GitHub repo audit, cleanup, PR review, and competitor analysis
Build Gradio web UIs and demos in Python. Use when creating, modifying, debugging, or answering questions about Gradio and its capabilties, components, event listeners, or layouts.
Writes the launch for an app clone: the landing page built on the positioning angle, pricing set against the original's public pricing and its users' complaints, and the App Store and Google Play listing linted against the stores' limits and copycat rules. Use when the user says "landing page", "pricing", "how much should I charge", "App Store listing", "store screenshots", "launch plan", "Product Hunt", or after /replica-brand.
Guides building end-to-end test suites with Playwright and Cypress. It is for developers who write E2E tests, debug flaky tests, or set testing standards.
Adds a self-hosted "Stargazers over time" chart to a GitHub repo's README. It generates a static SVG and refreshes it weekly with a GitHub Action. Useful when a third-party star chart shows "Requires authentication".
Splits a large pull request into smaller PRs so each one needs fewer CODEOWNERS reviewer groups. It is written for contributors to NVIDIA's Megatron-LM repository.
fastapi-templates: common questions
What does the FastAPI templates skill set up?
It describes a recommended FastAPI project layout with routes, core config, models, schemas, services, and repositories. It also gives requirements files and a sample async test setup.
Which database drivers does it use in its examples?
The examples use asyncpg for PostgreSQL with a postgresql+asyncpg URL, and aiosqlite for an in-memory SQLite test database.
How does it handle testing of async endpoints?
It uses pytest-asyncio fixtures, an httpx AsyncClient with an ASGI transport, and app.dependency_overrides to swap in a test database session.
How do I install fastapi-templates?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is fastapi-templates free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is fastapi-templates safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, 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 fastapi-templates?
Similar skills: openclaw-github-repo-commander, gradio, replica-launch, e2e-testing-patterns.
