summarize_git_diff — Claude prompt: commit messages from a diff
This prompt reads a git diff and returns a short conventional-commits message plus a bulleted list of what changed.
.claude/commands/summarize_git_diff.mdWhat summarize_git_diff does
The prompt sets up a project-manager-and-developer role focused on describing what changed in a diff. You feed it git diff output; it returns a single line under 100 characters with a prefix such as feat:, fix: or chore:, followed by a CHANGES section with 7–10 word bullets.
Prefixes come from the conventional commits list: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test. Wording stays in imperative mood and present tense, following the Deis Commit Style Guide. Links come out as HTML, everything else as plain Markdown.
In Claude you drop the prompt at .claude/commands/summarize_git_diff.md, so it runs as a slash command. On a huge diff a good chunk of context goes to the diff itself — that is a reason to keep commits smaller.
What it helps with
- write a commit message that follows conventional commits
- turn diff changes into short bullets
- switch change descriptions to imperative mood
- separate new features from refactors and doc updates
- describe a diff before pushing
Example prompts for the agent
- /summarize_git_diff
- run git diff through summarize_git_diff and give me a commit message
- summarize my staged changes in conventional commits style
How to install summarize_git_diff
Manually: put the files in place
.claude/commands/summarize_git_diff.mdHow to use
Paste the text at the start of a chat or into project instructions
Command from the source
fabric --pattern summarize_git_diffQuestions about summarize_git_diff
How do I install summarize_git_diff in Claude?
Place the prompt file at .claude/commands/summarize_git_diff.md in your project. It then runs as a slash command.
What does summarize_git_diff do?
It reads a git diff, writes a headline of up to 100 characters with a conventional-commits prefix, and adds a CHANGES section with 7–10 word bullets.
Which commit prefixes does it support?
build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test. The choice follows the nature of the change: new feature, bug fix or refactor.
Source text
summarize_git_diff · MIT
# IDENTITY and PURPOSE You are an expert project manager and developer, and you specialize in creating super clean updates for what changed in a Git diff. # STEPS - Read the input and figure out what the major changes and upgrades were that happened. - Output a maximum 100 character intro sentence that says something like, "chore: refactored the `foobar` method to support new 'update' arg" - Create a section called CHANGES with a set of 7-10 word bullets that describe the feature changes and updates. - keep the number of bullets limited and succinct # OUTPUT INSTRUCTIONS - Use conventional commits - i.e. prefix the commit title with "chore:" (if it's a minor change like refactoring or linting), "feat:" (if it's a new feature), "fix:" if its a bug fix, "docs:" if it is update supporting documents like a readme, etc. - the full list of commit prefixes are: 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'. - You only output human readable Markdown, except for the links, which should be in HTML format. - You only describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy to do frotz", as if you are giving orders to the codebase to change its behavior. Try to make sure your explanation can be understood without external resources. Instead of giving a URL to a mailing list archive, summarize the relevant points of the discussion. - You do not use past tense only the present tense - You follow the Deis Commit Style Guide # INPUT: INPUT:
© danielmiessler · MIT · danielmiessler/Fabric