A modern, feature-rich Cookiecutter template for Python projects with comprehensive Claude Code integration and development best practices.
- Python 3.10+ Support: Choose your minimum Python version
- Source Layout: Uses
src/layout for better import handling - Type Safety: Full type annotations with mypy checking
- Modern Packaging: Uses
pyproject.tomlinstead ofsetup.py
- CLAUDE.md: Comprehensive instructions for Claude Code with your development principles
- AGENTS.md: Detailed workflow guidelines for AI agents and developers
- Best Practices: Embedded simplicity-first development principles
- Project-Specific Instructions: Tailored guidance for each generated project
- PM System (Optional): Full Claude Code PM system for spec-driven development with GitHub Issues
- Multiple CLI Options: Choose from Typer, Click, argparse, or none
- Pre-commit Hooks: Optional automated code quality checks
- Modern Tooling: ruff (linting/formatting), mypy (type checking), pytest (testing)
- GitHub Actions: Optional CI/CD pipeline with multi-OS testing
- Docker Support: Optional Docker configuration
- Comprehensive Testing: pytest setup with coverage reporting
- Security Scanning: Bandit and safety checks in CI
- Package Building: Automated wheel building and PyPI publishing
- Documentation: README templates with badges and comprehensive guides
pip install cookiecutter# From GitHub (recommended)
cookiecutter gh:yourusername/cookiecutter-python-claude
# From local directory
cookiecutter /path/to/cookiecutter-python-claudeThe template will prompt you for:
full_name [Your Name]: John Doe
email [your.email@example.com]: john@example.com
github_username [yourusername]: johndoe
project_name [My Python Project]: Awesome Python Tool
project_slug [awesome_python_tool]:
pypi_package_name [awesome-python-tool]:
project_short_description [A Python project created with best practices]: A tool for awesome Python development
first_version [0.1.0]:
python_version [3.10]: 3.11
command_line_interface [None]: Typer
use_github_actions [y]: y
use_pre_commit [y]: y
license [MIT]: MIT
create_author_file [y]: n
use_docker [y]: n
awesome-python-tool/
├── src/awesome_python_tool/
│ ├── __init__.py # Package initialization
│ ├── cli.py # Optional CLI (Typer/Click/argparse)
│ └── py.typed # PEP 561 type marker
├── tests/
│ ├── __init__.py
│ ├── conftest.py # Pytest fixtures
│ ├── test_awesome_python_tool.py
│ └── test_cli.py # CLI tests (if enabled)
├── .github/workflows/
│ └── ci.yml # GitHub Actions CI/CD
├── docs/ # Documentation directory
├── scripts/ # Development scripts
├── pyproject.toml # Modern Python configuration
├── README.md # Project documentation
├── CLAUDE.md # Claude Code instructions
├── AGENTS.md # Development guidelines
├── LICENSE # License file
├── .gitignore # Git ignore rules
└── .pre-commit-config.yaml # Pre-commit hooks (if enabled)
- full_name: Your full name (for package metadata)
- email: Your email address
- github_username: Your GitHub username
- project_name: Human-readable project name
- project_slug: Python package name (auto-generated from project_name)
- pypi_package_name: PyPI package name (auto-generated)
- project_short_description: Brief project description
- python_version: Minimum Python version (3.10, 3.11, 3.12, 3.13)
- command_line_interface: CLI framework (None, Typer, Click, argparse)
- use_github_actions: Set up GitHub Actions CI/CD (y/n)
- use_pre_commit: Set up pre-commit hooks (y/n)
- license: License type (MIT, BSD-3-Clause, Apache-2.0, GPL-3.0, Proprietary)
- create_author_file: Create AUTHORS.md file (y/n)
- use_docker: Include Docker configuration (y/n)
- use_claude_pm: Include Claude Code PM system for spec-driven development (y/n)
Every generated project includes a comprehensive CLAUDE.md file with:
- Core Development Principles: Simplicity-first approach, code quality standards
- Project Structure: Clear overview of the codebase organization
- Common Commands: Development, testing, and deployment commands
- Architecture Overview: Key patterns and dependencies
- Best Practices: Error handling, performance, security guidelines
When enabled (use_claude_pm: y), the template includes the full Claude Code PM system from automazeio/ccpm, providing:
- Spec-driven development: Create PRDs through guided brainstorming
- GitHub Issues integration: Full traceability from specification to implementation
- Parallel agent execution: Multiple AI agents working simultaneously
- Context preservation: Maintain project state across all sessions
- Comprehensive commands:
/pm:*commands for complete workflow management
The PM system helps teams ship faster with better quality through structured planning, automated task decomposition, and intelligent work prioritization.
The AGENTS.md file provides detailed guidelines for:
- Project Structure: Module organization and conventions
- Development Commands: Setup, testing, quality checks
- Coding Standards: Python style, naming conventions, code organization
- Testing Practices: Framework setup, coverage requirements, testing patterns
- CI/CD Workflows: Commit conventions, PR guidelines, release processes
- ruff: Fast Python linter and formatter (replaces flake8, isort, black)
- mypy: Static type checker with strict configuration
- bandit: Security vulnerability scanner
- safety: Dependency vulnerability checker
- pytest: Modern testing framework with plugins
- pytest-cov: Coverage reporting with HTML output
- pytest-mock: Mocking utilities for tests
The GitHub Actions workflow includes:
- Multi-OS testing (Ubuntu, Windows, macOS)
- Multi-Python version testing
- Code quality checks (linting, formatting, type checking)
- Security scanning
- Test coverage reporting
- Package building and validation
- Optional integration testing
After generating a project, you can immediately start developing:
cd your-project-name
# Set up development environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e ".[dev]"
# Install pre-commit hooks (if enabled)
pre-commit install
# Run tests
pytest
# Check code quality
ruff check . --fix
ruff format .
mypy src/
# Build package
python -m buildThe template includes Python hooks for validation and cleanup:
- pre_gen_project.py: Validates user inputs (project names, email format, etc.)
- post_gen_project.py: Cleans up unused files and initializes git repository
To customize the template:
- Modify cookiecutter.json: Add new configuration options
- Update templates: Use Jinja2 templating in any file
- Extend hooks: Add validation or cleanup logic
- Test locally: Generate projects and test the output
{
"use_fastapi": ["y", "n"],
"database_type": ["sqlite", "postgresql", "mysql", "none"]
}Then in your templates:
{% if cookiecutter.use_fastapi == "y" -%}
dependencies = ["fastapi", "uvicorn"]
{% endif %}- Prefer simple, readable solutions over complex ones
- Use existing patterns - don't reinvent wheels
- Avoid over-engineering
- Maximum function length: 20 lines
- Single responsibility principle
- Full type annotations
- Comprehensive test coverage (>80%)
- Descriptive variable names
- Comments for "why", not "what"
- Automated formatting and linting
- Never commit secrets
- Input validation
- Dependency vulnerability scanning
- Secure defaults in configuration
We welcome contributions to improve this template! Please:
- Fork the repository
- Create a feature branch
- Test your changes by generating projects
- Submit a pull request
# Generate a test project
cookiecutter . --no-input
# Test the generated project
cd python-boilerplate
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pytest- Python 3.8+ (for running cookiecutter)
- cookiecutter (
pip install cookiecutter) - Git (for repository initialization)
Generated projects require:
- Python 3.10+ (configurable)
- Modern Python packaging tools (pip, build)
This template is licensed under the MIT License. Generated projects use the license you select during generation.
- Inspired by modern Python packaging standards
- Built for seamless Claude Code integration
- Follows Python Packaging Authority recommendations
- Uses best practices from the Python community
- Initial release with full Claude Code integration
- Modern Python tooling (ruff, mypy, pytest)
- Multi-CLI framework support
- Comprehensive CI/CD pipeline
- Security scanning integration
- Docker support
- 📫 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
Happy coding with modern Python and Claude Code! 🚀