agentleFS
xcrrrxcrrr/claude-skills/skills/coding/code-reviewer/SKILL.md

code-reviewer

Skill6 starsChanged 8 months agoMITView on GitHub

Use this skill when reviewing pull requests, auditing code quality, or providing structured feedback on code. Trigger phrases: 'review this code', 'check my PR', 'what's wrong with this', 'give feedback on'. Not for writing new code from scratch or debugging runtime errors.

  • Deletes or force-pushes

182 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-doc-updater, git-precommit and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • u9401066Skill

    git-doc-updater

    Auto-check and update key documentation before Git commits to keep docs in sync with code. Triggers: docs, 文檔, 更新文檔, sync docs, release, 發布.

    Also in 5 projects that use this

  • u9401066Skill

    git-precommit

    Orchestrate pre-commit workflow including Memory Bank sync, README/CHANGELOG/ROADMAP updates. Triggers: GIT, gc, push, commit, 提交, 準備 commit, 要提交了, git commit, pre-commit, 推送.

    Also in 5 projects that use this

  • JeffallanSkill

    shopify-expert

    Builds and debugs Shopify themes (.liquid files, theme.json, sections), develops custom Shopify apps (shopify.app.toml, OAuth, webhooks), and implements Storefront API integrations for headless storefronts. Use when building or customizing Shopify themes, creating Hydrogen or custom React storefronts, developing Shopify apps, implementing checkout UI extensions or Shopify Functions, optimizing performance, or integrating third-party services. Invoke for Liquid templating, Storefront API, app development, checkout customization, Shopify Plus features, App Bridge, Polaris, or Shopify CLI workflows.

    Also in 5 projects that use this

  • JeffallanSkill

    spec-miner

    Reverse-engineering specialist that extracts specifications from existing codebases. Use when working with legacy or undocumented systems, inherited projects, or old codebases with no documentation. Invoke to map code dependencies, generate API documentation from source, identify undocumented business logic, figure out what code does, or create architecture documentation from implementation. Trigger phrases: reverse engineer, old codebase, no docs, no documentation, figure out how this works, inherited project, legacy analysis, code archaeology, undocumented features.

    Also in 6 projects that use this

  • +4 more from u9401066
  • +4 more from Jeffallan

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 155 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If user['role'] is neither 'premium' nor 'vip' (e.g., 'standard'), discount is never assigned and the return statement raises …

    line 111
  2. Very specific:

    If user_id doesn't exist, db.query() likely returns None, causing a TypeError on user['role'].

    line 118
  3. Distinctive:

    If the network request fails, the error is silently swallowed.

    line 168
  4. Very specific:

    Consider user instead of u for clarity in the map callback.

    line 184
  5. Distinctive:

    Always explain *why* something is an issue, not just *what* it is

    line 190
  6. Distinctive:

    Keep individual comments concise.

    line 193
  7. Very specific:

    If you'd write it differently but the current approach also works, mark it [Nit] or [Suggestion]

    line 195
  8. Distinctive:

    Read the tests first — they reveal intent and what the author thought mattered

    line 206
  9. Distinctive:

    Run the code locally if possible before reviewing.

    line 207
  10. Distinctive:

    Use a checklist template so every review covers the same dimensions consistently

    line 208
  11. Distinctive:

    Look at the git diff stat first to size the review before diving into files

    line 210

“Common” is measured: kept by at least 6 in 10 of the 155 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Reviewer

Overview

The Code Reviewer skill provides a structured, systematic approach to evaluating code for correctness, security, performance, readability, and maintainability. It helps deliver actionable, prioritized feedback using defined severity levels so authors know exactly what must be fixed versus what is a suggestion. This skill draws on established best practices to ensure reviews are constructive, thorough, and consistent.

When to Use

  • Reviewing a pull request before merging
  • Auditing a module or file for quality issues
  • Providing mentorship feedback on another developer's code
  • Self-reviewing your own code before submitting
  • Evaluating third-party or open-source code before adopting it

When NOT to Use

  • Writing new features from scratch (use a code-generation skill instead)
  • Debugging a runtime error with a stack trace (use the debugger skill)
  • Profiling performance bottlenecks with tooling (use a profiler workflow)
  • Reviewing non-code artifacts like diagrams or documentation prose

Quick Reference

TaskApproach
Find correctness issuesTrace logic paths, check edge cases, verify inputs/outputs
Find security issuesOWASP checklist, look for injection, exposure of secrets
Find performance issuesCheck complexity, N+1 queries, unnecessary allocations
Find readability issuesVariable naming, function length, comment quality
Find maintainability issuesCoupling, cohesion, test coverage, duplication
Assign severityCritical → Major → Minor → Nit
Write actionable feedbackState the issue, explain why, suggest the fix

Instructions

  1. Understand the context — Read the PR description, linked issue, or stated goal. Know what the code is supposed to do before critiquing it.
  2. Run a high-level pass — Scan the overall structure. Identify the files changed, the patterns used, and the approach taken. Flag architectural concerns at this stage.
  3. Apply the correctness checklist:
    • Does the logic match the requirements?
    • Are edge cases handled (null, empty, zero, max values)?
    • Are error conditions caught and handled gracefully?
    • Are external calls (APIs, DBs) wrapped with error handling?
  4. Apply the security checklist:
    • Is user input validated and sanitized before use?
    • Are secrets, tokens, or credentials hardcoded?
    • Is data properly escaped before rendering (XSS)?
    • Are SQL queries parameterized (no string concatenation)?
    • Are authorization checks in place on every sensitive operation?
  5. Apply the performance checklist:
    • Are there nested loops with O(n²) or worse complexity?
    • Are database queries inside loops (N+1 problem)?
    • Are expensive operations cached where appropriate?
    • Are large payloads paginated or streamed?
  6. Apply the readability checklist:
    • Are names descriptive and consistent with the codebase conventions?
    • Are functions short and single-purpose?
    • Is complex logic explained with comments?
    • Is dead code or commented-out code removed?
  7. Apply the maintainability checklist:
    • Is there significant code duplication (DRY violations)?
    • Are tests included for new or changed logic?
    • Is the code properly modular and loosely coupled?
    • Does the change follow existing patterns in the project?
  8. Assign severity to each finding:
    • Critical — Must fix before merge. Causes bugs, data loss, or security vulnerabilities.
    • Major — Should fix before merge. Significant quality or correctness problem.
    • Minor — Fix in a follow-up. Code smell or style inconsistency.
    • Nit — Optional polish. Purely aesthetic or preference-based.
  9. Write feedback — For each finding, state: (a) what the issue is, (b) why it matters, (c) how to fix it. Use line references. Be respectful and specific.
  10. Summarize — End with an overall assessment: Approve, Request Changes (with blockers listed), or Comment (non-blocking suggestions only).

Examples

Example 1: Review a Python function with bugs

Input:

def get_user_discount(user_id, db):
    user = db.query("SELECT * FROM users WHERE id = " + user_id)
    if user['role'] == 'premium':
        discount = 0.2
    elif user['role'] == 'vip':
        discount = 0.35
    return discount

Output:

[Critical] SQL Injection Vulnerability (line 2) The user_id is concatenated directly into the SQL string. An attacker can pass '; DROP TABLE users; -- as user_id. Fix: Use parameterized queries:

user = db.query("SELECT * FROM users WHERE id = %s", (user_id,))

[Critical] NameError on unmatched role (line 6–7) If user['role'] is neither 'premium' nor 'vip' (e.g., 'standard'), discount is never assigned and the return statement raises UnboundLocalError. Fix: Add a default:

discount = 0.0  # default at top of function

[Major] No error handling for missing user (line 2) If user_id doesn't exist, db.query() likely returns None, causing a TypeError on user['role']. Fix:

if not user:
    return 0.0

[Minor] Magic numbers (lines 4, 6) 0.2 and 0.35 have no explanation. Use named constants:

PREMIUM_DISCOUNT = 0.20
VIP_DISCOUNT = 0.35

Overall: Request Changes — Two critical issues block merge.


Example 2: Review a JavaScript React component

Input:

function UserList() {
  const [users, setUsers] = useState([]);

  useEffect(() => {
    fetch('/api/users')
      .then(res => res.json())
      .then(data => setUsers(data));
  }, []);

  return (
    <div>
      {users.map(u => (
        <div onClick={() => deleteUser(u.id)}>
          {u.name} - {u.email}
        </div>
      ))}
    </div>
  );
}

Output:

[Critical] Missing key prop in list (line 12) React requires a unique key on list items. Without it, reconciliation produces incorrect UI updates. Fix: <div key={u.id} onClick={...}>

[Major] Unhandled fetch error (lines 5–8) If the network request fails, the error is silently swallowed. Users see a blank list with no feedback. Fix:

.catch(err => {
  console.error('Failed to load users:', err);
  setError('Could not load users. Please try again.');
});

[Major] deleteUser is not defined (line 13) The deleteUser function is referenced but never imported or declared in this component. This will throw a ReferenceError at runtime.

[Minor] Implicit any on fetch response data has no type annotation. If using TypeScript, add: .then((data: User[]) => setUsers(data)).

[Nit] Variable name u Consider user instead of u for clarity in the map callback.

Overall: Request Changes — Critical key prop missing; undefined function reference.

Best Practices

  • Review for the author's benefit, not to show off your knowledge
  • Always explain why something is an issue, not just what it is
  • Separate objective issues (bugs, security) from subjective preferences (style)
  • Acknowledge what is done well — reviews should reinforce good patterns too
  • Keep individual comments concise; link to docs or RFCs for deeper context
  • Batch nits at the bottom rather than peppering them throughout
  • If you'd write it differently but the current approach also works, mark it [Nit] or [Suggestion]

Common Mistakes

  • Reviewing style while missing security flaws — prioritize severity order
  • Writing vague feedback like "this is bad" without explaining why or how to fix it
  • Blocking a PR on personal preferences dressed up as standards
  • Reviewing the same code multiple times without acknowledging changes
  • Missing the overall design in favor of line-by-line nitpicking
  • Forgetting to check test coverage changes alongside the implementation

Tips & Tricks

  • Read the tests first — they reveal intent and what the author thought mattered
  • Run the code locally if possible before reviewing; reading code misses runtime behavior
  • Use a checklist template so every review covers the same dimensions consistently
  • Split large PRs: ask the author to break them up if reviewing end-to-end is too costly
  • Look at the git diff stat first to size the review before diving into files

Related Skills

  • debugger
  • security-auditor
  • test-writer
  • refactorer

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.