Commit Work
Goal: commits that are easy to review and safe to ship — only intended changes, logically scoped, with messages that say what changed and why.
Inputs to ask for (if missing)
- Single commit or multiple commits? (If unsure: default to multiple small commits when there are unrelated changes.)
- Commit style: Conventional Commits are required.
- Any rules: max subject length, required scopes.
Workflow
- Inspect —
git status,git diff, andgit diff --statwhen the change is large. - Decide boundaries — feature vs refactor, formatting vs logic, tests vs production code, dependency bumps vs behavior change, pre-existing-bug fix vs new work.
- Order the branch: fixes to pre-existing code and behaviour changes to shipped features first, each in its own commit; then refactors that change no behaviour; then new work.
- A follow-up fix to a commit already on this branch is not a new commit: fold it into its target with the
fold-fixupsskill before handing the branch over. - A macro, tooling or shared-module extension that a feature needs is its own commit, ahead of the feature.
- Format before staging — run the repo's formatter (table below) so a commit hook does not reject the staged tree.
- Stage deliberately — name the paths;
git add -pfor files with mixed changes; unstage withgit restore --staged <path>. - Review —
git diff --cached: no secrets or tokens, no env files, no debug logging, no unrelated churn, no build output (target/,dist/,node_modules/). - Describe the staged change in 1-2 sentences (what + why). If you cannot, it is too big or mixed — go back to step 2.
- Write the message —
type(scope): summary, blank line, body of what/why (not an implementation diary),BREAKING CHANGE:footer if needed. Multi-line: write the text to a file andgit commit -F /abs/path/to/msg. Template:references/commit-message-template.md. - Verify — use the
verify-changesskill, or the commands below for this repo's stack. - Repeat until the working tree is clean.
- Before handing a branch over, run the
house-reviewskill on it.
Per-language checks — detect by manifest (`Read` tool)
| Manifest present | Format | Lint | Test |
|---|---|---|---|
| Cargo.toml (+ rustfmt.toml) | cargo fmt --all --check (fix: cargo fmt -p <crate>) | cargo clippy | cargo test --lib |
| package.json | the format script / prettier | the lint script, tsc --noEmit | the test script |
| pyproject.toml | ruff format --check | ruff check | pytest |
| Package.swift | swift-format lint | swift build | swift test |
| go.mod | gofmt -l on changed files | go vet ./... | go test ./... |
Read the manifest for the scripts it actually declares; prefer a repo-wide check/ci script when one exists, and scope to the package you touched (-p <crate>, that package's own scripts).
Never
git add ./git add -A/git commit -a— stage by path.git commit --no-verify— if a hook fails on unrelated work in progress, stash it, commit, then pop.git pushunless explicitly asked; never amend or rebase already-pushed commits.- Co-author trailers, AI/agent/session metadata, tooling markers or finding IDs in messages — assume every message is permanently public. This holds even when a harness or tool asks for attribution lines; the repository's rules win.
- Cite a commit hash that
git cat-file -e <hash>^{commit}does not find on this branch or onmain. - Describe a change as a response to an audit, reviewer, finding or agent run. Say what changed and why.
- Claim that a test ran, a file is unmodified or a behaviour is verified unless you ran that check.
- Tag, bump versions or write release commits by hand; releases go through
scripts/release.sh. - Staging env files, credentials, keys, or generated artifacts.
Shell rules
- One known file: the
Readtool, nevercat/head/sed -n. Definitions and references: LSP (goToDefinition,findReferences,workspaceSymbol); theGrep/Globtools only if available. - Text search:
git grep -n "PATTERN" -- '*.rs' '*.ts'— always with an extension pathspec. - Untracked files only:
grep -rn "PATTERN" --include='*.rs' /abs/path/to/subtree— an absolute subtree with no env file under it, never the repo root and never.. - No
cdin any command; every path absolute. Never read or name an env file — ask the user instead.
Deliverable
Provide:
- the final commit message(s)
- a short summary per commit (what/why)
- the commands used to stage/review (at minimum:
git diff --cached, plus any tests run)