Skip to content

MaximeFARRE/github-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧱 GitHub Project Template

A professional, batteries-included project template for Python projects. Built to work seamlessly with AI coding agents (Claude, Codex, Cursor) and human developers alike.

License: MIT Python Ruff Code style: black pre-commit semantic-release: angular CI


🎯 Purpose

This template enforces a consistent, professional project structure across all your Python projects. It is specifically designed for vibe coding workflows β€” where AI agents (Claude, Codex, Cursor) do most of the heavy lifting β€” while keeping quality high and supervision low.

Goals:

  • πŸ€– Give AI agents clear, unambiguous instructions so they don't go off the rails
  • βœ… Enforce code quality automatically (lint, format, type check) before every commit
  • πŸš€ Automate versioning and releases via Conventional Commits
  • πŸ—οΈ Maintain a clean 3-layer architecture from day one

πŸ“¦ What's Included

Tool Purpose
Ruff Lightning-fast linter (replaces flake8, isort, pyupgrade)
Black Opinionated code formatter
Mypy Static type checker
pre-commit Runs ruff + black + mypy automatically before every commit
python-semantic-release Auto version bumps, CHANGELOG, and GitHub Releases
pytest + pytest-cov Test runner with coverage reporting
GitHub Actions CI (lint + type check + tests) and CD (automated releases)
Dependabot Weekly auto-updates for pip and GitHub Actions dependencies
Makefile Shortcuts: make lint / make test / make fix / make all
AGENTS.md Instructions for AI agents (Claude, Codex, Cursor…)
CLAUDE.md Claude-specific instructions with Karpathy principles
CODEX.md Codex-specific instructions + Windows git fix
STACK.md Project tech stack β€” read by agents before any change

πŸ—οΈ Architecture Convention

All projects using this template follow a strict 3-layer architecture:

src/ui/               β†’ pages, components, views (display only)
        ↓
src/services/         β†’ business logic, calculations, decisions
        ↓
src/repositories/     β†’ DB queries, external API calls

Rules enforced in AGENTS.md:

  • No business logic in UI files
  • No DB/API access outside repositories/
  • No cross-layer calls (UI β†’ repository is forbidden)
  • Reuse existing services before creating new ones

βš™οΈ Design Choices

Why Ruff + Black together?

Ruff handles linting (errors, warnings, imports, upgrades). Black handles formatting. They cover different concerns and are configured with matching line-length = 120 to avoid conflicts.

Why Mypy?

AI agents regularly generate untyped code. Mypy catches type errors before runtime and forces def func(x: int) -> str: annotations. Configured in pyproject.toml with disallow_untyped_defs = true.

Why pre-commit instead of just CI?

CI catches errors after the push β€” pre-commit catches them before. Faster feedback loop, and it prevents bad commits from ever entering the history. Both run in this template.

Why python-semantic-release?

Versioning should be a byproduct of good commit messages, not a manual step. With Conventional Commits, every feat: or fix: automatically determines the next version, updates the CHANGELOG, and creates a GitHub Release β€” no human action needed.

Why separate AGENTS.md, CLAUDE.md, and CODEX.md?

Each AI agent reads a different file at startup:

  • AGENTS.md β€” universal rules, read by all agents
  • CLAUDE.md β€” Claude-specific (read automatically by Claude Code)
  • CODEX.md β€” Codex-specific (read automatically by OpenAI Codex)

Keeping them separate avoids token waste β€” each agent only loads what it needs.


πŸš€ Using This Template

Step 1 β€” Create your repository

Click "Use this template" on GitHub, or clone and re-init:

git clone https://github.com/MaximeFARRE/github-project-template.git my-project
cd my-project
git remote set-url origin https://github.com/YOUR_USERNAME/my-project.git

Step 2 β€” Configure the template

a) Fill STACK.md with your project's tech stack, language, framework, DB, and commands. Agents read this before touching any code.

b) Update pyproject.toml β€” replace the project name and version:

[project]
name = "your-project-name"
version = "0.1.0"

c) Update README.md β€” use README.example.md as a starting point.

d) Fill requirements.txt with your runtime dependencies.

Step 3 β€” Local setup

# Create and activate a virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1      # Windows
source .venv/bin/activate          # macOS / Linux

# Install all dev dependencies (ruff, black, mypy, pytest, pre-commit, semantic-release…)
pip install -r requirements-dev.txt

# Install pre-commit hooks (runs ruff + black + mypy before every commit)
pre-commit install

Step 4 β€” GitHub setup (required once per project)

These settings are required for CI and automated releases to work.

1. Enable write permissions for Actions

Settings β†’ Actions β†’ General β†’ Workflow permissions β†’ Select "Read and write permissions" β†’ Check "Allow GitHub Actions to create and approve pull requests" β†’ Save

2. Protect the main branch

Settings β†’ Branches β†’ Add branch protection rule β†’ Branch name pattern: main (or master) β†’ βœ… Require a pull request before merging β†’ βœ… Require status checks to pass β†’ add Lint & Format and Tests β†’ βœ… Do not allow bypassing the above settings β†’ Save


πŸ“‹ How Releases Work

This template uses Conventional Commits to drive automatic versioning:

Commit prefix Version bump Example
feat: minor 0.1.0 β†’ 0.2.0 feat: add user authentication
fix: / perf: patch 0.1.0 β†’ 0.1.1 fix: prevent duplicate records
BREAKING CHANGE footer major 0.1.0 β†’ 1.0.0 feat!: redesign API
chore:, docs:, test: no bump docs: update README

On every push to main/master:

  1. GitHub Actions runs CI (lint + tests)
  2. semantic-release version calculates the next version from commits
  3. pyproject.toml is updated, a tag is created, CHANGELOG.md is generated
  4. A GitHub Release is published automatically

πŸ€– AI Agent Instructions

This template ships with ready-to-use instruction files for AI coding agents:

File Agent Key rules
AGENTS.md All agents Architecture, code quality, commits, "never do" list
CLAUDE.md Claude Code Same rules, Claude-specific format
CODEX.md OpenAI Codex Same rules + git safe.directory fix for Windows
STACK.md All agents Fill this first β€” tech stack, commands, conventions
PROMPTS.md You Reusable prompt templates for common tasks

For Codex on Windows: If Codex can't commit due to a git permission error, add this to ~/.codex/config.toml:

setup_commands = ["git config --global --add safe.directory '*'"]

πŸ“ Project Structure

.
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   β”œβ”€β”€ ci.yml              # Lint + type check + tests on every PR and push
β”‚   β”‚   └── release.yml         # Automated release on push to main
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”œβ”€β”€ pull_request_template.md
β”‚   └── dependabot.yml          # Weekly auto-updates for pip + GitHub Actions
β”œβ”€β”€ .githooks/
β”‚   └── pre-commit              # Blocks direct commits to main/master (Unix)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ ui/                     # Display and interaction only
β”‚   β”œβ”€β”€ services/               # Business logic
β”‚   └── repositories/           # DB and API access
β”œβ”€β”€ tests/
β”‚   └── conftest.py             # Shared pytest fixtures
β”œβ”€β”€ docs/
β”‚   └── ARCHITECTURE.md         # Layered architecture rules and examples
β”œβ”€β”€ AGENTS.md                   # AI agent instructions (universal)
β”œβ”€β”€ CLAUDE.md                   # Claude-specific instructions + Karpathy principles
β”œβ”€β”€ CODEX.md                    # Codex-specific instructions + Windows git fix
β”œβ”€β”€ STACK.md                    # ← Fill this for every project
β”œβ”€β”€ PROMPTS.md                  # Reusable prompts for AI tasks
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ CHANGELOG.md                # Auto-generated by semantic-release
β”œβ”€β”€ Makefile                    # make lint / test / fix / all
β”œβ”€β”€ pyproject.toml              # Ruff, black, mypy, pytest, semantic-release config
β”œβ”€β”€ .pre-commit-config.yaml     # pre-commit hooks (ruff, black, whitespace…)
β”œβ”€β”€ .editorconfig               # Consistent indent/charset across editors
β”œβ”€β”€ requirements.txt            # Runtime dependencies
└── requirements-dev.txt        # Dev dependencies

πŸ“„ License

MIT β€” see LICENSE.

About

A professional Python project template for vibe coding with AI agents. Includes ruff, black, mypy, pre-commit, pytest, semantic-release and GitHub Actions CI/CD out of the box.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors