Skip to content

holasoymalva/AI-PR-Reviewer-Tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” AI PR Reviewer Tasks πŸ€–

Welcome to AI PR Reviewer Tasks! This repository provides a collection of .mdc (Markdown Command) files designed to supercharge your Pull Request review process within the Cursor editor. Leverage AI to systematically analyze code changes, detect issues, suggest improvements, and ensure code quality before merging.

Transform your PR reviews from time-consuming manual tasks into efficient, thorough, and consistent quality checks!

πŸš€ Quick Start (5 minutes)

Prerequisites

  • Cursor Editor installed
  • Basic understanding of Pull Requests
  • A GitHub/GitLab repository with code changes

Your First Review

  1. Download the .mdc files to your project (see Installation)
  2. Open Cursor and navigate to your PR files
  3. Start simple: Use @analyze-pr-changes.mdc
  4. Tag your files: @src/component.js @tests/test.js
  5. Review results and follow AI suggestions

πŸ‘€ See It In Action

Before using the toolkit: ❌ "This code looks fine to me" (misses 3 security issues)

After using the toolkit: βœ… AI detects: SQL injection vulnerability in line 23
βœ… AI suggests: Use parameterized queries
βœ… AI proposes: 5 specific test cases for edge cases

πŸ“– Key Concepts

What is a Code Smell? πŸ€”
Code that works but is poorly written, hard to maintain, or follows bad practices.

What are .mdc files? πŸ“
Markdown Command files that give specific instructions to AI about how to analyze your code.

What is a PR Review? πŸ”
The process of checking code changes before they're merged into the main codebase.

✨ The Core Idea

Pull Request reviews are critical for code quality but can be inconsistent, time-consuming, and prone to human oversight. This toolkit aims to make PR reviews:

  1. Systematic: Follow proven review patterns and best practices
  2. Comprehensive: Cover security, performance, maintainability, and testing
  3. Consistent: Apply the same rigorous standards across all reviews
  4. Educational: Learn from AI suggestions and improve coding practices
  5. Efficient: Reduce review time while increasing thoroughness

πŸ› οΈ Available Tools

πŸ” analyze-pr-changes.mdc

Best for: Getting started, understanding what changed
Analyzes:

  • Code structure and architecture impact
  • Security vulnerability detection
  • Performance implications
  • Breaking changes identification
  • Dependencies and compatibility analysis

🚨 detect-code-smells.mdc

Best for: Deep code quality analysis
Identifies:

  • Code smells and anti-patterns
  • Complexity analysis
  • Naming conventions
  • Code duplication
  • Design pattern violations
  • Technical debt indicators

πŸ’‘ suggest-improvements.mdc

Best for: Getting actionable next steps
Provides:

  • Refactoring suggestions
  • Performance optimizations
  • Security enhancements
  • Code simplification opportunities
  • Best practice implementations

πŸ§ͺ propose-test-cases.mdc

Best for: Ensuring code is properly tested
Generates:

  • Missing test scenarios identification
  • Edge case coverage
  • Integration test suggestions
  • Mock and stub recommendations
  • Test structure improvements

πŸ“₯ Installation

  1. Download the toolkit

    • Clone this repository: git clone [repo-url]
    • Or download just the /mdc/ folder
  2. Place in your project

    your-project/
    β”œβ”€β”€ mdc/                    ← Put the files here
    β”‚   β”œβ”€β”€ analyze-pr-changes.mdc
    β”‚   β”œβ”€β”€ detect-code-smells.mdc
    β”‚   β”œβ”€β”€ suggest-improvements.mdc
    β”‚   └── propose-test-cases.mdc
    └── src/
        └── your-code-files.js
    
  3. You're ready! Open Cursor and start using @analyze-pr-changes.mdc

🎯 Choose Your Path

πŸš€ Beginner Path: Start Simple

Option A: Quick Health Check (2 minutes)

Use @analyze-pr-changes.mdc
Review this file: @src/myfile.js
Focus on: security and basic quality

Option B: One-Tool Focus (5 minutes)

Use @detect-code-smells.mdc for @src/component.js
Focus on: readability and maintainability

πŸ” Intermediate Path: Comprehensive Review

Perfect for important features or when you have more time:

Step 1: Get the Big Picture

Use @analyze-pr-changes.mdc
Review these changed files: @file1.js @file2.py @component.tsx
Context: [Brief description of the feature/fix]

Step 2: Deep Dive on Quality

Use @detect-code-smells.mdc for the files we just analyzed
Focus on: [performance, security, or maintainability]

Step 3: Get Specific Suggestions

Use @suggest-improvements.mdc based on the previous analysis
Prioritize: [high-impact changes, security fixes, or performance gains]

Step 4: Ensure Proper Testing

Use @propose-test-cases.mdc for the changed functionality
Include: [unit tests, integration tests, or specific test scenarios]

🎯 Specialized Workflows

🚨 Security-Focused Review (For sensitive code)

Use @analyze-pr-changes.mdc with security focus
Then @detect-code-smells.mdc emphasizing security patterns

πŸ§ͺ Test-First Review (For logic-heavy changes)

Use @propose-test-cases.mdc first to understand test requirements
Then @analyze-pr-changes.mdc to verify implementation quality

⚑ Performance Review (For optimization work)

Use @analyze-pr-changes.mdc focusing on performance
Then @suggest-improvements.mdc for specific optimizations

πŸ“Š What Each Tool Checks

πŸ”’ Security Review

  • Authentication and authorization checks
  • Input validation and sanitization
  • SQL injection and XSS prevention
  • Sensitive data handling
  • Dependency vulnerability assessment

⚑ Performance Review

  • Algorithm complexity analysis
  • Database query optimization
  • Memory usage patterns
  • Caching strategies
  • Bundle size impact

πŸ—οΈ Architecture & Design

  • SOLID principles adherence
  • Design pattern usage
  • Code organization and structure
  • Separation of concerns
  • API design consistency

πŸ§ͺ Testing & Quality

  • Test coverage adequacy
  • Test quality and effectiveness
  • Edge case handling
  • Error handling patterns
  • Code documentation

πŸ”§ Maintainability

  • Code readability and clarity
  • Naming conventions
  • Code duplication
  • Technical debt assessment
  • Future extensibility

πŸ†˜ Common Issues & Solutions

"AI doesn't understand my code"

  • βœ… Make sure to tag files with @ symbol: @src/file.js
  • βœ… Provide brief context about what the code does
  • βœ… Start with smaller files first

"Too many suggestions overwhelming me"

  • βœ… Start with just security and performance focus
  • βœ… Use "Quick Health Check" pattern for small changes
  • βœ… Focus on "High Priority" items first

"Don't understand the AI suggestions"

  • βœ… Ask AI to explain specific recommendations
  • βœ… Start with simple fixes before complex refactoring
  • βœ… Use one tool at a time instead of all four

"Takes too long"

  • βœ… Use quick patterns for small PRs
  • βœ… Save comprehensive reviews for important features
  • βœ… Focus on changed files only, not entire codebase

πŸ“ Toolkit Structure

/mdc/
β”œβ”€β”€ analyze-pr-changes.mdc      # πŸ” Start here - comprehensive PR analysis
β”œβ”€β”€ detect-code-smells.mdc      # 🚨 Code quality and anti-pattern detection  
β”œβ”€β”€ suggest-improvements.mdc    # πŸ’‘ Actionable improvement recommendations
└── propose-test-cases.mdc      # πŸ§ͺ Test coverage and scenario suggestions

🎯 Best Practices

πŸ”„ For Reviewers

  • Start simple: Use analyze-pr-changes.mdc first for context
  • Be selective: Use specific tools based on PR type and complexity
  • Stay constructive: Always provide actionable feedback
  • Prioritize: Focus on high-impact improvements first

πŸ‘¨β€πŸ’» For Developers

  • Be proactive: Run analysis tools before submitting PRs
  • Learn actively: Use suggestions to improve coding skills
  • Start small: Begin with quick checks, build up to comprehensive reviews
  • Security first: Address security and performance issues before style

🏒 For Teams

  • Standardize: Establish consistent review standards using these tools
  • Customize: Create team-specific adjustments for common patterns
  • Measure: Use analysis results for code quality metrics
  • Share: Spread learnings from AI suggestions across the team

βš™οΈ Customization Options

Each .mdc file can be tailored to your needs:

  • Language-Specific: Adjust for Python, JavaScript, Java, etc.
  • Framework-Focused: Customize for React, Django, Spring, etc.
  • Industry Standards: Adapt for fintech, healthcare, or other domains
  • Team Preferences: Include your organization's coding standards

πŸ“ˆ Benefits

  • ⚑ Faster Reviews: Systematic approach reduces review time
  • 🎯 Higher Quality: Catch issues that manual reviews might miss
  • πŸ“Š Consistency: Apply same standards across all PRs
  • πŸ“š Learning: Improve coding skills through AI suggestions
  • πŸ”’ Security: Proactive identification of security vulnerabilities
  • πŸ“ Documentation: Generate review comments and improvement tracking

πŸ”§ Integration Tips

With CI/CD Pipelines

  • Use analysis results to generate automated comments
  • Set quality gates based on detected issues
  • Track code quality metrics over time

With Code Review Tools

  • Copy AI suggestions into GitHub/GitLab comments
  • Use analysis as basis for review discussions
  • Create follow-up issues for larger improvements

With Development Workflow

  • Run checks before creating PRs
  • Use as pair programming assistant
  • Include in code quality training

πŸ’‘ Cheat Sheet

Quick Commands

# Basic analysis
Use @analyze-pr-changes.mdc with @src/file.js

# Quality check
Use @detect-code-smells.mdc for @components/Button.jsx

# Get improvements
Use @suggest-improvements.mdc based on previous analysis

# Check testing
Use @propose-test-cases.mdc for @utils/calculator.js

When to Use What

  • Small bug fix: Just analyze-pr-changes.mdc
  • New feature: All four tools in sequence
  • Security code: Focus on analyze + detect-code-smells
  • Performance work: analyze + suggest-improvements

🀝 Contributing

Help improve the AI PR Reviewer toolkit:

  • Share examples of effective reviews
  • Suggest new analysis patterns
  • Report issues with detection accuracy
  • Contribute language-specific improvements

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Built on proven code review practices and powered by AI to make quality assurance more accessible and consistent for development teams.


Ready to revolutionize your PR review process? Start with @analyze-pr-changes.mdc and let AI help you catch issues before they reach production! πŸš€