From dev-skills
Use when reviewing uncommitted or staged git changes before commit. Trigger on: 帮我 commit, 我要 commit, commit 一下, 准备提交, pre-commit, 提交前检查, 看下这次修改, commit 前看一下, I want to commit, let's commit, review my changes. Checks conventions, functional correctness, security/reliability/performance hotspots, wiring, comments, and dead code; emits a commit message only when READY. Does not mutate the working tree. Route to dev-commit-writer only when the user explicitly asks to skip review or wants only a commit message.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev-skills:dev-code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
IRON LAW: NO READY VERDICT WITHOUT WIRING EVIDENCE, AND NO COMMIT MESSAGE UNLESS READY.
IRON LAW: NO READY VERDICT WITHOUT WIRING EVIDENCE, AND NO COMMIT MESSAGE UNLESS READY.
Focused review on the current git working tree right before a commit. Goal: catch 规范、功能、安全/可靠性风险、闭环、注释、废代码 problems before they enter history.
This is NOT a full architecture review. Stay scoped to what actually changed in this diff.
Use this skill when the user is preparing to commit code or asks to review the current git working tree before committing.
Trigger phrases include:
帮我 commit我要 commitcommit 一下commit 这个改动准备 commit准备提交pre-commit提交前检查这次改动 review 一下看下这次修改commit 前看一下I want to commitlet's commitcheck before commitreview my changesAmbiguous commit requests such as 帮我 commit / commit 一下 mean "go through the full commit flow: review first, commit message only if ready". This is the safer default path because team policy requires review before commit.
Only route to dev-commit-writer when the user explicitly says skip review, 跳过 review, 我自审过了, only message, or 只要 message.
For other workflow stages, route to the matching skill:
dev-grill-docs (dev-spec remains a compatibility alias)dev-plandev-fixOptional arguments:
--staged: limit to staged changes only--path=<glob>: limit scope to a path glob执行前先加载 references/dev-baseline.md。以下行为准则在本 skill 全程生效:不假设、最小代码、外科手术式改动、可验证成功标准。
baseline 与本 skill 的关联点:
skill 内部规则在与 baseline 冲突时以局部为准(例如严重度 rubric)。
If any red flag appears, stop and correct the review before reporting:
git grep evidence command or naming an exemption.path:line, no clear axis, or no actionable fix.✅ READY, but you are about to output a Commit section.Run these read-only commands. They never mutate the working tree:
git status --short
git diff --stat
git diff # unstaged
git diff --cached # staged
git log --oneline -10 # recent commit message style
$ARGUMENTS contains --staged / staged / --cached → restrict to git diff --cached.$ARGUMENTS contains --path=<glob> (or a bare path) → restrict to that path.For each modified file, read the full file (not just the hunks) when the diff touches logic, so you can judge whether the change is closed-loop. Skim-only is acceptable for pure config / lockfile / generated code.
Skip these files' contents (mention they exist in Scope, but don't review):
*.lock, pnpm-lock.yaml, package-lock.json, yarn.lock, Cargo.lock, Gemfile.lock, poetry.lock, go.sum*.g.dart, *.freezed.dart, *.pb.go, *.pb.ts, *_pb2.py, *.gen.tsIf the diff includes paths that are usually gitignored (node_modules/, .next/, target/, dist/, build/, .venv/, __pycache__/, .DS_Store), emit a P1 finding (axis: 废码) prompting the user to check .gitignore.
Use this rubric to keep severity consistent across runs:
catch {}, except: pass, _ = err)console.log, print, debugPrint, println!, fmt.Println, NSLog, debugger)TODO / FIXME without owner or ticketWhen uncertain, prefer the lower severity. Don't inflate to look thorough.
For every finding, cite path:line and tag severity using the rubric above.
Before judging the functional axis, scan .claude/artifacts/{designs,plans,fixes}/ when it exists:
designs/<slug>.md and plans/<slug>.md exist, check the diff against both the spec acceptance criteria and the plan ADR.fixes/<slug>.md exists, check the diff against the recorded root cause, fix summary, regression test, and verification evidence.Clear divergence from an active spec, ADR, or fix artifact is a functional finding. If the implementation is reasonable but the artifact is stale, report artifact drift instead of silently accepting the mismatch.
Load references/risk-checklist.md only when relevant:
Keep findings mapped to the existing axes. Security, reliability, and performance problems normally belong to 功能, unless the issue is purely unused/dead code.
先识别本次 diff 涉及的语言,再用该语言的官方/社区规范评审。详细的逐语言检查清单见 references/lang-conventions.md —— 只加载与本次 diff 实际涉及语言相关的小节,不要把整个文件读进来。
项目配置优先级最高:如果项目根目录存在 lint 配置(.eslintrc*、analysis_options.yaml、pyproject.toml、.golangci.yml、clippy.toml、rustfmt.toml、.editorconfig、tsconfig.json、.swiftlint.yml 等),以项目配置为准,覆盖 references 中的通用条目。
通用项(语言无关,所有语言都查):
console.log / print / debugPrint / println! / fmt.Println / NSLog / debugger 等)。catch {} / except: pass / _ = err。Read the diff as if you have to ship it:
This is the most commonly skipped check. Two-valued — there is no "partially closed loop".
For every new public symbol introduced in this diff (function / class / method / route / component / config key / event type / DB column / error type), verify a consumer exists:
git grep -n "<symbol>" -- ':!<defining_file>'
Evidence before claims(必做):必须真正调用 bash 跑 git grep,在报告里展示 command + output(完整粘贴,或简洁引用「N matches in M files: ...」),不能只说「grep 验证通过」。这是 baseline「Evidence before claims」在闭环轴的最严落地 —— 没真跑 grep 就不算闭环检查。
Decision tree:
Framework-invoked exemptions (count as closed loop even with 0 grep hits):
*_test.*, *.test.*, *.spec.*, test_*.py)build() / initState() / dispose(), React component default exports, Vue setup(), Android onCreate(), iOS viewDidLoad(), etc.)@Override, @Autowired, @Component, @Injectable, Spring beans, etc.)main(), files declared as bin in package.json / pubspec.yaml)Other things to verify in this axis:
Comments should explain why, not what. Flag:
// increment counter above i++).// We will now loop through..., // This function...).TODO / FIXME without an owner or ticket.Keep: comments that document a non-obvious why, an invariant, a known bug workaround, or a subtle constraint.
if (false), code after return).Cleanup only when evidence shows no active consumers and deletion is within this commit's scope.Cleanup, naming the missing evidence/precondition (telemetry, migration, external consumer check, rollback path).输出语言跟随用户提问语言(中文提问出中文报告)。严格按下列模板,不要加寒暄、不要复述用户原话、不要解释自己在做什么。
Before output, run this self-check:
❌ BLOCK; P1 only → ⚠ FIX P1; no P0/P1/debug/dead-code → ✅ READY.git grep evidence or an explicit framework/public-API exemption.path:line, one of 规范 / 功能 / 闭环 / 注释 / 废码, and one actionable fix sentence.Commit is omitted unless Verdict is ✅ READY.━━━ Dev Code Review ━━━
Verdict : ✅ READY / ⚠ FIX P1 / ❌ BLOCK
Scope : <N> files · +<added> / −<removed> · <staged|unstaged|both>
Intent : <一句话,基于 diff 自己判断改动在做什么>
Languages : <按 diff 行数降序,例如:Dart, TypeScript> Lint config : <analysis_options.yaml | none>
Axis Check
规范 ✓ / ⚠ / ✗ <一行说明,仅在非 ✓ 时填>
功能 ✓ / ⚠ / ✗ ...
闭环 ✓ / ✗ ... ← 二值,不存在"部分闭环"
注释 ✓ / ⚠
废码 ✓ / ⚠
Findings (P0 阻塞 · P1 应修 · P2 可选)
[P0] path/to/file.dart:42 <axis> <一句话问题>
→ <一句话修复建议>
[P1] path/to/other.ts:117 <axis> ...
→ ...
[P2] ...
Cleanup (建议在本次 commit 内一并删除)
- path:line <注释 / 死代码 / 调试输出> — <一句话原因>
Commit
<type>(<scope>): <subject ≤72 chars>
<空行>
<body 可选,列要点;无要点则省略 body>
<空行>
Refs: spec/<slug> ← 自动追溯,见规则 11
Refs: plan/<slug> ← 同 slug 的 spec + plan 都列
❌ BLOCK ← 闭环 ✗ 或 存在 P0 或 检出 secret/credential⚠ FIX P1 ← 闭环 ✓ 且 无 P0 且 存在 P1✅ READY ← 闭环 ✓ 且 无 P0/P1 且 无残留调试输出 且 无明显废码✓ / ⚠ / ✗ 单字符,仅在非 ✓ 时追加一行说明。全部 ✓ 时整张表保留但说明列留空。[P?] path:line <axis> <问题> 单行 + 缩进 → <修复> 单行 的两行结构。axis 取值固定:规范 / 功能 / 闭环 / 注释 / 废码。Findings 写一行 none 即可,不要写"无"、"暂无问题"这类废话。✅ READY 时输出。其他 Verdict 下整段省略 —— 还没到提交时机。git log --oneline -10 观察到的风格;仓库无明显风格时退回 conventional commits(feat|fix|refactor|docs|test|chore|perf|ci|style|build)。subject 不加句号,祈使语气,≤72 字符。✅ READY 时):扫 .claude/artifacts/{designs,plans,fixes}/,按以下规则在 commit message footer 自动加 Refs: 行:
Refs: <type>/<slug>,type ∈ {spec, plan, fix})> 检测到多个 in-flight artifact: [...],请告诉我这次 commit 关联哪个,我会把 Refs 加进去.claude/artifacts/ 目录不存在 → 不加(用户没用 dev-skills 流程)━━━ Dev Code Review ━━━
Verdict : ⚠ FIX P1
Scope : 3 files · +84 / −12 · staged
Intent : 给 prepAll transfer 增加 aspirate 流速参数并透传到底层 SDK
Languages : Dart Lint config : analysis_options.yaml
Axis Check
规范 ✓
功能 ⚠ 新参数未做 null/负值校验
闭环 ✓
注释 ⚠ 保留了一行 // TODO: refine later 无 owner
废码 ✓
Findings
[P1] lib/.../prepAll_transfer_aspirate_setting.dart:88 功能 flowRate 允许传入负值,会让底层抛异常
→ 在 setter 里 clamp 到 [0, maxFlow] 或 throw ArgumentError
[P2] lib/.../prepAll_transfer_aspirate_setting.dart:14 注释 `// TODO: refine later` 无 owner/ticket
→ 删除该 TODO 或改成 `// TODO(jason, #123): ...`
Cleanup
- lib/.../prepAll_transfer_aspirate_setting.dart:14 TODO 注释 — 无 owner/ticket,应删除
git add / git commit / git stash / 改文件),除非用户在确认报告后明确说"帮我修"。references/lang-conventions.md 读进来,只读本次 diff 涉及的语言小节。references/risk-checklist.md;只有命中 Risk checklist loading 条件时才读。Recommended agent_type: worker
Use when:
Do:
../../docs/multi-agent-policy.md.Do not:
Output:
npx claudepluginhub jason-chen-coder/dev-skills --plugin dev-skillsProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.