skills/dbx-diff-review-control/SKILL.md
High-signal code change review controller for PRs, patches, staged/index changes, working-tree diffs, commit ranges, and file-scoped review. Use when the user asks to review concrete code changes for functional/user-impact risks, data model correctness, state ownership, compatibility, or maintainability. Handles partial staged hunks and user-selected files/commits by selecting the exact review target before reading the diff. Do not use for implementation-only requests, generic code explanation, release publishing, issue triage, or plan-only Linus-style strict-pragmatic critique; for strict critique of a concrete diff, use this skill only to establish the target before dbx-linus-review.
npx skillsauth add dbvc/skills dbx-diff-review-controlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review concrete code changes as a scoped control loop, not as a generic checklist. The priority is high-signal findings that can affect users, break functionality, corrupt data/state, violate contracts, or make the code materially harder to reason about.
Default output language is Chinese unless the user requests otherwise. Be direct, technical, and evidence-first. Do not perform persona theater. Do not insult authors.
dbx-linus-reviewThese two skills share a strict engineering substrate: real problems, correct data structures, clear ownership, compatibility, and practical simplicity.
They are different controllers:
dbx-diff-review-control is for concrete change-set review. It first selects the exact target: PR, branch diff, staged diff, working tree, commit range, selected files, or pasted patch.dbx-linus-review is for strict pragmatic judgment across diffs, architecture plans, and implementation proposals, especially when the user asks whether something is good enough, over-engineered, dangerously modeled, or worth doing.If the user explicitly asks for Linus-style, harsh, strict-pragmatic, or architecture/方案 critique without a concrete diff target, prefer dbx-linus-review. If the user asks for strict critique of a concrete diff with target ambiguity, use this skill first to establish the target, then apply dbx-linus-review. If the user asks for ordinary PR/diff review, merge readiness, or selected-file/commit review, use this skill.
Use this skill for:
Do not use this skill for:
dbx-linus-review. For strict critique of a concrete diff, use this skill only for target selection when staged/unstaged/branch/file scope is ambiguous.Before producing findings, check these gates:
If artifact or target is missing, ask for the smallest missing input. If the likely target can be inferred from explicit wording, proceed and state the assumption. Do not invent findings from vibes.
Always select the review target before collecting or reading diffs. This is the main guard against reviewing the wrong files.
Priority order:
base...head branch diff.staged, local, branch, or pasted artifact). Read neighboring files only as context and label them as context, not reviewed targets.git diff --cached). This correctly handles partial staged hunks inside a file.When working in a repo, use scripts/collect-review-context.py with an explicit target when possible:
python3 skills/dbx-diff-review-control/scripts/collect-review-context.py --root . --target staged
python3 skills/dbx-diff-review-control/scripts/collect-review-context.py --root . --target branch --base origin/main
python3 skills/dbx-diff-review-control/scripts/collect-review-context.py --root . --target files --file-scope staged --files src/a.ts src/b.ts
python3 skills/dbx-diff-review-control/scripts/collect-review-context.py --root . --target commit-range --commit-range main..HEAD
The script is read-only. It does not run tests or modify files.
Build this internal target contract and print it when ambiguity or dirty state matters:
review_target:
source: pasted_patch | pr | branch | staged | unstaged | local | commit | commit_range | selected_files
base: ""
head: ""
included_files: []
selected_files: []
context_files_read: []
out_of_scope_dirty_files: []
partial_out_of_scope_files: []
target_assumption: ""
Rules:
See references/target-selection-and-scope.md for examples.
Choose the smallest mode that fits the request and risk.
| Mode | Use when | Behavior |
| --- | --- | --- |
| quick | Small diff, user asks for obvious issues only | Find S0/S1 correctness, security, compatibility, and data-loss risks. Suppress low-value maintainability comments. |
| standard | Default PR/diff review | Review user impact, data model, invariants, maintainability, contracts, and validation. |
| deep | Large diff or high-risk area | Add specialist passes and adversarial verification. Use for auth, payments, migrations, persisted data, permissions, cross-service APIs, or core state models. |
| focused | User names a focus area | Keep findings inside the requested focus unless another issue is an S0/S1 blocker. |
| re-review | User asks whether prior findings were fixed | Check only prior findings and directly related regressions. Do not restart a nit hunt. |
Depth defaults:
quick: under 100 changed lines and 1 to 5 files, no high-risk surfaces.standard: 100 to 500 changed lines, 6 to 10 files, or normal feature work.deep: over 500 changed lines, over 10 files, or any high-risk surface: auth, permissions, payments, data mutation, migrations, persisted schema, destructive operations, external integrations, cache/state model rewrites, public API changes.Prefer direct evidence over conversational memory.
AGENTS.md, CLAUDE.md, REVIEW.md, README, package manifests, schemas, test config, CI workflows, architecture notes, generated-code rules.Before listing findings, build this internal model. Print only the useful parts.
change_model:
stated_goal: ""
actual_diff_goal: ""
changed_user_paths: []
core_entities: []
state_owners: []
important_invariants: []
public_contracts_changed: []
persisted_data_or_schema_changed: []
async_or_concurrency_surfaces: []
validation_surface: []
highest_risk_surface: ""
A good review understands what the code is trying to protect before judging the syntax.
Run these passes in order. The files in agents/ are optional specialist pass prompts, not a requirement to delegate. Use them with subagents only when the host supports delegation and the user has explicitly allowed multi-agent review; otherwise run the same passes sequentially in the current session.
Intent and scope drift pass
User-impact correctness pass
Data model and invariant pass
Contract and compatibility pass
Maintainability pass
Validation pass
Verifier pass
Suppress findings that are:
Prefer 1 to 5 high-signal findings over a wall of minor comments.
Use this severity scale. See references/severity-and-evidence.md for calibration.
[S0 blocker]: likely data loss, security exposure, production outage, irreversible user harm, hard compatibility break, or unsafe migration/release path.[S1 high]: likely functional regression in an important user flow, wrong data ownership/model, broken invariant, auth/permission mistake, severe performance cliff, or unsafe integration behavior.[S2 medium]: real but bounded correctness or maintainability risk; unnecessary complexity likely to cause future bugs; incomplete validation of important behavior.[S3 low]: small cleanup, clarity, local simplification, or test clarity. Report sparingly.Severity requires impact. Confidence requires evidence.
Use this shape by default. Omit sections that do not apply, but keep evidence inside each finding.
## 核心判断
- 结论:可以合并 / 需要修改后合并 / 不建议合并 / 信息不足
- 主要风险:一句话说明最高风险
- Review 模式:quick / standard / deep / focused / re-review
## Review 目标
- 来源:staged / unstaged / local / branch / commit-range / selected-files / pasted patch / PR
- 范围:...
- 未纳入范围:...
- 假设:...
## 变更理解
- 目标:...
- 实际改动:...
- 关键数据/状态模型:...
- 用户影响面:...
## 主要发现
1. [S1 high] 标题
- Evidence: 指向具体文件、函数、diff 行为、数据路径或用户路径
- Impact: 会影响谁、在什么条件下出错、为什么重要
- Fix: 最小可行修复方向
- Confidence: high / medium / low
- Verification: 已验证什么;未运行什么;还需要什么
## 数据结构和模型判断
- 哪些实体、状态 owner、生命周期或不变量是对的
- 哪些地方模型不稳,为什么会带来分支、缓存、同步或兼容性问题
## 可维护性判断
- 保留有明确后果的结构性评价
- 不写泛泛的“代码不够优雅”
## 验证建议
- Automated: 具体命令或测试建议
- Manual: 具体用户路径
- Not run: 当前没有运行或无法确认的验证
## 残余风险
- 合并后仍需要观察或补充的信息
If there are no major findings, say so directly:
## 核心判断
未发现需要阻止合并的问题。
## Review 目标
...
## 残余风险
...
## 验证建议
...
Do not pad the answer with fake rigor. If the review is small, keep it small.
You may say the review is complete when:
You may not say the change is safe, verified, tested, ready, or green unless the relevant evidence exists in the current session. Use Not run or 未验证 for missing checks.
references/target-selection-and-scope.md: exact review target selection, staged subsets, selected files, commit ranges, and dirty-state disclosure.references/severity-and-evidence.md: severity calibration and evidence rules.references/data-model-invariants.md: data structure, ownership, and invariant review guide.references/risk-surfaces.md: frontend, backend, API, data, security, and integration risk surfaces.references/reviewer-passes.md: specialist pass protocol and verifier behavior.references/examples.md: example high-signal findings and anti-patterns.scripts/collect-review-context.py: safe local context collector with explicit target modes. It reads git/package metadata and suggests validation commands. It does not run project commands.scripts/validate-review-report.py: optional report sanity checker for saved Markdown review reports.testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-showhand`, `$dbx-software-plan-first-showhand`, or asks to manually trigger this exact DBX Software Plan-First safe automatic execution phase. Do not auto-trigger for ordinary automatic execution, do-it-all, showhand, or plan-first requests.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-plan-issue`, `$dbx-software-plan-first-plan-issue`, or asks to manually trigger this exact DBX Software Plan-First plan convergence phase. Do not auto-trigger for ordinary planning, Plan mode, repository exploration, or implementation requests.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-implement-feature`, `$dbx-software-plan-first-implement-feature`, or asks to manually trigger this exact DBX Software Plan-First review-gated single-task implementation phase. Do not auto-trigger for ordinary implementation, tasks.md, next-task, or plan-first requests.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-ground-plan`, `$dbx-software-plan-first-ground-plan`, or asks to manually trigger this exact DBX Software Plan-First read-only grounding phase. Do not auto-trigger for ordinary repo reading, fact checking, plan writing, or implementation requests.