Agent skill
commit
Use when the user wants to commit changes, save work, or create a git commit message.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/commit-huzaifa525-claude-code-optimize
SKILL.md
Generate a commit message and commit staged changes.
Steps
-
Check staged changes
git diff --cached --stat git diff --cached -
Check recent commit style
git log --oneline -10 -
Generate commit message following Conventional Commits:
Prefix When to Use feat:New feature fix:Bug fix refactor:Code restructure, no behavior change docs:Documentation only test:Adding or fixing tests chore:Build, deps, config changes perf:Performance improvement style:Formatting, whitespace ci:CI/CD changes -
Format rules
- Subject line: max 72 characters, imperative mood ("Add" not "Added")
- Body: wrap at 80 characters, explain WHY not WHAT
- If multiple changes: use bullet points in body
-
Commit
git commit -m "type: short description - Detail 1 - Detail 2" -
Show result
git log --oneline -1
Pre-Delivery Checklist
Before committing, verify:
-
git diff --cachedwas read (not just--stat) - Commit prefix matches the change type (feat/fix/refactor/etc.)
- Subject line is under 72 characters
- Subject uses imperative mood ("Add" not "Added")
- No sensitive files staged (.env, credentials, keys)
- No unrelated changes bundled in the same commit
- Body explains WHY if the change is non-obvious
If nothing is staged
Run git status and tell the user what files are available to stage.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?