home/claude/skills/git-commit/SKILL.md
Analyze working tree changes and commit them — fixup into existing commits where appropriate, otherwise new atomic commits
npx skillsauth add lambdalisue/dotfiles git-commitInstall 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 the commit messages / mapping (e.g., "Fix #123", "Performance improvement", "These changes belong to the auth refactor"). Used to generate accurate messages and to inform which existing commits changes map to.This command is fixup-aware: each change is mapped to the existing commit
(since the base branch) whose intent it extends and committed as a fixup;
changes that match no existing commit become new atomic commits. When the
branch has no commits since the base branch, it falls back to new commits only.
Use /git-commit-new instead when you want new commits only, with no fixups.
Analyze - Use the Task tool (subagent_type: "git-commit-fixup") to analyze all working tree changes, map them to existing commits since base branch, and create a fixup-aware plan (mix of fixup and new entries).
subagent_type: "git-commit" to produce a new-commits-only plan and continue with that plan. Do NOT tell the user to switch commands.Approve - Present the 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 2 is the explicit permission to commit; this is the only place commits run.
Procedure:
git backup "before commit-all" (or git branch backup/$(date +%s) HEAD if git backup alias is unavailable)git reset HEAD -- .git add <file>...); for partial hunks use git add -p <file> interactively only when truly necessary — prefer file-level staginggit diff --cached --statfixup entries: git commit --fixup=<target-sha>new entries: git commit -m "<message>" (use a heredoc for multi-line messages)git log --oneline of the new commits to the userForbidden 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 - If the plan contained any fixup entries, show rebase instructions in Japanese:
✅ コミットを作成しました(fixup を含みます)
以下のコマンドで fixup を自動的にスカッシュできます:
git rebase -i --autosquash origin/<base-branch>
If the plan contained only new commits, this step is unnecessary.
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