Skip to content

AlexZaccaria/CursorCommands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cursor Commands

Automated code review and PR management workflows for Cursor AI.

Overview

Pre-configured commands for systematic code review, PR comment management, and automated fixes.

⚠️ Templates Provided: BUGBOT checklist and test script are examples. Customize for your stack and workflow.

Quick Start

1. Setup GitHub Credentials

cp .cursor/credentials/github.json.template .cursor/credentials/github.json

Edit .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

2. Test Setup

bash .cursor/credentials/test-github-access.sh

⚠️ Note: Test script uses example repository. Edit script with your own repo for real testing.

Commands

/review-my-pr <PR-URL>

Analyzes 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

/fix-my-pr <PR-URL>

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.


/review-my-branch

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

/review-my-changes

Reviews local changes (staged + unstaged).

Output:

  • .cursor/reviews/review-changes-[timestamp].md - Full report
  • .cursor/commands/action-[file-slug]-[timestamp].md - Per-file fixes

Structure

.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)

Review Checklist (BUGBOT)

⚠️ Note: .cursor/BUGBOT.md is an example template. Adapt it to your project's needs.

12-section checklist covering:

  1. Architecture & Framework - Best practices, component naming
  2. Data Layer - HTTP client, queries, types
  3. Data Fetching - Configuration, caching, error handling
  4. Forms & Validation - Schema management
  5. Real-time Communication - WebSocket/SSE patterns
  6. File Structure - Organization conventions
  7. Code Quality - Functionality, readability, performance
  8. Security - Vulnerabilities, input validation
  9. Internationalization - i18n implementation
  10. Linting & Build - Zero errors policy
  11. Documentation & Language - English typos & grammar
  12. Anti-Patterns - Common mistakes to avoid

Severity Levels

  • 🔴 Critical - Blocks merge (security, breaking changes)
  • 🟡 Major - Should fix (architecture, types, errors)
  • 🟢 Minor - Optional (style, docs, optimizations)

Workflow Examples

PR Review + Auto-Fix

# 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

Branch Review Before Merge

# Review all changes vs staging
/review-my-branch

# Fix issues (if any)
# Open generated action commands in .cursor/commands/

Pre-Commit Review

# Review local changes
/review-my-changes

# Fix issues before committing

Features

  • 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)

Customization

⚠️ Important: This repository provides example templates. Adapt to your project.

Adapt BUGBOT Checklist

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.

Modify Test Script

Edit .cursor/credentials/test-github-access.sh:

  • Replace owner/repository with your actual repository
  • Replace PR #123 with a real PR you have access to
  • Adjust scope requirements if needed

Modify Commands

Edit files in .cursor/commands/ to:

  • Change output formats
  • Add custom verification steps
  • Adjust file naming conventions
  • Integrate with CI/CD

Security

  • ⚠️ Never commit .cursor/credentials/github.json
  • ⚠️ Add to .gitignore (included by default)
  • ✅ Token requires: repo, read:discussion scopes
  • ✅ Test script validates permissions

Requirements

  • Cursor AI Editor
  • GitHub Personal Access Token
  • Git repository
  • Bash (for test script)

License

Customize as needed for your project.


Maintained by: Alex Zaccaria

About

Cursor commands for automated PR review, fixes, and GitHub integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages