Perform a code review.
Arguments: $ARGUMENTS (optional scope)
- commit: Review only staged files for commit
- pr [number]: Review all files changed in the current PR (or specific PR number)
- all: Review the entire codebase
- If no argument provided:
- If in a PR branch: defaults to 'pr'
- Otherwise: defaults to 'commit'
Phase 1: Scope Determination
- Determine scope based on $ARGUMENTS
- If reviewing a PR, fetch PR details and linked issue with
gh pr viewandgh issue view
Phase 2: Review
- Run available linting tools for detected languages
- Check against project standards from CLAUDE.md (80 char limit, whitespace, naming)
- Review for: correctness, performance, security, maintainability, test coverage
- If PR: check alignment with target issue requirements and CI/CD status with
gh pr checks
Phase 3: Synthesis
- Organise findings by priority:
- Critical issues (must fix)
- Important improvements (should fix)
- Suggestions (consider fixing)
- Positive observations
For each issue, provide location, description, suggested fix, and rationale.