技能 编程开发 设计文档代码一致性检测

设计文档代码一致性检测

v20261030
egm-drift-report
该技能用于检测设计文档与代码之间的一致性。它分析设计文档和 README,识别缺失功能、模型不完整或架构差异。最终生成差异报告,帮助用户了解代码实现是否符合设计规范,适用于项目维护和质量检查场景。
获取技能
322 次下载
概览

Detect Drift In Designs and Code

When running in Codex or ChatGPT Work, first read Codex integration.
In Claude Code or Cowork, read ${CLAUDE_PLUGIN_ROOT}/docs/claude.md first.

When the user asks to detect drift across all designs or a set of READMEs, the
goal is to identify all instances where the codebase has diverged or failed to
implement the specifications described by those designs or READMEs.

  1. Check Input: Verify a directory containing design documents or READMEs

is provided. If not provided, ask the user to specify the target directory.

  1. List Documents: List all files in the design directory.
  2. Analyze: For EACH design document:
  • Contextualize: Read the design document. Identify the intent,

proposed changes, and specific filenames/symbols mentioned.

  • Locate Source: Find the corresponding source code files in the

source tree. If paths aren't explicit, use code search or grep to
locate the relevant classes, functions, or API endpoints mentioned in
the doc. Prompt the user to add missing links to the document to make
future detection cheaper.

  • Verify: Read the current state of those source files.
  • Detect Drift: Compare the design vs. reality. Look specifically for:
  • Missing Features: Logic described in the doc but absent in the code.
  • Incomplete Models: Dataclasses/Classes/Structs/Protos missing fields

specified in the design.

  • Logic Shortcuts: Hardcoded values where dynamic logic was planned.
  • Architectural Divergence: Implementation using different

patterns/libraries than proposed.

  • Filter: Report ONLY the differences. Do not describe what is working

or what matches. If the code matches the design perfectly, output "No
drift detected."

  1. Report: Produce a single report listing all discrepancies found.
  • Append the analysis for each file to {YYYY-MM-DD}_DRIFT_REPORT.md

using your file-writing tool.

  • Strict Format:

```markdown

DOCNAME>



```

  1. Guidance
  • Be rigorous. If a design doc mentions a specific object, field or file

name and the code doesn't have it, that is a reportable drift. Double
check for coverage. If there is some part of the logic that is not
referenced in a design or README, this is a reportable drift.

  • Read files liberally to ensure you are looking at the current state

of the code, not relying on memory.

  • Process the files sequentially to ensure the tool output buffer doesn't

overflow.

信息
分类 编程开发
名称 egm-drift-report
版本 v20261030
大小 2.2KB
更新时间 2026-11-02
语言