home/claude/skills/git-commit-staged-fixup/SKILL.md
Map staged changes to existing commits and create fixup commits for autosquash
npx skillsauth add lambdalisue/dotfiles git-commit-staged-fixupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
context (optional): Additional context for mapping changes to commits (e.g., "These changes are for the auth refactor", "Fix edge cases in parser"). This context will be used to inform which existing commits the changes should be mapped to.Pre-check - BEFORE calling the agent, verify staging status:
git diff --cached --quiet && echo "NOTHING_STAGED" || echo "HAS_STAGED_CHANGES"
If output is "NOTHING_STAGED", inform the user: "ステージングされた変更がありません。先に git add <file> でファイルをステージングしてください。" and STOP. Do NOT proceed to the agent.
Analyze - Use the Task tool (subagent_type: "git-commit-staged-fixup") to analyze staged changes, map them to existing commits since base branch, and create a fixup plan.
/git-commit-staged instead. STOP.Approve - Present the fixup plan to the user exactly as returned by the agent. Use AskUserQuestion to ask for approval with options: "Approve", "Modify" (let user adjust the plan), "Cancel".
Execute - If approved, execute the approved plan directly via the Bash tool (do NOT delegate to the agent for execution). The user's approval at step 3 is the explicit permission; this is the only place commits run.
Procedure (single fixup target — staging untouched):
git commit --fixup=<target-sha>git log --oneline -1Procedure (multiple targets — needs re-staging):
git diff --cached --statgit reset HEAD -- .git diff --cached --statgit commit --fixup=<target-sha>git commit -m "<message>"git log --oneline of new commitsForbidden during execution: git add -A, git add ., git commit -a, git stash, git rebase, git commit --amend. Stage explicitly by name only.
If a commit fails (e.g., pre-commit hook), stop and report — do NOT improvise around the failure.
Present - Show rebase instructions in Japanese:
✅ fixup コミットを作成しました
以下のコマンドで自動的にスカッシュできます:
git rebase -i --autosquash origin/<base-branch>
tools
Update the title and body of an existing pull request WITHOUT asking for approval
tools
Create a pull request with title and body based on commits WITHOUT asking for approval
tools
Create a Conventional Commit from already staged changes WITHOUT asking for approval
tools
Map staged changes to existing commits and create fixup commits for autosquash WITHOUT asking for approval