Agent skill
amend-staged
Amend the last commit with staged changes only
Install this agent skill to your Project
npx add-skill https://github.com/goodluckz/claude-code-config/tree/main/skills/amend-staged
SKILL.md
Amend Staged Changes
Amend the most recent commit by adding currently staged changes to it, without staging new files.
Context
- Current git status: {{GIT_STATUS}}
- Current branch: {{GIT_BRANCH}}
- Recent commits: {{GIT_LOG}}
Safety Checks
Before amending, you MUST verify ALL of these conditions:
-
HEAD commit was created by Claude:
- Run:
git log -1 --format='%an %ae' - Must show: "Claude Sonnet 4.5 noreply@anthropic.com" in Co-Authored-By
- Run:
-
Commit has NOT been pushed:
- Run:
git status - Must show "Your branch is ahead of" (not "up to date")
- If already pushed, WARN user that amend requires force push
- Run:
-
There are staged changes:
- Must have "Changes to be committed" in git status
- If no staged changes, inform user nothing to amend
Your task
Based on the staged changes shown above, amend the last commit.
IMPORTANT:
- Do NOT run
git add. Only amend with already-staged changes. - Use
git commit --amend --no-editto keep the existing commit message - If you need to update the commit message, use
git commit --amendand provide new message
Steps:
- Run safety checks (verify conditions above)
- If all checks pass, run:
git commit --amend --no-edit - Report what was amended
Example:
# Verify HEAD commit author
git log -1 --format='%an %ae'
# Verify not pushed
git status
# Amend with staged changes (keep message)
git commit --amend --no-edit
Notes
- This follows Git Safety Protocol: only amend commits created by Claude in this conversation
- Never amend commits that have been pushed without explicit user request
- If user wants to change commit message, use
git commit --amendwithout--no-edit
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
test00-check
Check test00 honeynet production server status - pcap files, tcpdump processes, containers, and Google Drive sync. Use when user wants to check test00 data or server health.
commit-staged
Git commit commands for staged-only commits
git-submodule
Add a directory as a git submodule with its own remote repository. Use when user wants to track a directory with separate git history.
dagster-remote
Manage remote Dagster server on dns-analy4 - start, stop, restart, check status, sync code, and view logs. Use when user wants to manage the remote Dagster deployment.
arkime-tag-manager
Manage Arkime session tags (add/remove) using API
arkime-data-manager
Manage Arkime data (wipe database, import PCAPs)
Didn't find tool you were looking for?