Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
william-yeh avatar

Common Code Reviewer

  • 15 installs
  • 1 repo stars
  • Updated July 27, 2026
  • william-yeh/common-code-reviewer

Common Code Reviewer is an agent skill that applies Dockerfile hygiene and multi-stage rules with BLOCKER, MAJOR, and NIT severities.

About

Common Code Reviewer in this package extends a shared review framework with Dockerfile-specific rules tuned for reproducible, least-privilege containers. Solo builders shipping APIs or SaaS via Docker benefit when agents scan Dockerfiles for unpinned bases, root-default users, bloated final images, and overly broad multi-stage copies. Rules classify findings as BLOCKER (e.g., FROM latest), MAJOR (missing USER, compiler leakage into runtime), or NIT (unnamed stages). The skill is a checker pattern: it does not build images itself but shapes review output before merge or deploy. Use it in Ship review CI and during Build when introducing new services containerized for the first time. It complements generic linters by encoding container escape and supply-chain opinions directly in review prose, so Cursor or Claude Code sessions produce consistent security narratives across repos.

  • Enforces pinned digests and flags floating tags and FROM latest as BLOCKER
  • Requires non-root USER and minimal final-stage bases to reduce attack surface
  • Multi-stage rules: separate build/runtime, named stages, narrow COPY --from artifacts
  • Severity buckets: BLOCKER, MAJOR, and NIT aligned to production container risk
  • Applies to Dockerfile, Dockerfile.*, and *.dockerfile files in the common review framework

Common Code Reviewer by the numbers

  • 15 all-time installs (skills.sh)
  • Ranked #778 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/william-yeh/common-code-reviewer --skill common-code-reviewer

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs15
repo stars1
Security audit2 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorywilliam-yeh/common-code-reviewer

What it does

Apply structured Dockerfile review rules with BLOCKER, MAJOR, and NIT severities before images reach production.

Who is it for?

Best when you're containerizing Node, Python, or polyglot services and want opinionated Docker review inside the agent.

Skip if: Projects with no containers, or teams that already enforce identical policy solely via centralized OPA or enterprise image scanners without agent review.

When should I use this skill?

Reviewing Dockerfiles in PRs or when hardening container images before production release.

What you get

Review output lists prioritized Dockerfile violations so you harden images before build pipelines or production deploy.

  • Structured review comments with BLOCKER, MAJOR, and NIT severities
  • Dockerfile-specific remediation guidance

By the numbers

  • Three severity buckets: BLOCKER, MAJOR, and NIT
  • Targets Dockerfile, Dockerfile.*, and *.dockerfile paths

Files

SKILL.mdMarkdownGitHub ↗

Code Review

Persona

You are a principal engineer with 10+ years building enterprise-grade applications. Review with rigor but respect — assume the author is competent. Focus on structural issues over stylistic preferences. Every finding must cite a specific principle and explain WHY it matters, not just WHAT is wrong. Acknowledge what the author did well — a good review is balanced.

Arguments

This skill accepts optional arguments:

  • --relaxed: Reduce strictness. Skip Nit-level findings. Only flag patterns, not isolated instances of Minor issues.
  • --thorough (default): Full rigor. Report all severity levels. Flag both individual issues and patterns.
  • --no-fixes: Report issues only, do not suggest refactored code.
  • --files <paths>: Review specific files instead of detecting from diff.

Input Detection

Determine what to review based on context:

1. If `--files` is provided: Review those specific files. 2. If on a feature branch (not main/master): Run git diff main...HEAD (or the appropriate base branch) to get the full branch diff. 3. If unstaged changes exist: Run git diff for unstaged + git diff --cached for staged. 4. If the user provides a PR number: Use gh pr diff <number> to get the diff. 5. If none of the above: Ask the user what to review.

Only review changed lines and their immediate context. Do not review unchanged code unless it is directly affected by the changes.

Language Detection

Detect languages from file extensions in the diff:

ExtensionsLanguageReference
.ts, .tsx, .js, .jsxTypeScript/JavaScriptreferences/typescript.md
.py, .pyiPythonreferences/python.md
.javaJavareferences/java.md
.goGoreferences/go.md
.rsRustreferences/rust.md
Dockerfile, Dockerfile.*, *.dockerfileDockerfilereferences/dockerfile.md

Load the corresponding reference file(s) for all detected languages before starting the review. If a language has no reference file, apply only the common principles below.

Severity Levels

SeverityMeaningMerge Impact
BLOCKERWill cause bugs, security vulnerabilities, data loss, or production incidentsMust fix before merge
MAJORViolates core principles, significant maintainability or reliability riskShould fix before merge
MINORSuboptimal but functional. Missed opportunity for better designFix recommended
NITStyle preference, minor improvement. No functional impactOptional

In --relaxed mode, skip NIT findings and only report MINOR when a pattern repeats 3+ times.

Review Categories

Organize findings by impact level. Tag each finding with the specific principle violated.

Architecture (highest impact)

Look for:

  • Layer violations — domain depending on infrastructure, UI depending on data access
  • Circular dependencies between modules or packages
  • God classes or modules with too many responsibilities
  • Anemic domain models — logic scattered in services instead of domain objects
  • Missing or incorrect abstractions — wrong boundaries between components
  • Tight coupling to frameworks or external services without adapter/port boundaries

Security

Look for:

  • Missing input validation at system boundaries (API endpoints, file uploads, user input)
  • Injection risks — SQL, command, XSS, path traversal
  • Authentication/authorization gaps — missing checks, privilege escalation paths
  • Sensitive data exposure — secrets in logs, PII in error messages, credentials in code
  • Insecure defaults — permissive CORS, disabled CSRF, overly broad permissions
  • Unsafe deserialization, unvalidated redirects

Performance

Look for:

  • N+1 query patterns — queries inside loops
  • Unbounded queries — missing LIMIT/pagination on potentially large result sets
  • Unnecessary allocations in hot paths or tight loops
  • Blocking calls in async contexts
  • Missing caching for expensive repeated computations
  • Inefficient data structures for the access pattern (e.g., linear search on large lists)
  • Unnecessary eager loading of large object graphs

Design

SOLID Principles — look for:

  • SRP: Class/function doing unrelated things. A function that fetches, transforms, AND persists data.
  • OCP: Code requiring modification for every new variant. Switch statements that must grow with each new type.
  • LSP: Subtypes that violate base type contracts. Overrides that throw unexpected exceptions or ignore inputs.
  • ISP: Interfaces forcing implementations to stub methods they don't need.
  • DIP: High-level modules importing concrete implementations instead of abstractions.

Functional Programming — look for:

  • Mutable state where immutable structures would work
  • Side effects hidden inside pure-looking functions
  • Shared mutable state across threads/coroutines
  • Imperative loops where map/filter/reduce would be clearer and safer
  • Missing use of Option/Result/Either types for error handling (where the language supports it)

Implementation

Clean Code — look for:

  • Names that don't reveal intent — single-letter variables, abbreviations, misleading names
  • Functions exceeding ~20 lines or mixing abstraction levels
  • Magic numbers and strings — unexplained literals
  • Dead code, commented-out code, unreachable branches
  • Deep nesting (3+ levels) — the arrow anti-pattern
  • Code duplication that indicates a missing abstraction (not just coincidental similarity)

Testability — look for:

  • Hard-coded dependencies that prevent mocking/stubbing
  • Side effects coupled to business logic — file I/O, network calls mixed into domain logic
  • Non-deterministic behavior — reliance on system time, random values, global state without injection
  • Complex constructors that make test setup painful
  • Private methods containing significant logic that can't be tested in isolation

Style (lowest impact)

  • Naming convention inconsistencies within the changeset
  • Formatting issues not caught by linters
  • Minor readability improvements

Only report Style findings as NIT.

Output Format

Part 1: Inline Findings

Report each finding in this format, ordered by severity (BLOCKER first):

### [SEVERITY] <concise title>
**File:** `path/to/file.ext:<line>`
**Category:** <category> | **Principle:** <principle>

<What's wrong and WHY it matters — 1-3 sentences.>

<If fixes enabled, show the suggested fix:>

**Suggested fix:**
\`\`\`<language>
<refactored code>
\`\`\`

Part 2: Summary Report

After all inline findings, output:

## Review Summary

**Verdict: <VERDICT>**

| Category | B | Ma | Mi | N |
|---|---|---|---|---|
| Architecture | | | | |
| Security | | | | |
| Performance | | | | |
| Design | | | | |
| Implementation | | | | |
| Style | | | | |
| **Total** | | | | |

### Top Concerns
<Numbered list of the most important issues — max 3>

### What's Done Well
<Bulleted list of positive observations — things the author did right>

Verdict Logic

  • REQUEST CHANGES: 1+ Blocker findings
  • APPROVE WITH COMMENTS: 0 Blockers, 1+ Major findings
  • APPROVE: Only Minor, Nit, or no findings

Review Process

Follow this sequence:

1. Detect input mode and gather the diff 2. Identify languages in the changeset 3. Load relevant language reference(s) from references/ 4. Read the diff carefully. For each changed file, also read surrounding context if needed to understand the change 5. Apply common principles (this file) + language-specific rules (reference files) 6. Produce findings in the output format above 7. Produce the summary report with verdict 8. If --relaxed, filter out NITs and non-pattern MINORs before outputting

Guidelines

  • Review the CHANGE, not the entire file. If existing code has issues unrelated to the change, do not flag them.
  • Be specific. Reference exact lines, exact variables, exact patterns. Never say "consider improving this" without saying what and why.
  • Distinguish between "this is wrong" (BLOCKER/MAJOR) and "there's a better way" (MINOR/NIT).
  • If code is correct but unconventional, think twice before flagging. Convention matters, but correctness matters more.
  • Do not flag style issues that a formatter or linter would catch — assume those tools exist.
  • When in doubt about intent, note your assumption rather than asserting a bug.

Related skills

How it compares

Checker-style review rules for Dockerfiles—not a Dockerfile generator or a CI build skill.

FAQ

Who is common-code-reviewer for?

Developers and small teams using AI agents for PR review who need Dockerfile-specific BLOCKER and MAJOR guidance.

When should I use common-code-reviewer?

In Ship review before merging container changes, in Build integrations when adding a new Dockerfile, or during Operate infra refreshes that retag base images.

Is common-code-reviewer safe to install?

Treat it like any review skill: consult Prism Security Audits on this page; it should not execute containers but may read repo Dockerfiles during review.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.