openspec-verify-change
它能做什么
这项技能在 OpenSpec 变更归档之前,检查代码是否真正符合其规划文档。适合希望确认功能完整且正确的开发者。
适用场景
- ✓当你想在归档变更之前确认实现已完整时。
- ✓当你想对照 OpenSpec 变更中的规格和任务检查代码的时候。
- ✓当你怀疑代码与规划文档已经不一致的时候。
技能链接
https://github.com/fengshao1227/ccg-workflow/blob/main/.agents/skills/openspec-verify-change/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在归档之前,请验证我 OpenSpec 中的支付功能是否与其规格和任务一致。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会加载变更的文档,检查完整性、正确性和一致性,并将任务和规格与已实现的代码进行比对。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Verify that an implementation matches the change artifacts (specs, tasks, design).
Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
If no change name provided, prompt for selection
Run
openspec list --jsonto get available changes. Use the AskUserQuestion tool to let the user select.Show changes that have implementation tasks (tasks artifact exists). Include the schema used for each change if available. Mark changes with incomplete tasks as "(In Progress)".
IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.
Check status to understand the schema
openspec status --change "<name>" --jsonParse the JSON to understand:
schemaName: The workflow being used (e.g., "spec-driven")- Which artifacts exist for this change
Get the change directory and load artifacts
openspec instructions apply --change "<name>" --jsonThis returns the change directory and context files. Read all available artifacts from
contextFiles.Initialize verification report structure
Create a report structure with three dimensions:
- Completeness: Track tasks and spec coverage
- Correctness: Track requirement implementation and scenario coverage
- Coherence: Track design adherence and pattern consistency
Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
Verify Completeness
Task Completion:
- If tasks.md exists in contextFiles, read it
- Parse checkboxes:
- [ ](incomplete) vs- [x](complete) - Count complete vs total tasks
- If incomplete tasks exist:
- Add CRITICAL issue for each incomplete task
- Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
Spec Coverage:
- If delta specs exist in
openspec/changes/<name>/specs/:- Extract all requirements (marked with "### Requirement:")
- For each requirement:
- Search codebase for keywords related to the requirement
- Assess if implementation likely exists
- If requirements appear unimplemented:
- Add CRITICAL issue: "Requirement not found: <requirement name>"
- Recommendation: "Implement requirement X: <description>"
Verify Correctness
Requirement Implementation Mapping:
- For each requirement from delta specs:
- Search codebase for implementation evidence
- If found, note file paths and line ranges
- Assess if implementation matches requirement intent
- If divergence detected:
- Add WARNING: "Implementation may diverge from spec: <details>"
- Recommendation: "Review <file>:<lines> against requirement X"
Scenario Coverage:
- For each scenario in delta specs (marked with "#### Scenario:"):
- Check if conditions are handled in code
- Check if tests exist covering the scenario
- If scenario appears uncovered:
- Add WARNING: "Scenario not covered: <scenario name>"
- Recommendation: "Add test or implementation for scenario: <description>"
- For each requirement from delta specs:
Verify Coherence
Design Adherence:
- If design.md exists in contextFiles:
- Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
- Verify implementation follows those decisions
- If contradiction detected:
- Add WARNING: "Design decision not followed: <decision>"
- Recommendation: "Update implementation or revise design.md to match reality"
- If no design.md: Skip design adherence check, note "No design.md to verify against"
Code Pattern Consistency:
- Review new code for consistency with project patterns
- Check file naming, directory structure, coding style
- If significant deviations found:
- Add SUGGESTION: "Code pattern deviation: <details>"
- Recommendation: "Consider following project pattern: <example>"
- If design.md exists in contextFiles:
Generate Verification Report
Summary Scorecard:
## Verification Report: <change-name> ### Summary | Dimension | Status | |--------------|------------------| | Completeness | X/Y tasks, N reqs| | Correctness | M/N reqs covered | | Coherence | Followed/Issues |Issues by Priority:
- CRITICAL (Must fix before archive):
- Incompl
- CRITICAL (Must fix before archive):
常见问题
它检查哪些内容?
它检查任务和规格是否完整、实现是否正确,以及设计是否前后一致。
它会替我选择变更吗?
不会。它会请你选择要验证的变更。
什么时候应该运行它?
在实现完成之后、归档之前运行。
详情
作者的原始描述
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
热度
- GitHub 星标
- 6.0k
- 排名
- #14521
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
openspec-bulk-archive-change
6.0k帮你的智能体一次归档多个已完成的 OpenSpec 变更,并在归档前检查每项变更的任务和规格。
openspec-continue-change
6.0k帮你的智能体继续推进 OpenSpec 变更,创建下一个产物,例如提案、规格、设计或任务清单。
openspec-ff-change
6.0k帮你的智能体一次性创建 OpenSpec 变更的全部产物,让你无需逐步操作即可开始实现。
openspec-new-change
6.0k帮你的智能体为功能或修复开启新的 OpenSpec 变更,创建其文件夹,并提示接下来应编写哪些产物。