跳到正文
Skillpedia
通用编程81k · #1554

adr-review

它能做什么

这项技能引导智能体把代码改动与已接受的架构决策记录进行比较,并指出违规或偏离之处。适合希望代码遵守既定决策的团队。

适用场景

  • ✓当你即将合并拉取请求,并希望对照决策进行检查的时候。
  • ✓当某项改动涉及一个已有已接受决策的领域的时候。
  • ✓当你想定期检查代码是否仍遵循架构的时候。

技能链接

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-adr/skills/adr-review/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请对照我们已接受的架构决策检查我的分支,并告诉我是否有改动违反了其中之一。”

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

工作原理

智能体会读取差异,找出与被改动文件相关的决策记录,并检查这些改动是否与某项已接受的决策相矛盾。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

ADR Review

Review code changes against accepted Architecture Decision Records to detect violations, drift, and non-compliance.

When to use

Before merging a PR, after significant code changes, or as part of a periodic compliance check. Use this to ensure code changes respect the architectural decisions the team has agreed upon.

Steps

  1. Get diff -- Run git diff main...HEAD --name-only (or the specified branch) to list changed files. Then run git diff main...HEAD to get the full diff content.

  2. Find relevant ADRs -- For each changed file:

    • Grep the file for ADR references (ADR-\d+)
    • Grep docs/adr/ for ADRs that mention the changed file paths or modules
    • Call mcp__plugin_ruflo-core_ruflo__memory_search with the file path and change summary to find semantically related ADRs
  3. Load ADR content -- Read each relevant ADR file. Focus on:

    • The Decision section (what was decided)
    • The Status (only enforce "accepted" ADRs)
    • The Consequences (expected constraints)
  4. Check for violations -- Analyze each changed file against its relevant ADRs:

    • Does the code change contradict an accepted decision?
    • Does it use a technology/pattern that an ADR explicitly rejected?
    • Does it modify a module in a way the ADR's consequences warned against?
    • Is the code referencing a deprecated or superseded ADR?
  5. Query relationship graph -- Call mcp__plugin_ruflo-core_ruflo__memory_list with namespace adr-edges (rows are keyed <relation>:<from>__<to> with relation supersedes, amends or depends-on) to check if any referenced ADR has been superseded. If the namespace is empty, run adr-index first. If a referenced ADR is superseded, flag that the code references an outdated decision.

  6. Report -- Present findings as a compliance report:

    ## ADR Compliance Report
    
    ### Violations
    - [ ] <file>:<line> — violates ADR-NNN: <reason>
    
    ### Warnings
    - [!] <file> references superseded ADR-NNN (replaced by ADR-MMM)
    
    ### Compliant
    - [x] <file> — consistent with ADR-NNN
    
    ### Unlinked Changes
    - [?] <file> — no ADR coverage (consider creating one)
    
  7. Suggest actions -- For each violation, suggest whether to update the code or propose a new ADR to supersede the violated one.

常见问题

它只检查已接受的决策吗?

是的。这项技能说明它只强制执行状态为已接受的决策。

它与哪个分支进行比较?

默认与 main 比较,不过你可以指定其他分支。

它会修改代码吗?

这项技能用于审查,它会报告问题,改动则由你决定。

详情

作者的原始描述

Review code changes against accepted ADRs for compliance violations

repo: ruvnet/ruflo

热度

GitHub 星标
81k
排名
#1554
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能