Agent skill

generate-commit-message

Generate a commit message for staged changes

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/generate-commit-message

SKILL.md

Generate Commit Message

Analyze staged changes and generate a single-line commit message.

Instructions

  1. Check for staged changes

    • Run git diff --cached to see what's staged
    • If nothing is staged, check git status and suggest what to stage
  2. Check project conventions

    • Run git log --oneline -10 to see recent commit style
    • Match the existing format (conventional commits, prefixes, etc.)
  3. Generate a single-line commit message

Best Practices

  • 50 characters or less - keep it concise
  • Imperative mood - "Add feature" not "Added feature" or "Adds feature"
  • Capitalize the first letter
  • No period at the end
  • What and why, not how

If the project uses Conventional Commits, use the format:

type(scope): description

Types: feat, fix, docs, style, refactor, test, chore

Output

Print the commit message in a code block:

Add user authentication endpoint

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results