Git Conventions
Commit Message Format
Conventional-commits format and the type list are in CONTRIBUTING.md ("Commit Conventions").
A count in a subject or body is written as its magnitude — "a handful of proposals", never the number — for the same reason a spec does (the openspec skill, references/repo-owned-facts.md).
Every commit ends with the Co-Authored-By trailer the session's attribution reminder gives, written as the message's last line and never stripped: it is what names the model pnpm ai:sweep:status prints beside a ledger unit's date (the sweeps skill, references/ledger-files.md).
Multi-line Commit Messages — Tool-Specific Syntax
A heredoc piped to -F - from Bash, a single-quoted here-string from PowerShell — never one tool's syntax in the other — then git log -1 --format='%B' (references/commit-messages.md).
Safety Rules
- Never
git add -Awithout readinggit statusfirst. The tree can already be dirty with someone else's work — a leftover snapshot refresh, an unfinished edit — and-Asweeps it into your commit, where it ships under a message that does not describe it. Stage the paths you touched, or check the status and confirm every extra file belongs. If one already landed in the commit,git reset --soft <your sha>~1thengit restore --staged <paths>puts it back in the working tree with its content intact. - Commit by pathspec when another session shares the checkout, leave a file
git statuslists as modified until it is committed, never--amend(it takes the whole index), and name a commit to reset to by its sha (references/shared-checkout.md). - No command over the whole index in a shared checkout.
git add .,git add -N .,git reset -- .andgit restore --staged .reach every peer's staged entry as well as your own;git reset -- .can drop a peer's staged files; stage by explicit path. Name your paths. The ward's whole-index guard (packages/genshin-mods/src/services/ward/) refuses these forms with a Bash deny while another session edits the checkout. - A rename that only changes case needs
git -c core.ignorecase=falseon every command that names the path — Windows checks out withcore.ignorecase=true, sogit addand a pathspecgit commitrefuse the new spelling as "did not match any file", and a commit that does land leaves the old spelling behind as a stagedAthatgit -c core.ignorecase=false rm --cachedclears.git mvalone stages the move correctly; the pathspec commit after it is where the flag is needed. - Never use
git stash— a failed/forgotten pop loses in-progress changes. To inspect prior committed state, usegit show HEAD:path/to/fileorgit diff HEAD. To set work aside, make a WIP commit. - Save a patch before discarding uncommitted edits.
git checkout -- <paths>andgit restore <paths>erase work that is not in any commit. Rungit diff -- <paths> > <scratchpad>/<name>.patchfirst, check it is non-empty, and only then discard, so the work can be re-applied in onegit apply.
Pushing
Landing commits on ai/queue is the review-queue skill's loop (its pull, push and worktree).
Branch Hygiene
The session's checked-out branch is ai/queue; there are no per-chunk feature branches. The review and the nightly release move main; the review brings a diverged main back into the queue itself (openspec/specs/infra/review/design.md, step 2). Otherwise main moves only by the owner's fast-forward of main to ai/queue after a review (review-queue skill). A branch's name says whose it is and the rulesets hold it to that — ai/ the pipeline's, renovate/ the bot's, external/ the one prefix a collaborator may create, anything else the maintainer's (openspec/specs/infra/branch-namespaces/design.md). Cut a branch only when the work genuinely cannot land incrementally (a spike — in a git worktree rather than checked out over work in progress), and delete it after merging.
Merging `main` and the Lockfile
Resolve pnpm-workspace.yaml first, keeping the higher version on every conflict — no pnpm runs while its markers stand — then delete pnpm-lock.yaml and pnpm i; never hand-resolve the lock, and never merge main into ai/queue by hand — the review's diverged-main step is the one merge (references/lockfile-merges.md).
Commit Chunks
Commits stay per coherent chunk, and a fix is its own commit behind the unit. The touched tests' timing is the running-checks skill's.
Reference pages
references/commit-messages.md— when writing a multi-line commit message from Bash or PowerShell.references/shared-checkout.md— when another session shares the checkout.references/peer-hunks-in-a-worktree.md— when a hunk of a file a peer also has dirty is committed, or a commit is built in a throwaway worktree.references/lockfile-merges.md— when a merge brings apnpm-workspace.yamlorpnpm-lock.yamlconflict.