Skip to main content
ClaudeWave
Slash Command828 estrellas del repoactualizado 13d ago

commit

The commit slash command automates git commits by either using a provided message or analyzing staged changes to generate a meaningful commit following conventional format conventions. Use this to quickly save work with properly formatted commit messages without manually typing them.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/01-basic-commands/.claude/commands/commit.md -o ~/.claude/commands/commit.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

commit.md

Create a git commit.

If a message is provided: $ARGUMENTS
- Use that as the commit message

If no message is provided:
- Analyze the changes with `git diff --staged` (or `git diff` if nothing staged)
- Generate a concise, meaningful commit message

## Steps

1. Check `git status` to see current state
2. If nothing staged, run `git add .` to stage all changes
3. Review what will be committed with `git diff --staged`
4. Create commit:
   - If `$ARGUMENTS` is provided, use it as the message
   - Otherwise, generate a message based on the diff
5. Show the commit result

## Commit Message Format

- Start with type: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`
- Be concise but descriptive (max 72 chars for first line)
- Example: `feat: add user authentication with JWT`

## Output

Show a brief confirmation:
```
✓ Committed: [commit message]
  [number] files changed
```