Skip to main content
ClaudeWave
EN, English
Slash Command1.4k repo starsupdated 22d ago

commit

The commit command analyzes staged Git changes and automatically generates a conventional commit message following the format type(scope): description, using types such as feat, fix, docs, style, refactor, perf, test, and chore. Use this when you want to streamline committing staged changes with properly formatted messages that follow commit conventions without manually writing the message yourself.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/CloudAI-X/claude-workflow-v2/HEAD/commands/commit.md -o ~/.claude/commands/commit.md
Then start a new Claude Code session; the slash command loads automatically.

commit.md

## Context

- Current branch: !`git branch --show-current`
- Git status: !`git status --short`
- Staged changes: !`git diff --cached --stat`
- Staged diff: !`git diff --cached`
- Recent commits (for style reference): !`git log --oneline -5`

## Task

Based on the staged changes above, create a single git commit:

1. Analyze the staged diff to understand what changed
2. Generate a conventional commit message following the format:
   - `type(scope): description`
   - Types: feat, fix, docs, style, refactor, perf, test, chore
3. If no changes are staged, inform the user and suggest staging files
4. Execute the commit

$ARGUMENTS