Comprehensive Python development expertise covering modern best practices, type hints, FastAPI web development, async/await, testing, and performance optimization. Use when working on Python projects requiring guidance on: (1) Modern Python features and best practices, (2) Type hints and static typing with mypy, (3) FastAPI web development, (4) Async/await and asyncio patterns, (5) Testing with pytest, (6) Data validation with Pydantic, (7) Database integration (SQLAlchemy), (8) Project structure and dependencies, (9) Performance optimization, (10) Logging and observability, or (11) Code reviews and common errors.
From devsnpx claudepluginhub aaronbassett/agent-foundry --plugin devsThis skill uses the workspace's default tool permissions.
assets/configs/mypy.iniassets/configs/pyproject.tomlassets/configs/pytest.iniassets/configs/ruff.tomlreferences/async-patterns.mdreferences/code-review.mdreferences/common-errors.mdreferences/common-libraries.mdreferences/dependencies.mdreferences/fastapi-guide.mdreferences/performance.mdreferences/principles.mdreferences/project-structure.mdreferences/testing.mdreferences/type-hints.mdscripts/audit_dependencies.shscripts/init_python_project.shscripts/setup_logging.shSearches, 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.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Implements iterative retrieval pattern with dispatch-evaluate-refine loop to progressively gather relevant codebase context for subagents in multi-agent workflows.
Comprehensive guidance for modern Python development with focus on FastAPI, type safety, and best practices.
Getting Started
scripts/init_python_project.sh for FastAPI or package projectsWriting Code
Web Development (FastAPI)
Code Quality
Project Management
| Question | Reference |
|---|---|
| "How do I build a FastAPI app?" | fastapi-guide.md |
| "How do I add type hints?" | type-hints.md |
| "How do I use async/await?" | async-patterns.md |
| "How do I test this?" | testing.md |
| "What are Python best practices?" | principles.md |
| "How do I structure my project?" | project-structure.md |
| "What libraries should I use?" | common-libraries.md |
| "How do I manage dependencies?" | dependencies.md |
| "How do I improve performance?" | performance.md |
| "Why am I getting this error?" | common-errors.md |
Initialize Project
./scripts/init_python_project.sh my-api fastapi
cd my-api
Set Up Environment
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install fastapi uvicorn[standard] sqlalchemy pydantic
pip install pytest mypy ruff --dev
Configure Tools
assets/configs/ruff.toml for lintingassets/configs/mypy.ini for type checkingassets/configs/pytest.ini for testingStart Development
uvicorn app.main:app --reload
Visit http://localhost:8000/docs for automatic API documentation
Define Pydantic Models
from pydantic import BaseModel, EmailStr
class UserCreate(BaseModel):
username: str
email: EmailStr
password: str
class User(BaseModel):
id: int
username: str
email: EmailStr
is_active: bool = True
Create Endpoint
from fastapi import FastAPI, Depends, HTTPException
from sqlalchemy.orm import Session
app = FastAPI()
@app.post("/users/", response_model=User)
async def create_user(
user: UserCreate,
db: Session = Depends(get_db)
):
db_user = crud.create_user(db, user)
return db_user
Add Tests
from fastapi.testclient import TestClient
def test_create_user():
response = client.post(
"/users/",
json={"username": "test", "email": "test@example.com", "password": "secret"}
)
assert response.status_code == 200
assert response.json()["username"] == "test"
Type Check
mypy app/
Lint and Format
ruff check app/
ruff format app/
Run Tests
pytest --cov=app
Security Audit
./scripts/audit_dependencies.sh
Use FastAPI when:
Use Django when:
Use Flask when:
See fastapi-guide.md for comprehensive FastAPI patterns.
Always use type hints for:
Example:
from typing import Optional
def process_data(
items: list[str],
filter_fn: Optional[callable] = None
) -> dict[str, int]:
"""Process items and return counts."""
return {item: len(item) for item in items}
See type-hints.md for advanced patterns.
Use async when:
Use sync when:
See async-patterns.md for asyncio patterns.
scripts/init_python_project.shInitialize a new Python project with best practices:
Usage: ./scripts/init_python_project.sh my-project [package|fastapi]
scripts/audit_dependencies.shAudit dependencies for security vulnerabilities:
Usage: ./scripts/audit_dependencies.sh
scripts/setup_logging.shSet up structured logging with structlog:
Usage: ./scripts/setup_logging.sh
assets/configs/ruff.tomlModern Python linter and formatter configuration:
assets/configs/mypy.iniStatic type checker configuration:
assets/configs/pytest.iniTesting framework configuration:
assets/configs/pyproject.tomlComplete project configuration template:
# main.py
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI(title="My API")
class Item(BaseModel):
name: str
price: float
is_offer: bool = False
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.post("/items/")
async def create_item(item: Item):
return {"item_name": item.name, "item_price": item.price}
@app.get("/items/{item_id}")
async def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q}
Run: uvicorn main:app --reload
Docs: http://localhost:8000/docs
See fastapi-guide.md for:
Load references progressively:
Don't load all references at once—consult them as needs arise.