This skill should be used when the user asks to ”commit changes”, ”make a commit”, ”commit staged files”, ”create a commit with conventional commit format”, or mentions committing code following conventional commit convention.
npx playbooks add skill pitzcarraldo/skills --skill commit
This skill automatically analyzes staged Git changes and creates commits following the [Conventional Commits](https://www.conventionalcommits.org/) specification. It examines the changes, determines the appropriate commit type and scope, and generates a well-structured commit message without requiring user input.
| Type | Purpose | Example |
|------|---------|---------|
| feat | New feature | Adding user authentication |
| fix | Bug fix | Fixing null pointer exception |
| docs | Documentation | Updating README |
| style | Formatting changes | Code style, whitespace |
| refactor | Code restructuring | Extract function to module |
| perf | Performance | Optimize database queries |
| test | Testing | Add unit tests |
| build | Build system | Update dependencies |
| ci | CI/CD | Modify GitHub Actions |
| chore | Maintenance | Update tooling |
<type>(<scope>): <description>
[optional body explaining WHY the change was made]
[optional footer(s)]
Format Rules:
Author Policy:
Check if we're in a git repository:
git rev-parse --git-dir 2>&1
Expected output:
.git or path to git directoryError message format:
Error: Not in a git repository
Please initialize git with: git init
Run these commands in parallel to gather context:
git diff --cached --stat
git diff --cached
git log --oneline -5
Purpose:
--cached --stat: Summary of staged files--cached: Detailed line-by-line changeslog --oneline -5: Recent commit messages for style consistencyIf no staged changes:
No files are staged for commit.
Stage files with:
git add <file> # Stage specific file
git add . # Stage all changes
git add -p # Stage interactively
Determine commit type based on:
README.md, *.md in docs/ → docspackage.json, Gemfile → build.github/workflows/ → ci_test.js, _spec.rb → testfeatfixrefactorperfstylesrc/auth/ → auth)Basic commit (no body needed):
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
EOF
)"
Complex commit (with body):
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
Detailed explanation of WHY this change was made.
Wrap at 72 characters for readability.
Use multiple paragraphs if needed.
EOF
)"
When to include body:
Create the commit:
git commit -m "$(cat <<'EOF'
[generated message]
EOF
)"
Verify the commit:
git log -1 --pretty=format:"%h - %s%n%n%b"
Display to user:
✓ Commit created successfully
[short hash] - [commit subject]
[commit body if present]
All commit operations follow this consistent format:
Analyzing staged changes...
Files changed:
[file list from git diff --cached --stat]
Creating commit with message:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
<type>(<scope>): <description>
[body]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Commit created: [hash]
Staged changes:
+ src/auth/passwordReset.ts (new file)
+ 45 lines
Generated commit:
feat(auth): add password reset functionality
Staged changes:
M src/api/userProfile.ts
- return user.profile
+ return user.profile || defaultProfile
Generated commit:
fix(api): handle null values in user profile endpoint
Previously the endpoint would crash when users had incomplete profiles.
Added fallback to default profile object to prevent null reference errors.
Staged changes:
M README.md
+ Installation section
+ 20 lines added
Generated commit:
docs: add installation instructions to readme
Staged changes:
M src/utils/validation.ts
M src/components/Form.tsx
+ src/utils/validators.ts (new file)
Generated commit:
refactor(utils): extract validation logic into separate module
Moved reusable validators to dedicated module for better code organization
and to enable reuse across multiple components.
Staged changes:
M src/components/Button.tsx
M src/components/Input.tsx
M src/styles/global.css
Generated commit:
style: apply consistent formatting to component files
| Tool | Purpose | Check Command |
|------|---------|---------------|
| Git | Version control | git --version |
| Git Config | User identity | git config user.name && git config user.email |
Error: Not a git repository
git init or navigate to a git repositoryError: No staged files
git add <file> or git add .Error: User identity unknown
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Error: Empty commit message
git diff --cachedError: Hook failed
--no-verify if appropriateFor breaking changes, add an exclamation mark after type/scope and include BREAKING CHANGE in footer.
If changes affect multiple scopes but are tightly related, use comma-separated scopes.
Include issue references in body or footer (e.g., Fixes #123 or Closes #456).
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.