Governs branches, commits, and history. Read before committing.
Never commit or push without explicit approval for that specific batch. Approval is per-batch and never carries forward — being told "commit and push" once does not authorise the next set.
Finish the work, verify it, leave it in the working tree, and report what is ready. Staging with git add so a diff can be reviewed is fine; creating a commit is not.
Applies to AI agents and humans alike.
Every commit touches exactly one file. No bundling a component with its hook, no sweeping a rename in one go.
- A commit touching two files becomes two commits, each with its own message.
- If a change genuinely cannot be split — a rename git tracks as one operation, a lockfile regenerated by a manifest edit, a migration with the generated types it produces — say so in the commit body. That is the only escape.
- Order the sequence so the tree is as coherent as possible at each step: introduce a module before the code importing it.
A mechanical change spanning many files may be batched — a folder restructure, a rename sweep, a formatter run. Splitting those per file produces noise, not history. Feature work is not mechanical and stays one file per commit. When in doubt, ask.
The final commit of a sequence must build and pass checks. Never push a sequence whose tip is broken.
Conventional Commits:
<type>(<scope>): <subject>
<body>
<footers>
Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert. No others.
Scopes: web (the React app), db (migrations), functions (edge functions), or omit for repo-wide changes.
Subject: imperative mood ("add", not "added"), lowercase after the colon, no trailing period, under 72 chars. Name the change, not the file — fix(functions): skip gitea branches older than the window, never fix(functions): update gitea.ts.
Body: required whenever the subject is not self-evident. Explain why: the problem and how it surfaced, why this approach over the obvious alternative, what was deliberately not done, what was verified. Wrap at 72 chars. Prose, not a bullet list of the diff.
Per the no-comments rule, reasoning that cannot live in code lives here.
Footers:
| Footer | Meaning |
|---|---|
Refs #N |
Related to the issue. The only issue footer used here. |
BREAKING CHANGE: <what> |
Incompatible change, with migration path |
No Co-Authored-By trailer, and no AI attribution of any kind — not in a commit, a PR description, or an issue comment. The commit author is whoever ran the work; how the diff was produced is not part of the history.
Never write Closes #N, Fixes #N or Resolves #N. Those keywords auto-close the issue when the PR merges, before anyone has verified the behaviour on the merged branch. Use Refs #N and say in the body what was done and what remains.
The product has one version: version in package.json, shown on the landing page. The release tag is that version, vX.Y.Z, and the /releases page reads GitHub releases.
Releasing is its own commit, chore(release): vX.Y.Z, bumping only package.json. After it lands on main, tag it vX.Y.Z, push the tag and publish the GitHub release — only with approval, like any push.
| Bump | When |
|---|---|
patch |
A fix, copy change or internal change with no new behaviour |
minor |
A new feature or a changed behaviour |
major |
A breaking change for users or self-hosters (a schema reset, a removed flow) — ask first |
mainis the default branch; PRs target it. It is protected — PR required, no force-push.- Names:
<type>/<short-slug>, e.g.feat/gitea-oauth. With an issue:feat/12-gitea-oauth. - Branch from
main. Rebase ontomainrather than merging it in, so history stays linear.
- Never force-push a shared branch. Correct a mistake with a new commit or a
revert. - Rebasing and squashing are fine on a local, unpushed branch, and expected before opening a PR.
- Never rewrite
main.
- Credentials, tokens, or any
.env(.env,supabase/functions/.env). - Generated artefacts — build output,
.react-router/, caches,supabase/functions/deno.lock. Generated database types are source and are committed. - A second lockfile. This repo is Yarn 4 only;
npm installproduces a conflictingpackage-lock.json. - Commented-out code. Delete it; git remembers.