Prompt file imported from TrevorPLam/command-center (
.windsurf/workflows/pr-review-workflow.md). Copyright stays with the author.
Pull Request Code Review
This workflow guides you through a comprehensive code review process to ensure quality, security, and maintainability.
Step 1: Analyze the Changes
First, examine what files have been modified and understand the scope of the changes.
- Get the git diff to see all changes:
git diff main...HEAD --name-only
git diff main...HEAD --stat
- Read the full diff for each changed file to understand the implementation.
Step 2: Check Against Rules
Review each changed file against the relevant rules in our library:
- For TypeScript files: Check
typescript-standards.mdc - For API routes: Check
api-standards.mdcandinput-validation.mdc - For React components: Check
accessibility-standards.mdcandi18n-standards.mdc - For database changes: Check
database-schema-integrity.mdc - For security changes: Check
auth-standards.mdcandsecurity-headers.mdc - For performance changes: Check
frontend-performance.mdcandbackend-performance.mdc
Step 3: Verify Tests
Ensure adequate test coverage for the changes:
- Check if new functions/classes have corresponding test files
- Verify existing tests still pass
- Look for edge cases that might not be covered
- Check if integration tests are needed for API changes
Step 4: Security Review
Pay special attention to security implications:
- Check for any exposed secrets or credentials
- Verify proper authentication/authorization
- Look for potential XSS, SQL injection, or other vulnerabilities
- Review any changes to permissions or access controls
Step 5: Performance Impact
Assess the performance implications:
- Check for potential N+1 queries in database changes
- Look for missing indexes on new query patterns
- Verify proper caching implementation
- Check for bundle size impact in frontend changes
Step 6: Documentation
Ensure proper documentation:
- Check if README needs updates
- Verify inline documentation is accurate
- Look for outdated comments
- Check if API documentation needs updates
Step 7: Final Review
Provide a structured review summary with:
✅ What looks good
- List well-implemented changes
⚠️ Areas for improvement
- Specific issues with line numbers
- Suggestions for fixes
- Rule violations found
🚫 Blocking issues (if any)
- Security vulnerabilities
- Breaking changes
- Missing critical functionality
💡 Additional suggestions
- Performance optimizations
- Code style improvements
- Architectural considerations
Remember to be constructive and specific in your feedback. The goal is to improve the codebase, not to criticize the author.