agentleFS
juanitourquizajuanitourquiza/shipframe/skills/code-review/SKILL.md

code-review

Skill2 starsChanged 2 months agoMITView on GitHub

Review changed code before commit or PR with fast checks plus SOLID, security, performance, and test coverage audit.

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 9 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
  • +1 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, 11 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Check if $ARGUMENTS contains --base-branch.

    line 48
  2. Very specific:

    Use AskUserQuestion with the following question:

    line 51
  3. Very specific:

    Read only the files returned by that command.

    line 62
  4. Very specific:

    If the diff is empty, inform the user: "No changes detected between the current branch and <BASE_BRANCH>." and stop.

    line 64
  5. Distinctive:

    Check the detected stack (see AGENTS.md if available) and verify conventions are followed:

    line 86
  6. Distinctive:

    All items pass → proceed to Phase 2

    line 113
  7. Distinctive:

    Before any signature change, identify every file that imports the target.

    line 150
  8. Distinctive:

    If a signature changes, all dependent files must be updated in the same change.

    line 151
  9. Distinctive:

    Check for unreachable code and dead exports

    line 155
  10. Distinctive:

    Check for circular dependencies

    line 156
  11. Distinctive:

    Verify files are in the correct location per the project's structure (reference AGENTS.md)

    line 157
  12. Distinctive:

    Run the project's lint and type-check commands.

    line 158
  13. Distinctive:

    After completing both phases, report findings in this format:

    line 164
  14. Distinctive:

    If errors exist: report them and ask "Should I apply the fixes?"

    line 182
  15. Distinctive:

    After applying fixes: re-run the relevant phase to verify resolution

    line 183
  16. Very specific:

    If the codebase has no AGENTS.md, suggest running /init-project first for better stack-aware review

    line 184

“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

Two-phase code review skill. Phase 1 catches surface-level issues fast. Phase 2 audits structural correctness using SOLID as the primary framework and KISS/DRY/YAGNI for implementation quality.

Usage

With a base branch — reviews only the files changed between your current branch and the specified base:

/code-review --base-branch main
/code-review --base-branch develop
/code-review --base-branch origin/main

Without arguments — Claude will detect your local branches and ask you to pick the base interactively:

/code-review

You'll be prompted with a question like:

"Which branch should be used as the base for this review?" Options: main, master, develop, or any other local branch detected. Select one or type a custom name.

Tip: Run /init-project first if the project has no AGENTS.md. The review uses it for stack-aware checks in Phase 1.


Mindset: There is no reward for speed. The reward comes from persistence on resolving issues to a high standard. Consistent iteration produces better outcomes than fast completion.


Setup — Resolve Base Branch

Current branch: !git branch --show-current

Available local branches:

!git branch

Step 1 — Parse the argument. Check if $ARGUMENTS contains --base-branch. If it does, extract the value that follows it and use that as BASE_BRANCH. Skip to Step 3.

Step 2 — Ask the user (only if --base-branch was not provided). Use AskUserQuestion with the following question:

  • Question: "Which branch should be used as the base for this review?"
  • Header: "Base branch"
  • Build the options from the branch list above. Always include the most common default (main) plus any branches found locally. Cap at 4 options; if there are more, include the 3 most relevant and leave "Other" for free input. If there is no more options but default, just use the default.

Step 3 — Scope the review to changed files. Run:

git diff <BASE_BRANCH>...HEAD --name-only

Read only the files returned by that command. Do not review files that were not changed relative to BASE_BRANCH.

If the diff is empty, inform the user: "No changes detected between the current branch and <BASE_BRANCH>." and stop.


Phase 1 — Fast Pre-Commit Check

Catch the 80% of issues before going deeper. Run this first.

1.1 Spec & Logic

  • Code exactly matches the stated requirements — no more, no less
  • Edge cases are handled: empty states, null/undefined, error boundaries
  • No leftover debug artifacts: console.log, commented-out code, TODO-without-ticket

1.2 Type Safety & Validation

  • No unconstrained any / unknown casts without justification
  • External input (API responses, form data, env vars) is validated at the boundary
  • Types are derived from a single source of truth — not duplicated across files

1.3 Stack Alignment

Check the detected stack (see AGENTS.md if available) and verify conventions are followed:

  • Framework-specific patterns are used correctly (e.g., server vs. client components, lifecycle hooks, routing conventions)
  • Styling follows the project's chosen approach consistently
  • ORM/database queries follow the project's data-access layer patterns

1.4 Verification

  • Existing tests pass
  • New behavior has test coverage (unit or integration)
  • There is observable evidence the change works (test output, screenshot, logs)

1.5 Security Checks

  • No hardcoded secrets or credentials
  • No sensitive data in logs or error messages
  • Input validation prevents injection attacks
  • Dependencies are up to date

1.6 Performance Checks

  • No N+1 queries
  • No unnecessary database queries
  • No unnecessary API calls
  • No unnecessary computations

Phase 1 outcome:

  • All items pass → proceed to Phase 2
  • Any item fails → fix and re-run Phase 1 before continuing

Phase 2 — Deep SOLID & Structural Audit

Gate 1: Single Responsibility (SRP)

  • Pass: Each function/class has one reason to change. Logic is encapsulated by domain. Functions are under ~20 lines.
  • Fail: "God objects" that mix UI, state, and I/O logic. Deep nesting (>2 levels). Side effects inside functions advertised as pure.
  • Action on Fail: Trigger decomposition — split logic into atomic, single-purpose units. Each extracted piece should be testable in isolation.

Gate 2: Open/Closed + Liskov Substitution (OCP/LSP)

  • Pass: New behavior is added by extending, not by modifying existing code. Subtypes are drop-in replacements for their parents without breaking contracts.
  • Fail: Large if/else or switch chains that must grow for each new type. Subclass methods throwing "Not Implemented".
  • Action on Fail: Refactor using the Strategy pattern or polymorphism. Close the current abstraction and extend via composition.

Gate 3: Interface Segregation + Dependency Inversion (ISP/DIP)

  • Pass: Interfaces are narrow — clients only depend on what they use. High-level modules depend on abstractions, not concrete implementations.
  • Fail: "Fat" interfaces where implementors are forced to stub unused methods. Hardcoded new SpecificClass() inside constructors. Tight coupling to third-party SDKs in business logic.
  • Action on Fail: Introduce dependency injection. Split fat interfaces into focused contracts. Wrap third-party dependencies behind an abstraction layer owned by your code.

Gate 4: Pragmatic Quality (KISS / DRY / YAGNI)

  • Pass: Zero duplicated logic. Simplest solution that satisfies the requirement. Intent-revealing names (isExpired vs flag). Related code is colocated.
  • Fail: Over-engineering for hypothetical future requirements. Magic numbers. Single-use abstractions with more complexity than the code they replaced. Abbreviated names (ptr, tmp, idx).
  • Action on Fail: Inline over-engineered abstractions. Replace magic numbers with named constants. Choose duplication over a premature abstraction when the abstraction adds net complexity.

Phase 2 — Critical Patterns

Dependency Impact Scan

Before any signature change, identify every file that imports the target.
If a signature changes, all dependent files must be updated in the same change. Never leave broken imports or type errors downstream.

Structural Integrity

  • Check for unreachable code and dead exports
  • Check for circular dependencies
  • Verify files are in the correct location per the project's structure (reference AGENTS.md)
  • Run the project's lint and type-check commands. Block completion if they fail.

Reporting

After completing both phases, report findings in this format:

## Code Review Results

### ❌ Errors (must fix)
- <specific issue, file:line, remediation>

### ⚠️ Warnings (should fix)
- <specific issue, file:line, remediation>

### ✅ Passed
- <what was verified>

### Recommendation
Approve / Request Changes — <one-line rationale>
  • If errors exist: report them and ask "Should I apply the fixes?"
  • After applying fixes: re-run the relevant phase to verify resolution
  • If the codebase has no AGENTS.md, suggest running /init-project first for better stack-aware review

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.