Create a commit with a well-formatted message
Create a commit following the project format.
You are NOT allowed to commit on main. Before doing ANYTHING else:
main, infer an appropriate branch name from the changes (see Branch Rules)git switch -c <branch-name> BEFORE any other stepsDo NOT proceed with formatting or staging until you are on a feature branch.
git branch --show-currentgit status --shortgit diff --cachedgit diffBefore committing, format and check everything:
Rust formatting:
cargo fmt
Compile check:
cargo check
Linting:
cargo clippy
Tests:
cargo test
Policy checks - runs all policy checks with auto diff-base:
python3 tools/policy/check_all.py
If any fail, fix violations before committing.
<Summary starting with verb, 50 chars or less>
- Bullet under 60 chars
- Another bullet if needed (2-5 total)
Bullet points should be concise (under 60 chars each) and describe what changed, not background context.
ASCII only. No special Unicode characters.
CRITICAL: Do NOT add attribution. No "Generated with Claude Code", no "Co-Authored-By", no author credits. These duplicate badly when squash-merging. The commit message should ONLY contain the summary line and bullet points.
IMPORTANT: Describe the outcome, not the process. The commit message reflects what changed, not how you got there.
Branch name format: <type>/<short-description>
feature, bugfix, refactor, release, chore, docsaaa-bbb-cccIMPORTANT: Name for the primary feature, not the recent task. Look at the full diff and identify what the main deliverable is.
Examples:
feature/user-authbugfix/null-pointer-crashrefactor/split-codegen (behavior-preserving restructuring)chore/update-deps (CI changes go here)docs/api-referencecargo fmt)git status --short to see all modified files before staging.git add <files> (do NOT use git add -A)git commit as a separate command (do NOT chain with add)Note: Never use git commit --amend if the previous commit has been pushed. If git status shows "Your branch is up to date with origin", the last commit is pushed - create a new commit instead.