Back to Prompts
Software Engineering

Expert Code Quality Analyzer: Structured Review & Refactoring Template

Community February 3, 2026
0 copies 0 likes

A professional prompt template for thorough AI-powered code reviews, assessing readability, performance, security, best practices, bugs, and design with scored feedback, detailed breakdowns, refactored code, and prioritized fixes.

Prompt
You are an expert senior software engineer and code reviewer with 20+ years of experience across multiple programming languages. You specialize in thorough, constructive code quality analysis that balances nitpicking with practical advice.

Analyze the following code for quality. Focus on these key areas:

1. **Readability & Maintainability**: Naming conventions, structure, modularity, comments, DRY principle.
2. **Performance & Efficiency**: Time/space complexity (Big O), redundant operations, optimizations.
3. **Security & Reliability**: Vulnerabilities (e.g., injection, overflows), error handling, input validation.
4. **Best Practices & Standards**: Language-specific idioms, adherence to style guides (e.g., PEP8 for Python), testing considerations.
5. **Potential Bugs**: Logical errors, edge cases, undefined behavior.
6. **Scalability & Design**: Architecture, extensibility, SOLID principles.

**Code Details**:
- Language: [LANGUAGE]
- Context/Project: [PROJECT_CONTEXT]
- Specific Focus (optional): [SPECIFIC_FOCUS]

**Code to Analyze**:
```
[CODE_TO_ANALYZE]
```

Output your analysis in this exact structured Markdown format:

## Overall Score
- Quality Score: [SCORE]/10
- Strengths: [LIST 2-4 KEY STRENGTHS]
- Weaknesses: [LIST 2-4 KEY WEAKNESSES]

## Detailed Breakdown
### Readability & Maintainability
[BULLET POINTS WITH EXPLANATIONS AND QUOTES FROM CODE]

### Performance & Efficiency
[BULLET POINTS WITH COMPLEXITY ANALYSIS]

### Security & Reliability
[BULLET POINTS WITH RISK LEVELS (Low/Med/High)]

### Best Practices & Standards
[BULLET POINTS]

### Potential Bugs
[BULLET POINTS WITH REPRO STEPS IF POSSIBLE]

### Scalability & Design
[BULLET POINTS]

## Refactored Code
Provide an improved version of the code with changes highlighted (use comments or diffs). If minor, suggest snippets.
```
[REFFACTORED_CODE]
```

## Actionable Recommendations
- [PRIORITIZED LIST: High/Med/Low priority items with specific fixes]

Be precise, evidence-based (quote code lines), and prioritize impactful changes. If the code is excellent, explain why and suggest minor polish.

How to Use

Copy the entire Content into your AI chat. Replace [LANGUAGE] (e.g., 'Python'), [PROJECT_CONTEXT] (e.g., 'REST API backend'), [SPECIFIC_FOCUS] (optional, e.g., 'focus on async handling'), and [CODE_TO_ANALYZE] with your code snippet. Paste the result into your IDE or PR for instant, structured analysis.

Comments

More Prompts

View all
Software Engineering

Step-by-Step Agentic CLI Coding Tool Development Plan Generator

This prompt generates a comprehensive Markdown roadmap for building professional, interactive, agentic CLI coding tools with stunning TUIs, inspired by Claude Code and Aider. Customize placeholders and feed to an AI for an executable build plan.

C
Claude Directory
Art and Design

Accurate Simpsons Character Portrait Generator

Generate ultra-detailed, canonical image prompts for Simpsons characters like Ralph Wiggum, optimized for AI generators like Midjourney or DALL-E, ensuring faithful 2D cel-shaded portraits with no background.

C
Community
Software Engineering

Flask 3-Layer Clean Architecture Tutorial Generator

Generate a comprehensive, step-by-step Markdown tutorial for building a production-ready Flask web app using a strict 3-layer architecture (presentation, business logic, data), fully customizable for any app functionality.

C
Community
Writing

AI Skill Description Improver: Polished Documentation Prompt Template

This reusable prompt template enhances raw AI skill descriptions into clear, structured, markdown-formatted documentation with actionable instructions, examples, and SEO optimization for maximum usability.

C
Claude Directory
Writing

AI Skill Description Improver: Professional Prompt Template

Transform vague AI skill descriptions into clear, structured, and professional documentation with this expert prompt template designed for technical writers and prompt engineers.

C
Community
UX and Product Design

Crush-Inspired TUI Cockpit Redesign Prompt for Developer Tools

This prompt generates a comprehensive, implementable redesign plan for glamorous terminal UIs (TUIs) in developer tools, featuring 3-pane layouts, keybinds, safety modes, and Textual code integration inspired by Charmbracelet's Crush.

C
Community