The AI-Native Python template uses hooks to automate setup tasks automatically.
The post_gen_project.py hook runs after project generation to:
- Initialize the project as a Git repository
- Create the project's initial commit
- Set up GitHub remote (if credentials available)
- Generate a fully up-to-date
uv.lockfile - Run
task initto install dependencies - Push to GitHub and create an initial release
Environment variables can be set before running cookiecutter to modify hook behavior:
SKIP_GIT_PUSH=true- Skip automatic Git pushRUN_POST_HOOK=false- Skip the post-generation hook entirely (not recommended)
For more environment variable options, see the Optional Setup Guide.
Automatically run code quality checks before each commit.
task init # Installs pre-commit and sets up hooks, alongside setting up other project dependencies to get started- Python - Ruff for linting and formatting
- Security - Trufflehog for secret detection
- File Checks - JSON/YAML validation, large files, merge conflicts
- Spell Check - Typos with custom dictionary
- Shell Scripts - ShellCheck validation
- GitHub Actions - Actionlint validation
- OpenAPI - Schema validation
For the full list of hooks, see {{cookiecutter.project_name}}/.pre-commit-config.yaml
Edit .pre-commit-config.yaml to customize:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--fix, --show-fixes]- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest
language: system
pass_filenames: false