Skip to main content
command CX Codex

commit · rohitg00 — Claude Code command: what it does, how to install

Runs project checks, reviews staged changes, and creates a focused git commit. Use it when a change is ready to be recorded.

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 commit does

The command inspects repository status and diff size, then runs npm run lint, npm run typecheck, and tests limited to changed files. It also reviews staged content for debug statements, untracked TODO-style comments, embedded secrets, and leftover test code.

It drafts a Conventional Commits-style message from the staged diff, with a type, optional scope, short summary, and a reason-focused body. Specific files are staged with git add, then the command reports the commit hash and summary. Options include --no-verify, --amend, and --push.

Projects without the lint, typecheck, or test npm scripts will fail the matching checks. Skipping the quality gates is reserved for an explicit flag or a direct user instruction.

What it helps with

  • inspect repository status before committing
  • run lint, type checks, and changed-file tests
  • spot secrets and debug code in staged changes
  • draft a Conventional Commits message
  • stage selected files and report the commit hash

Example prompts for the agent

  • /commit
  • /commit --amend to update the previous commit
  • /commit --no-verify to skip the quality gates

How to install commit

1Plugin marketplace

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

2Manually: put the files in place

.claude/commands/commit.md

Call it with /commit. For all projects use ~/.claude/commands/

Questions about commit

How do I install commit in Claude Code?

Add the marketplace with /plugin marketplace add rohitg00/pro-workflow, then install the plugin with /plugin install pro-workflow@pro-workflow.

What does commit do?

It checks repository state, runs quality gates, reviews staged changes for common issues, drafts a focused message, and creates the commit after confirmation.

Which checks does commit run?

It runs npm run lint, npm run typecheck, and npm test -- --changed --passWithNoTests. The --no-verify option skips these gates.

Source text

commit.md · MIT
---
description: Create a focused git commit after running quality checks.
---

# /commit - Smart Commit with Quality Gates

Create a well-crafted commit after running pro-workflow quality checks.

## Process

### 1. Pre-Commit Checks

```bash
git status
git diff --stat
```

- Any unstaged changes to include?
- Any files that shouldn't be committed (.env, credentials, large binaries)?

### 2. Quality Gates

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

- All checks passing? If not, fix before committing.
- Skip only if user explicitly says to.

### 3. Code Review

Scan staged changes for:
- `console.log` / `debugger` statements
- TODO/FIXME/HACK comments without tickets
- Hardcoded secrets or API keys
- Leftover test-only code

Flag any issues before proceeding.

### 4. Commit Message

Draft a commit message based on the staged diff:

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

<body - what changed and why>
```

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

**Rules:**
- Summary under 72 characters
- Body explains *why*, not *what*
- Reference issue numbers when applicable
- No generic messages ("fix bug", "update code")

### 5. Stage and Commit

```bash
git add <specific files>
git commit -m "<message>"
```

- Stage specific files, not `git add -A`
- Show the commit hash and summary after

### 6. Learning Check

After committing, ask:
- Any learnings from this change to capture?
- Any patterns worth adding to LEARNED?

## Usage

```
/commit
/commit --no-verify
/commit --amend
```

## Options

- **--no-verify**: Skip quality gates (use sparingly)
- **--amend**: Amend the previous commit instead of creating new
- **--push**: Push to remote after commit

## Example Flow

```
> /commit

Pre-commit checks:
  Lint: PASS
  Types: PASS
  Tests: 12/12 PASS

Staged changes:
  src/auth/login.ts (+45 -12)
  src/auth/session.ts (+8 -3)

Suggested commit:
  feat(auth): add rate limiting to login endpoint

  Limit login attempts to 5 per IP per 15 minutes using
  Redis-backed sliding window. Returns 429 with Retry-After
  header when exceeded.

  Closes #142

Commit? (y/n)
```

## Related Commands

- `/wrap-up` - Full end-of-session checklist
- `/learn-rule` - Capture a learning after committing

---

**Trigger:** Use when user says "commit", "save changes", "commit this", or is ready to commit after making changes.

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar slash commands

All slash commands for Git and GitHub →

commit by other authors comes first.

commit official Anthropic Creates a git commit based on current branch changes. Helps stage and commit diffs in Claude Code without typing commit messages. CX Codex +1 4,121installs commit evmts A slash command that builds your git commit: stages files, writes a conventional-commit message with an emoji, and runs the project's checks first. CX Codex +1 ★ 2,003repo stars commit CloudAI-X Inspects staged Git changes and creates a conventional commit with an automated message. CX Codex +1 ★ 1,424repo stars commit qdhenry Generates task-aligned Conventional Commits, tracks status transitions, and validates changed files against task scopes. CX Codex +1 ★ 1,357repo stars commit carlrannaberg Builds a git commit that matches your project's conventions: scans the diff, updates docs, writes the message. CX Codex +1 ★ 763repo stars setup-pre-commit Matt Pocock The setup-pre-commit skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. CX Codex +1 489,289installs caveman-commit JuliusBrussee caveman-commit generates terse Conventional Commits messages focused strictly on intent. Ideal for keeping git history clean without boilerplate or AI signatures. CX Codex +1 441,600installs git-commit official github A GitHub Copilot skill that turns a working diff into a commit: it reads the changes, stages the related files, writes a Conventional Commits message and runs git commit. CX Codex +1 47,165installs conventional-commit official github A GitHub Copilot skill that builds commit messages in the Conventional Commits format. After you change files, it checks the diff and commits with a message assembled from an XML template. CX Codex +1 17,103installs commit-context rohitg00 The commit-context skill links a file, function, or line to the commit and agent session behind it. Use it when a code change needs its history and context. CX Codex +1 14,700installs commit-history rohitg00 commit-history lists git commits linked to agent sessions with optional filters for branch, repo, and limit. CX Codex +1 14,600installs

From the same set83

The whole set →
context-engineer context-engineer audits context window usage across project files, tools, and MCP servers. Useful when sessions run slow or hit token compaction too often. CX Codex ★ 2,966repo stars pre-flight-discipline The pre-flight-discipline rule makes Claude Code surface assumptions, limit edits to the request, and verify multi-step work. It fits projects where drive-by changes are a concern. CX Codex +1 ★ 2,966repo stars smart-commit smart-commit runs lint, typecheck and tests before a commit, scans staged code for leftovers, then writes a conventional commit message from the diff. CX Codex +1 ★ 2,966repo stars file-watcher file-watcher configures Claude Code hooks to react to changes in configuration files, dependencies, and environment files. CX Codex +1 ★ 2,966repo stars mcp-audit mcp-audit analyzes connected MCP servers for token overhead, redundancy, and unused configurations. Run when sessions slow down or before connecting a new server. CX Codex +1 ★ 2,966repo stars tdd tdd guides Claude Code through a strict test-driven development loop: write a failing test, pass it with minimal code, and clean up. CX Codex +1 ★ 2,966repo stars module-shape The module-shape rule keeps public module APIs small while hiding complexity inside. Use it when designing modules or reviewing tests and dependencies. CX Codex +1 ★ 2,966repo stars improve-architecture improve-architecture audits code structure, identifies tangles in boundaries and dependencies, and proposes a ranked list of minimal moves that relieve the strain—no rewrite, only a plan you approve first. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open