code-review

llama-farm/llamafarm · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/llama-farm/llamafarm --skill code-review
0 commentsdiscussion
summary

Comprehensive code review for diffs with auto-detected domain-specific checks.

  • Analyzes changed code for security vulnerabilities, anti-patterns, quality issues, and breaking changes across generic, frontend, and backend domains
  • Auto-detects domain (frontend, backend, CLI, config) from file paths and applies relevant checklists
  • Generates structured markdown reports with severity levels, file locations, code snippets, and actionable recommendations
  • Performs impact analysis to ident
skill.md

Code Review Skill

You are performing a comprehensive code review on a diff. Your task is to analyze the changed code for security vulnerabilities, anti-patterns, and quality issues.

Input Model

This skill expects a diff to be provided in context before invocation. The caller is responsible for generating the diff.

Example invocations:

  • User pastes PR diff, then runs /code-review
  • Agent runs git diff HEAD~1, then invokes this skill
  • CI tool provides diff content for review

If no diff is present in context, ask the user to provide one or offer to generate one (e.g., git diff, git diff main..HEAD).


Domain Detection

Auto-detect which checklists to apply based on directory paths in the diff:

Directory Domain Checklist
designer/ Frontend Read frontend.md
server/ Backend Read backend.md
rag/ Backend Read backend.md
runtimes/universal/ Backend Read backend.md
cli/ CLI/Go Generic checks only
config/ Config Generic checks only

If the diff spans multiple domains, load all relevant checklists.


Review Process

Step 1: Parse the Diff

Extract from the diff:

  • List of changed files
  • Changed lines (additions and modifications)
  • Detected domains based on file paths

Step 2: Initialize the Review Document

Create a review document using the temp-files pattern:

SANITIZED_PATH=$(echo "$PWD" | tr '/' '-')
REPORT_DIR="/tmp/claude/${SANITIZED_PATH}/reviews"
mkdir -p "$REPORT_DIR"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
FILEPATH="${REPORT_DIR}/code-review-${TIMESTAMP}.md"

Initialize with this schema:

# Code Review Report

**Date**: {current date}
**Reviewer**: Code Review Agent
**Source**: {e.g., "PR diff", "unstaged changes", "main..HEAD"}
**Files Changed**: {count}
**Domains Detected**: {list}
**Status**: In Progress

## Summary

| Category | Items Checked | Passed | Failed | Findings |
|----------|---------------|--------|--------|----------|
| Security | 0 | 0 | 0 | 0 |
| Code Quality | 0 | 0 | 0 | 0 |
| LLM Code Smells | 0 | 0 | 0 | 0 |
| Impact Analysis | 0 | 0 | 0 | 0 |
| Simplification | 0 | 0 | 0 | 0 |
{domain-specific categories added based on detected domains}

## Detailed Findings

{findings added here as review progresses}

Step 3: Review Changed Code

For EACH checklist item:

  1. Scope feedback to diff lines only - Only flag issues in the changed code
  2. Use file context - Read full file content to understand surrounding code
  3. Apply relevant checks - Use domain-appropriate checklist items
  4. Document findings - Record each violation found in changed code

Key principle: The diff is what gets reviewed. The rest of the file provides context to make that review accurate.

Step 4: Impact Analysis

Check if the diff might affect other parts of the codebase:

  • Changed exports/interfaces - Search for usages elsewhere that may break
  • Modified API signatures - Check for callers that need updating
  • Altered shared utilities - Look for consumers that may be affected
  • Config/schema changes - Find code that depends on old structure

Report any unaccounted-for impacts as findings with severity based on risk.

Step 5: Document Each Finding

For each issue found, add an entry:

### [{CATEGORY}] {Item Name}

**Status**: FAIL
**Severity**: Critical | High | Medium | Low
**Scope**: Changed code | Impact analysis

#### Violation

- **File**: `path/to/file.ext`
- **Line(s)**: 42-48 (from diff)
- **Code**:

// problematic code snippet from diff

- **Issue**: {explanation of what's wrong}
- **Recommendation**: {how to fix it}

Step 6: Finalize the Report

After completing all checks:

  1. Update the summary table with final counts
  2. Add an executive summary:
    • Total issues found
    • Critical issues requiring immediate attention
    • Impact analysis results
    • Recommended priority order for fixes
  3. Update status to "Complete"
  4. Inform the user of the report location

Generic Review Categories

These checks apply to ALL changed code regardless of domain.


Category: Security Fundamentals

Hardcoded Secrets

Check diff for:

  • API keys, passwords, secrets in changed code
  • Patterns: api_key, apiKey, password, secret, token, credential with literal values

Pass criteria: No hardcoded secrets in diff (should use environment variables) Severity: Critical


Eval and Dynamic Code Execution

Check diff for:

  • JavaScript/TypeScript: eval(, new Function(, setTimeout(", setInterval("
  • Python: eval(, exec(, compile(

Pass criteria: No dynamic code execution in changed lines Severity: Critical


Command Injection

Check diff for:

  • Python: subprocess with shell=True, os.system(
  • Go: exec.Command( with unsanitized input

Pass criteria: No unvalidated user input in shell commands Severity: Critical


Category: Code Quality

Console/Print Statements

Check diff for:

  • JavaScript/TypeScript: console.log, console.debug, console.info
  • Python: print( statements

Pass criteria: No debug statements in production code changes Severity: Low


TODO/FIXME Comments

Check diff for:

  • TODO:, FIXME:, HACK:, XXX: comments

Pass criteria: New TODOs should be tracked in issues Severity: Low


Empty Catch/Except Blocks

Check diff for:

  • JavaScript/TypeScript: catch { } or catch(e) { }
  • Python: except: pass or empty except blocks

Pass criteria: All error handlers log or rethrow Severity: High


Category: LLM Code Smells

Placeholder Implementations

Check diff for:

  • TODO, PLACEHOLDER, IMPLEMENT, NotImplemented
  • Functions that just return None, return [], return {}

Pass criteria: No placeholder implementations in production code Severity: High


Overly Generic Abstractions

Check diff for:

  • New classes/functions with names like GenericHandler, BaseManager, AbstractFactory
  • Abstractions without clear reuse justification

Pass criteria: Abstractions are justified by actual reuse Severity: Low


Category: Impact Analysis

Breaking Changes

Check if diff modifies:

  • Exported functions/classes - search for imports elsewhere
  • API endpoints - search for callers
  • Shared types/interfaces - search for usages
  • Config schemas - search for consumers

Pass criteria: All impacted code identified and accounted for Severity: High (if unaccounted impacts found)


Category: Simplification

Duplicate Logic

Check diff for:

  • Repeated code patterns (not just syntactic similarity)
  • Copy-pasted code with minor variations
  • Similar validation, transformation, or formatting logic

Pass criteria: No obvious duplication in changed code Severity: Medium Suggestion: Extract shared logic into reusable functions


Unnecessary Complexity

Check diff for:

  • Deeply nested conditionals (more than 3 levels)
  • Functions doing multiple unrelated things
  • Overly complex control flow

Pass criteria: Code is reasonably flat and focused Severity: Medium Suggestion: Use early returns, extract helper functions


Verbose Patterns

Check diff for:

  • Patterns that have simpler alternatives in the language
  • Redundant null checks or type assertions
  • Unnecessary intermediate variables

Pass criteria: Code uses idiomatic patterns Severity: Low Suggestion: Simplify using language built-ins


Domain-Specific Review Items

Based on detected domains, read and apply the appropriate checklists:

  • Frontend detected (designer/): Read frontend.md and apply those checks to changed code
  • Backend detected (server/, rag/, runtimes/): Read backend.md and apply those checks to changed code

Final Summary Template

## Executive Summary

**Review completed**: {timestamp}
**Total findings**: {count}

### Critical Issues (Must Fix)
1. {issue 1}
2. {issue 2}

### Impact Analysis Results
- {summary of any breaking changes or unaccounted impacts}

### High Priority (Should Fix)
1. {issue 1}
2. {issue 2}

### Recommendations
{Overall recommendations based on the changes reviewed}

Notes for the Agent

  1. Scope to diff: Only flag issues in the changed lines. Don't review unchanged code.

  2. Use context: Read full files to understand the changes, but feedback targets the diff only.

  3. Check impacts: When changes touch exports, APIs, or shared code, search for affected consumers.

  4. Be specific: Include file paths, line numbers (from diff), and code snippets for every finding.

  5. Prioritize: Flag critical security issues immediately.

  6. Provide solutions: Each finding should include a recommendation for how to fix it.

  7. Update incrementally: Update the review document after each category, not at the end.

how to use code-review

How to use code-review on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add code-review
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/llama-farm/llamafarm --skill code-review

The skills CLI fetches code-review from GitHub repository llama-farm/llamafarm and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/code-review

Reload or restart Cursor to activate code-review. Access the skill through slash commands (e.g., /code-review) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.564 reviews
  • Kofi Mensah· Dec 28, 2024

    We added code-review from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Kofi Yang· Dec 24, 2024

    We added code-review from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Evelyn Jackson· Dec 20, 2024

    I recommend code-review for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Michael Gonzalez· Dec 16, 2024

    code-review reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Nia Smith· Dec 8, 2024

    Registry listing for code-review matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Michael Haddad· Dec 4, 2024

    code-review fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Nia Taylor· Dec 4, 2024

    I recommend code-review for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Nia Zhang· Nov 27, 2024

    Useful defaults in code-review — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Kofi Thomas· Nov 23, 2024

    code-review reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Oshnikdeep· Nov 19, 2024

    We added code-review from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

showing 1-10 of 64

1 / 7