Skip to content
Back to skills

Smart Commit

ASecurity

Turns uncommitted work into a small series of atomic, well-described git commits: reads the real diff, groups hunks by intent, excludes secrets and build noise, matches the repository's existing message style, and verifies a clean tree. Use when the user says commit, commit this, commit what's been done, commit smartly, split into commits, or asks for a commit message for pending changes.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 25, 2026
ai-agentsbashgit

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add louisbrillet/cor-skills --skill smart-commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Smart Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Smart Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/louisbrillet-smart-commit/badge)](https://www.skillsdirectory.com/skills/louisbrillet-smart-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: smart-commit
description: "Turns uncommitted work into a small series of atomic, well-described git commits: reads the real diff, groups hunks by intent, excludes secrets and build noise, matches the repository's existing message style, and verifies a clean tree. Use when the user says commit, commit this, commit what's been done, commit smartly, split into commits, or asks for a commit message for pending changes."
status: beta
stability: experimental
---

# Smart Commit

Commit by intent, not by file list. One logical change per commit, message in the repo's own voice.

---

## Workflow

```
Commit Progress:
- [ ] Step 1: Read the state
- [ ] Step 2: Triage what must not be committed
- [ ] Step 3: Group changes by intent
- [ ] Step 4: Commit each group
- [ ] Step 5: Verify
```

**Step 1 — Read the state.** Run all three before deciding anything:

```bash
git --no-pager status --short
git --no-pager log --oneline -10
git --no-pager diff HEAD --stat
```

Then read the actual diff of every non-trivial file (`git --no-pager diff HEAD -- <path>`). A stat line is not enough to write a message.

**Step 2 — Triage what must not be committed.** Check the full change list against [references/exclusions.md](references/exclusions.md). Anything matching is left out, reported to the user, and a `.gitignore` entry is proposed if missing. Never commit a file containing a credential even if the user said "commit everything".

**Step 3 — Group changes by intent.** A group is a set of hunks a reviewer would want to read together. Split when any of these are true:

- different product area (feature vs docs vs tooling vs dependency bump)
- one part is a refactor and another is a behavior change
- one part could be reverted independently without breaking the other

Merge when files only make sense together (a component plus the store it reads). Ten unrelated files → several commits. One feature across ten files → one commit.

If the user staged something explicitly ("commit the staged changes"), respect the index: commit exactly what is staged, do not touch the rest. Otherwise reset the index and rebuild it per group.

**Step 4 — Commit each group.** Stage by path (`git add <paths>`), or `git add -p` when one file carries two intents. Never `git add -A` / `git add .`. Write the message with [references/message-style.md](references/message-style.md): subject copies the style of the last ten commits (prefix convention, language, tense), body explains why when the subject cannot. Append the co-author trailer the environment requires, if any.

**Step 5 — Verify.** Do not proceed while this fails:

```bash
git --no-pager status --short   # must be empty, or only the triaged exclusions
git --no-pager log --oneline -N # N = commits just created
```

Report the created commits as the final answer. If a commit landed with the wrong grouping, fix it with `git reset --soft HEAD~1` and redo — before anything is pushed only.

---

## Hard rules

- Read the diff before writing a message.
- No `git add -A`, `git add .`, `git commit -a`.
- No `--no-verify`. If a hook fails, fix the cause or stop and report.
- No amend, rebase, or force-push of commits that already exist on a remote.
- No new files created to "complete" a commit; commit what exists.

## Bundled resources

- [references/exclusions.md](references/exclusions.md) — what to keep out of a commit and how to report it.
- [references/message-style.md](references/message-style.md) — subject/body rules and how to derive the repo's convention from its log.

Files in this skill

  • SKILL.md3.5 KB
  • evaluations/exclude-secrets-and-noise.json530 B
  • evaluations/respect-existing-staging.json485 B
  • evaluations/split-mixed-changes.json721 B
  • references/exclusions.md2 KB
  • references/message-style.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.