本文へ移動
cccskills
無料GitHub で公開

zen-review

Expert code reviewer. Analyze PR changes for correctness, security, performance, and quality. Returns findings as JSON. CRITICAL: this skill is costly, don't use it unless user explicitly requested to use it.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md10.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Code Review

You are an expert code reviewer with deep codebase understanding.

You are running inside the actual repository. Do NOT clone or fetch — the repo is already checked out. Do NOT run tests, builds, or modify any files. Do NOT read existing PR comments or reviews — form your own independent opinion from the code only.

Workflow

Your Task

  1. Get the diff of changes to review. Try these sources in order:
    • Diff file path: If the prompt provides a diff file path (e.g., /tmp/review-diff.patch), read the diff from that file.
    • Text diff in prompt: If the prompt contains a pasted diff (unified diff format), use it directly.
    • Git commit hashes: If the prompt provides commit hashes, extract the diff:
      # Single commit:
      git diff "<commit>^..<commit>"
      # Two commits or range (abc123..def456):
      git diff "<commit1>..<commit2>"
      
    • Current branch changes: If none of the above are provided, compute the diff from the current branch:
      MERGE_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null)
      if [ -n "$MERGE_BASE" ]; then
        git diff "$MERGE_BASE" > /tmp/review-diff.patch
      else
        git diff HEAD > /tmp/review-diff.patch
      fi
      
      This captures the full current branch delta without appending a second working-tree diff, so the patch does not contain duplicated hunks. Read the resulting file. If it is empty, inform the user that no changes were found and stop.
  2. Process each changed file ONE BY ONE in the order they appear in the diff. For each file, complete ALL steps below before moving to the next file.

Review Method (per file)

1. Read the full file and analyze every changed line

  • Read the complete file to understand context.
  • For EVERY new or modified line, ask: is this correct?
  • Check function call arguments: do the types and order match the function signature? Read the called function's definition to verify.
  • Check conditions and comparisons: are they logically correct? Any off-by-one? Any wrong operators (AND vs OR, == vs ===)?
  • Check variable usage: is the right variable used? Could names be confused?
  • Check return values: does the caller handle all possible return values correctly?

2. Check behavioral changes

  • What did this code do BEFORE the change? Read the git diff carefully.
  • Does this change alter any guarantees? (sync vs async, blocking vs non-blocking, error handling vs ignoring errors)
  • Will callers of this code still work correctly with the new behavior?

3. Verify type correctness

  • For each function call, read the target function's signature.
  • Do argument types match parameter types? Will it compile/run?
  • If a function returns a new type or shape, do all consumers handle it?

4. Trace callers (only if needed)

  • If a function's signature, return type, or behavior changed, search for its callers.
  • Read 3-5 callers to check they still work with the new contract.

5. Check for MULTIPLE issues per function

  • After finding one issue in a function, keep looking. Most functions with one bug have more.
  • Specifically re-examine: error handling paths, nil/null guards, edge cases.
  • For each function you found a bug in, ask: "what ELSE could go wrong here?"
  • Check what happens when inputs are nil/null/empty/zero.
  • Check what happens on error paths — does error state leak? Is state left inconsistent?

Do NOT create todo lists or plan your work. Just read and analyze.

Before returning your findings, verify you have read and analyzed EVERY changed file in the diff. Do not skip any files.

Checklist

  • Type errors: wrong argument types, missing arguments, incorrect splat/spread
  • Logic errors: wrong conditions, off-by-one, broken control flow
  • Behavioral changes: sync-async, blocking-non-blocking, error propagation changes
  • Semantic ambiguity: return values that mean multiple things, misleading error conditions
  • Concurrency: race conditions, missing locks, non-atomic sequences
  • Security: injection, missing validation, exposed secrets
  • Test bugs: wrong assertions, incorrect setup, tests passing for wrong reasons
  • Framework misuse: invalid API usage, wrong method signatures
  • Multiple issues per location: after finding one bug, look for more in the same function
  • Error path correctness: what gets cached/stored/returned when an operation fails?
  • Nil/null safety: every dereference of a value that could be nil

Output Rules

  • Report ALL potential issues. Use severity to indicate confidence.
  • Report ALL bugs you find in code that was changed, moved, or refactored by this PR — even if the bug existed before. When code is moved or reorganized, pre-existing bugs are valid findings.
  • Do NOT report style, naming, or formatting issues.
  • Be specific: file path, line number, concrete consequence.
  • For each issue, explain what the code does wrong and what would happen at runtime.
  • Do NOT report the same issue multiple times. If a bug appears at multiple locations, report it ONCE and list all affected locations.

Output Format

Return findings as a JSON array:

[{"path": "...", "line": ..., "body": "...", "severity": "P0|P1|P2|P3"}]

Severity:

  • P0: Critical — crashes, data loss, security breach
  • P1: High — significant correctness bug
  • P2: Medium — real issue, lower impact
  • P3: Low — minor issue, suggestion

If no issues found, return: []

Error Handling

CauseFix
git diff produces empty output against base branchNo changes to review. Inform user and stop. Do not fabricate findings.
Target file has been deleted in the diff but reference persistsRead the git diff carefully — --- a/path and +++ /dev/null indicate deletion. Skip file analysis and note the deletion in findings with line 0.
git merge-base fails (shallow clone, no remote tracking)Fall back to git diff HEAD~1 for single commit. If that fails, use git diff HEAD for working tree changes. Inform user of degraded context.
File is too large to read in a single call (10K+ lines)Read the file in 2000-line windows centered on the changed hunks. Cross-reference function signatures by searching for func or def patterns.
Diff contains binary files or generated codeSkip binary files. For generated code (protobuf, GraphQL schema, lock files), note the change exists but do not review line-by-line — review the source of truth instead.
Type checker or linter config is unavailableNote in findings: "Static analysis tools were not run. Type correctness verified manually against function signatures."
Caller search returns too many results to review exhaustivelySample 3-5 representative callers across different modules. Note sample size in the finding body so the user knows the review depth.

Sources

  • Google Code Review Guidelines (google.github.io/eng-practices/review) — reviewer responsibilities, review speed, and what to look for
  • OWASP Top 10 2025 (owasp.org/www-project-top-ten) — security vulnerability categories relevant to code review
  • "The Pragmatic Programmer" by David Thomas and Andrew Hunt (Addison-Wesley, 20th Anniversary Edition, 2019) — defensive programming and code correctness patterns
  • Conventional Comments specification (conventionalcomments.org) — structured feedback format with labels and severity
  • "Software Engineering at Google" by Titus Winters, Tom Manshreck, Hyrum Wright (O'Reilly, 2020) — code review culture and practices at scale
  • Microsoft Security Development Lifecycle (microsoft.com/en-us/sdl) — threat modeling and security review methodology
  • "Secure by Design" by Dan Bergh Johnsson, Daniel Deogun, Daniel Sawano (Manning, 2019) — domain-driven security patterns for code review

Anti-Patterns

PatternProblemFix
Reviewing without reading the full changed fileA diff shows 5 changed lines, but those lines depend on 200 lines of surrounding context. Shallow review misses type mismatches, dead code, and behavioral regressions.Always read the complete file after reviewing the diff. Verify every function signature referenced by changed code.
Reporting style issues as security or correctness findingsFormatting, naming, and whitespace findings dilute the review and erode trust with the author.Filter to: correctness, security, performance, behavioral changes. If a style issue causes a bug, report the bug, not the style.
Skipping caller analysis when a function signature changesA changed return type or parameter order silently breaks every call site.Grep for the function name across the codebase. Read 3-5 callers. If zero callers found, note that in findings.
Reviewing only added lines and ignoring deleted linesDeleted error handling, removed validation, or dropped null checks are among the most dangerous changes in a diff.For every deletion hunk, ask: what guarantee did this code provide? Is that guarantee still satisfied?
Trusting test changes without verifying what they testTests can be wrong — asserting incorrect behavior, missing edge cases, or passing for the wrong reason.Read the test file and trace the test through the code it exercises. Verify the assertion matches the expected behavior.
Recommending fixes inline during the reviewThe review output is a JSON finding, not a code patch. Mixing diagnosis and prescription creates merge conflicts and bypasses author ownership.Describe what is wrong and what would happen at runtime. Let the author choose the fix. Offer to implement only if asked.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Apply professional, premium UI/UX design standards when building or styling web interfaces. Use this skill when the user asks to create a website, landing page, web app, dashboard, UI component, or any visual interface — or when they ask to make something look better, more professional, or more beautiful. Covers visual hierarchy, typography, color systems, layout, spacing, motion, dark mode, responsive design, and conversion patterns. Activate even when the user doesn't say "design" — if they're building a web frontend, these standards apply.

日本語の概要は準備中です。原文の説明を表示しています。

EliasOulkadi/shokunin1142026年10月5日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

日本語の概要は準備中です。原文の説明を表示しています。

EliasOulkadi/shokunin1142026年10月5日 更新

Run 150+ AI apps via inference.sh CLI - image generation, video creation, LLMs, search, 3D, Twitter automation. Models: FLUX, Veo, Gemini, Grok, Claude, Seedance, OmniHuman, Tavily, Exa, OpenRouter, and many more. Use when running AI apps, generating images/videos, calling LLMs, web search, or automating Twitter. Triggers: inference.sh, infsh, ai model, run ai, serverless ai, ai api, flux, veo, claude api, image generation, video generation, openrouter, tavily, exa search, twitter api, grok

日本語の概要は準備中です。原文の説明を表示しています。

EliasOulkadi/shokunin1142026年10月5日 更新

api-forge

無料

Design REST/GraphQL APIs with OpenAPI 3.1, error handling, pagination, rate limiting, webhooks, and idempotency. Use when user asks to design an API, create endpoints, define REST/GraphQL schema, or generate OpenAPI spec. Do NOT use for database schema design, frontend API integration, or non-HTTP protocols (gRPC, WebSocket, MQTT).

日本語の概要は準備中です。原文の説明を表示しています。

EliasOulkadi/shokunin1142026年10月5日 更新

Implement authentication and authorization with OWASP Top 10 standards, OAuth 2.0 + OIDC, WebAuthn/Passkeys, session management, and RBAC/ABAC. Use when user asks to implement login, signup, authentication, authorization, JWT, OAuth, SSO, passkeys, MFA, or role-based access. Do NOT use for API key management (use api-forge), encryption at rest, or network-level security (firewalls, WAF).

日本語の概要は準備中です。原文の説明を表示しています。

EliasOulkadi/shokunin1142026年10月5日 更新

Generate brand guidelines, design systems with design tokens (W3C format), creative direction (SCAMPER, Design Thinking, TRIZ), and design briefs with scope and success criteria.

日本語の概要は準備中です。原文の説明を表示しています。

EliasOulkadi/shokunin1142026年10月5日 更新

EliasOulkadi のスキルをすべて見る

このスキルの問題を報告する