agentleFS
primeline-aiprimeline-ai/primeline-skills/skills/code-review/SKILL.md

code-review

Skill1 starsChanged 9 months agoMITView on GitHub

Use when reviewing pull requests, reviewing your own code before committing, or when asked to review code changes. Provides structured analysis with severity categorization, security focus, and optional worktree isolation for safe PR review.

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use starter, media-processing 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.
  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 4 projects that use this

  • mrgoonieSkill

    media-processing

    Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

    Also in 5 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 15 projects that use this

  • mrgoonieSkill

    aesthetic

    Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

    Also in 4 projects that use this

  • AWSSkill

    ask-matt

    Ask which skill or flow fits your situation. A router over the skills in this repo.

    Also in 32 projects that use this

  • AWSSkill

    resolving-merge-conflicts

    Use when you need to resolve an in-progress git merge/rebase conflict.

    Also in 48 projects that use this

  • +1 more from mrgoonie
  • +2 more from aws

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 14 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before committing your own code, check these 3 things:

    line 14
  2. Distinctive:

    Does it break existing tests?: Run the full test suite. Not just your new tests.

    line 16
  3. Distinctive:

    Does it leak secrets or PII?: Search your diff for API keys, passwords, tokens, email addresses.

    line 18
  4. Distinctive:

    If all 3 pass, your code is ready for a proper review.

    line 20
  5. Distinctive:

    Before reading a single line of code:

    line 26
  6. Distinctive:

    Read the diff file by file.

    line 55
  7. Distinctive:

    Do types match? (especially at boundaries - API responses, user input)

    line 61
  8. Distinctive:

    Every finding gets a severity:

    line 79
  9. Distinctive:

    Before committing code to a shared branch

    line 135
  10. Distinctive:

    After implementing a feature, before marking it done

    line 136
  11. Distinctive:

    When you suspect code quality issues in a section of the codebase

    line 137
  12. Distinctive:

    When the user explicitly says "skip review"

    line 143
  13. Distinctive:

    If you have the Starter System installed:

    line 206
  14. Very specific:

    Use /remember to log review patterns specific to your codebase

    line 207
  15. Very specific:

    Use /handoff to pass review context across sessions

    line 209
  16. Distinctive:

    When Kairn is configured, code review gains:

    line 213

“Common” is measured: kept by at least 6 in 10 of the 175 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 Review

Structured code review that catches what matters. Not style nitpicks - real bugs, security holes, and logic errors.

Announce: "Using code-review to analyze these changes."

Quick Start (Self-Review)

Before committing your own code, check these 3 things:

  1. Does it break existing tests? Run the full test suite. Not just your new tests.
  2. Does it handle the error case? For every happy path, ask: "What if this fails?"
  3. Does it leak secrets or PII? Search your diff for API keys, passwords, tokens, email addresses.

If all 3 pass, your code is ready for a proper review.

The Full System

Step 1: Understand the Context

Before reading a single line of code:

  • What is this change supposed to do? (Read the PR description or commit message)
  • What files are involved? (Get the scope)
  • Are there unaddressed comments from previous reviewers?
# For PRs:
gh pr view <number> --json title,body,files
gh pr diff <number>

Step 2: Set Up Safe Review (PRs Only)

For reviewing other people's PRs, use a git worktree for isolation:

# Create isolated workspace
git worktree add .worktrees/pr-<number> -b review/pr-<number>
cd .worktrees/pr-<number>

# Check out the PR
gh pr checkout <number>

Why isolation? The PR may contain untrusted code. Never run code from a PR you haven't reviewed. A worktree keeps your working directory clean.

Step 3: Analyze the Changes

Read the diff file by file. For each file, check:

Correctness:

  • Does the logic do what the description says?
  • Are edge cases handled? (null, empty, zero, negative, overflow)
  • Are error paths handled? (network failure, disk full, permission denied)
  • Do types match? (especially at boundaries - API responses, user input)

Security:

  • Input validation on user-provided data?
  • SQL/NoSQL injection possible?
  • XSS possible in rendered output?
  • Auth checks on new endpoints?
  • Secrets hardcoded anywhere?
  • Unsafe deserialization?

Quality:

  • Does the change follow existing patterns in the codebase?
  • Are there obvious simplifications?
  • Is there dead code or unused imports?
  • Are variable names clear enough to understand without comments?

Step 4: Categorize Findings

Every finding gets a severity:

SeverityMeaningAction
CriticalSecurity vulnerability, data loss, crash in productionMust fix before merge
HighBug, race condition, significant logic errorShould fix before merge
MediumCode quality, missing edge case, maintainabilityShould address, not blocking
LowStyle, naming suggestion, minor improvementOptional

Each finding needs:

  • File and line reference (src/auth.ts:45)
  • What the issue is (specific, not vague)
  • Why it matters (impact)
  • Suggested fix (actionable, not "please improve")

Step 5: Write the Review

Structure your review:

## Review: [PR Title or Change Description]

### Summary
[1-2 sentences: what this change does and overall assessment]

### Critical / High
[List issues that must or should be fixed]
- `file:line` - [Issue]. [Why it matters]. Fix: [suggestion].

### Medium
[Issues worth addressing]
- `file:line` - [Issue]. Fix: [suggestion].

### Low
[Optional improvements]
- `file:line` - [Suggestion].

### Positive Notes
[What's done well - this matters for morale and learning]

### Verdict
[Approve / Request Changes / Comment]

Step 6: Clean Up (PRs Only)

# Return to main workspace
cd ../..
git worktree remove .worktrees/pr-<number>
git branch -D review/pr-<number>

When to Use

  • Reviewing a pull request (yours or someone else's)
  • Before committing code to a shared branch
  • After implementing a feature, before marking it done
  • When you suspect code quality issues in a section of the codebase

When NOT to Use

  • Reviewing documentation-only changes (just read them)
  • Reviewing auto-generated code (CI configs, lock files)
  • When the user explicitly says "skip review"
  • For exploratory or prototype code that will be rewritten

Delegation Pattern

Large PRs (500+ lines) benefit from delegation:

## 1. TASK
Review the diff of PR #[NUMBER] for bugs, security issues, and code quality.

## 2. EXPECTED OUTCOME
Categorized findings (Critical/High/Medium/Low) with file:line references and suggested fixes.

## 3. REQUIRED TOOLS
Read, Grep, Glob, Bash (gh pr view, gh pr diff only)

## 4. MUST DO
- Read every changed file
- Check for security vulnerabilities (OWASP top 10)
- Check for logic errors and unhandled edge cases
- Categorize findings by severity
- Include specific file:line references

## 5. MUST NOT DO
- Don't run any code from the PR
- Don't modify any files
- Don't approve or merge the PR
- Don't report style-only issues as High/Critical

## 6. CONTEXT
PR: [URL or number]
Description: [What the PR does]
Key files: [Most important files to focus on]

Agent: general-purpose | Model: Sonnet | Effort: High (12 turns)

Security Focus Areas

These are the highest-value things to check. A review that catches one of these pays for itself:

AreaWhat to Check
Auth bypassNew endpoints without auth middleware? Role checks missing?
InjectionUser input reaching SQL, shell commands, or HTML without sanitization?
SecretsAPI keys, tokens, passwords in code or config committed to repo?
SSRFUser-controlled URLs being fetched server-side?
Path traversalUser input in file paths without validation?
Mass assignmentUser input spread into database objects without whitelisting fields?

Anti-Patterns

PatternProblemFix
"LGTM" with no commentsRubber-stamp review, catches nothingSpend at least 5 minutes per 100 lines
Style-only feedbackMisses real bugs while bikesheddingCheck security and correctness first, style last
"This could be better"Vague, not actionableSpecific: what, where, why, how to fix
Reviewing 2000 lines at onceAttention drops after ~400 linesRequest smaller PRs or review in chunks
Skipping test filesTests might assert wrong behaviorReview tests - they're the spec

With Starter System

If you have the Starter System installed:

  • Use /remember to log review patterns specific to your codebase
  • "Always check for X in Y files" becomes institutional knowledge
  • Use /handoff to pass review context across sessions

With Kairn (Course)

When Kairn is configured, code review gains:

  • Cross-project patterns - "This auth pattern was flagged in 3 other projects"
  • Review history - tracks which types of issues your codebase tends to have
  • Codebase-specific rules - learns your project's conventions over time

Without Kairn: review quality depends on the reviewer's memory. Still structured, still valuable, just not adaptive.

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.