home/claude/skills/git-commit-staged/SKILL.md
Create a Conventional Commit from already staged changes
npx skillsauth add lambdalisue/dotfiles git-commit-stagedInstall 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 message (e.g., "Fix #123", "Performance improvement", "Refactor for clarity"). This context will be used to generate a more accurate and meaningful commit message.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") to analyze staged changes and draft a commit message.
Approve - Present the proposed commit message to the user exactly as returned by the agent. Use AskUserQuestion to ask for approval with options: "Approve", "Edit" (let user modify the message), "Cancel".
Execute - If approved, execute git commit 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 the commit runs.
Procedure:
git diff --cached --statgit commit -m "<approved message>" (use a heredoc for multi-line messages). NEVER use -a / --all.git log --oneline -1 to the user.If the commit fails (e.g., pre-commit hook), stop and report — do NOT improvise around the failure.
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