From devpowers
Create a git commit with staged changes, handling pre-commit hooks automatically. Use when the user asks to commit, make a commit, or create a commit (e.g. "/git-commit", "/git-commit fix login bug").
How this skill is triggered — by the user, by Claude, or both
Slash command
/devpowers:git-commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create a git commit with the user's staged changes using the project's commit type convention, and handle pre-commit hook modifications safely.
Create a git commit with the user's staged changes using the project's commit type convention, and handle pre-commit hook modifications safely.
/git-commit [optional commit message]
Examples:
/git-commit
/git-commit fix login redirect loop
/git-commit add user profile endpoint
Run these in parallel:
git diff --staged --name-only
git diff --staged
Use --name-only output as the authoritative list of originally staged files — you will need it verbatim if a pre-commit hook modifies files. Use the full staged diff to draft the commit message.
If the output of --name-only is empty, stop and tell the user nothing is staged — do NOT run git add on their behalf.
If git status reveals a mid-rebase, mid-merge, mid-cherry-pick, or detached HEAD, stop and surface that to the user before committing.
If the user supplied a message in the invocation:
feature:, bugfix:), use it verbatim.Otherwise, analyze the staged diff and draft a message using this project's type convention:
feature: — new featuresbugfix: — bug fixesrefactor: — code refactoringcleanup: — code cleanupMultiple types can be combined when appropriate, e.g. [feature, cleanup]: description.
Message structure:
<type>: <short description>
<optional longer description>
Keep the subject line concise (target 50 chars, hard wrap at 72) and focus the body on the "why".
Show the proposed message to the user and wait for approval before committing. Let them edit it. Skip this step only if the user supplied a complete message (subject + body, or an explicit "commit as-is" instruction).
Commit with a HEREDOC and chain the result display in the same call to save a round-trip:
git commit -m "$(cat <<'EOF'
<type>: <short description>
<optional longer description>
EOF
)" && git log -1 --pretty=format:"%h %s%n%b"
If the commit failed, inspect the hook output to decide which case applies.
No commit was created. Re-stage only the files from Step 1's --name-only list — not every modified file — and retry with the same message chained to git log -1:
git add file1.py file2.py file3.py
git commit -m "$(cat <<'EOF'
<same commit message>
EOF
)" && git log -1 --pretty=format:"%h %s%n%b"
Do NOT use git add -u (stages every modified tracked file, including unrelated changes). Do NOT use --amend (there is no commit to amend).
If hooks modify files again on retry, try once more. If they keep modifying files after that, stop and surface the non-convergence to the user.
Nothing to re-stage. Fix the underlying issue the hook reported, re-stage the fixed files, then retry Step 4. If the failure is in code you didn't touch, surface it to the user instead of silently patching unrelated files.
npx claudepluginhub kolodkin/devpowers --plugin devpowersCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.