/skills:smart-commitfrom skills
Smart commit workflow with a code-quality pass (flags redundant AI-generated comments and leftover debug code), risk-triggered security checks, repo-convention-aware conventional commits, and documentation awareness. Use this skill when the user asks to commit changes or create a git commit.
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert at creating clear, meaningful git commits. You survey the changes, strip low-value noise (especially the redundant comments AI tends to over-produce), catch security issues and debug leftovers, conform to the repository's existing commit style, and write a tight conventional commit.
Be conservative and never surprise the user: do not delete code, rewrite history, push, or commit files the user did not intend without confirming first.
Run in parallel to see the full picture:
git status
git diff --staged # what is already staged
git diff # unstaged changes to tracked files
Decide what to commit:
git add -A or a targeted subset.Only the files you intend to commit should be staged by the time you reach Step 6.
Before writing anything, infer the project's style instead of imposing one:
git log --oneline -20
Conform to what you see:
feat:, fix(scope):) or freeform subjects.Co-Authored-By, Signed-off-by, issue refs). Match the prevailing pattern — do NOT add a Co-Authored-By trailer if the history doesn't use one.Prefer an explicit rule in CONTRIBUTING.md or CLAUDE.md over inferred style.
If the staged set is ONLY:
package-lock.json, bun.lock, yarn.lock, pnpm-lock.yaml, composer.lock, Gemfile.lock, Cargo.lock, go.sum, poetry.lockpackage.json + lock).gitignore only…skip the quality review and questions and jump to Step 6 with a short, subject-only message (e.g. chore(deps): update dependencies).
Inspect the added lines of the diff (the + lines) so you only judge new code, not pre-existing content. Run these scans automatically; raise a finding only when there's something to act on.
AI agents (and rushed humans) tend to over-comment, narrating code that already speaks for itself. Most such comments add nothing because the code is self-explanatory. Flag newly added comments that carry no information beyond the code:
Flag for removal (high-confidence noise):
count++ // increment count; // set the name above this.name = name.// Loop through users, // Return the result, // Import dependencies, // First, ..., // Now we ..., // Step 1: ....// getUser — gets the user.Always keep:
// Workaround for <bug>; remove after <cond>).TODO/FIXME with context.Honor any repo-specific rule (e.g. a CLAUDE.md that says "prefer docblocks, avoid inline comments" → be stricter).
When in doubt, keep it and merely list it as a suggestion. Present findings as file:line — <comment> — why it's noise, then offer to remove the clearly-redundant ones. Only auto-remove the high-confidence set if the user has said something like "just clean it up." After removing, re-stage the affected files.
Flag newly added debugging leftovers: console.log/console.debug, dd()/dump()/var_dump()/ray(), debugger, ad-hoc print() debug lines, and focused tests (.only, fdescribe, it.only). Offer to remove, same conservative rule.
Scan the added lines for:
If nothing trips, stay silent and move on. If something trips, list each as file:line — issue and ask whether to fix first or commit anyway. Never commit a hardcoded secret without an explicit go-ahead.
Only when the change plausibly needs it (new feature, public API, config, command, or behavior change), ask whether docs should be updated and where (CLAUDE.md / README.md / a docs file). For routine fixes and refactors, skip silently.
For anything the user approves (comment cleanup, debug removal, security fix, docs), apply it with the Edit tool, then re-stage the touched files (git add <files>) so the commit reflects the cleaned-up state. Re-run git diff --staged if you changed anything.
Match the convention learned in Step 2. Default conventional shape:
type(scope): concise summary in the imperative
Optional body explaining WHY — the problem, context, trade-offs.
Wrap the body at 72 chars. Omit it entirely for small, self-evident changes.
feat, fix, docs, style, refactor, perf, test, chore, build, ci.type(scope): prefix; imperative mood; no trailing period.Co-Authored-By) ONLY if the repo's history uses them or the user asks.git commit -m "$(cat <<'EOF'
type(scope): summary
Body (if any).
EOF
)"
<<'EOF' keeps the message literal — do not interpolate variables into it.git commit actually succeeded.Confirm the result:
git status
git log -1 --stat
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
Other plugins' skills for the same job
npx claudepluginhub ricardo-lobo/claude-code --plugin skills