docs: add commit rules section to CLAUDE.md
This commit is contained in:
19
CLAUDE.md
19
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(<scope>): add failing tests for step <N> — <short description>` |
|
||||
| **Green commit subject** | `feat(<scope>): implement step <N> — <short description>` |
|
||||
| **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(<scope>):` |
|
||||
| **`fix` for bug fixes** | `fix(<scope>): <what was broken and how it was fixed>` |
|
||||
| **`docs` for documentation** | Changes to `CLAUDE.md`, `INSTRUCTIONS.md`, `README.md` → `docs:` |
|
||||
|
||||
### GitHub Actions Workflows
|
||||
|
||||
| Workflow file | Trigger | What it does |
|
||||
|
||||
Reference in New Issue
Block a user