Commit Skill
Use this skill when the user asks to "commit" changes or runs /commit.
Process
- •Check Status: Run
git statusto see what files are changed. - •Review Changes: Run
git diff(andgit diff --cachedif needed) to understand the changes. - •Confirm Scope: If there are many unrelated changes, ask the user if they want to split them or commit all.
- •Stage: Use
git addto stage the files intended for the commit. - •Commit: Generate a commit message following Conventional Commits format.
Commit Message Format
Use the following structure:
text
<type>(<scope>): <subject> <body>
Common types:
- •
feat: New feature - •
fix: Bug fix - •
docs: Documentation only - •
style: Formatting, missing semi-colons, etc. - •
refactor: A code change that neither fixes a bug nor adds a feature - •
test: Adding missing tests - •
chore: Maintenance tasks
Implementation Details
When executing the commit command, ALWAYS use the HEREDOC format to ensure safe string handling:
bash
git commit -m "$(cat <<'EOF' feat: add new functionality Detailed description of the changes. EOF )"