一键导入
code-review
Use when reviewing code changes for quality, correctness, and security — runs a structured checklist with severity-rated findings
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when reviewing code changes for quality, correctness, and security — runs a structured checklist with severity-rated findings
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when research or domain knowledge keeps getting rediscovered across sessions — build a supplementary markdown wiki that compounds synthesized knowledge without replacing GitHub or committed project guidance
Use when you need to build a new MCP server — plan the tool surface, implement the server, register it in Copilot CLI, inspect the config, and test the tools end to end.
Use when delegated work needs runtime guardrails — constrain sub-agents with loop detection, circuit breakers, and escalating sandbox levels before accepting their output
Use when reviewing the source code of an MCP server or client implementation — not just its runtime config — for authentication, session, rate-limit, schema-validation, and SDK-usage vulnerabilities, with file/line-cited findings mapped to OWASP Top 10
Use when you need to evaluate an LLM pipeline or AI feature systematically — sets up an eval harness with test cases, scoring rubrics, and pass/fail tracking rather than one-off manual spot-checks
Use when a question requires comprehensive evidence gathering from multiple sources, systematic synthesis, and traceable citations — produces a structured research brief rather than a quick answer
| name | code-review |
| description | Use when reviewing code changes for quality, correctness, and security — runs a structured checklist with severity-rated findings |
| metadata | {"category":"development","agent_type":"code-review"} |
# See what files changed
git --no-pager diff --stat main...HEAD
# Get a summary of the diff
git --no-pager diff main...HEAD --shortstat
For PR reviews, use the code-review agent type which is purpose-built for this:
task agent_type: "code-review"
prompt: "Review the staged changes in this repository"
Evaluate each changed file against these categories:
| Priority | Category | What to Check |
|---|---|---|
| 🔴 Critical | Correctness | Logic errors, off-by-one, null handling, race conditions |
| 🔴 Critical | Security | Injection, auth bypass, secret exposure, unsafe deserialization |
| 🟡 Important | Error handling | Missing try/catch, unhandled promise rejections, error propagation |
| 🟡 Important | Edge cases | Empty inputs, large inputs, unicode, concurrent access |
| 🟢 Minor | Performance | N+1 queries, unnecessary re-renders, missing indexes |
| 🟢 Minor | Maintainability | Dead code, unclear naming, missing types |
# Find TODO/FIXME/HACK left in changed files
git --no-pager diff main...HEAD | Select-String "TODO|FIXME|HACK"
# Check for console.log or debug statements
git --no-pager diff main...HEAD | Select-String "console\.log|debugger|print\("
# Ensure tests exist for changed source files
git --no-pager diff --name-only main...HEAD | Select-String "\.(ts|js|py|go)$"
# Run the test suite
npm test 2>&1 | Select-Object -Last 20
# Look for changed function signatures or removed exports
git --no-pager diff main...HEAD -- "*.ts" | Select-String "^[-+].*(export|public|function)"
# Check for changed API routes or database schemas
grep -rn "router\.\|app\.\|migration" --include="*.ts" src/
# Stage changes and review
git add -A
git --no-pager diff --cached --stat
git --no-pager diff --cached
The code-review agent provides high signal-to-noise analysis — it only surfaces
issues that genuinely matter (bugs, security, logic errors), never style or formatting.
task agent_type: "code-review"
prompt: "Review changes between main and the current branch. Focus on correctness and security."
| Rationalization | Reality |
|---|---|
| "LGTM, it's a simple change" | Simple-looking changes can break implicit dependencies. (Hyrum's Law) |
| "Tests pass, so it's fine" | Tests only verify what's explicitly tested. Reviews catch what tests don't. |
| "I trust the author" | Reviews aren't distrust — they're a second pair of eyes. Authors miss their own bugs. |
| "It's a big PR, I'll skim it" | Large PRs need more thorough review. The size itself is the first piece of feedback. |
| "Security is for the security team later" | Cost to fix in development < cost to fix in production × 100. |
AI-generated code requires the same review standard as human-written code — often a stricter one.
Core principle: Treat the AI as a junior engineer. The first output is a draft, not a finished product.
Verify, Don't Trust.
Review agent output exactly as you would review a code submission from a new contributor.
| Risk | What to look for |
|---|---|
| Plausible but wrong logic | Code that looks correct but contains subtle semantic errors — AI optimizes for appearance |
| Hallucinated APIs | Method names, library versions, or options that don't exist |
| Missing edge cases | AI often generates the happy path only; check null, empty, concurrent, and boundary conditions |
| Scope creep | AI may change code beyond what was asked — diff carefully |
| Test quality | AI-written tests often assert the implementation, not the behavior; verify they would actually catch regressions |
| Security assumptions | AI may apply patterns from its training data that are outdated or contextually wrong |
git diff --stat)git --no-pager diff main...HEADview tool rather than reading raw diffsexplore agent to understand unfamiliar code paths before commenting