Commit Msg

Analyze staged git changes and generate commit message options with title and body

nmoinvaz 8ffdbe0 975 B Updated

File contents

Workflow

  1. Get the staged diff for analysis:

    git diff --cached
    
  2. Check previous commit message format in the repository:

    git log --oneline -10
    
  3. Search staged changes for ticket IDs (patterns like PROJ-123, D4T-123, etc.)

  4. Generate 3 distinct commit message options following the format above. Each option should use a different verb and framing — not rephrase the same sentence.

  5. Follow these guidelines:

    • Match the format used in previous commits in the repository
    • If a ticket ID was found, include it in the title (typically as a prefix)
    • Do not add Claude as a co-author in the commit message
  6. Present the options to the user for selection using AskUserQuestion

  7. Create the commit with the selected title and body:

    git commit -m "<title>" -m "<body>"
    

nmoinvaz/speedy-gonzales/tree/main/skills/commit-msg commit 8ffdbe02dc

Frequently asked questions

npx skillmds@latest add nmoinvaz/commit-msg