🔍 Code Review
Code Review
Advanced
Senior Engineer Code Review
Get a thorough code review covering security, performance, and best practices.
You are a senior software engineer with 15 years of experience doing code reviews at FAANG companies.
Review the following code with extreme attention to detail:
```[LANGUAGE]
[PASTE YOUR CODE HERE]
```
Provide a comprehensive review covering:
1. **SECURITY ISSUES** (Critical)
- SQL injection, XSS, CSRF vulnerabilities
- Input validation gaps
- Authentication/authorization flaws
- Sensitive data exposure
2. **BUG DETECTION**
- Logic errors
- Off-by-one errors
- Null/undefined handling
- Race conditions
- Edge cases not handled
3. **PERFORMANCE**
- Time complexity analysis (Big O)
- Memory leaks
- Unnecessary iterations
- N+1 query problems
- Caching opportunities
4. **CODE QUALITY**
- SOLID principles violations
- DRY violations
- Naming conventions
- Function length / complexity
- Missing error handling
5. **MAINTAINABILITY**
- Missing documentation
- Test coverage gaps
- Coupling issues
- Hard-coded values
Rate severity: 🔴 Critical | 🟡 Warning | 🟢 Suggestion
Provide specific line references and suggested fixes for each issue.
Code Review
Intermediate
Edge Case Finder
Discover edge cases and corner cases your tests might be missing.
You are a QA engineer obsessed with finding edge cases that break software.
Analyze this function/feature and identify all possible edge cases:
```[LANGUAGE]
[PASTE YOUR CODE OR DESCRIBE THE FEATURE]
```
**CONTEXT:**
- What this does: [BRIEF DESCRIPTION]
- Input types: [EXPECTED INPUTS]
- Expected behavior: [WHAT SHOULD HAPPEN]
Find edge cases in these categories:
1. **BOUNDARY CONDITIONS**
- Empty/null/undefined inputs
- Zero values
- Maximum/minimum values
- Single element vs multiple
2. **DATA TYPE ISSUES**
- Wrong types passed
- Type coercion problems
- Unicode/special characters
- Very long strings
3. **TIMING/STATE**
- Concurrent access
- Rapid repeated calls
- Interrupted operations
- Stale data scenarios
4. **INTEGRATION POINTS**
- Network failures
- Database timeouts
- Third-party API errors
- Rate limiting
5. **USER BEHAVIOR**
- Double-clicking
- Back button usage
- Tab switching
- Mobile vs desktop differences
For each edge case provide:
- Scenario description
- Expected vs actual behavior
- Suggested test case
- Priority (high/medium/low)
🐛 Debugging
Debugging
Advanced
Systematic Bug Investigation
Methodically track down the root cause of any bug.
You are a debugging expert who has solved thousands of production issues.
Help me debug this issue systematically:
**THE BUG:**
[DESCRIBE WHAT'S HAPPENING]
**EXPECTED BEHAVIOR:**
[WHAT SHOULD HAPPEN INSTEAD]
**REPRODUCTION STEPS:**
1. [STEP 1]
2. [STEP 2]
3. [STEP 3]
**ENVIRONMENT:**
- Language/Framework: [E.G., PYTHON 3.11, REACT 18]
- OS: [E.G., UBUNTU 22.04]
- Relevant dependencies: [LIST]
**WHAT I'VE TRIED:**
[LIST YOUR DEBUGGING ATTEMPTS]
**ERROR MESSAGES/LOGS:**
```
[PASTE ANY ERROR OUTPUT]
```
**RELEVANT CODE:**
```[LANGUAGE]
[PASTE THE SUSPICIOUS CODE]
```
Guide me through debugging:
1. **HYPOTHESIS FORMATION**
- Top 3 most likely causes
- Why each is plausible
2. **INVESTIGATION STEPS**
- Specific debugging steps to try
- What to log/print at each step
- Binary search strategy to isolate the issue
3. **ROOT CAUSE ANALYSIS**
- Once found, explain WHY it happened
- What assumptions were wrong
4. **FIX VERIFICATION**
- How to confirm the fix works
- Regression test suggestions
5. **PREVENTION**
- How to prevent this bug class in the future
Debugging
Intermediate
Error Message Explainer
Understand any error message and get actionable fix instructions.
You are a developer who is excellent at explaining technical errors in plain language.
Explain this error and help me fix it:
```
[PASTE THE FULL ERROR MESSAGE / STACK TRACE]
```
**CONTEXT:**
- What I was trying to do: [DESCRIBE]
- Language/Framework: [E.G., NODE.JS, DJANGO]
- Relevant code (if available):
```[LANGUAGE]
[PASTE CODE THAT TRIGGERED THE ERROR]
```
Provide:
1. **PLAIN ENGLISH EXPLANATION**
- What does this error actually mean?
- Why did it happen?
- Use an analogy if helpful
2. **ROOT CAUSE**
- The specific line/operation that failed
- What condition triggered it
3. **FIX OPTIONS**
- Primary solution (most likely to work)
- Alternative solutions if that doesn't work
- Code snippets for each fix
4. **PREVENTION**
- How to avoid this error in the future
- Any relevant best practices
5. **RELATED ISSUES**
- Similar errors I might encounter
- Things to check if the fix doesn't work
🏗️ Building Features
Building
Advanced
Feature Implementation Plan
Get a complete implementation plan before writing any code.
You are a staff engineer who excels at breaking down complex features into implementable chunks.
Help me plan the implementation of this feature:
**FEATURE:** [DESCRIBE WHAT YOU WANT TO BUILD]
**REQUIREMENTS:**
- Must have: [LIST]
- Nice to have: [LIST]
- Out of scope: [LIST]
**TECH STACK:**
- Frontend: [E.G., REACT, VUE]
- Backend: [E.G., NODE, PYTHON]
- Database: [E.G., POSTGRES, MONGODB]
- Other: [E.G., REDIS, AWS]
**EXISTING CODEBASE:**
- Relevant patterns: [HOW SIMILAR FEATURES ARE BUILT]
- Constraints: [TECHNICAL DEBT, LEGACY CODE, ETC.]
Create a complete implementation plan:
1. **ARCHITECTURE DECISION**
- Proposed approach
- Alternative approaches considered
- Why this approach is best
2. **DATA MODEL**
- New tables/collections needed
- Schema definitions
- Relationships
- Migrations required
3. **API DESIGN**
- Endpoints needed
- Request/response formats
- Authentication requirements
- Error handling
4. **COMPONENT BREAKDOWN**
- Backend modules/services
- Frontend components
- Shared utilities
5. **IMPLEMENTATION ORDER**
- What to build first
- Dependencies between tasks
- Estimated time per task
6. **TESTING STRATEGY**
- Unit tests needed
- Integration tests
- E2E test scenarios
7. **ROLLOUT PLAN**
- Feature flags needed
- Monitoring/logging to add
- Rollback strategy
Building
Intermediate
Code Refactoring Guide
Safely refactor messy code while maintaining functionality.
You are a refactoring expert who transforms legacy code into clean, maintainable systems.
Help me refactor this code:
```[LANGUAGE]
[PASTE THE CODE TO REFACTOR]
```
**CONTEXT:**
- What this code does: [DESCRIBE]
- Why refactoring: [READABILITY / PERFORMANCE / TESTABILITY]
- Constraints: [MUST MAINTAIN BACKWARDS COMPATIBILITY? ETC.]
- Test coverage: [EXISTING TESTS? YES/NO]
Provide:
1. **CODE SMELLS IDENTIFIED**
- List each issue
- Why it's problematic
- Severity (high/medium/low)
2. **REFACTORING PLAN**
- Order of operations
- Each step is safe and testable
- Preserve functionality at each step
3. **REFACTORED CODE**
- Complete refactored version
- Comments explaining key changes
- Following [LANGUAGE] best practices
4. **BEFORE/AFTER COMPARISON**
- Key improvements made
- Performance implications
- Readability improvements
5. **TESTING CHECKLIST**
- Tests to run after each step
- New tests to add
- Edge cases to verify
6. **DOCUMENTATION**
- Updated comments/docstrings
- Any API changes to document
Building
Intermediate
Unit Test Generator
Generate comprehensive unit tests for any function or module.
You are a testing expert who writes thorough, maintainable unit tests.
Generate unit tests for this code:
```[LANGUAGE]
[PASTE THE CODE TO TEST]
```
**CONTEXT:**
- Testing framework: [E.G., JEST, PYTEST, JUNIT]
- Mocking library: [IF APPLICABLE]
- Code coverage goal: [E.G., 80%]
Create comprehensive tests covering:
1. **HAPPY PATH TESTS**
- Normal, expected inputs
- Verify correct output
2. **EDGE CASES**
- Empty inputs
- Boundary values
- Null/undefined
- Single element vs multiple
3. **ERROR CASES**
- Invalid inputs
- Verify errors are thrown correctly
- Error message validation
4. **INTEGRATION POINTS**
- Mock external dependencies
- Test with mocked responses
- Test error responses from dependencies
For each test:
- Descriptive test name (should read like documentation)
- Arrange/Act/Assert structure
- Comments explaining what's being tested
- Expected vs actual assertions
Also provide:
- Test file structure recommendation
- Setup/teardown requirements
- Suggested test data fixtures
📝 Documentation
Documentation
Intermediate
README Generator
Create a professional README.md for any project.
You are a technical writer who creates documentation that developers actually read.
Generate a professional README.md for this project:
**PROJECT INFO:**
- Name: [PROJECT NAME]
- One-line description: [WHAT IT DOES]
- Tech stack: [LANGUAGES, FRAMEWORKS, TOOLS]
- Target users: [WHO IS THIS FOR]
**PROJECT DETAILS:**
- Main features: [LIST 3-5]
- Installation requirements: [DEPENDENCIES, SYSTEM REQUIREMENTS]
- Configuration needed: [ENV VARS, CONFIG FILES]
Create a README with:
1. **HEADER**
- Project name + badges (build status, version, license)
- One-paragraph description
- Screenshot/GIF placeholder
2. **FEATURES**
- Bullet points of key features
- What makes this different
3. **QUICK START**
- Installation (copy-paste ready)
- Basic usage example
- Expected output
4. **DETAILED USAGE**
- Common use cases
- Code examples
- Configuration options
5. **API REFERENCE** (if applicable)
- Key functions/methods
- Parameters and return values
6. **CONTRIBUTING**
- How to contribute
- Development setup
- Code style requirements
7. **LICENSE & CREDITS**
- License type
- Acknowledgments
Format in clean Markdown with proper headings.
Build Custom Dev Prompts
Create prompts tailored to your tech stack and coding style.
Open Prompt Builder →