원클릭으로
review
Code review for correctness, KISS/DRY/YAGNI/SOLID, security, language BKMs, tests, and docs
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Code review for correctness, KISS/DRY/YAGNI/SOLID, security, language BKMs, tests, and docs
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Draft or refine clare/autonomy.yml boundaries and sources_of_truth via guided interview
Capture normalized agent interactions for local CLARE2 distillation
Scaffold an MCP server exposing CLARE verify and autonomy-check tools
Prepare release collateral by auditing docs, updating CHANGELOG, and committing/pushing changes; hand off publish to human due signing passphrase.
| name | review |
| description | Code review for correctness, KISS/DRY/YAGNI/SOLID, security, language BKMs, tests, and docs |
| mode | agent |
Review all changes on the current branch against an appropriate base ref — as if performing a thorough pull-request code review. Do not guess at correctness; read the actual diff and the relevant file context.
Resolve the base ref in priority order. Use the first one that succeeds:
git rev-parse --verify "upstream/$(git symbolic-ref --short HEAD 2>/dev/null)" 2>/dev/nullgit rev-parse --verify "origin/$(git symbolic-ref --short HEAD 2>/dev/null)" 2>/dev/nullorigin/main — git rev-parse --verify origin/main 2>/dev/nullorigin/master — git rev-parse --verify origin/master 2>/dev/nullmain — git rev-parse --verify main 2>/dev/null# Unified diff from merge base (PR semantics — use triple-dot)
git diff <BASE_REF>...HEAD
# File summary (what changed at a glance)
git diff --stat <BASE_REF>...HEAD
# Untracked new files not yet committed
git status --short
Read the complete diff before beginning the review. Do not review hunks in isolation.
For every file that appears in the diff, read the full file — not just the changed hunks. This is required to:
Apply every category below to every changed file. Do not skip a category because the change looks small — subtle bugs hide in small diffs.
return in a branch; switch/match case that falls through when it should not== vs .equals() (Java), is vs == (Python), === vs == (JS), pointer vs. struct comparison (Go/C)dangerouslySetInnerHTML, server-side templates with unescaped interpolation*), missing security headers (Content-Security-Policy, X-Frame-Options)== (not constant-time); use crypto.timingSafeEqual (Node), hmac.compare_digest (Python), subtle.ConstantTimeCompare (Go)request_body, headers, or user_data serialized into logs or tracing spans without redaction of sensitive fieldsload, eval-based JSON parsing) without safe loader or schema validationcounter++, map[key] = map[key] + 1) without atomics or a mutexawait / unhandled promise rejections — async functions called without await; .catch() missing on a Promise chain; top-level await without try/catchfs.readFileSync, or blocking network calls on the main thread in Node.js or a browser contextvar in for)KISS — Keep It Simple
DRY — Don't Repeat Yourself
YAGNI — You Ain't Gonna Need It
SOLID Principles
switch/match/if-else chains that should be polymorphism, a registry, or a strategy mapCode Hygiene
camelCase vs snake_case), misleading names (a function named get* that has side effects), inconsistent verb tenseApply the checks for the language(s) present in the diff.
JavaScript / TypeScript
== instead of === (type coercion bugs)any on new interfaces; unchecked type assertions (as Foo without a preceding instanceof or type guard)=== instead of an epsilon / Number.EPSILON checkvar declarations (prefer let/const for block scoping)async/await)Object.assign({}, userInput) or spreadPromise chains missing .catch() or a try/catch around top-level await!) on values that could genuinely be null or undefined at runtimeAbortController / signal propagation on fetch or long-lived async operations that should be cancellablePython
def f(items=[]) or def f(cfg={}):except: — catches SystemExit and KeyboardInterrupt; use except Exception: or a specific typeis for value comparison — correct only for singletons (None, True, False); use == for all other values== — use math.isclose()if __name__ == "__main__": guard on executable scriptseval() or exec() on user inputos.path string manipulation instead of pathlib.Path for filesystem operations (Python 3.4+)Go
_ , err discarded or _ used where the error must be handledcontext.Context cancellationcontext.Context argumentinit() functions with side effects that make packages hard to test in isolationsync.Mutex embedded in a struct that is copied by value, silently breaking the mutexRust
unwrap() or expect() in non-test, non-prototype code without a // Safety: or // Invariant: comment justifying why the panic cannot occurunsafe blocks without a // SAFETY: comment explaining which invariants holdchecked_*, saturating_*, or wrapping_*)clone() where a borrow would suffice, especially in hot paths.to_string() / .to_owned() in function signatures where &str / AsRef<str> would avoid allocationGeneral / Any Language
toBeTruthy(), assert(result), or checking implementation details instead of observable, user-facing behaviornull/undefined/nil inputs, empty collections, zero/negative numbers, maximum-size inputs, concurrent callers, or injected errorssleep() for timing synchronization, real network calls in unit tests without mocking, non-deterministic data ordering, reliance on wall-clock time"works correctly", "handles the case" vs. "never creates duplicate users for the same email" or "returns 403 when caller does not own the resource"Structure your response exactly as follows. Omit a section only if it truly has no content; always include the header.
## Code Review — <branch-name> vs <base-ref>
(<N> files changed, +<additions> / -<deletions>)
### Issues
**[SEVERITY] `path/to/file.ext:42`** — Short descriptive title
> Explanation of the problem and why it matters.
> Suggested fix or the approach to take.
... (one block per issue) ...
_No issues found._ ← use only when Issues is genuinely empty
### Observations
- `path/to/file.ext:17` — Context-only note (no action required).
_None._ ← use only when there are no observations
### Execution Plan
> Only include this section when Issues is non-empty.
Ordered list of fixes. Mark items that can be done in parallel.
1. Fix [issue] in `path/file.ext:42`
2. Fix [issue] in `other.ext:88` — can parallelize with item 4
3. Fix [issue] in `third.ext:12`
4. Fix [issue] in `fourth.ext:55` — can parallelize with item 2
Severity scale:
| Severity | Meaning |
|---|---|
CRITICAL | Data loss, security breach, or crash in production — must fix before merge |
HIGH | Logic error or exploitable vulnerability that will cause real bugs under normal use |
MEDIUM | Suboptimal pattern, missing test, or risky assumption that increases the chance of a future bug |
LOW | Style issue, minor DRY violation, or weak assertion with limited blast radius |
file:line reference must come from the actual diff or file contents you read.CRITICAL and HIGH issues before MEDIUM and LOW.