Index of every page on this site: llms.txt
All skills
llama-farm avatar

/code-review

@6244d46
by Llama Farmllama-farm/llamafarm837 stars
59
Run it yourself

Comprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backend) from file paths.

Use this Skill: https://skilld.dev/gh/llama-farm/llamafarm/code-review

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

frontend.md

≈2.8k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Frontend Review Checklist

Domain-specific review items for React, TypeScript, Tailwind CSS, and React Query codebases.

Add these categories to the summary table:

  • React Architecture
  • State Management
  • TypeScript Quality
  • React Query
  • Tailwind CSS
  • Performance (React)

Category: Security (Frontend)

Dangerous HTML Rendering (XSS)

Search patterns:

# Find dangerouslySetInnerHTML usage
grep -r "dangerouslySetInnerHTML" --include="*.tsx" --include="*.jsx"

# Find innerHTML assignments
grep -r "\.innerHTML\s*=" --include="*.ts" --include="*.tsx" --include="*.js"

Pass criteria: No usage, OR all usage properly sanitizes input with DOMPurify or similar Severity: Critical


Unsanitized URL Parameters

Search patterns:

# Direct use of URL params
grep -rE "(window\.location|useSearchParams|URLSearchParams)" --include="*.tsx" --include="*.ts"

# Template literals in href/src
grep -rE "(href|src)=\{`" --include="*.tsx"

Pass criteria: All URL parameters validated before use Severity: High


Sensitive Data in localStorage

Search patterns:

grep -rE "localStorage\.(setItem|getItem).*['\"]?(token|auth|password|secret|key|credential)" --include="*.ts" --include="*.tsx"

Pass criteria: No auth tokens or secrets in localStorage (use httpOnly cookies) Severity: High


Category: React Architecture

God Components (Oversized)

Search technique:

# Find large component files (>300 lines)
find . -name "*.tsx" -exec wc -l {} \; | awk '$1 > 300 {print}'

# Then review each for:
# - Multiple unrelated responsibilities
# - Many useState calls (>5)
# - Mixed concerns (fetching + logic + UI)

Pass criteria: No components over 300 lines with mixed concerns Severity: Medium


Array Index as Key

Search patterns:

grep -rE "key=\{(index|i|idx)\}" --include="*.tsx" --include="*.jsx"
grep -rE "\.map\([^)]*,\s*(index|i|idx)\)" --include="*.tsx" --include="*.jsx"

Pass criteria: No index-based keys in dynamic lists Severity: Medium


Missing Keys in Lists

Search technique:

# Find map calls, then check if key prop exists
grep -rn "\.map(" --include="*.tsx" --include="*.jsx"
# Review each to ensure returned elements have key props

Pass criteria: All mapped elements have stable, unique keys Severity: Medium


Prop Drilling (3+ Levels)

Search technique:

  • Identify components passing props through without using them
  • Look for same prop name appearing in multiple nested component signatures
  • Search for props passed unchanged through intermediary components

Pass criteria: Props not passed through more than 2 component levels Severity: Low


Spreading Unknown Props

Search patterns:

grep -rE "\{\.\.\.props\}|\{\.\.\.rest\}" --include="*.tsx"

Review: Verify spread is intentional and typed, not spreading onto DOM elements Pass criteria: No untyped prop spreading onto DOM elements Severity: Medium


Category: State Management

State Declared as Variables

Search patterns:

# Variables in component body that should be state
grep -rE "^\s+(let|var)\s+\w+\s*=" --include="*.tsx" -A 5 | grep -v "const"

Pass criteria: Persistent values use useState or useRef Severity: High


Direct State Mutation

Search patterns:

# Array mutations
grep -rE "\.(push|pop|shift|unshift|splice|sort|reverse)\(" --include="*.tsx" --include="*.ts"

# Object property assignment on state
grep -rE "state\.\w+\s*=" --include="*.tsx"

Pass criteria: All state updates create new references Severity: High


Props Copied to State

Search patterns:

grep -rE "useState\(props\." --include="*.tsx"
grep -rE "useState\(\{.*props\." --include="*.tsx"

Pass criteria: No copying props to state (except for intentional "initial value" patterns) Severity: Medium


Derived State Stored

Search technique:

  • Look for useState that computes from other state
  • Search for "total", "count", "sum", "filtered", "sorted" state variables
  • Check if these could be computed with useMemo instead

Pass criteria: Computed values derived in render or useMemo, not stored Severity: Medium


useEffect Missing Dependencies

Search patterns:

# Empty dependency arrays that reference outer scope
grep -rE "useEffect\([^)]+,\s*\[\s*\]\)" --include="*.tsx" -A 10

Review: Check if effect body references variables not in deps array Pass criteria: All referenced variables in dependency array Severity: High


Data Fetching in useEffect

Search patterns:

grep -rE "useEffect.*fetch\(|useEffect.*axios\.|useEffect.*\.get\(" --include="*.tsx"

Pass criteria: Data fetching uses React Query, not raw useEffect Severity: Medium


Category: TypeScript Quality

Any Type Usage

Search patterns:

grep -rE ":\s*any\b|<any>|as any" --include="*.ts" --include="*.tsx"

Pass criteria: No any types (or each is justified with comment) Severity: High


Type Assertions (as Type)

Search patterns:

grep -rE "\bas\s+\w+" --include="*.ts" --include="*.tsx" | grep -v "as const"

Review: Each assertion should be necessary and safe Pass criteria: Minimal assertions, none that bypass type checking unsafely Severity: Medium


Missing Component Prop Types

Search patterns:

# Functions without typed props
grep -rE "function\s+\w+\s*\(\s*props\s*\)" --include="*.tsx"
grep -rE "const\s+\w+\s*=\s*\(\s*props\s*\)" --include="*.tsx"

# Arrow functions without type annotation
grep -rE "=>\s*\{" --include="*.tsx" -B 2 | grep -v "Props"

Pass criteria: All components have explicit prop interfaces Severity: Medium


Event Handler Types

Search patterns:

grep -rE "\(e\)|\(event\)|\(e:\s*any\)" --include="*.tsx"

Pass criteria: Event handlers use proper React event types Severity: Low


Untyped API Responses

Search patterns:

grep -rE "\.then\(\s*\(?\s*data\s*\)?" --include="*.ts" --include="*.tsx"
grep -rE "await fetch" --include="*.ts" --include="*.tsx"

Pass criteria: All API responses have defined types Severity: High


ts-ignore and ts-nocheck

Search patterns:

grep -rE "@ts-ignore|@ts-nocheck|@ts-expect-error" --include="*.ts" --include="*.tsx"

Pass criteria: No suppressions, or each has justifying comment Severity: High


Category: React Query (TanStack Query)

Missing QueryClientProvider

Search technique:

  • Check app root/entry point for QueryClientProvider
  • Verify provider wraps the entire application

Pass criteria: QueryClientProvider exists at app root Severity: Critical (if using React Query)


Query Keys Missing Dynamic Parameters

Search patterns:

grep -rE "queryKey:\s*\[['\"]" --include="*.ts" --include="*.tsx" -A 5

Review: Check if queryFn uses variables not in queryKey Pass criteria: All dynamic parameters in queryKey Severity: High


Query Data Copied to Redux/Context

Search patterns:

grep -rE "dispatch\(.*data\)" --include="*.tsx"
grep -rE "useEffect.*set.*\(.*data" --include="*.tsx"

Pass criteria: Query data used directly, not synced to other state Severity: Medium


Missing Enabled Flag for Conditional Queries

Search patterns:

grep -rE "useQuery\(" --include="*.tsx" -A 10 | grep -v "enabled"

Review: Check if any queries depend on undefined values Pass criteria: Conditional queries use enabled flag Severity: Medium


Missing Query Invalidation After Mutations

Search patterns:

grep -rE "useMutation\(" --include="*.tsx" -A 15

Review: Check for onSuccess/onSettled with queryClient.invalidateQueries Pass criteria: Mutations invalidate related queries Severity: High


Category: Tailwind CSS

Arbitrary Values (Magic Numbers)

Search patterns:

grep -rE "\[([\d]+px|[\d]+rem|#[a-fA-F0-9]+)\]" --include="*.tsx" --include="*.jsx"

Examples to flag: w-[347px], text-[13px], bg-[#ff5733] Pass criteria: Uses design tokens from config, not arbitrary values Severity: Medium


Missing Responsive Variants

Search technique:

  • Check layout components for responsive breakpoints
  • Look for fixed widths without sm:, md:, lg: variants

Pass criteria: Key layouts have responsive variants Severity: Medium


Missing Focus States

Search patterns:

grep -rE "<button|<a\s|onClick" --include="*.tsx" | grep -v "focus:"

Pass criteria: Interactive elements have focus indicators Severity: High (accessibility)


Important Overuse

Search patterns:

grep -rE "!\w+-" --include="*.tsx"

Examples: !mt-4, !text-red-500 Pass criteria: Minimal or no !important usage Severity: Low


Conflicting Classes

Search patterns:

# Look for contradictory utilities in same className
grep -rE "flex.*block|block.*flex|hidden.*visible|mt-\d+.*mt-\d+" --include="*.tsx"

Pass criteria: No conflicting utility classes Severity: Low


Inline Styles Mixed with Tailwind

Search patterns:

grep -rE "style=\{" --include="*.tsx" | grep "className"

Pass criteria: Consistent approach - either Tailwind or inline, not mixed Severity: Low


Category: Performance (React)

Missing useMemo for Expensive Computations

Search technique:

  • Find .filter(), .map(), .reduce(), .sort() in render
  • Check if results are memoized

Pass criteria: Expensive computations memoized Severity: Medium


Missing useCallback for Prop Functions

Search patterns:

grep -rE "on\w+=\{\s*\(" --include="*.tsx"

Review: Check if inline functions are passed to memoized children Pass criteria: Callback props use useCallback when appropriate Severity: Low


Large Lists Without Virtualization

Search technique:

  • Find .map() calls rendering lists
  • Check array sizes (if static) or data source sizes

Pass criteria: Lists >100 items use virtualization Severity: Medium


Missing Error Boundaries

Search patterns:

grep -rE "componentDidCatch|ErrorBoundary" --include="*.tsx"

Pass criteria: Error boundaries exist for critical sections Severity: Medium


Missing Loading States

Search technique:

  • Review components that fetch data
  • Check for loading indicators

Search patterns:

grep -rE "isLoading|isPending|loading" --include="*.tsx"

Pass criteria: Async operations show loading state Severity: Medium


Missing Error States

Search patterns:

grep -rE "isError|error\s*\?" --include="*.tsx"

Pass criteria: Error conditions are handled and displayed Severity: Medium

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo4 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill is a code review tool that analyzes diffs for security and quality issues using local search commands. Its main security risk is indirect prompt injection from processing untrusted code content.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer9mo

    3/3 files flagged

Signed by skilld at 6244d46. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 10 months ago
What it can do
Runs commands Reads files Edits files
All 7 allowed tools
BashReadEditWriteGrepGlobTask
  • Security
  • code-review
  • quality
  • diff
  • anti-patterns
  • vulnerabilities
  • static-analysis

README badge

README badge for llama-farm/llamafarm

Analyzes diffs for security vulnerabilities, anti-patterns, and code quality issues, auto-detecting domain (frontend/backend) from file paths to apply relevant checklists. Generates a structured review report with findings organized by severity and category, including impact analysis for breaking changes.

Generated from the current SKILL.md.

Does this skill work with any VCS or just Git?
The skill is designed for Git diffs (e.g. git diff, git diff HEAD~1, PR diffs) but can accept any diff format provided in context. It does not invoke VCS commands itself.
Can it detect issues outside the changed lines?
No. The skill scopes all feedback to diff lines only and uses surrounding file context only to understand the changes, not to flag issues in unchanged code.
Does it check domain-specific issues like frontend or backend concerns?
Yes. It auto-detects domains (frontend, backend, CLI, config) from file paths in the diff and loads domain-specific checklists (frontend.md or backend.md) if available.
What happens if the diff spans multiple domains?
The skill loads and applies all relevant checklists. For example, if the diff touches both designer/ and server/ paths, it will apply both frontend and backend checks.

Generated from the current SKILL.md. These answers refresh after source changes.