ruvnet/ruflo/tree/main/plugins/ruflo-adr
ruflo-adr
ADR 生命週期管理——建立、索引、協調、取代、檢查合規性,並透過 AgentDB 階層儲存與因果邊(supersedes/amends/depends-on/related)將架構決策記錄連結到程式碼
關於這個 mod
ruflo-adr
概覽
管理架構決策記錄的完整生命週期(proposed、accepted、deprecated、superseded)。ADR 以 markdown 檔案儲存在 docs/adr/,並索引至 AgentDB;因果邊會追蹤 supersedes/amends/depends-on 關係。外掛也會掃描 git diff 來檢查合規性,並透過 adr-reindex 協調從磁碟刪除的 ADR(#2666)。
安裝
claude --plugin-dir plugins/ruflo-adr
Agents
| Agent | 模型 | 角色 |
|-------|------|------|
| adr-architect | sonnet | ADR 生命週期管理、透過 grep/blame 連結程式碼與 ADR、AgentDB 圖形儲存 |
Skills
| Skill | 用法 | 說明 |
|-------|------|------|
| adr-create | /adr-create <title> | 建立具有連續編號並註冊至 AgentDB 的新 ADR |
| adr-index | /adr-index | 在 AgentDB 中建立或重建 ADR 索引與相依圖(只新增或更新——絕不移除) |
| adr-review | /adr-review [--branch BRANCH] | 對照已接受的 ADR 審查程式碼變更,檢查合規性違規 |
| adr-verify | /adr-verify | 讀回 adr-patterns + adr-edges 命名空間,顯示懸空參照、取代循環與狀態不一致;遇到循環時結束碼為 1 |
| adr-reindex | /adr-reindex | 協調一個已刪除的 ADR 檔案:依目前磁碟內容刪除並重建 adr-patterns + adr-edges |
指令(7 個子指令)
# 生命週期
adr create <title>
adr list
adr status <adr-id> <new-status>
adr supersede <old-id> <new-id>
# 合規性
adr check # 掃描最近的 git 變更,檢查 ADR 違規
adr graph # 顯示 ADR 相依圖
adr search <query> # 在 ADR 中進行語意搜尋
ADR 生命週期
proposed --> accepted --> deprecated
\--> superseded by ADR-XXX
以因果邊追蹤的關係:supersedes、amends、depends-on、related。
正文中的關係欄位可以接受 **Amends by scope**: 或 **Depends-on / confirms**: 等限定詞,Relates 是 Related 的別名。換行的清單可以繼續寫在只包含 ADR 參照(包括 Markdown 連結)和分隔符號的行上。不會掃描敘述性的續行;如需宣告其他關係,請使用另一個粗體欄位。
相容性
- CLI: 固定使用
@claude-flow/cliv3.6 的 major+minor 版本。 - 驗證:
bash plugins/ruflo-adr/scripts/smoke.sh是契約。
命名空間協調
此外掛擁有 adr-patterns AgentDB 命名空間。命名規則遵循 ruflo-agentdb ADR-0001 "命名空間慣例"。保留命名空間(pattern、claude-memories、default)絕不能被覆寫。
adr-patterns 依照慣例使用 kebab-case 的 <plugin-stem>-<intent> 形式。外掛透過 hooks_transfer(位於 ruflo-intelligence)使用它進行 ADR 語意搜尋和跨專案模式傳輸。
驗證
bash plugins/ruflo-adr/scripts/smoke.sh
# 預期:「22 passed, 0 failed」
架構決策
相關外掛
ruflo-agentdb—— 命名空間慣例的擁有者;ADR 圖譜的後端儲存ruflo-ddd—— 將領域決策記錄為 ADRruflo-sparc—— 架構階段(Phase 3)產出 ADRruflo-migrations—— 將架構變更決策記錄為 ADRruflo-jujutsu—— PR 上的 ADR 感知差異分析ruflo-intelligence——hooks_transfer將 ADR 模式傳輸到各個專案
授權條款
MIT
作為 mod
ADR 也提供函式掛鉤 mod(ADR-445 模式;掛鉤位於 hooks/,隨外掛載入)。不使用網路、不產生程序,也不呼叫模型。
- Guard(預設開啟): 拒絕在
adr*命名空間中寫入(agentdb_hierarchical-store、agentdb_causal-edge或memory_store)且包含金鑰、權杖或密碼的 ADR。它只會收緊規則:絕不允許工作階段原本會拒絕的內容通過,拒絕時也絕不重複機密資訊。使用guard選項關閉。 /adr-mod: 在本機回應。/adr-mod status、/adr-mod scan <text>、/adr-mod format。- 狀態檔:
.claude-flow/adr-mod/status.json(version、updatedMs、計數器),在工作階段開始時及每次拒絕呼叫時寫入;主控台會讀取它。 - 選項(
userConfig):guard(預設開啟)。
測試:claude plugin validate plugins/ruflo-adr、claude plugin test plugins/ruflo-adr,以及 bash plugins/ruflo-adr/scripts/smoke.sh。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add ruvnet/ruflo claude plugin install ruflo-adr
原文 / README
ruflo-adr
ADR lifecycle management -- create, index, reconcile, supersede, and link Architecture Decision Records to code.
Overview
Manages Architecture Decision Records through their full lifecycle (proposed, accepted, deprecated, superseded). ADRs are stored as markdown files in docs/adr/ and indexed in AgentDB with causal edges tracking supersedes/amends/depends-on relationships. Includes compliance checking that scans git diffs for ADR violations, and reconciliation (adr-reindex) for ADRs deleted from disk (#2666).
Installation
claude --plugin-dir plugins/ruflo-adr
Agents
| Agent | Model | Role |
|-------|-------|------|
| adr-architect | sonnet | ADR lifecycle management, code-ADR linking via grep/blame, AgentDB graph storage |
Skills
| Skill | Usage | Description |
|-------|-------|-------------|
| adr-create | /adr-create <title> | Create a new ADR with sequential numbering and AgentDB registration |
| adr-index | /adr-index | Build or rebuild the ADR index and dependency graph in AgentDB (add/update only — never removes) |
| adr-review | /adr-review [--branch BRANCH] | Review code changes against accepted ADRs for compliance violations |
| adr-verify | /adr-verify | Read back adr-patterns + adr-edges namespaces, surface dangling refs / supersede cycles / status mismatches; exits 1 on cycles |
| adr-reindex | /adr-reindex | Reconcile a deleted ADR file: drop-and-rebuild adr-patterns + adr-edges from what's on disk right now |
Commands (7 subcommands)
# Lifecycle
adr create <title>
adr list
adr status <adr-id> <new-status>
adr supersede <old-id> <new-id>
# Compliance
adr check # Scan recent git changes for ADR violations
adr graph # Show ADR dependency graph
adr search <query> # Semantic search across ADRs
ADR Lifecycle
proposed --> accepted --> deprecated
\--> superseded by ADR-XXX
Relationships tracked as causal edges: supersedes, amends, depends-on, related.
Body relationship fields accept qualifiers such as **Amends by scope**: or
**Depends-on / confirms**:, and Relates is an alias for Related. Wrapped
lists may continue on lines containing only ADR references (including Markdown
links) and separators. Narrative continuation is not scanned for relationships;
declare additional relationships in another bold field.
Compatibility
- CLI: pinned to
@claude-flow/cliv3.6 major+minor. - Verification:
bash plugins/ruflo-adr/scripts/smoke.shis the contract.
Namespace coordination
This plugin owns the adr-patterns AgentDB namespace. It defers to ruflo-agentdb ADR-0001 §"Namespace convention" for naming rules. Reserved namespaces (pattern, claude-memories, default) MUST NOT be shadowed.
adr-patterns follows kebab-case <plugin-stem>-<intent> per the convention. The plugin uses it for semantic ADR search and for cross-project pattern transfer (via hooks_transfer in ruflo-intelligence).
Verification
bash plugins/ruflo-adr/scripts/smoke.sh
# Expected: "22 passed, 0 failed"
Architecture Decisions
ADR-0001— ruflo-adr plugin contract (pinning, namespace coordination, smoke as contract)ADR-0002— Reconcile deleted ADRs (hard-delete primitive + drop-and-rebuild reindex)
Related Plugins
ruflo-agentdb— namespace convention owner; backing store for the ADR graphruflo-ddd— document domain decisions as ADRsruflo-sparc— Architecture phase (Phase 3) produces ADRsruflo-migrations— schema change decisions recorded as ADRsruflo-jujutsu— ADR-aware diff analysis on PRsruflo-intelligence—hooks_transferships ADR patterns across projects
License
MIT
As a mod
ADR also ships as a function-hook mod (ADR-445 pattern; hooks in hooks/, loaded with the plugin). No network, no process, no model call.
- Guard (default on): refuses an ADR write (
agentdb_hierarchical-store,agentdb_causal-edgeormemory_storeinto anadr*namespace) that holds a key, token or password. It only tightens: it never allows anything the session would deny, and the refusal never repeats the secret. Turn it off with theguardoption. /adr-mod: answered locally./adr-mod status,/adr-mod scan <text>,/adr-mod format.- Status file:
.claude-flow/adr-mod/status.json(version,updatedMs, counters), written at session start and whenever a call is refused; the console reads it. - Options (
userConfig):guard(onby default).
Test: claude plugin validate plugins/ruflo-adr, claude plugin test plugins/ruflo-adr, and bash plugins/ruflo-adr/scripts/smoke.sh.
