Create a new commit from staged changes following Conventional Commits
Creates a commit from staged changes following Conventional Commits format.
/plugin marketplace add pproenca/dot-claude-old/plugin install commit@dot-claudeAnnounce at start: "Creating a commit from staged changes."
Run this command NOW:
git diff --cached --stat
If no output: STOP. Tell user: "No staged changes. Run git add <files> first."
If output exists: Continue.
Run these commands:
git diff --cached
git diff --cached --name-only
| Pattern | Type |
|---|---|
Only test files (*_test.*, test_*.*, tests/, __tests__/) | test |
Only docs (*.md, docs/, README*) | docs |
Only CI files (.github/, .gitlab-ci*, Jenkinsfile) | ci |
Only build configs (Makefile, *config.*, package.json deps) | build |
| Bug fix patterns (error handling, null checks, edge cases) | fix |
| Files renamed/moved, no new exports | refactor |
| New files in source directories, new exports/functions | feat |
Pick the best-fit type. Only ask the user if two types are genuinely equally valid (e.g., changes both add a feature AND fix a bug).
Scan for these patterns:
If detected, mark as breaking change (add ! and footer). Do not ask—show in the message.
Format: type[!]: description
Rules:
Body (for non-trivial changes):
Present the complete commit message and ask:
Single-line:
git commit -F - <<'EOF'
type: description
EOF
Multi-line:
git commit -F - <<'EOF'
type: subject
Body text.
EOF
Breaking changes:
git commit -F - <<'EOF'
feat!: remove deprecated API
BREAKING CHANGE: description.
EOF
Verify with:
git log -1 --format='%B'
Apply user's corrections and re-present.
Tell user:
git reset HEAD <files> to unstage some files, then run /commit:new for each logical commit/commit:resetStop without committing.
<<'EOF') for commit messages (prevents all shell expansion including !)