返回 Skills 目录
warpdotdev/common-skills已通过检查

SKILL DETAIL

check-impl-against-spec

warpdotdev/common-skills/check-impl-against-spec

此技能用于在代码审查期间,当存在 spec_context.md 时,检查拉取请求的实现是否与批准的规范上下文实质性匹配。它作为正常代码审查的补充,不产生单独的报告文件。 流程包括:从 spec_context.md 提取具体承诺(如必需行为、文件变更、约束和后续步骤),然后与 pr_diff.txt 和检出文件中的实际实现进行比较。仅当差异具有实质性(如缺少必需行为、与规范决策矛盾、引入重大未计划范围或缺少必需的验证/迁移步骤)时才标记。结果应合并到 review.json 中,广泛的范围漂移问题放在审查摘要中,内联评论仅针对可关联到变更行的差异。

安装量 · 343查看来源

Installation

npx skills add https://github.com/warpdotdev/common-skills --skill check-impl-against-spec

技能文件

SKILL.md

最近同步 · 2026年9月30日

SKILL.md›
---
name: check-impl-against-spec
description: Compare a pull request's implementation against spec context in spec_context.md and feed any material mismatches into review.json. Use during PR review when approved or repository spec context is available.
---

# Check implementation against spec

Use this skill only when `spec_context.md` exists during PR review.

## Goal

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.

## Inputs

- `spec_context.md` 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).
- `pr_diff.txt` contains the annotated diff for the PR.
- `pr_description.md` may contain additional scope or rationale.
- The working tree contains the PR branch contents.

## Process

1. Read `spec_context.md` and extract the concrete commitments it makes:
   - 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
2. Compare those commitments against the actual implementation in `pr_diff.txt` and the checked-out files.
3. 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.
4. 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

## 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.

## 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.