An automated review system that uses two AI agents to iteratively review and improve PRs until both agents approve:
- @review agent - Comprehensive full-stack code reviewer (checks constitution, patterns, quality, security)
- GitHub Copilot - Additional review perspective via GitHub CLI
Full automated review loop that alternates between @review agent and GitHub Copilot for up to 3 iterations.
Usage:
# Auto-detect PR from current branch
/review-loop
# Specify PR number
/review-loop 123What it does:
- @review agent reviews the PR
- Implements recommended changes (if any)
- Waits for GitHub Copilot review (auto-triggered on push)
- @review re-evaluates Copilot suggestions
- Implements agreed-upon changes
- Repeats until both approve or max iterations reached
Exit conditions:
- ✅ Both agents approve
⚠️ Max iterations reached (3)- ❌ Tests fail
Single-pass review using @review agent only. No automation, no changes made.
Usage:
# Quick review of current PR
/review
# Review specific PR
/review 123Use this when you want feedback without automated implementation.
Check PR status without triggering any reviews.
Usage:
/review-statusShows:
- Review decision
- Status checks
- Recent comments
- Recent commits
# 1. Create PR from your feature branch
git checkout feature/my-feature
gh pr create --base develop --title "Add new feature"
# 2. Run automated review loop
/review-loop
# The system will:
# - @review checks constitution, patterns, code quality
# - Fixes issues automatically
# - Waits for Copilot review (auto-triggered on push)
# - Iterates until both approve
# 3. Check final status
/review-status
# 4. Merge when approved
gh pr merge# Just want to see what @review thinks
/review
# Read feedback, implement changes manually
# Push changes
git push
# Run full loop when ready
/review-loopThe @review agent is a principal full-stack code reviewer that checks:
- Code structure, design patterns, architectural decisions
- Separation of concerns, modularity, maintainability
- Error handling and edge case coverage
- Performance implications and scalability
- Security vulnerabilities (XSS, SQL injection, CSRF, auth flaws)
- Data validation and sanitization
- API security, authentication, authorization
- Sensitive data exposure and encryption
- Frontend-backend API contracts and data flow
- State management and data synchronization
- Database schema design and query optimization
- Caching strategies and data consistency
- Language-specific conventions and framework best practices
- Code comments, documentation, type safety
- Testing coverage and test quality
- Accessibility, SEO, cross-browser compatibility
- Constitution compliance (
.specify/memory/constitution.md) - Pattern adherence (
.specify/memory/patterns.md) - Repository pattern enforcement
- Test isolation patterns
The @review agent structures feedback as:
- Summary - Brief overview of code quality and concerns
- Best Practices - Framework-specific optimizations
- Positive Notes - Well-implemented aspects
- Improvements - Code quality and maintainability suggestions
- Critical Issues - Security vulnerabilities, bugs, architectural problems
- ✅ Approved: Response contains "APPROVED: All changes look good"
- ❌ Changes requested: Response contains "CHANGES REQUESTED:"
- ✅ Approved: Check completes with no issues, or contains "LGTM"/"looks good"
- ❌ Changes requested: Provides specific suggestions in PR comments
⚠️ Timeout: If check doesn't complete in 3 minutes, treated as approved (continue anyway)
- Max iterations: Prevents infinite loops (default: 3)
- Test verification: All changes must pass
npm test - Read-only @review: Agent cannot directly modify code
- Explicit approval: Both agents must explicitly approve
- Push after commit: Changes immediately pushed to remote
- Copilot timeout: 3-minute limit prevents indefinite waiting (60s initial + 2min polling)
- Ensure you're on a feature branch with an open PR
- Or specify PR number:
/review-loop 123
- Fix test failures manually
- Re-run
/review-loopto continue
- Copilot may still be processing
- Check PR manually for Copilot feedback
- Loop continues anyway (treats as approved)
- Review the suggested changes
- Some issues may need manual intervention
- Check
/review-statusfor details
- Verify
~/.opencode/agents/review.mdexists - Try invoking directly:
@review please review this PR
Edit .opencode/command/review-loop.md and change:
⚙️ Max iterations: 3Edit ~/.opencode/agents/review.md to adjust:
- Review criteria
- Output format
- Approval signals
- Tool permissions
This complements your existing SpecKit workflow:
# Existing: Feature development
/speckit.specify
/speckit.plan
/speckit.implement
# New: Automated review
git push
gh pr create --base develop
/review-loop
# Existing: Merge when ready
gh pr merge- Start with
/reviewfor quick feedback before committing to full loop - Use
/review-statusto check progress mid-loop - Interrupt with Ctrl+C if needed - safe to re-run
- Max 3 iterations prevents runaway automation
- Both agents must approve ensures high quality
Potential improvements:
- Resume capability after interruption
- Configurable iteration limits per PR
- Multiple reviewer agents (security, performance, etc.)
- Integration with GitHub Actions
- Slack/Discord notifications on completion
- Review history tracking