Automated code review and PR management workflows for Cursor AI.
Pre-configured commands for systematic code review, PR comment management, and automated fixes.
cp .cursor/credentials/github.json.template .cursor/credentials/github.jsonEdit .cursor/credentials/github.json:
{
"github": {
"token": "ghp_your_token_here",
"username": "your-username"
}
}Required Scopes: repo, read:discussion
Generate token: https://github.com/settings/tokens
bash .cursor/credentials/test-github-access.shAnalyzes PR comments and generates action commands.
Output:
.cursor/reviews/review-pr-[NUMBER]-[timestamp].md- Full report.cursor/commands/action-pr-[NUMBER]-comment-[N]-[timestamp].md- Per-comment actions
Example:
/review-my-pr https://github.com/owner/repo/pull/582
Executes all action commands, applies fixes, marks comments as resolved.
Auto-runs /review-my-pr if no action commands exist.
Output:
.cursor/fixes/fix-report-pr-[NUMBER]-[timestamp].md- Execution report.cursor/fixes/fix-log-pr-[NUMBER]-comment-[N]-[timestamp].md- Per-fix logs
Cleanup: Deletes action commands after processing.
Reviews all changes in current branch vs staging.
Checks: Architecture, code quality, types, security, documentation, typos.
Output:
.cursor/reviews/review-branch-[timestamp].md- Full report.cursor/commands/action-[file-slug]-[timestamp].md- Per-file fixes
Reviews local changes (staged + unstaged).
Output:
.cursor/reviews/review-changes-[timestamp].md- Full report.cursor/commands/action-[file-slug]-[timestamp].md- Per-file fixes
.cursor/
├── BUGBOT.md # Review checklist (12 sections)
├── commands/ # Command definitions
│ ├── review-my-pr.md
│ ├── fix-my-pr.md
│ ├── review-my-branch.md
│ └── review-my-changes.md
├── credentials/ # Auth config (gitignored)
│ ├── github.json.template
│ ├── github.json # YOUR CREDENTIALS
│ ├── README.md
│ └── test-github-access.sh
├── reviews/ # Generated review reports
├── fixes/ # Generated fix logs
└── rules/ # (Reserved for future use)
.cursor/BUGBOT.md is an example template. Adapt it to your project's needs.
12-section checklist covering:
- Architecture & Framework - Best practices, component naming
- Data Layer - HTTP client, queries, types
- Data Fetching - Configuration, caching, error handling
- Forms & Validation - Schema management
- Real-time Communication - WebSocket/SSE patterns
- File Structure - Organization conventions
- Code Quality - Functionality, readability, performance
- Security - Vulnerabilities, input validation
- Internationalization - i18n implementation
- Linting & Build - Zero errors policy
- Documentation & Language - English typos & grammar
- Anti-Patterns - Common mistakes to avoid
- 🔴 Critical - Blocks merge (security, breaking changes)
- 🟡 Major - Should fix (architecture, types, errors)
- 🟢 Minor - Optional (style, docs, optimizations)
# Single command (auto-runs review if needed)
/fix-my-pr https://github.com/owner/repo/pull/582
# Or manual two-step
/review-my-pr https://github.com/owner/repo/pull/582
/fix-my-pr https://github.com/owner/repo/pull/582# Review all changes vs staging
/review-my-branch
# Fix issues (if any)
# Open generated action commands in .cursor/commands/# Review local changes
/review-my-changes
# Fix issues before committing- ✅ Automated PR Analysis - Extracts and categorizes all comments
- ✅ Action Commands - Step-by-step fix instructions per issue
- ✅ Auto-Fix Execution - Applies fixes, verifies, marks resolved
- ✅ GitHub Integration - Marks comments as resolved via GraphQL
- ✅ Comprehensive Checks - 12-section architecture review
- ✅ Typo Detection - English spelling/grammar verification
- ✅ Severity Classification - Critical/Major/Minor prioritization
- ✅ Clean Workflows - Auto-cleanup of processed commands
- ✅ Iterative Support - Re-run safe (skips resolved comments)
Edit .cursor/BUGBOT.md to match your project:
- Add/remove sections based on your tech stack
- Customize severity rules for your workflow
- Update anti-patterns list with team conventions
- Add project-specific checks (frameworks, libraries, patterns)
Example: If using Vue instead of React, update component patterns. If using REST instead of GraphQL, adjust API sections.
Edit .cursor/credentials/test-github-access.sh:
- Replace
owner/repositorywith your actual repository - Replace PR
#123with a real PR you have access to - Adjust scope requirements if needed
Edit files in .cursor/commands/ to:
- Change output formats
- Add custom verification steps
- Adjust file naming conventions
- Integrate with CI/CD
⚠️ Never commit.cursor/credentials/github.json⚠️ Add to.gitignore(included by default)- ✅ Token requires:
repo,read:discussionscopes - ✅ Test script validates permissions
- Cursor AI Editor
- GitHub Personal Access Token
- Git repository
- Bash (for test script)
Customize as needed for your project.
Maintained by: Alex Zaccaria