check-impl-against-spec
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCheck implementation against spec
检查实现是否符合规范
Use this skill only when exists during PR review.
spec_context.md仅在PR审查期间存在时使用此技能。
spec_context.mdGoal
目标
Determine whether the implementation in the checked-out PR materially matches the approved spec context. This is a supplement to the normal code review, not a separate output.
确定已检出PR中的实现是否与已批准的规范上下文实质性匹配。这是对常规代码审查的补充,而非独立输出。
Inputs
输入
- contains the spec context to compare against. It may include both product spec content (intended behavior, acceptance criteria) and tech spec content (implementation details, file changes).
spec_context.md - contains the annotated diff for the PR.
pr_diff.txt - may contain additional scope or rationale.
pr_description.md - The working tree contains the PR branch contents.
- 包含用于对比的规范上下文,可能同时包含产品规范内容(预期行为、验收标准)和技术规范内容(实现细节、文件变更)。
spec_context.md - 包含PR的带注释差异内容。
pr_diff.txt - 可能包含额外的范围说明或基本原理。
pr_description.md - 工作目录包含PR分支的内容。
Process
流程
- Read and extract the concrete commitments it makes:
spec_context.md- required behaviors (from the product spec)
- required files or subsystems to change (from the tech spec)
- stated constraints
- required follow-up steps, validation, or migrations
- Compare those commitments against the actual implementation in and the checked-out files.
pr_diff.txt - Treat small implementation-level adjustments as acceptable when they preserve the spec's intent. Do not flag harmless differences in naming, structure, or low-level technique.
- Flag a mismatch only when it is material, such as:
- required behavior in the product spec is missing
- the implementation contradicts a spec decision
- the change introduces significant unplanned scope
- a required validation, migration, or compatibility step from the tech spec is absent
- 读取并提取其中明确的要求:
spec_context.md- 产品规范中的必填行为
- 技术规范中要求变更的文件或子系统
- 规定的约束条件
- 要求的后续步骤、验证或迁移操作
- 将这些要求与和已检出文件中的实际实现进行对比。
pr_diff.txt - 当调整保留了规范意图时,将小范围的实现层面调整视为可接受。不要标记命名、结构或底层技术方面的无害差异。
- 仅当差异具有实质性时才标记不匹配,例如:
- 产品规范中的必填行为缺失
- 实现与规范决策相矛盾
- 变更引入了重大的计划外范围
- 技术规范中要求的验证、迁移或兼容性步骤缺失
Outputs
输出
- Do not create a separate report file.
- Fold spec-alignment findings into .
review.json - Put broad spec-drift concerns in the review summary.
- Add inline comments only when the mismatch can be tied to changed lines in the diff.
- Treat material spec drift as at least an important concern.
- If the implementation matches the spec closely enough, do not add comments just to mention alignment.
- 不要创建单独的报告文件。
- 将规范一致性检查结果整合到中。
review.json - 将广泛的规范偏离问题放在审查摘要中。
- 仅当不匹配可关联到差异中的变更行时,添加行内注释。
- 将实质性的规范偏离视为至少是重要问题。
- 如果实现与规范足够接近,不要仅为提及一致性而添加注释。
Boundaries
边界
- Do not require literal one-to-one implementation of the spec when the PR achieves the same outcome safely.
- Do not speculate about spec details that are not actually present in .
spec_context.md - Do not post to GitHub directly.
- 当PR安全地达成相同结果时,不要求严格按照规范逐字实现。
- 不要对中未实际提及的规范细节进行推测。
spec_context.md - 不要直接发布到GitHub。