跳到正文
Skillpedia
技术文档81k · #1552

adr-index

它能做什么

这项技能运行一个导入脚本,读取项目中的每一份架构决策记录,并保存记录及其链接。适合拥有大量决策记录、并希望它们可搜索、相互关联的团队。

适用场景

  • ✓当你从另一个项目导入了决策记录的时候。
  • ✓当已保存的索引与磁盘上的决策文件不一致的时候。
  • ✓当你要在现有代码库上设置决策跟踪的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请重建我们的架构决策记录索引,并显示已接受、提议中和已被取代的数量。”

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

工作原理

智能体会运行导入脚本,它会读取两种常见的 ADR 格式,保存每条记录及其关系,并报告摘要。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

ADR Index

Persists every ADR under */docs/adr/ or */docs/adrs/ to the adr-patterns namespace and every relationship (supersedes / amends / related / depends-on) to adr-edges. Handles both ADR formats found in the Ruflo monorepo:

  • v3-style: # ADR-097: Title heading + **Status**: Proposed line
  • plugin-style: YAML frontmatter (id: ADR-NNNN, status: Proposed)

Implementation is in scripts/import.mjs (one Bash call) rather than dozens of per-ADR MCP tool calls — same effective behavior, materially faster, dual-format-aware, and false-positive-resistant for issue numbers.

When to use

  • After importing ADRs from another project
  • When the AgentDB graph is out of sync with the on-disk ADR files
  • Bootstrapping ADR tracking on an existing codebase

Steps

  1. Run the importer:

    node plugins/ruflo-adr/scripts/import.mjs
    

    Optional env:

    • IMPORT_FORMAT=json — emit JSON instead of markdown
    • IMPORT_DRY_RUN=1 — parse + summarize, skip persistence
    • ADR_ROOT=/path — scan a different root (default: cwd)
  2. Inspect the summary — total ADRs, stored count, by-status breakdown, edge counts, dangling refs, status mismatches.

  3. Verify graph integrity (optional but recommended) via the sibling adr-verify skill, which runs scripts/verify.mjs and exits 1 on cycles.

  4. Search semantically via mcp__plugin_ruflo-core_ruflo__memory_search against the populated namespace:

    memory_search --query "federation budget" --namespace adr-patterns
    

Storage shape

adr-patterns namespace, key <ADR-id>::<basename>, value (text):

<title> — <first paragraph of Context>

file: <relative path>
status: <Proposed|Accepted|Superseded|...>
date: <ISO date>
tags: <comma-separated>

adr-edges namespace, deterministic key <relation>:<FROM>__<TO>, value:

{ "from": "ADR-097", "to": "ADR-086", "relation": "related", "capturedAt": "<ISO>" }

Both ADR records and relationship edges are stored with explicit upsert semantics. Re-running adr-index refreshes changed metadata in place and does not create duplicate copies of an unchanged semantic edge.

False-positive guard

#1697 / commit abc123 / PR 1234 references inside ADR bodies are stripped before regex extraction so they don't get misread as ADR-1697 etc. See extractAdrRefs() in scripts/import.mjs.

What this skill cannot do

adr-index only ever adds/upserts. If an ADR file was deleted (or a relation line removed from a surviving file), the row it wrote stays forever — adr-verify won't catch it either, since an orphan has no dangling ref and forms no cycle. Use the sibling adr-reindex skill to reconcile a deletion (issue #2666).

Cross-references

  • adr-create — produces the ADR files this skill consumes
  • adr-review — runs over adr-patterns for compliance checks
  • adr-verify (sibling skill) — runs scripts/verify.mjs for graph-integrity gating
  • adr-reindex (sibling skill) — drop-and-rebuild reconcile for a deleted ADR file (this skill can only add, never remove)
常见问题

它能读取哪些文件格式?

这项技能处理两种格式:一种带有 ADR 标题和状态行,另一种带有 front matter。

我能先测试吗?

可以。这项技能有一个试运行选项,只解析文件而不保存任何内容。

如何检查关系图是否健康?

这项技能提到了一个配套的验证技能,可以检查关系图并报告循环。

详情

作者的原始描述

Build or rebuild the ADR index + dependency graph by running scripts/import.mjs (handles v3-style and plugin-style ADR formats; one Bash call vs hundreds of MCP round-trips)

repo: ruvnet/ruflo

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能