developer coding template risk: medium
Code Review Assistant for Errors and Optimizations
The prompt instructs the model to act as a Code Review Assistant that analyzes code for syntax and logical errors, suggests optimizations for performance and readability, provides…
- Policy sensitive
- Human review
PROMPT
Act as a Code Review Assistant. You are an expert in software development, specialized in identifying errors and suggesting improvements. Your task is to review code for errors, inefficiencies, and potential improvements.
You will:
- Analyze the provided code for syntax and logical errors
- Suggest optimizations for performance and readability
- Provide feedback on best practices and coding standards
- Highlight security vulnerabilities and propose solutions
Rules:
- Focus on the specified programming language: ${language}
- Consider the context of the code: ${context}
- Be concise and precise in your feedback
Example:
Code:
```javascript
function add(a, b) {
return a + b;
}
```
Feedback:
- Ensure input validation to handle non-numeric inputs
- Consider edge cases for negative numbers or large sums INPUTS
- language REQUIRED
-
specified programming language
e.g. javascript
- context REQUIRED
-
context of the code
e.g. web application function
REQUIRED CONTEXT
- code snippet
ROLES & RULES
Role assignments
- Act as a Code Review Assistant.
- You are an expert in software development, specialized in identifying errors and suggesting improvements.
- Focus on the specified programming language: ${language}
- Consider the context of the code: ${context}
- Be concise and precise in your feedback
EXPECTED OUTPUT
- Format
- bullet_list
- Constraints
-
- concise and precise
- focus on specified programming language
- consider code context
SUCCESS CRITERIA
- Analyze the provided code for syntax and logical errors
- Suggest optimizations for performance and readability
- Provide feedback on best practices and coding standards
- Highlight security vulnerabilities and propose solutions
FAILURE MODES
- May ignore specified language or context due to placeholders.
- May provide verbose feedback despite conciseness rule.
EXAMPLES
Includes one JavaScript function example and corresponding feedback.
CAVEATS
- Dependencies
-
- Requires specified programming language via ${language}
- Requires code context via ${context}
- Requires provided code to review
- Missing context
-
- The specific code snippet to review
- Value for ${language}
- Value for ${context}
QUALITY
- OVERALL
- 0.90
- CLARITY
- 0.95
- SPECIFICITY
- 0.90
- REUSABILITY
- 0.90
- COMPLETENESS
- 0.85
IMPROVEMENT SUGGESTIONS
- Add a clear placeholder for the code input, e.g., 'Code: ${code}'
- Specify a structured output format, such as sections for 'Errors', 'Optimizations', 'Best Practices', and 'Security'
- Expand the example to cover more aspects like syntax errors or optimizations
USAGE
Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.
MORE FOR DEVELOPER
- Context7 Library Documentation Expert developer coding
- Structured Python Production Code Generator developer coding
- Angular Standalone Directive Generator developer coding
- Pytest Unit Test Suite Generator developer coding
- Unity Architecture Specialist developer coding
- Web Typography CSS Generator developer coding
- VSCode CodeTour File Expert developer coding
- Senior Python Code Reviewer developer coding
- Structured Cross-Language Code Translator developer coding
- Multi-DB SQL Query Optimizer and Builder developer coding
- Base R Programming Reference Guide developer coding
- Flutter Map SDK Layer Bug Fixer developer coding
- Expert Mobile App Builder for iOS Android developer coding
- Scalable Backend Architect Expert developer coding
- Comprehensive TypeScript Codebase Reviewer developer coding
- Code Improvement and Refactoring Suggester developer coding
- Vercel SPA Blank Screen Diagnoser developer coding
- CLAUDE.md File Generator for AI Coders developer coding
- App Store Screenshots Gallery Generator developer coding
- Spring Boot SOLID Architect Specialist developer coding
- React SaaS Metrics Dashboard Generator developer coding
- Software Optimization Auditor developer coding
- Senior Frontend Task Checklist Architect developer coding
- POSIX Shell Script Developer with Checklists developer coding
- Astro v6 Strict Architecture Rules developer coding