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.
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.mdcommit.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 ```
Review code changes for quality, security, and best practices. Proactively use this after code modifications.
Run tests and report results concisely. Use this after code changes to verify everything works.
Analyze log files and extract actionable insights. Use when troubleshooting issues or investigating incidents.
Explore and analyze API-related code. Use when investigating endpoints, routing, or HTTP handling.
Explore and analyze authentication-related code. Use when investigating auth flows, session management, or security.
Explore and analyze database-related code. Use when investigating data models, queries, or persistence.
Analyze root cause of bugs after location is identified. Second step in bug investigation.
Implement bug fixes after analysis is complete. Third step in bug fix pipeline.