PR Reviewer
Automated review of SparQ pull requests against project standards defined in CLAUDE.md.
When to Use
- Before pushing a branch or opening a PR
- Reviewing someone else's contribution
- Validating your own changes before requesting review
Workflow
Step 1: Identify Changed Files
- Determine the base branch — use the branch or PR number provided as argument (e.g.,
/review-pr feature/xyzor/review-pr 42), the PR target branch if in a PR context, or default tomain - Run
git diff --name-only {base}...HEADto list all changed files - Run
git diff --stat {base}...HEADfor a size overview - Classify each file into categories:
- cli:
bin/**/*.mjs - agent:
claude/agents/*.md - skill:
claude/skills/** - reference:
claude/skills/sparq-shared/references/** - test:
test/**/*.test.mjs - config:
biome.json,mcp/*.json,.github/** - docs: root
*.mdfiles,docs/**
- cli:
- If no changed files found, report "No changes detected" and stop
Step 2: Run Quality Gates
Execute and capture results:
npm run check— must exit 0 (runs Biome lint + all tests)- For each changed
.mjsfile:node --check {file}— must exit 0 - For each new
.mjsfile inbin/lib/: verify a correspondingtest/unit/{name}.test.mjsexists - For each new
.mjsfile inbin/lib/commands/: verify it is registered inconstants.mjsandhelp.mjs
Report pass/fail for each gate. If npm run check fails, include the relevant error output.
Step 3: Category-Specific Review
Load references/review-checklist.md and review each changed file against its category-specific criteria. The checklist covers: CLI code, agents, skills, references, tests, MCP configs, security, and prompt optimization compliance.
For any agent/skill/reference changes with >20 lines of prompt content changed, check for evidence that /sparq:prompt-optimizations was applied. Flag as Warning if no optimization evidence found.
Step 4: Produce Review Report
Output using this structure:
## PR Review: {branch name}
**Files reviewed**: {count} ({category breakdown})
**Quality gates**: {pass/fail summary}
### Critical
{Findings that MUST be fixed — broken gates, missing required sections, real credentials}
### Warnings
{Findings that SHOULD be addressed — line count limits, missing optimization, missing tests}
### Info
{Non-blocking suggestions and observations}
### Verdict
{One of: Ready to merge | Needs fixes ({count} critical, {count} warnings) | Needs rework}
Omit empty severity sections. If all gates pass and no findings exist, output a short "All clear" summary.
References
CLAUDE.md— canonical code standards and quality gates.claude/skills/review-pr/references/review-checklist.md— detailed review criteria by categoryclaude/skills/sparq-prompt-optimizations/SKILL.md— prompt optimization requirements