| name | commit |
| description | Semantic commit format and pre-commit checks |
| license | MIT |
STOP — verification gate
Before reading further, confirm in this session you have:
- Verified the staged diff.
- Applied any findings.
- Re-verified until clean.
If any of those is missing, stop now and verify first. A 30-day audit found 60% of commit-time sessions skipped this step despite the precondition being declared. The pattern is the agent skipping past preamble — this gate exists to interrupt that. Do not draft the commit message, do not run git add, do not continue past this section until verification has happened.
Before every commit
Run automatically without asking. Set the bash tool's workdir to the repo root rather than passing git -C <path>. Permission patterns like git push * match parsed argv starting with git push; git -C <path> push injects flags between git and the subcommand and bypasses those patterns silently.
- Stage:
git add -A.
- Unstage in-flight OpenSpec change files:
git reset -q -- 'openspec/changes/*' ':(exclude)openspec/changes/archive'. In-flight changes under openspec/changes/<name>/ are intentionally un-ignored so they surface in review, but they are review artifacts, not code — they belong in the durable store and are moved there at archive time. This unstages them while leaving everything else (including any archived specs) staged.
- Skip globally-ignored files:
git check-ignore <files>. Do NOT stage files in ~/.config/git/ignore (e.g. .talismanrc).
- Run the full test suite — unit, integration, e2e, system. Do not commit with failures.
- Draft the commit message in the format below, with a
Co-Authored-By trailer naming the model used (e.g. anthropic/claude-sonnet-4-6):
Co-Authored-By: anthropic/claude-sonnet-4-6 <noreply@opencode.ai>
Format
type(scope): description
| Type | When |
|---|
feat | New feature or capability |
fix | Bug fix |
refactor | Code change that neither fixes nor adds |
docs | Documentation only |
test | Adding or updating tests |
chore | Build, CI, dependencies, tooling |
Scope — component/area (fix(auth): ...). Semantic, not ticket numbers.
Description — lowercase, no trailing period, imperative ("add" not "added"), focus on why, under 72 characters.
feat(auth): add password reset flow
fix(auth): prevent token refresh race condition
refactor(api): extract validation middleware
chore(deps): bump lodash to 4.17.21
Squashing
Before first push: squash related commits — multiple feature attempts → single feat, fix+test for same issue → single fix. Keep unrelated changes separate.
After review feedback: add new commits, don't rewrite history. Each round gets its own commit(s) with an appropriate type (e.g. fix(auth): address review — validate token expiry). Never force-push pushed commits — reviewers lose context. Squashing at merge happens via the platform's squash-and-merge.