# ${PROJECT_NAME} — Agent Context > Patterns, gotchas, and guidelines for AI agents working on this project. > **Update this file** when you discover reusable patterns or non-obvious requirements. ## Codebase Patterns - Use Pydantic models for all request/response validation - Use dependency injection (`Depends()`) for shared resources - Use `httpx.AsyncClient` for external HTTP calls - Use `BackgroundTasks` for fire-and-forget operations - Structured logging with `structlog` or `logging` ## Common Gotchas - Always run `uv sync` after pulling — dependencies may have changed - Database migrations must be run before tests that use the DB - Async tests need `@pytest.mark.asyncio` decorator ## Quality Gates **All must pass before any commit:** ```bash uv run ruff check src/ tests/ && uv run ruff format --check src/ && uv run mypy src/ && uv run pytest --cov ``` ## Key Files | File | Purpose | |------|---------| | `pyproject.toml` | Project configuration, dependencies | | `src/${PROJECT_SLUG}/main.py` | Application entry point | ## Testing Approaches - Unit tests: pytest with fixtures in `conftest.py` - API tests: `httpx.AsyncClient` with `TestClient` - Coverage minimum: 85%