Review Commit Skill
This skill provides a convenient slash command to launch the commit-cleaner agent, which reviews and cleans up staged changes before committing.
Usage
Simply type /review-commit and the commit-cleaner agent will be invoked to:
- Review all staged changes
- Remove redundant code and code smells
- Filter out documentation and tracking files
- Eliminate code duplication
- Ensure succinct implementations
- Organize assets into util folders
- Prepare code for a clean commit
How It Works
When you invoke this skill, it automatically launches a Task with the commit-cleaner subagent. The agent will:
- Analyze staged and unstaged changes using
git status and git diff
- Review code quality and identify issues
- Clean up redundancies and code smells
- Unstage non-essential files (docs, tracking MDs)
- Organize assets into util-scripts/
- Provide a summary of changes and files ready to commit
When to Use
- Before committing code to ensure quality
- When you want to clean up messy staged changes
- To remove documentation files from staging
- To consolidate duplicate code before committing
- To get a code review before pushing changes
Important Notes
The commit-cleaner agent will NOT commit your changes. It only prepares and cleans the staging area. You must run git commit manually after the agent completes its review.
Example Workflow
# Stage your changes
git add .
# Review and clean
/review-commit
# After agent completes, commit manually
git commit -m "Your commit message"
Integration with Git Workflow
This skill is designed to fit into your normal git workflow:
- Make code changes
- Stage files with
git add
- Run
/review-commit to clean and review
- Review the agent's summary
- Commit manually with
git commit
What Gets Reviewed
The agent reviews:
- Source code files for redundancies and code smells
- Documentation files (to unstage them)
- Asset files (to organize them)
- Duplicate code across multiple files
- Code complexity and clarity
What Gets Cleaned
The agent will:
- Remove dead code and unused imports
- Extract duplicate logic into utilities
- Replace magic numbers with constants
- Simplify nested conditionals
- Improve naming clarity
- Unstage documentation and tracking files
- Move assets to util-scripts/ folder