Python Project Scaffolder
Create a properly structured Python project with modern tooling.
Process
Step 1: Gather Requirements
Ask about:
- Type: CLI tool, web API, library/package, data pipeline, automation script?
- Framework: FastAPI, Django, Flask, Click, Typer, plain Python?
- Database: PostgreSQL, SQLite, MongoDB, none?
- Testing: pytest (recommended), unittest?
- Package manager: uv (recommended), poetry, pip?
Step 2: Create Structure
Adapt to project type. Example for FastAPI:
project/
├── src/
│ └── project_name/
│ ├── __init__.py
│ ├── main.py # App entrypoint
│ ├── config.py # Settings via pydantic-settings
│ ├── models/ # Database models
│ ├── routes/ # API endpoints
│ ├── services/ # Business logic
│ └── schemas/ # Pydantic schemas
├── tests/
│ ├── conftest.py # Shared fixtures
│ └── test_main.py
├── CLAUDE.md
├── pyproject.toml # Modern Python packaging
├── .gitignore
└── README.md
Step 3: Configure Tooling
In pyproject.toml:
- ruff for linting and formatting (replaces flake8, black, isort)
- mypy for type checking
- pytest for testing
- Modern build system (hatchling or setuptools)
Step 4: Implement Foundation
- Entry point that runs
- Type hints on all functions
- Basic error handling
- One passing test
- Environment variable configuration (no secrets in code)
Step 5: Create CLAUDE.md
Generate project-specific CLAUDE.md with:
- Python version, framework, key dependencies
- Build, test, lint commands
- Architecture conventions
- Hard rules (testing requirements, type hint expectations)
Step 6: Verify
python -m project_name or uvicorn starts successfully
pytest passes
ruff check . clean
mypy . clean (or close to it)
1---2name: python-scaffold3description: Scaffold a new Python project with modern best practices. Use when the user says "new Python project", "create a Python app", "scaffold Python", "set up a Python package", or "Python starter".4---56# Python Project Scaffolder78Create a properly structured Python project with modern tooling.910## Process1112### Step 1: Gather Requirements13Ask about:141. **Type**: CLI tool, web API, library/package, data pipeline, automation script?152. **Framework**: FastAPI, Django, Flask, Click, Typer, plain Python?163. **Database**: PostgreSQL, SQLite, MongoDB, none?174. **Testing**: pytest (recommended), unittest?185. **Package manager**: uv (recommended), poetry, pip?1920### Step 2: Create Structure21Adapt to project type. Example for FastAPI:22```23project/24├── src/25│ └── project_name/26│ ├── __init__.py27│ ├── main.py # App entrypoint28│ ├── config.py # Settings via pydantic-settings29│ ├── models/ # Database models30│ ├── routes/ # API endpoints31│ ├── services/ # Business logic32│ └── schemas/ # Pydantic schemas33├── tests/34│ ├── conftest.py # Shared fixtures35│ └── test_main.py36├── CLAUDE.md37├── pyproject.toml # Modern Python packaging38├── .gitignore39└── README.md40```4142### Step 3: Configure Tooling43In `pyproject.toml`:44- **ruff** for linting and formatting (replaces flake8, black, isort)45- **mypy** for type checking46- **pytest** for testing47- Modern build system (hatchling or setuptools)4849### Step 4: Implement Foundation50- Entry point that runs51- Type hints on all functions52- Basic error handling53- One passing test54- Environment variable configuration (no secrets in code)5556### Step 5: Create CLAUDE.md57Generate project-specific CLAUDE.md with:58- Python version, framework, key dependencies59- Build, test, lint commands60- Architecture conventions61- Hard rules (testing requirements, type hint expectations)6263### Step 6: Verify64- `python -m project_name` or `uvicorn` starts successfully65- `pytest` passes66- `ruff check .` clean67- `mypy .` clean (or close to it)