Pre-commit workflow and commit guidelines. Use when asked to commit changes. Requires passing lint and tests, signed commits, semantic prefixes, imperative mood.
Pre-commit workflow and commit guidelines.
Before making ANY commit, ensure:
lintro chk returns zero issues)
--tools filteringlintro chk --tools ruff,yamllintlintro tst succeeds)fix:, feat:, chore:, docs:, refactor:, test:, build:, ci:, perf:, style:Make incremental, logical commits rather than one large commit:
Good groupings:
feat(logging): add subprocess execution logging (one component)feat(logging): add config parsing logging (related files)docs: add debugging guide (documentation separate from code)Bad groupings:
When working on a new extension or feature branch where all files are new:
When modifying an existing codebase:
If commits are poorly structured (too large, wrong groupings, or showing modified when should be added):
git log --onelinegit reset --soft <good-commit>git reset HEADgit status that file statuses (A/M) are correctWhen asked to commit:
lintro chk (full, no --tools flag)npm run lintlintro tstnpm testgit status to plan logical groupingsgit add <related-files>
git commit -S -m "feat: add user authentication"
Good commit messages:
fix: resolve null pointer in user servicefeat: add dark mode togglechore: update dependenciesdocs: improve API documentationrefactor: simplify authentication flowBad commit messages:
fixed bug (not semantic, past tense)WIP (not descriptive)updates (not semantic, not specific)