Amend the last commit with an improved subject and body following conventional commit best practices
Amends the last commit with a conventional commit message based on the diff analysis.
/plugin marketplace add krmcbride/claude-plugins/plugin install essentials@krmcbride-pluginsoptional type override (feat, fix, refactor, etc.) or additional contextAmend the last commit with a well-crafted message following conventional commit best practices.
$ARGUMENTS
This command ONLY amends the message of the last commit. It does NOT:
Verify there is at least one commit by running git rev-parse HEAD.
Run these commands to understand the commit:
# Current commit message
git log -1 --format=%B
# Commit statistics (files changed, insertions, deletions)
git show --stat HEAD
# Full diff for analysis
git show HEAD
Also note any type override or additional context from the user input above.
Based on the diff, craft a new commit message following this format:
type(scope): imperative description
Determine type from diff characteristics (user override takes precedence):
feat - New functionality, new files that add capabilitiesfix - Bug fixes, error correctionsrefactor - Code restructuring without changing behaviordocs - Documentation, README, commentsstyle - Formatting, whitespace, linting (no logic change)test - Adding or updating testschore - Maintenance, dependencies, toolingperf - Performance improvementsbuild - Build system, CI configurationci - CI/CD pipeline changesDerive scope - use a short service, module, or feature name (not a file path):
auth, billing, search, apilogin, checkout, exportWrite description in imperative mood:
Write 2-4 sentences explaining:
Do NOT:
Optional references at the end:
Refs: #123 - Related issueCloses: #123 - Issue this resolvesDisplay the current and proposed messages clearly:
## Current Commit Message
[show current message]
## Proposed New Message
[show proposed subject + body]
Then use AskUserQuestion to confirm:
If user approves, run the amendment using HEREDOC to preserve the multiline body:
git commit --amend -m "$(cat <<'EOF'
type(scope): subject line here
Body paragraph explaining why this change was made and who benefits.
Additional context if needed.
EOF
)"
After successful amendment, run git log -1 to confirm and display the result.
For a commit that adds OAuth support:
Current:
wip oauth stuff
Proposed:
feat(auth): add OAuth2 support for GitHub login
Enable users to authenticate via GitHub OAuth2 flow. This reduces
friction for developers who already have GitHub accounts and avoids
managing another set of credentials.
The implementation uses authorization code flow with PKCE for
enhanced security in browser environments.
Begin the amend commit workflow now.