一键导入
code-review-workflow
Canonical code-review workflow for any PR, branch, diff, or local change. Findings ordered by severity, defer to specialist skills when needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Canonical code-review workflow for any PR, branch, diff, or local change. Findings ordered by severity, defer to specialist skills when needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | Code Review Workflow |
| description | Canonical code-review workflow for any PR, branch, diff, or local change. Findings ordered by severity, defer to specialist skills when needed. |
| category | dev-tools |
| tags | ["ai","api","backend","cli","database"] |
| source | {"url":"https://github.com/langfuse/langfuse/tree/8624bbf82b06381c461c84e75bdb5fc6626dbb1a/.agents/skills/code-review","fetched_at":"2026-06-12","commit":"8624bbf82b06381c461c84e75bdb5fc6626dbb1a","license":"MIT","original_path":".agents/skills/code-review/SKILL.md"} |
| license | MIT |
| author | Langfuse (downstream pack: badhope) |
| version | 1.0.0 |
| needs_review | false |
| slug | code-review |
| created | 2026-06-12 |
| updated | 2026-06-19 |
| inputs | [{"name":"change_scope","type":"string","required":true,"description":"PR number/URL/branch/diff path/\"local\""},{"name":"areas_touched","type":"array","required":false,"description":"Areas touched - frontend/backend/security/database/ci/docs/infra/mobile/none"},{"name":"severity_threshold","type":"string","required":false,"description":"Lowest severity to report - critical/high/medium/low (default medium)"}] |
| output | {"format":"markdown","description":"Generated content based on the user request"} |
| quality | stable |
You're reviewing code — a PR, a branch, a diff, or local changes. The job is correctness, regressions, risk, and missing tests. You are not the author; you are the second pair of eyes.
The skill is built around three rules:
Don't use this skill for implementing a feature (use the feature's own skill). And don't use it as a replacement for security review — defer to the security-review skill on the same change.
| Field | Required | Notes |
|---|---|---|
change_scope | yes | PR number / URL / branch / diff path / "local". |
areas_touched | no | Drives which specialised skills to consult. |
severity_threshold | no | Lowest severity to report. Default medium. |
Plain-text review. Typical return:
Findings (3):
1. CRITICAL — Missing tenant isolation check
File: web/src/server/api/routers/projects.ts:89
Procedure `updateProject` does not verify the
caller is a member of the project being updated.
Required: ctx.session.user.memberOf(projectId)
Fix: copy the call site at
web/src/server/api/routers/projects.ts:42
2. HIGH — Missing test
File: web/src/server/api/routers/projects.ts:89
No test covers cross-tenant access denial.
Add: web/src/server/api/routers/projects.test.ts
case "user from project A cannot update project B"
3. MEDIUM — Untyped error response
File: web/src/server/api/routers/projects.ts:104
Error returned as `throw new Error(...)` instead of
`throw new TRPCError({ code: 'FORBIDDEN' })`.
Required: typed errors with code so the client can
distinguish 401 / 403 / 404.
Deferred to:
- security-review (cross-tenant, RBAC)
- frontend-large-feature-architecture (no — purely
backend in this PR)
Residual risk:
- did not run the test suite locally; CI must
confirm
- did not review the corresponding Fern SDK
generator output
You are reviewing code, not writing it. Output
findings first, ordered by severity, with file:line
references. No findings is a valid result.
1. Read the canonical review checklist first.
Most repos have a `references/review-checklist.md`
(or equivalent: `CONTRIBUTING.md`, `docs/review.md`,
`AGENTS.md`). Read it. It encodes the rules the
team has already agreed on. Do not duplicate those
rules in your review.
Examples of canonical rules (project-specific):
- ClickHouse / Postgres migration expectations
- tenant isolation checks
- API generator (Fern / OpenAPI / tRPC) consistency
- env var access patterns
- banner-offset UI positioning
2. Identify the area(s) the change touches.
- frontend — UI, components, state, styles
- backend — API, business logic, queues
- security — auth, RBAC, secrets, outbound HTTP
- database — schema, migration, query
- ci — workflows, build, deploy
- docs — prose, examples, READMEs
- infra — terraform, k8s, network
- mobile — iOS / Android
- none — minor doc typo, comment-only
3. Defer to the specialised skill for the area.
- security → also use the `security-review` skill
- database (ClickHouse) → also use the
`clickhouse-best-practices` skill
- frontend (large feature) → also use the
`frontend-large-feature-architecture` skill
- database migration → also use the repo's
migration checklist (often in the canonical
review checklist)
- new MCP server → also use the `mcp-builder`
skill
Do not duplicate the specialised skill's checks.
Defer; cite; move on.
4. Focus the review on the four priorities.
- correctness bugs (does it work)
- behavioural regressions (did it break what
worked)
- security / tenant risks (who can access what)
- missing / weak tests (for risky changes)
- performance w/ real impact (only if measurable)
Do NOT report:
- style nits the linter should catch
- bikeshed naming
- "I'd do it differently" without a concrete
reason
- speculative future-proofing
5. Output format.
Findings first, ordered by severity:
CRITICAL: correctness bug or direct exploit
HIGH: missing validation, missing test for
a risky change
MEDIUM: hardening gap, defense in depth
LOW: nice-to-have, log / metric
For each finding:
- file:line
- current behaviour
- required behaviour
- fix (name the call site to copy, or the
canonical helper)
After findings:
- short summary (1-3 sentences)
- list of specialised skills deferred to
- residual risk: what you couldn't verify
If there are no findings at or above the
severity threshold, say so explicitly. Note any
coverage gaps so the next reviewer knows where to
look.
6. Honour the severity threshold.
`critical-only` — only CRITICAL. Fast triage.
`high` — HIGH and above.
`medium` — MEDIUM and above (default).
`low` — everything, including LOW.
Input:
change_scope: "PR #1423 — add updateProject procedure"
areas_touched: [backend, security]
severity_threshold: medium
Output:
Findings (3):
1. CRITICAL — Missing tenant isolation check
File: web/src/server/api/routers/projects.ts:89
Procedure `updateProject` does not verify the
caller is a member of the project being updated.
Required: ctx.session.user.memberOf(projectId)
Fix: copy the call site at
web/src/server/api/routers/projects.ts:42
2. HIGH — Missing test
File: web/src/server/api/routers/projects.ts:89
No test covers cross-tenant access denial.
Add: web/src/server/api/routers/projects.test.ts
case "user from project A cannot update project B"
3. MEDIUM — Untyped error response
File: web/src/server/api/routers/projects.ts:104
Error returned as `throw new Error(...)` instead of
`throw new TRPCError({ code: 'FORBIDDEN' })`.
Required: typed errors with code so the client can
distinguish 401 / 403 / 404.
Deferred to:
- security-review (cross-tenant, RBAC scope drift)
- clickhouse-best-practices (no schema changes)
Residual risk:
- did not run the test suite locally; CI must
confirm
- did not review the corresponding Fern SDK
generator output
Review code changes and report issues by severity with actionable fixes.
Sharpen a fuzzy intention into one measurable objective string that drives the rest of the work.
Convert a Prompt Flow PRS pipeline submission to run a Microsoft Agent Framework workflow.
Build a Model Context Protocol (MCP) server that lets an LLM call into external tools and resources.
Summarize PDF documents into concise bullet-point digests.
Bump a dependency version across a pnpm workspace and update lockfile.