Commit Command
Create a git commit with a concise message following the Conventional Commits 1.0.0 specification.
Instructions
- •Run
git diff --stagedto see the staged changes - •If nothing is staged, run
git diffto see unstaged changes and stage the relevant files - •Analyze the changes and create a commit message following the specification below
Conventional Commits Specification
The commit message MUST follow this structure:
code
<type>[optional scope][optional !]: <description> [optional body] [optional footer(s)]
Rules (from specification)
- •Commits MUST be prefixed with a type (feat, fix, etc.), followed by an OPTIONAL scope, an OPTIONAL exclamation mark for breaking changes, and a REQUIRED terminal colon and space
- •The type
featMUST be used for new feature additions - •The type
fixMUST be used for bug fixes - •An optional scope MAY be provided in parentheses after the type (e.g.,
fix(parser):) - •A description MUST immediately follow the colon and space after the type/scope prefix
- •A longer body MAY be provided after a blank line following the description
- •An exclamation mark before the colon indicates a BREAKING CHANGE
- •BREAKING CHANGE: in the footer is equivalent to the exclamation mark in the prefix
- •Additional types beyond
featandfixare permitted (e.g.,docs,refactor,test,chore,build,ci,perf,style)
Common Types
- •
feat: A new feature - •
fix: A bug fix - •
docs: Documentation changes - •
style: Formatting, whitespace (no code change) - •
refactor: Code change that neither fixes a bug nor adds a feature - •
perf: Performance improvement - •
test: Adding or updating tests - •
build: Build system or dependency changes - •
ci: CI configuration changes - •
chore: Maintenance tasks
Commit Message Guidelines
- •Keep the description concise (ideally under 50 characters)
- •Use imperative mood: "add" not "added", "fix" not "fixed"
- •Do not capitalize the first letter of the description
- •Do not end the description with a period
Examples
code
feat: add user authentication endpoint
code
fix(api): handle null response in fetch handler
code
docs: update installation instructions in README
code
refactor: extract validation into separate module
code
build: upgrade pytorch to 2.1.0
code
feat(dataloader): add streaming dataset support
code
feat!: remove deprecated config options BREAKING CHANGE: config.legacy_mode no longer supported
code
fix(parser): prevent infinite loop on malformed input The parser now validates input length before processing. Reviewed-by: Alice Refs: #123
Bad Examples (avoid these)
- •
feat: Add new feature for user authentication with JWT tokens and refresh token support- too long - •
Fixed the bug- no type prefix, past tense, vague - •
feat: Add user auth.- should not capitalize, should not end with period - •
updated files- no type, vague
Execution
After analyzing the diff, create the commit:
bash
git commit -m "<type>[scope]: <description>"
Do NOT use --no-verify unless explicitly requested by the user.
IMPORTANT: Do NOT add any Co-Authored-By or similar trailers to the commit message.