Git workflow commands

Install

/plugin install git@psousa50-plugins

Run it inside Claude Code after adding the marketplace with /plugin marketplace add psousa50/claude-plugins.

Contents

Discovered from source

Skills 1

Commit Message

Generate a single-line commit message based on the conversation context, using the git diff to confirm scope.

Instructions

Phase 1: Gather Context

  1. Review the full conversation history — this is the primary source of intent
  2. Run git diff --staged
    • If there is staged output, use it. Do NOT run git diff (unstaged). Skip to Phase 2.
    • If there is no staged output, run git diff to check for unstaged changes
    • If neither staged nor unstaged changes exist, inform the user and stop

Only one diff should be in scope — staged takes priority. Ignore any unstaged diff output from earlier in the conversation if staged changes exist.

Phase 2: Analyse

Priority order:

  1. Conversation intent — what was the user trying to achieve? What problem were they solving? What did they ask for?
  2. Conversation arc — did the approach evolve? Was there a key decision or pivot?
  3. Diff confirmation — use the staged diff to verify scope and catch anything the conversation might not fully reflect

The conversation tells you why. The diff tells you what. Prefer why.

Phase 3: Generate Message

Create a single-line commit message following these rules:

  • Start with verb: add, fix, update, remove, refactor, rename, move
  • Lowercase, no period at end
  • Max 72 characters
  • Focus on what and why, not how
  • Be specific: "fix login redirect loop" not "fix bug"
  • Reflect the user's intent from the conversation, not just a mechanical description of changed lines

Phase 4: Output & Commit

  1. Display only the commit message, nothing else. No explanation, no alternatives.
  2. Ask the user if they want to commit with this message.
    • If yes — run git commit -m "<message>" (stage all tracked changes first with git add -u if nothing is currently staged)
    • If no — stop. Do not commit.

Sponsors

Details

Marketplace
psousa50/claude-plugins
Source
plugins/git
Category
Community

More from psousa50/claude-plugins

All 5