A production-ready Python project template with modern development tools, quality gates, and AI-assisted workflow integration.
This is a template repository for creating Python projects with:
- β
Quality gates - Single-command verification (
.\scripts\check.ps1) - β Virtual environment - Isolated dependencies per project
- β Testing infrastructure - pytest with example tests
- β Code quality tools - ruff for linting and formatting
- β Cline workflow - Structured Plan/Act mode development
- β Cross-platform - Windows, Linux, and macOS support
- β Bootstrap automation - One command to set up new projects
-
Use this template on GitHub
- Click the "Use this template" button on GitHub
- Or clone and create a new repository:
git clone https://github.com/veritarium/python-cline-template-0.1.git my-project cd my-project rm -rf .git git init
-
Bootstrap your project (replaces placeholders and sets up environment)
# Windows .\scripts\bootstrap.ps1 -SetupVenv -NonInteractive # Linux/macOS (requires pwsh) pwsh ./scripts/bootstrap.ps1 -SetupVenv -NonInteractive
-
Verify everything works
.\scripts\check.ps1
-
Commit the bootstrapped project
git add -A git commit -m "chore: bootstrap project" git push -u origin main
That's it! Your project is ready for development.
The bootstrap script (scripts/bootstrap.ps1) performs these tasks:
-
Replaces placeholders in documentation files:
__PROJECT_NAME__β your project name (defaults to folder name)- Updates memory-bank files with project context
-
Sets up Python environment (when
-SetupVenvis used):- Creates
.venvvirtual environment - Installs development dependencies (ruff, pytest)
- Runs quality gate to verify setup
- Creates
-
Prepares project for development:
- Updates documentation
- Configures Cline workflow rules
- Sets up quality gates
your-project/
βββ .clinerules/ # AI workflow rules (Plan/Act mode)
βββ .venv/ # Virtual environment (created by bootstrap)
βββ devproj/ # Main Python package
β βββ __init__.py
β βββ main.py # Example module with tests
βββ tests/ # Test suite
β βββ test_greeting.py
β βββ test_smoke.py
βββ scripts/
β βββ bootstrap.ps1 # Project initialization
β βββ check.ps1 # Quality gate (lint + format + test)
β βββ check.sh # Bash version (Linux fallback)
β βββ fix.ps1 # Auto-fix linting issues
βββ memory-bank/ # Project context for AI assistants
βββ pyproject.toml # Tool configuration (ruff, pytest)
βββ requirements.txt # Runtime dependencies
βββ requirements-dev.txt # Development dependencies
βββ DEVELOPMENT.md # Development workflow guide
βββ BOOTSTRAP.md # Detailed bootstrap documentation
βββ PROJECT_README_TEMPLATE.md # Becomes README.md after bootstrap
Single command to verify everything:
.\scripts\check.ps1This runs:
- β
ruff check .- Linting - β
ruff format --check .- Format verification - β
pytest- All tests
The template includes .clinerules/ with structured workflows:
- Plan Mode - Create detailed plans before implementation
- Act Mode - Execute one step at a time
- Quality gates - Mandatory checks after each step
- Commit discipline - Small, focused commits
- PR templates - Structured pull request documentation
See DEVELOPMENT.md for the complete workflow guide.
Prerequisites:
- Python 3.12+ (from python.org, not Microsoft Store)
- Git for Windows
- PowerShell (built-in)
Setup:
cd C:\dev\projects
git clone https://github.com/veritarium/python-cline-template-0.1.git my-project
cd my-project
# Bootstrap with venv setup
.\scripts\bootstrap.ps1 -SetupVenv -NonInteractive
# Verify
.\scripts\check.ps1
# Commit
git add -A
git commit -m "chore: bootstrap project"Prerequisites:
- Python 3.12+ (
python3,python3-venv,python3-pip) - Git
- PowerShell Core (
pwsh) - recommended# Ubuntu/Debian sudo apt-get install -y powershell
Setup:
cd ~/dev/projects
git clone https://github.com/veritarium/python-cline-template-0.1.git my-project
cd my-project
# Bootstrap with venv setup
pwsh ./scripts/bootstrap.ps1 -SetupVenv -NonInteractive
# Verify (use pwsh or bash version)
pwsh ./scripts/check.ps1
# Or: bash ./scripts/check.sh
# Commit
git add -A
git commit -m "chore: bootstrap project"# Full setup (recommended for new projects)
.\scripts\bootstrap.ps1 -SetupVenv -NonInteractive
# Custom project name (instead of folder name)
.\scripts\bootstrap.ps1 -ProjectName "my-awesome-project" -SetupVenv
# Documentation only (no venv setup)
.\scripts\bootstrap.ps1
# Interactive mode (with confirmation prompts)
.\scripts\bootstrap.ps1 -SetupVenvOnce bootstrapped, follow this workflow:
-
Create feature branch
git checkout -b feature/my-feature
-
Verify baseline is green
.\scripts\check.ps1
-
Use Cline in Plan Mode
- Define goal, acceptance criteria, and non-goals
- Create a plan (max 10 steps)
- Get approval before implementation
-
Switch to Act Mode
- Implement ONE plan step at a time
- Run quality gate after each step
- Commit when green
-
Create PR
- Use PR template from
.clinerules/91-pr-template.md - Ensure all checks pass
- Use PR template from
See DEVELOPMENT.md for complete guidelines.
After bootstrapping, customize these files for your project:
- README.md - Replace with PROJECT_README_TEMPLATE.md content
- devproj/ - Rename package or add your code
- tests/ - Add your test cases
- requirements.txt - Add your runtime dependencies
- pyproject.toml - Adjust project metadata
- TEMPLATE_USAGE.md - Quick reference for template usage
- BOOTSTRAP.md - Detailed bootstrap process documentation
- DEVELOPMENT.md - Development workflow and Cline integration
- CHANGELOG.md - Template version history
This template is maintained to provide the best Python development experience with Cline.
To contribute improvements:
- Fork this template repository
- Create a feature branch
- Follow the development workflow
- Ensure
.\scripts\check.ps1passes - Submit a PR with clear description
- AI-first workflow - Optimized for Cline-assisted development
- Quality gate focus - Single source of truth for code quality
- Bootstrap automation - Zero-friction project setup
- Workflow discipline - Structured Plan/Act development process
- Cross-platform scripts - PowerShell that works everywhere
- Memory bank - Project context for AI assistants
MIT License - See LICENSE file
Built for modern Python development with:
- pytest - Testing framework
- ruff - Fast Python linter and formatter
- Cline - AI-assisted development workflow
- PowerShell - Cross-platform automation
Ready to start your next Python project? Click "Use this template" and run the bootstrap! π