This skill helps you amend the last commit by adding staged changes or updating the message, following Conventional Commits.
npx playbooks add skill ikatsuba/skills --skill amend
Modifies the most recent commit by adding staged changes, updating the message, or both. Follows Conventional Commits specification for message formatting.
Use this skill when the user needs to:
git log -1 --pretty=format:"%h %s" to show the last commitgit diff --cached --stat to see if there are staged changesgit diff --stat to see unstaged changesDisplay to user:
Last commit: a1b2c3d feat(auth): add login form
Staged changes: 2 files
Unstaged changes: 1 file
Based on state and user intent:
| Scenario | Action |
|----------|--------|
| Staged changes, no message provided | Add changes, keep message |
| No staged changes, message provided | Update message only |
| Staged changes + message provided | Add changes + update message |
| No staged changes, no message | Ask what user wants to do |
If there are staged changes to add:
If updating the message:
Quick fixes:
git:amend fix → Change type to fix, keep restgit:amend (api) → Change scope to api, keep restgit:amend "better description" → Update description onlyShow the planned changes:
Amending commit a1b2c3d
Current: feat(auth): add login form
New: fix(auth): add login form validation
Adding: 2 files (+15, -3 lines)
Proceed? [Y/n]
If approved, run:
# Message change only
git commit --amend -m "<new message>"
# Changes only (keep message)
git commit --amend --no-edit
# Both
git commit --amend -m "<new message>"
Important: Do NOT add Co-Authored-By, Signed-off-by, or any other trailers to the commit message.
Before amending, verify:
⚠️ Warning: This commit appears to be pushed to origin.
Amending will require force push. Continue? [y/N]
❌ Cannot amend merge commits. Use git revert instead.
You have unstaged changes. Options:
1. Stage all and include in amend
2. Amend with only currently staged changes
3. Cancel
$ARGUMENTS ($0) - Optional. Can include:feat, fix, docs, etc.(auth), (api)"full commit message"--no-edit - Keep current message, just add staged changesExamples:
git:amend - Interactive: ask what to changegit:amend --no-edit - Add staged changes, keep messagegit:amend fix - Change commit type to fixgit:amend (api) - Change scope to apigit:amend "feat(auth): add login validation" - Replace entire messageWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.