Commit with Code Review
Runs CodeRabbit review on staged changes, then commits if approved.
Flow
- Check for staged changes
- Run CodeRabbit review (
cr review --plainfor headless/Claude compatibility) - Show review results
- If review passes → prompt for commit message → commit
- If review fails → show issues → ask user if they want to proceed anyway
Usage
# Stage your changes first
git add <files>
# Standard commit
/commit
# Ralph mode — atomic commit + mark story criterion
/commit --story=US-106 --message="feat: US-106 description"
What This Skill Does
When invoked, Claude will:
- Check staged changes: Run
git diff --staged --statto show what's staged - Run CodeRabbit: Execute
cr review --plain(headless mode, works from Claude) - Evaluate results:
- If CR passes (no critical issues): proceed to commit
- If CR fails: show issues and ask user for decision
- Commit: Generate commit message based on changes, commit with co-author
Ralph Mode (Story Commits)
When --story is provided, this skill does atomic commit + criterion marking:
- Stages files (specified or auto-detected)
- Commits (pre-commit hook runs all tests)
- If commit succeeds → marks the commit criterion as checked in story JSON
- If commit fails → neither happens, reports failure
Ralph Mode Flags
| Flag | Description |
|---|---|
--story=ID |
Story ID (e.g., US-106, BUG-028) — triggers Ralph mode |
--message=MSG |
Commit message (required in Ralph mode) |
--files=PATHS |
Files to stage (default: prd-json/ + modified files) |
--dry-run |
Show what would happen without doing it |
Why Ralph Mode Exists
- Atomic: Either both happen (commit + check) or neither
- No double-testing: Uses pre-commit hook, doesn't run tests twice
- Clean failure: If tests fail, criterion stays unchecked for retry
Requirements
crCLI installed (CodeRabbit)- Changes staged with
git add
After Committing
Committing is ONE step in the full workflow. After commit:
- Push →
git push -u origin <branch> - PR + Review + Merge →
/pr-loop(the full loop)
Do NOT stop at commit. The mission is MERGED, not committed.