smart-commit
Skill18 starsChanged 6 months agoMITView on GitHub
Detect staged and unstaged git changes, classify them by type (feat/fix/refactor/docs/chore/test/style/perf), group into logical commit units, then commit each group separately with user approval. Use when the user wants to commit their current work, wants help writing a commit message, or says /commit or /smart-commit.
- Reads credentials
17 other projects use a version of this.
Adopted by
Most recently taken up by
- babs/skillstheir own version, first seen Nov 8, 2026
- CsHeng/agent-skillstheir own version, first seen Nov 4, 2026
- claude-world/director-mode-litetheir own version, first seen Nov 1, 2026
- Phoebe-WD/claude-skillstheir own version, first seen Oct 25, 2026
- sinuxnet/skillstheir own version, first seen Oct 20, 2026
- pksarkar345/claude-skillstheir own version, first seen Oct 15, 2026
Used with
Projects with it also use security-review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- rohitg00/pro-workflow★ 2.9ksame name
- sd0xdev/sd0x-dev-flow★ 192same name
- sd0xdev/sd0x-harness★ 192same name
- claude-world/director-mode-lite★ 80same name
- jackjin1997/ClawForge★ 12same name
- babs/skills★ 4same name
- CsHeng/agent-skills★ 3same name
- AlanSyue/my-skills★ 2same name
- jindalAnuj/publish-skills★ 2same name
- themusecatcher/ai-coding-kit★ 2same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-cost-manager-reducerSkill
- api-contract-reviewerSkill
- apps-language-rulesSkill
- cli-developerSkill
- contract-dto-consistency-reviewerSkill
- database-schema-reviewerSkill
- deep-code-reviewerSkill
- docs-managerSkill
- docs-publication-managerSkill
- feature-slice-designerSkill
- github-issue-solverSkill
- grasp-ooad-reviewSkill
- language-integratorSkill
- link-workspace-packagesSkill
- mcp-managerSkill
- migration-risk-reviewerSkill
- mobile-app-designerSkill
- mobile-app-integratorSkill
- mobile-app-product-ownerSkill
- mobile-app-reviewerSkill
- mobile-language-checkerSkill
- mobile-rulesetSkill
- mobil-ui-ux-rulesetSkill
- monitor-ciSkill
- nx-generateSkill
- nx-importSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
- product-owner-deciderSkill
- react-native-performance-reviewerSkill
- react-vite-performance-reviewerSkill
- release-readiness-reviewerSkill
- repo-architecture-auditorSkill
- repo-performance-guardSkill
- repository-pattern-reviewerSkill
- security-reviewerSkill
- supabase-api-rpc-reviewerSkill
- supabase-index-trigger-reviewerSkill
- supabase-rls-security-reviewerSkill
- supabase-schema-reviewerSkill
- tailwind-ui-ux-reviewerSkill
- ui-contract-guardSkill
- test-managerSkill
- unit-test-plannerSkill
- vite-performance-engineerSkill
- link-workspace-packagesSkill
- monitor-ciSkill
- nx-generateSkill
- nx-importSkill
- nx-pluginsSkill
- nx-run-tasksSkill
- nx-workspaceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 18
Run all three commands and keep the output in context:
- Distinctive: line 26
If both staged and unstaged areas are empty, tell the user there is nothing to commit and stop.
- Distinctive: line 66
Do not proceed to Step 4 until this table is shown to the user.
- Distinctive: line 96
Wait for confirmation before continuing.
- Distinctive: line 110
Never use git add -A or git add .
- Distinctive: line 151
After each successful commit, show the short SHA and commit summary, then move to the next group.
- Distinctive: line 155
After all groups are processed, show a summary:
- Distinctive: line 170
Never merge unrelated types into one commit: If in doubt, split.
- Distinctive: line 171
Never skip the confirmation step: Not even when the change looks trivial.
- Very specific: line 172
Never use --no-verify. If a hook fails, report the error and ask the user how to proceed.
- Distinctive: line 173
Never force-push or amend a published commit.
- Very specific: line 174
Never commit files that look like secrets (.env, credentials, private keys).
- Distinctive: line 176
If the user has already staged some files, include them in the classification and respect existing staging in the grouping proposal.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Smart Commit
Inspect the working tree, classify every change first, group into logical commits, then handle each commit separately with explicit user approval.
Never commit without user confirmation. Never lump unrelated changes into one commit.
Workflow
Step 1 — Snapshot the working tree
Run all three commands and keep the output in context:
git status --short
git diff --stat HEAD
git diff --cached --statIf both staged and unstaged areas are empty, tell the user there is nothing to commit and stop.
Step 2 — Read the full diff
# Staged changes
git diff --cached
# Unstaged changes
git diffSkim hunks to understand what changed, not just which files. Treat both staged and unstaged as candidates — classification covers everything.
Step 3 — Classify ALL changes (REQUIRED FIRST STEP)
This step is mandatory before any staging or committing decision is made.
Map every changed file (staged or unstaged) to a conventional-commit type:
| Type | When to use |
feat | New user-visible feature or capability |
fix | Bug fix or incorrect behavior corrected |
refactor | Code restructuring with no behavior change |
perf | Performance improvement |
test | Adding or updating tests only |
docs | Documentation, comments, README only |
style | Formatting, whitespace, lint — no logic change |
chore | Build scripts, deps, tooling, config |
ci | CI/CD pipeline changes |
revert | Reverts a previous commit |
Output a classification table immediately:
| File | Status | Type | Scope | Brief description |
path/to/file.ts | staged/unstaged | feat | auth | Added login form |
path/to/other.ts | unstaged | chore | deps | Updated lockfile |
Do not proceed to Step 4 until this table is shown to the user.
Step 4 — Group into logical commit units
Based on the classification, propose separate commits for each distinct type/scope cluster. Do not merge unrelated types into one commit.
Rules for grouping:
- Same type + same scope → one commit candidate
- Different types → separate commits
- Unrelated features in the same type → separate commits (use judgment)
- A single large feat that also touches tests → two commits (
feat+test) unless trivially inseparable - Purely mechanical changes (style, chore, docs) should never be bundled with feat/fix
Present the proposed grouping:
Proposed commit plan (N commits):
Commit 1 —
feat(auth): login form + validation Files:src/auth/LoginForm.tsx,src/auth/validators.tsCommit 2 —
test(auth): add login form tests Files:src/auth/LoginForm.test.tsxCommit 3 —
chore(deps): update lockfile Files:pnpm-lock.yaml
Ask the user:
Does this grouping look right? Reply yes to proceed group by group, regroup <instructions> to adjust, or cancel to abort.
Wait for confirmation before continuing.
Step 5 — Handle each commit group, one at a time
For each proposed commit group (in order):
5a — Stage the files for this group
Stage only the files belonging to this group:
git add path/to/file1 path/to/file2Never use git add -A or git add . unless the user explicitly requests it for a specific group.
5b — Draft the commit message
Format: Conventional Commits v1.0
<type>(<optional scope>): <short imperative summary, ≤72 chars>
<optional body: what changed and why, wrapped at 72 chars>
<optional footer: breaking changes, closes #issue>Rules:
- Summary line: imperative mood, no period, ≤72 chars
- Body: explain why, not what (the diff shows what)
- Breaking change: add
BREAKING CHANGE:footer or!after type - Co-author line added automatically on user approval
5c — Present and ask for confirmation
Show the user:
- Files being staged for this commit
- Proposed commit message (in a code block)
- Progress indicator — e.g., "Commit 1 of 3"
- Explicit question:
Shall I commit group 1/3 with this message? Reply yes to commit, edit <new message> to change the message, skip to skip this group, or cancel to abort all remaining commits.
5d — Act on the user's reply
| Reply | Action |
yes / y | Run git commit -m "..." with approved message + Co-Authored-By footer |
edit <new message> | Use provided message instead, ask once more |
skip | Skip this group, move to next |
cancel / no | Abort all remaining commits, leave working tree as-is |
After each successful commit, show the short SHA and commit summary, then move to the next group.
Step 6 — Final summary
After all groups are processed, show a summary:
Done. N commits created:
abc1234feat(auth): add login formdef5678test(auth): add login form testsghi9012chore(deps): update lockfileM file(s) still have unstaged changes: [list if any]
Constraints
- Branch check. Run
git branch --show-currentbefore staging. If the result ismainordevelopment, warn: "You're on<branch>— this is a shared branch. Consider creating a feature branch first:feature/,fix/,docs/, orrefactor/+ short slug. Seedocs/en/how-to/contributors/branching.md." Do not block, but surface the warning prominently. - Classification (Step 3) is always the first substantive action. Never stage or commit before classifying.
- Never merge unrelated types into one commit. If in doubt, split.
- Never skip the confirmation step. Not even when the change looks trivial.
- Never use
--no-verify. If a hook fails, report the error and ask the user how to proceed. - Never force-push or amend a published commit.
- Never commit files that look like secrets (
.env, credentials, private keys). Warn and exclude them. - Stage specific files by name — never
git add -Aunless the user explicitly requests it for a group. - If the user has already staged some files, include them in the classification and respect existing staging in the grouping proposal.
Example triggers
/smart-commit/commit- "Commit my changes"
- "Help me write a commit message"
- "Stage and commit everything"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

