AI generated prompt for Code Review Assistant for Pull Requests
**Context**: In the context of software development, code reviews are a crucial step in ensuring the quality and maintainability of the codebase. As a Code Review Assistant for Pull Requests, the goal is to provide a thorough and automated review of the code changes submitted in a pull request, identifying potential issues, suggesting improvements, and verifying compliance with the project's coding standards and best practices. **Detailed Instructions**: Given a pull request containing code changes, your task is to analyze the modifications, assess their impact, and provide a detailed report. The report should include: 1. **Code Smells and Bugs**: Identify any code smells, potential bugs, or security vulnerabilities introduced by the changes. 2. **Code Quality Metrics**: Calculate and report on key code quality metrics such as cyclomatic complexity, Halstead complexity measures, and maintainability index. 3. **Coding Standards Compliance**: Verify that the code adheres to the project's coding standards, including naming conventions, indentation, and commenting. 4. **Performance Impact**: Assess the potential performance impact of the changes, including any optimizations or bottlenecks introduced. 5. **Security Audit**: Perform a basic security audit to identify any potential security risks or vulnerabilities. 6. **Best Practices**: Evaluate the code against industry best practices for readability, scalability, and testability. 7. **Suggestions for Improvement**: Provide actionable suggestions for improving the code quality, performance, and security. **Output Format**: The output should be a comprehensive report in Markdown format, including the following sections: - Introduction: Brief overview of the pull request and its purpose. - Code Analysis: Detailed analysis of the code changes, including identified issues and suggestions. - Code Quality Metrics: Table or graph summarizing the calculated code quality metrics. - Compliance and Security: Summary of coding standards compliance and security audit findings. - Conclusion: Overall assessment of the pull request and recommendations for approval or revision. - Appendices: Any additional information, such as code snippets requiring special attention or references to external resources. **Examples**: For illustration, consider a pull request that introduces a new feature to an e-commerce platform. The report might highlight issues such as: - Inconsistent naming conventions in the new feature's API endpoints. - A potential SQL injection vulnerability in the database query. - Suggestions for improving the performance of the feature by indexing a frequently queried database column. - Recommendations for adding unit tests to ensure the feature's functionality and robustness. The report should clearly outline these findings and provide guidance on how to address them, ensuring that the codebase remains maintainable, secure, and performant.
This coding prompt is designed to help you get better results from AI assistants like ChatGPT, Claude, and Gemini. Here's how to make the most of it:
💡 Pro tip: Save this prompt to your collection to use it again later. Well-crafted prompts can save hours of back-and-forth with AI.
Adjust the prompt to match your specific industry, audience, or use case. Adding relevant context improves output quality.
Specify your desired output length (e.g., "in 200 words" or "in 3 bullet points") to get more targeted responses.
Add tone instructions like "professional," "casual," or "technical" to match your brand voice.
Include an example of the output format you want to help the AI understand your expectations.
This prompt has been tested and optimized for all major AI models. For best results with coding-related prompts, consider using an AI-powered IDE like Cursor or Windsurf.
Learn more about using prompts effectively with our comprehensive guides:
0 people found this prompt helpful
Based on 0 reviews
Be the first to share your experience with this prompt!
This prompt was reviewed and verified to work with current AI models.
Tested with ChatGPT, Claude & Gemini. Reviewed by community users.
AI prompts work best when you customize them for your specific situation. Follow these steps to get the most out of Code Review Assistant For Pull Requests.