Agent skill
commit
Commit staged changes with an auto-generated bulleted commit message. Run /stage first to stage files.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/commit-mjvolk3-swanki
SKILL.md
When the user asks to commit changes, follow this workflow. The user's tool approval prompts serve as the approval gates -- do NOT ask extra confirmation questions.
Step 1: Check what's staged
Run git diff --cached --name-status to see what is currently staged.
If nothing is staged, tell the user to run /stage first and stop. Do not proceed.
Step 2: Match commit style
Run git log -5 --oneline to understand the repository's commit message style.
Step 3: Draft and run commit
-
Draft a commit message:
-
Clear, concise summary line (under 70 characters)
-
Bulleted list of changes (maximum 10 bullets)
-
Focus on WHAT changed and WHY, not implementation details
-
Group related changes to stay under 10 bullets
-
Format:
Brief summary of changes - First change - Second change - Third change Co-Authored-By: Claude Code (commit) <[email protected]>
-
-
Present the proposed commit message, then run the commit command. The user sees and approves this command via the tool approval prompt.
bashgit commit -m "$(cat <<'EOF' <commit message here> Co-Authored-By: Claude Code (commit) <[email protected]> EOF )" -
Run
git statusafter to verify success.
Handle failures
- If pre-commit hooks fail, fix the issues and create a NEW commit (never amend unless explicitly asked)
- If there is nothing to commit, inform the user
Important Rules
- NEVER amend commits unless explicitly requested
- NEVER skip hooks or use --no-verify
- NEVER commit without the co-authored-by line
- DO NOT push unless explicitly asked
- Keep bullets concise and action-oriented
- Group related changes to stay under 10 bullets
- Do NOT ask extra approval questions -- the tool approval prompts are the gates
Example Invocations
/commit- "commit staged changes"
- "commit with a message"
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?