跳到正文
Skillpedia
技术文档10k · #11880

egm-drift-report

它能做什么

这个技能把设计文档与实际代码进行比较,并列出差异。适合文档可能已落后于软件的团队。

适用场景

  • ✓当你怀疑代码已经与其设计文档不一致时。
  • ✓当你想对某个文件夹中所有设计文档或 README 进行一致性检查的时候。
  • ✓当你需要列出文档中描述但代码中缺失的功能的时候。

技能链接

https://github.com/google/elephant-goldfish-model/blob/main/distributions/claude/skills/egm-drift-report/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/google/elephant-goldfish-model/blob/main/distributions/claude/skills/egm-drift-report/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把文档文件夹中的所有设计文档与代码进行对照,告诉我哪些地方已经不一致。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会列出每份设计文档,找到对应的源文件,阅读当前代码并比较两者。它会在报告中记录缺失的功能、变化的行为以及其他差异。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.

  2. List Documents: List all files in the design directory.

  3. 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."
  4. 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:

      ## <DESIGN_DOC_NAME>
      
      <Bulleted list of specific divergences found>
      <Or "No drift detected">
      
  5. 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.
常见问题

什么算是“偏离”?

偏离指文档描述的内容与代码实际执行的内容之间的任何差距。

如果文档没有写明对应的代码怎么办?

AI 会搜索文档提到的类或函数,并可能请你添加链接。

这个技能会修复这些差异吗?

它的任务是生成差异报告。

详情

作者的原始描述

Runs drift detection on all design documents to check for document and code consistency. Produces an actionable report with differences. Use when the user asks to detect drift or check for consistency across all design documents or READMEs in a directory.

repo: google/elephant-goldfish-model

热度

GitHub 星标
10k
排名
#11880
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能