From git-commit
This skill should be used when the user asks to "commit changes", "create a commit", "commit my work", "stage and commit", "write commit message", "make a commit", or mentions committing code changes to a git repository.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-commit:git-commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Guide the process of creating well-structured git commits with meaningful commit messages. This skill ensures commits follow best practices and include proper attribution.
Guide the process of creating well-structured git commits with meaningful commit messages. This skill ensures commits follow best practices and include proper attribution.
When the user wants to commit changes:
Run the following commands in parallel to understand the current state:
# See all untracked and modified files (never use -uall flag)
git status
# See both staged and unstaged changes
git diff
git diff --staged
# See recent commit messages for style reference
git log --oneline -10
Review all changes (staged and unstaged) and determine:
Create a concise commit message following these guidelines:
If the recent commit history follows the Conventional Commits format, the generated commit message must also follow that format. Conventional Commits use this structure:
<type>[(optional scope)]: <description>
Common types: feat, fix, docs, style, refactor, test, chore, ci, build, perf.
Examples:
feat(auth): add OAuth2 login supportfix: resolve race condition in connection poolingdocs(readme): update installation instructionsrefactor(db): simplify query builder logicchore: bump dependency versionsLook at the output of git log --oneline -10 from Step 1. If the majority of recent commits use the type: or type(scope): prefix pattern, adopt the same format for the new commit message.
If the commit history does not follow Conventional Commits, use a standard imperative format:
Add validation for user email inputFix race condition in connection poolingUpdate authentication flow to support OAuth2Refactor database queries for better performanceBefore committing, verify:
Stage specific files by name rather than using git add -A or git add .:
# Stage specific files
git add path/to/file1 path/to/file2
# Create commit with sign-off flag and HEREDOC for proper formatting
git commit --signoff -m "$(cat <<'EOF'
Commit message here.
Assisted-by: <assistant-name>
EOF
)"
After committing, run git status to confirm the commit succeeded.
git push under any circumstances, uless user explicitly requests itgit add -A--signoff flag with every commitAlways include the Assisted-by: trailer at the end of commit messages. The coding agent should use its own identity from context to fill in the appropriate value (e.g., "Claude Code", "Cursor", "GitHub Copilot").
Always use the --signoff (or -s) flag when creating commits. This adds a Signed-off-by: trailer with the committer's identity from git config.
If a pre-commit hook fails:
User: "Commit my changes"
Response:
npx claudepluginhub kadel/claude-plugins --plugin git-commitCreates semantic git commits with conventional commit format, stages changes, and pushes to remote. Handles pre-commit hooks and writes meaningful commit messages.
Creates git commits matching repository style. Stages files explicitly and writes concise commit messages in imperative mood.
Creates local Git commits with conventional messages and GitHub issue references. Handles staging, pre-commit hooks, and automatic issue detection from changes.