From skills
Creates semantic git commits with conventional commit format, stages changes safely, handles pre-commit hooks, and optionally pushes to remote.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Step 1 — Check for changes**
Step 1 — Check for changes
Run in parallel:
git status --shortgit diffgit diff --stagedIf there's nothing to commit, stop and say so. Review both unstaged and already staged diffs before writing the message.
Step 2 — Stage thoughtfully
Add specific files by name rather than git add . or git add -A. Broad staging risks accidentally committing .env files, credentials, or build artifacts. Scan git status for anything that looks like a secret before staging.
Step 3 — Write a conventional commit
Format: <type>(<scope>): <subject>
Common types: feat, fix, chore, docs, refactor, test, style, perf
# No body needed — subject is self-explanatory
git commit -m "fix(auth): handle expired token on page refresh"
# Body only when the why is non-obvious
git commit -m "$(cat <<'EOF'
feat(auth): add refresh token rotation
Single-use tokens prevent session hijacking after a token is stolen —
the old token is invalidated on first use.
EOF
)"
Step 4 — Handle pre-commit hook failures
If a hook fails (lint, typecheck, tests), the commit did NOT happen. Fix the issue, re-stage the modified files, then create a NEW commit. Never use --amend after a hook failure — that would modify the previous commit, potentially losing work.
Step 5 — Verify the commit
Do not claim success until git log -1 --oneline shows the new commit. Include
the commit hash in the final response.
Step 6 — Ask about pushing
Use AskUserQuestion: "Push to remote?" with options:
Before pushing, check branch/upstream with git status -sb. If no upstream is
configured, ask before setting one. After an approved push, verify with
git status -sb; do not claim the push succeeded if the branch is still ahead.
.env, *.pem, *credentials*, *secret*, *token* filesmain, master, develop)Do not finish until:
git log -1 --onelinegit status -sb confirms the branch is not ahead of upstream| Type | When |
|---|---|
feat | New capability |
fix | Bug fix |
refactor | Code change with no behavior change |
test | Adding or fixing tests |
docs | Documentation only |
chore | Tooling, deps, config |
perf | Performance improvement |
style | Formatting, whitespace |
npx claudepluginhub kriscard/skillsStages intended git changes avoiding secrets and creates clear Conventional Commits like feat(scope): subject. Useful for clean, semantic commit history.
Executes git commits with conventional commit message analysis, intelligent staging, and message generation. Use when asked to commit changes or when /commit is invoked.
Creates structured git commits with clear messages following repo conventions or conventional commit format. Activated when the user asks to commit changes.