AI-PR-Reviewer-Tasks
holasoymalva · holasoymalva/AI-PR-Reviewer-Tasks
Cho phép phân tích có hệ thống các thay đổi mã trong Pull Request bằng AI trong Cursor, phát hiện vấn đề, gợi ý cải tiến và đảm bảo chất lượng mã.
A simple AI PR Reviewer Tasks in Cursor
Xem trước
Bạn có thể làm gì với nó
- Phân tích có hệ thống các thay đổi mã trong Pull Request để tìm lỗi tiềm ẩn.
- Phát hiện các lỗ hổng bảo mật và nhận gợi ý sửa lỗi trong mã của bạn.
- Xác định các code smell và thực hành không tốt để cải thiện khả năng bảo trì.
Kiểm tra an toàn
Dùng được, nhưng nên đọc ghi chú trước.
- ●Hơn một năm không cập nhật.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
🔍 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
- Download the
.mdcfiles to your project (see Installation) - Open Cursor and navigate to your PR files
- Start simple:
Use @analyze-pr-changes.mdc - Tag your files:
@src/component.js @tests/test.js - 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:
- Systematic: Follow proven review patterns and best practices
- Comprehensive: Cover security, performance, maintainability, and testing
- Consistent: Apply the same rigorous standards across all reviews
- Educational: Learn from AI suggestions and improve coding practices
- 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
-
Download the toolkit
- Clone this repository:
git clone [repo-url] - Or download just the
/mdc/folder
- Clone this repository:
-
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 -
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