From a3dcec0efb9aaf79426a88dba28f8f9ada2ebc09 Mon Sep 17 00:00:00 2001 From: Gabriel Sancho Date: Thu, 26 Mar 2026 18:40:36 -0300 Subject: [PATCH] docs: add commit rules section to CLAUDE.md --- CLAUDE.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index a5a2b56..b611d52 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -501,6 +501,25 @@ BODY: - PRs require all CI checks to pass before merging. - Never commit directly to `main`. +### Commit Rules (enforced by AI) + +These rules apply to every commit made during AI-assisted implementation: + +| Rule | Detail | +|------|--------| +| **Two commits per TDD step** | 1st commit = failing tests (Red), 2nd commit = passing implementation (Green) | +| **Commit after each step** | Never accumulate multiple steps in one commit | +| **Red commit subject** | `test(): add failing tests for step ` | +| **Green commit subject** | `feat(): implement step ` | +| **Scope values** | `backend`, `frontend`, `docker`, `ci`, `config` | +| **Body** | Optional but encouraged: list what was added/changed | +| **No `--no-verify`** | Never bypass git hooks | +| **No force push** | Never use `--force` on shared branches | +| **Atomic commits** | Each commit must leave the build green (except deliberate Red-phase test commits) | +| **`chore` for housekeeping** | Config changes, dependency tweaks, file renames → `chore():` | +| **`fix` for bug fixes** | `fix(): ` | +| **`docs` for documentation** | Changes to `CLAUDE.md`, `INSTRUCTIONS.md`, `README.md` → `docs:` | + ### GitHub Actions Workflows | Workflow file | Trigger | What it does |