Python Project Bootstrap
Scaffold a new Python project with an opinionated, production-ready toolchain.
Toolchain
| Tool | Purpose | Config |
|---|---|---|
| uv | Package management, venv, dependency resolution | pyproject.toml |
| ruff | Linting (PEP 8, isort, bugbear, etc.) + formatting | pyproject.toml [tool.ruff] |
| pyright | Static type checking in strict mode | pyproject.toml [tool.pyright] |
| pytest | Testing | pyproject.toml [tool.pytest] |
| pre-commit | Git hooks (ruff + pyright) | .pre-commit-config.yaml |
| GitHub Actions | CI (lint, format, type check, test) | .github/workflows/ci.yml |
Usage
Run the bootstrap script. It accepts a project name and optional flags:
bash
python <skill_path>/scripts/bootstrap.py <project-name> \ --python 3.12 \ --description "Short project description" \ --dir /optional/parent/directory
The script:
- •Creates the project directory with src layout (
src/<package_name>/) - •Generates
pyproject.tomlwith all tool configuration - •Creates test scaffolding,
.gitignore,README.md, pre-commit config, and CI workflow - •Runs
uv venvanduv sync --all-extrasto install dependencies - •Verifies all checks pass (ruff lint, ruff format, pyright, pytest)
Coding Standards
All code in projects created by this skill must follow:
- •PEP 8 — enforced by ruff (E, W, F, I, N, UP, B, SIM, TCH, RUF rule sets)
- •Static type annotations on all functions, parameters, and return types — enforced by pyright in strict mode
- •
py.typedmarker included for PEP 561 compliance
Defaults
- •Python version: 3.12 (override with
--python) - •Line length: 88 (ruff/black standard)
- •Layout: src layout (
src/<package_name>/)
After Bootstrap
Remind the user to:
- •
cd <project-name> - •
git init && uv run pre-commit install - •Start coding in
src/<package_name>/