Skip to main content
skill CX Codex

smart-commit — Claude Code skill: what it does, how to install

smart-commit runs lint, typecheck and tests before a commit, scans staged code for leftovers, then writes a conventional commit message from the diff.

MIT ★ 2,966 updated 2026-09-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow
Open on GitHub

What smart-commit does

Each commit follows the same route: git status and git diff --stat show what changed, quality gates run, the staged diff gets read, and the message is drafted from it. Only files you name are staged. After the commit the skill asks whether anything from this change should be kept as a lesson.

The pre-commit scan looks at production code rather than tests. It flags console.log and debugger, TODO/FIXME/HACK notes with no ticket number, secrets pasted into source, and test scaffolding left behind. Messages use <type>(<scope>): <summary> with a body that explains the reason, and the summary stays under 72 characters. git add -A and git add . are off the table, so a stray file cannot slip into the commit.

Gates call npm run lint, npm run typecheck and npm test -- --changed --passWithNoTests. A repo on a different toolchain needs those lines edited before the skill is any use. Some changes are skipped on purpose: threshold and feature-flag tweaks, import reordering, formatting-only diffs, console.log inside test files.

What it helps with

  • run lint, typecheck and tests before a commit
  • strip console.log and debugger from staged production code
  • catch a hardcoded API key before it reaches the remote
  • draft a conventional commit message from the diff
  • commit the files you picked and nothing else

Example prompts for the agent

  • Commit the changes in src/auth.ts
  • Save my changes and commit them
  • Check the staged diff and suggest a commit message

How to install smart-commit

1Plugin marketplace

/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow

This installs the whole pro-workflow plugin with all its skills

2Skills CLI (Vercel)

npx skills add rohitg00/pro-workflow --skill smart-commit -a claude-code

3Manually: put the files in place

~/.claude/skills/smart-commit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/smart-commit/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about smart-commit

How do I install smart-commit in Claude Code?

Add the marketplace with /plugin marketplace add rohitg00/pro-workflow, then install the plugin: /plugin install pro-workflow@pro-workflow. The skill ships with it.

What does smart-commit do?

It runs quality gates, reviews the staged diff for problems, and writes a conventional commit for the files you named. Then it asks what this change taught you.

Can the quality gates be skipped?

Only when you say so explicitly; otherwise they always run. Staging by file name is a hard rule, and git add -A never happens.

Source text

SKILL.md · MIT
---
name: smart-commit
description: Run quality gates, review staged changes for issues, and create a well-crafted conventional commit. Use when saying "commit", "git commit", "save my changes", or ready to commit after making changes.
user-invocable: true
---

# Smart Commit

## Trigger

Use when saying "commit", "save changes", or ready to commit after making changes.

## Workflow

1. Check current state and identify what to commit.
2. Run quality gates (lint, typecheck, tests on affected files).
3. Scan staged changes for issues.
4. Draft a conventional commit message from the diff.
5. Stage specific files, create the commit.
6. Prompt for learnings from this change.

## Commands

```bash
git status
git diff --stat

npm run lint 2>&1 | tail -5
npm run typecheck 2>&1 | tail -5
npm test -- --changed --passWithNoTests 2>&1 | tail -10

git add <specific files>
git commit -m "<type>(<scope>): <summary>"
```

## Code Review Scan

Before committing, check staged changes in **production code** (not test files) for:
- `console.log` / `debugger` statements (suppressed in test files — see Review Suppressions)
- TODO/FIXME/HACK comments without ticket references (e.g., `TODO(JIRA-123)` is fine)
- Hardcoded secrets or API keys
- Leftover test-only code

Flag any issues before proceeding.

## Commit Message Format

```
<type>(<scope>): <short summary>

<body - what changed and why>
```

**Types:** feat, fix, refactor, test, docs, chore, perf, ci, style

## Guardrails

- Never skip quality gates unless user explicitly says to.
- Stage specific files by name. Never `git add -A` or `git add .`.
- Summary under 72 characters. Body explains *why*, not *what*.
- No generic messages ("fix bug", "update code").
- Reference issue numbers when applicable.

## Output

- Quality gate results (pass/fail)
- Issues found in staged changes
- Suggested commit message
- Commit hash after committing
- Prompt: any learnings to capture?

## Review Suppressions

Do NOT flag these during the pre-commit scan. They add noise without catching real bugs:
- Threshold, config value, or feature flag changes (limits, timeouts, retry counts)
- Import reordering that does not change runtime behavior
- Whitespace-only or formatting-only changes
- Adding or removing `console.log` in test files
- TODO/FIXME comments (tracked separately in issue trackers)
- Variable or parameter renames that do not change behavior

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar skills

All skills for Git and GitHub →

From the same set83

The whole set →

Project sponsors

Companies that keep this analytics open