Imported from fjpulidop/deckdex_mtg (
.cursor/skills/agents/references/examples/fastapi-app/src/AGENTS.md). Install upstream withnpx skills add fjpulidop/deckdex_mtg --skill src. Copyright stays with the author.
AGENTS.md — src
Overview
Backend services (Python)
Key Files
| File | Purpose |
|---|---|
src/config.py |
Application |
src/__init__.py |
(add description) |
src/services/__init__.py |
(add description) |
src/services/item_service.py |
(add description) |
src/services/user_service.py |
(add description) |
Golden Samples (follow these patterns)
| Pattern | Reference |
|---|---|
| Standard implementation | src/services/item_service.py |
Setup & environment
- Install:
pip install -e . - Python version: >=3.11
- Package manager: uv
- Environment variables: See .env or .env.example
Build & tests
- Typecheck:
mypy . - Format:
ruff format . - Lint:
ruff check . - Test:
pytest
Code style & conventions
- Follow PEP 8 style guide
- Use type hints for all function signatures
- Naming:
snake_casefor functions/variables,PascalCasefor classes - Docstrings: Google style, required for public APIs
- Imports: group by stdlib, third-party, local (use isort)
- Modern Python: prefer
|overUnion,listoverList
Security & safety
- Validate and sanitize all user inputs
- Use parameterized queries for database access
- Never use dynamic code execution with untrusted data
- Sensitive data: never log or expose in errors
- File paths: validate and use
pathlibfor path operations - Subprocess: use list args, avoid shell=True with user input
PR/commit checklist
- Tests pass:
pytest - Type check clean:
mypy . - Lint clean:
ruff check . - Formatted:
ruff format . - Public functions have docstrings
Patterns to Follow
Prefer looking at real code in this repo over generic examples. See Golden Samples section above for files that demonstrate correct patterns.
When stuck
- Check Python documentation: https://docs.python.org
- Review existing patterns in this codebase
- Check root AGENTS.md for project-wide conventions
- Use
python -m pydoc <module>for stdlib help