npx skills add https://github.com/jwilger/agent-skills --skill code-review价值: 反馈与沟通——结构化的审查能发现作者无法察觉的缺陷,将审查分为不同阶段可以防止某一领域的彻底性挤占其他领域。
教授一种系统性的三阶段代码审查方法,将规范符合性、代码质量和领域完整性作为独立的步骤进行评估。通过确保每个维度都得到专注的关注,防止在合并审查时让问题溜走。
按顺序进行三个阶段的代码审查。不要合并它们。每个阶段都有一个单一焦点。早期阶段的失败会阻止后续阶段——审查不符合规范的代码质量是没有意义的。
阶段 1:规范符合性。 代码是否按要求执行?不多不少。
针对每个验收标准或需求:
标记每个标准:PASS(通过)、FAIL(缺失/不完整/偏离)或 CONCERN(已实现但可能不正确)。将超出需求构建的任何内容标记为 OVER-BUILT(过度构建)。
如果有任何标准为 FAIL,则停止。在继续之前返回修改实现。
架构符合性检查(在逐项标准循环之后、进入阶段 2 之前运行):
docs/ARCHITECTURE.md 存在:验证此更改是否符合所有已记录的约束和模式(组件、模式、约束部分)。不符合即为 FAIL——严重性与缺失验收标准相同。docs/ARCHITECTURE.md 不存在:标记为阶段 2 的 CONCERN:"未找到架构文档;无法验证架构符合性。"在阶段 1 的输出中包含:Architecture Compliance: PASS / FAIL / N/A (no ARCHITECTURE.md)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
对于实现垂直切片(添加用户可观察行为)的任务,按顺序执行以下检查:
入口点连接检查(基于差异): 检查变更集是否包含对应用程序入口点或其连接/路由层的修改。如果切片声称添加了新的用户可观察行为,但差异未触及任何连接或入口点代码,则审查失败,除非作者明确记录了为什么现有连接已经路由到新行为。
端到端可追溯性: 验证可以从应用程序的外部入口点,通过任何基础设施或集成层,追踪到新的领域逻辑,再返回到可观察的输出。如果此路径的任何部分在变更集中缺失且代码库中尚未存在,则标记此缺口。
边界级测试覆盖: 确认至少有一个测试通过应用程序的外部边界(例如,HTTP 请求、CLI 调用、队列上的消息)来测试新行为,而不是直接调用内部函数。在应用程序架构支持自动化边界测试可行的情况下,缺少此类测试是审查的关注点。
测试级别异味检查: 如果变更集中的每个测试都是对孤立内部函数的单元测试,而没有集成或验收级测试,则将其标记为一个关注点。该切片可能正在实现领域逻辑,但未能证明其可通过运行的应用程序访问。
阶段 2:代码质量。 代码是否清晰、可维护且经过良好测试?
审查每个更改的文件:
domain-modeling 技能进行原始类型迷恋检测。按严重程度对发现的问题进行分类:
如果存在任何 CRITICAL 问题,则停止。返回修改实现。
阶段 3:领域完整性。 最后一道关卡——代码是否尊重领域边界?
检查:
domain-modeling 的 bool-as-state 检查。)标记问题,但不要因建议而阻塞,约定违规除外——根据"约定优于先例"规则,这些是阻塞性的。
完成所有三个阶段后,生成结构化摘要:
REVIEW SUMMARY
Stage 1 (Spec Compliance): PASS/FAIL
Stage 2 (Code Quality): PASS/FAIL/PASS with suggestions
Stage 3 (Domain Integrity): PASS/FAIL/PASS with flags
Overall: APPROVED / CHANGES REQUIRED
If CHANGES REQUIRED:
1. [specific required change]
2. [specific required change]
完成所有三个阶段后,生成一个 REVIEW_RESULT 证据包,包含:各阶段裁决 {stage, verdict (PASS/FAIL), findings [{severity, description, file, line?, required_change?}]}、overall_verdict、required_changes_count、blocking_findings_count。
当上下文元数据中提供了 pipeline-state 时,code-review 技能以流水线模式运行,并将证据存储到 .factory/audit-trail/slices/<slice-id>/review.json。当独立运行时,证据仅为信息性(不存储)。
在工厂模式下,整个团队在流水线推送代码之前进行审查——这是取代构建期间共识的质量检查点。所有阻塞性审查反馈必须在推送前解决。有关工厂模式审查子部分,请参见 references/mob-review.md。
审查发现必须写入 .reviews/ 文件作为默认的持久化机制。消息仅是补充的协调信号——它们无法在上下文压缩后保留。
<reviewer-name>-<task-slug>.md(例如,kent-beck-user-login.md).reviews/ 目录(添加到 .gitignore)这确保了审查发现能够在上下文压缩、代理重启以及缺乏代理间消息传递的框架中保留下来。
出现在 2+ 个不同切片的连续审查中的非阻塞性项目(SUGGESTION 严重性)必须升级为阻塞性(IMPORTANT 严重性)。通过检查 .reviews/ 中先前的审查文件来跟踪重复出现的情况。
这可以防止持续的质量问题被永久性地推迟为"只是一个建议"。
当 GWT 场景描述了用户可见的行为(UI 元素、显示的消息、视觉变化)时,变更集必须包含产生该可见输出的代码。当场景描述 UI 交互时,仅实现 API 是规范符合性失败——切片不完整。
书面约定优先于观察到的模式。当审查发现与项目约定(CLAUDE.md、AGENTS.md、crate 级文档、架构决策记录)冲突但与代码库中的现有代码匹配时,该发现仍然有效。违反约定的现有代码是技术债务,而不是先例。
规则:
示例:项目约定规定"对状态机使用类型状态模式"。新代码使用 struct Foo { is_active: bool },因为三个现有文件也这样做。审查必须阻止新代码并且将这三个现有文件记录为技术债务。
当你的审查发现与实现方法冲突时:
你的存在是为了发现作者遗漏的问题,而不是为了阻碍进展。
在阶段 1 中,还需考虑:
这些不是阻塞性关注点,但在相关时应予以注明。
硬性约束:
[H][RP]有关流水线返工预算冲突,请参见模板目录中的 CONSTRAINT-RESOLUTION.md。
根据此技能完成审查后,请验证:
.reviews/ 文件(不仅仅是消息)如果有任何标准未满足,请在最终确定前重新审视相关阶段。
此技能可独立工作。对于增强的工作流程,它与以下技能集成:
缺少依赖项?使用以下命令安装:
npx skills add jwilger/agent-skills --skill domain-modeling
每周安装次数
92
仓库
GitHub 星标数
2
首次出现
2026年2月12日
安全审计
安装于
codex79
cursor79
opencode77
github-copilot77
amp77
kimi-cli77
Value: Feedback and communication -- structured review catches defects that the author cannot see, and separating review into stages prevents thoroughness in one area from crowding out another.
Teaches a systematic three-stage code review that evaluates spec compliance, code quality, and domain integrity as separate passes. Prevents combined reviews from letting issues slip through by ensuring each dimension gets focused attention.
Review code in three sequential stages. Do not combine them. Each stage has a single focus. A failure in an earlier stage blocks later stages -- there is no point reviewing code quality on code that does not meet the spec.
Stage 1: Spec Compliance. Does the code do what was asked? Not more, not less.
For each acceptance criterion or requirement:
Mark each criterion: PASS, FAIL (missing/incomplete/divergent), or CONCERN (implemented but potentially incorrect). Flag anything built beyond requirements as OVER-BUILT.
If any criterion is FAIL, stop. Return to implementation before continuing.
Architecture Compliance Check (run after the per-criterion loop, before moving to Stage 2):
docs/ARCHITECTURE.md exists: verify this change complies with all documented constraints and patterns (Components, Patterns, Constraints sections). Non-compliance is a FAIL — same severity as a missing acceptance criterion.docs/ARCHITECTURE.md does not exist: flag as a Stage 2 CONCERN: "No architecture document found; architectural compliance cannot be verified."Include in Stage 1 output: Architecture Compliance: PASS / FAIL / N/A (no ARCHITECTURE.md)
For tasks that implement a vertical slice (adding user-observable behavior), perform the following checks in order:
Entry-point wiring check (diff-based): Examine whether the changeset includes modifications to the application's entry point or its wiring/routing layer. If the slice claims to add new user-observable behavior but the diff does not touch any wiring or entry-point code, the review fails unless the author explicitly documents why existing wiring already routes to the new behavior.
End-to-end traceability: Verify that a path can be traced from the application's external entry point, through any infrastructure or integration layer, to the new domain logic, and back to observable output. If any segment of this path is missing from the changeset and not already present in the codebase, flag the gap.
Boundary-level test coverage: Confirm that at least one test exercises the new behavior through the application's external boundary (e.g., an HTTP request, a CLI invocation, a message on a queue) rather than calling internal functions directly. Where the application architecture makes automated boundary tests feasible, their absence is a review concern.
Test-level smell check: If every test in the changeset is a unit test of isolated internal functions with no integration or acceptance-level test, flag this as a concern. The slice may be implementing domain logic without proving it is reachable through the running application.
Stage 2: Code Quality. Is the code clear, maintainable, and well-tested?
Review each changed file for:
domain-modeling skill for primitive obsession detection.Categorize findings by severity:
If any CRITICAL issue exists, stop. Return to implementation.
Stage 3: Domain Integrity. Final gate -- does the code respect domain boundaries?
Check for:
domain-modeling bool-as-state check.)Flag issues but do not block on suggestions, EXCEPT convention violations -- those are blocking per the Convention Over Precedent rule.
Produce a structured summary after all three stages:
REVIEW SUMMARY
Stage 1 (Spec Compliance): PASS/FAIL
Stage 2 (Code Quality): PASS/FAIL/PASS with suggestions
Stage 3 (Domain Integrity): PASS/FAIL/PASS with flags
Overall: APPROVED / CHANGES REQUIRED
If CHANGES REQUIRED:
1. [specific required change]
2. [specific required change]
After completing all three stages, produce a REVIEW_RESULT evidence packet containing: per-stage verdicts {stage, verdict (PASS/FAIL), findings [{severity, description, file, line?, required_change?}]}, overall_verdict, required_changes_count, blocking_findings_count.
When pipeline-state is provided in context metadata, the code-review skill operates in pipeline mode and stores the evidence to .factory/audit-trail/slices/<slice-id>/review.json. When running standalone, the evidence is informational only (not stored).
In factory mode , the full team reviews before the pipeline pushes code -- this is the quality checkpoint that replaces consensus-during-build. All blocking review feedback must be addressed before push. See references/mob-review.md for the factory mode review subsection.
Review findings MUST be written to .reviews/ files as the default persistence mechanism. Messages are supplementary coordination signals only — they do not survive context compaction.
<reviewer-name>-<task-slug>.md (e.g., kent-beck-user-login.md).reviews/ directory (add to .gitignore)This ensures review findings survive context compaction, agent restarts, and harnesses that lack inter-agent messaging.
Non-blocking items (SUGGESTION severity) that appear in 2+ consecutive reviews of different slices MUST escalate to blocking (IMPORTANT severity). Track recurrence by checking previous review files in .reviews/.
This prevents persistent quality issues from being perpetually deferred as "just a suggestion."
When a GWT scenario describes user-visible behavior (UI elements, displayed messages, visual changes), the changeset MUST include code that produces that visible output. An API-only implementation when the scenario describes UI interaction is a spec compliance failure — the slice is incomplete.
Written conventions override observed patterns. When a review finding conflicts with a project convention (CLAUDE.md, AGENTS.md, crate-level docs, architectural decision records) but matches existing code in the codebase, the finding is still valid. Existing code that violates a convention is tech debt, not precedent.
Rules:
Example: a project convention says "use the typestate pattern for state machines." The new code uses struct Foo { is_active: bool } because three existing files do the same. The review must block the new code AND note the three existing files as tech debt.
When your review finding conflicts with the implementation approach:
You exist to catch what the author missed, not to block progress.
During Stage 1, also consider:
These are not blocking concerns but should be noted when relevant.
Hard constraints:
[H][RP]See CONSTRAINT-RESOLUTION.md in the template directory for pipeline rework budget conflicts.
After completing a review guided by this skill, verify:
.reviews/ files (not messages only)If any criterion is not met, revisit the relevant stage before finalizing.
This skill works standalone. For enhanced workflows, it integrates with:
Missing a dependency? Install with:
npx skills add jwilger/agent-skills --skill domain-modeling
Weekly Installs
92
Repository
GitHub Stars
2
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex79
cursor79
opencode77
github-copilot77
amp77
kimi-cli77
AI绩效改进计划PIP技能:提升AI任务执行主动性、交付质量与问题解决能力
993 周安装
Snowflake平台技能:使用CLI、Cortex AI函数和Snowpark构建AI数据云应用
326 周安装
React + Cloudflare Workers 集成 Microsoft Entra ID 身份验证完整指南 | Azure Auth
327 周安装
Cloudflare Images 图像托管与转换 API 使用指南 | 支持 AI 人脸裁剪与内容凭证
328 周安装
Terraform Provider验收测试模式指南:使用plugin-testing与插件框架
72 周安装
Cloudflare MCP Server 教程:在Cloudflare Workers上构建远程模型上下文协议服务器
328 周安装
Google Gemini 文件搜索设置教程 - 完全托管RAG系统,支持100+格式,集成最佳实践
328 周安装