
Code Review Analysis
- 2.3k installs
- 305 repo stars
- Updated March 4, 2026
- aj-geddes/useful-ai-prompts
code-review-analysis is a prompt skill for systematic PR reviews across quality, security, performance, and testing.
About
The code-review-analysis skill structures comprehensive reviews across code quality, security, performance, maintainability, and standards compliance. It targets pull request and merge request review, pre-merge quality checks, vulnerability identification, and mentoring through constructive feedback. Quick start uses git diff main...feature-branch, git diff --stat for scope, and git log --oneline for commit history context. Reference guides split work into initial assessment, code quality analysis, security review, performance review, testing review, and best practices files under references/. DO guidance emphasizes respectful tone, explaining why behind suggestions, code examples, clarifying questions, acknowledging good patterns, focusing on important issues, and offering pairing on complex fixes. DON'T guidance warns against personal criticism, style nitpicks better handled by automation, blocking on subjective taste, reviewing more than about four hundred lines at once, skipping tests, ignoring security, or rushing. The overview positions the process as systematic industry-standard review rather than ad hoc commentary.
- Covers quality, security, performance, maintainability, and standards.
- Quick start uses git diff and log against the base branch.
- Reference guides split assessment, security, performance, and testing.
- Encourages constructive feedback with examples and context awareness.
- Avoid reviewing more than about 400 lines or skipping test coverage.
Code Review Analysis by the numbers
- 2,336 all-time installs (skills.sh)
- +20 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #69 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
code-review-analysis capabilities & compatibility
- Capabilities
- git diff and commit history based review start · modular reference guides per review dimension · constructive feedback and mentoring practices · security and performance emphasis in review scop · anti patterns for nitpicks and oversized reviews
- Use cases
- code review · security audit · testing
What code-review-analysis says it does
Systematic code review process covering code quality, security, performance, maintainability, and best practices
Review too many changes at once (>400 lines)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill code-review-analysisAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2.3k |
|---|---|
| repo stars | ★ 305 |
| Security audit | 3 / 3 scanners passed |
| Last updated | March 4, 2026 |
| Repository | aj-geddes/useful-ai-prompts ↗ |
How should I review this pull request thoroughly and constructively before merging?
Run systematic pull request reviews covering quality, security, performance, testing, and constructive feedback using reference guides.
Who is it for?
Reviewing pull requests, merge requests, or pre-merge quality and security checks.
Skip if: Skip for automated lint-only fixes or writing new features without a review request.
When should I use this skill?
User asks for code review, PR analysis, security check on changes, or merge feedback.
What you get
A structured review covering diffs, risks, tests, and actionable suggestions with respectful tone.
- Structured review comments
- Security and quality findings
Files
Code Review Analysis
Table of Contents
Overview
Systematic code review process covering code quality, security, performance, maintainability, and best practices following industry standards.
When to Use
- Reviewing pull requests and merge requests
- Analyzing code quality before merging
- Identifying security vulnerabilities
- Providing constructive feedback to developers
- Ensuring coding standards compliance
- Mentoring through code review
Quick Start
Minimal working example:
# Check the changes
git diff main...feature-branch
# Review file changes
git diff --stat main...feature-branch
# Check commit history
git log main...feature-branch --onelineReference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Initial Assessment | Initial Assessment |
| Code Quality Analysis | Code Quality Analysis |
| Security Review | Security Review |
| Performance Review | Performance Review |
| Testing Review | Testing Review |
| Best Practices | Best Practices |
Best Practices
✅ DO
- Be constructive and respectful
- Explain the "why" behind suggestions
- Provide code examples
- Ask questions if unclear
- Acknowledge good practices
- Focus on important issues
- Consider the context
- Offer to pair program on complex issues
❌ DON'T
- Be overly critical or personal
- Nitpick minor style issues (use automated tools)
- Block on subjective preferences
- Review too many changes at once (>400 lines)
- Forget to check tests
- Ignore security implications
- Rush the review
Best Practices
Best Practices
Error Handling
// ❌ Silent failures
try {
await saveData(data);
} catch (e) {
// empty catch
}
// ✅ Proper error handling
try {
await saveData(data);
} catch (error) {
logger.error("Failed to save data", { error, data });
throw new DataSaveError("Could not save data", { cause: error });
}Resource Management
# ❌ Resources not closed
file = open('data.txt')
data = file.read()
process(data)
# ✅ Proper cleanup
with open('data.txt') as file:
data = file.read()
process(data)Code Quality Analysis
Code Quality Analysis
Readability
# ❌ Poor readability
def p(u,o):
return u['t']*o['q'] if u['s']=='a' else 0
# ✅ Good readability
def calculate_order_total(user: User, order: Order) -> float:
"""Calculate order total with user-specific pricing."""
if user.status == 'active':
return user.tier_price * order.quantity
return 0Complexity
// ❌ High cognitive complexity
function processData(data) {
if (data) {
if (data.type === "user") {
if (data.status === "active") {
if (data.permissions && data.permissions.length > 0) {
// deeply nested logic
}
}
}
}
}
// ✅ Reduced complexity with early returns
function processData(data) {
if (!data) return null;
if (data.type !== "user") return null;
if (data.status !== "active") return null;
if (!data.permissions?.length) return null;
// main logic at top level
}Initial Assessment
Initial Assessment
# Check the changes
git diff main...feature-branch
# Review file changes
git diff --stat main...feature-branch
# Check commit history
git log main...feature-branch --onelineQuick Checklist:
- [ ] PR description is clear and complete
- [ ] Changes match the stated purpose
- [ ] No unrelated changes included
- [ ] Tests are included
- [ ] Documentation is updated
Performance Review
Performance Review
// ❌ N+1 query problem
const users = await User.findAll();
for (const user of users) {
user.orders = await Order.findAll({ where: { userId: user.id } });
}
// ✅ Eager loading
const users = await User.findAll({
include: [{ model: Order }],
});# ❌ Inefficient list operations
result = []
for item in large_list:
if item % 2 == 0:
result.append(item * 2)
# ✅ List comprehension
result = [item * 2 for item in large_list if item % 2 == 0]Security Review
Security Review
Common Vulnerabilities
SQL Injection
# ❌ Vulnerable to SQL injection
query = f"SELECT * FROM users WHERE email = '{user_email}'"
# ✅ Parameterized query
query = "SELECT * FROM users WHERE email = ?"
cursor.execute(query, (user_email,))XSS Prevention
// ❌ XSS vulnerable
element.innerHTML = userInput;
// ✅ Safe rendering
element.textContent = userInput;
// or use framework escaping: {{ userInput }} in templatesAuthentication & Authorization
// ❌ Missing authorization check
app.delete("/api/users/:id", async (req, res) => {
await deleteUser(req.params.id);
res.json({ success: true });
});
// ✅ Proper authorization
app.delete("/api/users/:id", requireAuth, async (req, res) => {
if (req.user.id !== req.params.id && !req.user.isAdmin) {
return res.status(403).json({ error: "Forbidden" });
}
await deleteUser(req.params.id);
res.json({ success: true });
});Testing Review
Testing Review
Test Coverage
describe("User Service", () => {
// ✅ Tests edge cases
it("should handle empty input", () => {
expect(processUser(null)).toBeNull();
});
it("should handle invalid data", () => {
expect(() => processUser({})).toThrow(ValidationError);
});
// ✅ Tests happy path
it("should process valid user", () => {
const result = processUser(validUserData);
expect(result.id).toBeDefined();
});
});Check for:
- [ ] Unit tests for new functions
- [ ] Integration tests for new features
- [ ] Edge cases covered
- [ ] Error cases tested
- [ ] Mock/stub usage is appropriate
#!/bin/bash
# validate-schema.sh - Validate database schema
# Usage: ./validate-schema.sh <schema_file>
set -euo pipefail
SCHEMA_FILE="${{1:?Usage: $0 <schema_file>}}"
echo "Validating schema: $SCHEMA_FILE"
# TODO: Add schema validation
# - Check SQL syntax
# - Verify foreign key references
# - Check index definitions
# - Validate naming conventions
# - Check for missing constraints
echo "Schema validation complete."
-- Migration: [description]
-- Created: [date]
-- TODO: Customize for your migration framework
BEGIN;
-- Up migration
-- TODO: Add schema changes
-- CREATE TABLE IF NOT EXISTS ...
-- ALTER TABLE ...
-- Down migration (rollback)
-- TODO: Add rollback statements
-- DROP TABLE IF EXISTS ...
COMMIT;
Related skills
How it compares
Pick code-review-analysis for narrative PR feedback across quality dimensions; use a linter skill for rule-by-rule static analysis only.
FAQ
What git commands start the review?
Use git diff main...feature-branch, git diff --stat, and git log main...feature-branch --oneline.
How large should a single review be?
Avoid reviewing more than about 400 changed lines at once; split large diffs.
Where are detailed checklists?
Load references for initial assessment, security, performance, testing, and best practices.
Is Code Review Analysis safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.