Production-ready scaffolding for Python projects that expect humans and coding agents to work in the same repository.
This template gives agents a crisp operating contract, gives humans reproducible quality gates, and keeps the two aligned through AGENTS.md, uv, ruff, mypy, pytest, pre-commit hooks, CI, and a small set of bridge files.
This repository is a template, not an application. Fork it, replace the project identity, add your Python code, and keep the quality gates intact.
It includes:
AGENTS.md- the canonical instructions for agents and humans; Codex reads this natively..agents/context/- small, task-targeted context files for project, architecture, testing, style, and review..agents/prompts/- reusable prompts for planning, implementation, review, feature work, and bugfixes.CLAUDE.md,GEMINI.md,.github/copilot-instructions.md- thin bridge files that point popular agents at the canonical instructions.pyproject.toml- package metadata, build backend, dependency groups, and tool configuration.Makefile- reproducible local commands for daily development and CI parity..pre-commit-config.yaml- local hooks for formatting, linting, typing, and file hygiene..github/workflows/ci.yml,.github/dependabot.yml- GitHub Actions pipeline and dependency update automation.src/andtests/- a minimal typed package and test so the template is green from day one.
Most Python repositories drift into avoidable inconsistency: mixed tooling, weak typing expectations, unclear project layout, no shared test discipline, and agent instructions that are either vague or duplicated across tools.
This blueprint makes the contract explicit:
- Agents read one canonical instruction file before editing.
- Agents can then load only the smallest relevant
.agents/context/*.mdfile instead of re-reading the full policy surface. - Humans get a short setup checklist and reproducible commands.
uv,ruff,mypy,pytest, and CI enforce what prose alone cannot.- Tool-specific files stay tiny and delegate to
AGENTS.md, avoiding drift.
This template uses current Python community defaults that are both high quality and widely adopted:
uvfor fast environment and dependency managementhatchlingas a modern build backendsrc/layout per Python packaging guidancepytestwith--import-mode=importlibfor new projectsrufffor formatting and lintingmypy --strictfor type safetypre-commitfor local hygiene
Prerequisites:
uv- Python 3.12+ (or let
uvmanage Python for you)
Setup:
git clone https://github.com/your-org/python-project-blueprint.git
cd python-project-blueprint
uv sync --group dev
make hooks
make ci-checkThen replace the template placeholders called out in AGENTS.md, README.md, pyproject.toml, and src/python_project_blueprint/.
make hooks
make ci-check
make format-check
make lint
make typecheck
make test
make test-cov
make buildCI runs the same core quality gates on a Python version matrix.
Installed pre-commit hooks run fast hygiene, formatting, linting, and typing checks on commit, then run tests and builds on push.
Read AGENTS.md before editing. It contains the entrypoint rules and points to the smaller context files under .agents/context/ for architecture, testing, style, and review.
MIT - see LICENSE.