一键导入
adr-index
Build or rebuild the ADR index and dependency graph in AgentDB (strict mode — Phase 3 corpus, ADR- prefix filenames, no legacy fallbacks)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build or rebuild the ADR index and dependency graph in AgentDB (strict mode — Phase 3 corpus, ADR- prefix filenames, no legacy fallbacks)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | adr-index |
| description | Build or rebuild the ADR index and dependency graph in AgentDB (strict mode — Phase 3 corpus, ADR- prefix filenames, no legacy fallbacks) |
| argument-hint | |
| allowed-tools | mcp__ruflo__agentdb_hierarchical-store mcp__ruflo__agentdb_hierarchical-query mcp__ruflo__agentdb_causal-edge mcp__ruflo__agentdb_causal-query mcp__ruflo__memory_store mcp__ruflo__memory_search Bash Read Grep Glob |
Build or rebuild the full ADR index and dependency graph in AgentDB from the docs/adr/ directory. Strict mode — assumes the corpus has been migrated to canonical post-ADR-0211 shape (Phase 3 complete) AND filenames use the project-canonical ADR-NNNN-<slug>.md form. Fails loud on legacy / non-canonical content.
Files in docs/adr/ follow the self-identifying form:
ADR-NNNN-<slug>.md → ID = ADR-NNNN
ADR-NNNN<letter>-<slug>.md → ID = ADR-NNNN<letter> (sub-letter form, rare on ADR side)
ADR-NNNN.<descriptor>.md → ID = ADR-NNNN-<slug-of-descriptor> (legacy companion form, kept for migration tail)
This deviates slightly from canonical MADR (which uses bare NNNN-slug.md); the deviation is deliberate so every reference in the codebase is unambiguously typed (ADR-NNNN vs ODR-NNNN — both corpora share the same numeric range).
After importing ADRs from another project, when the AgentDB graph is out of sync, or when bootstrapping ADR tracking on an existing codebase. The strict mode is appropriate for projects whose ADR corpus is fully migrated to the post-Council-415 + ADR-prefix-rename shape.
ADRs follow canonical MADR 4.x with two project extensions:
tags: frontmatter field for cross-cutting categorisationsupersedes:, depends-on:, implements:The strict-mode indexer does not tolerate any of the following — each is a hard failure:
decision-makers:, deciders:, consulted:, informed:) — dropped by Council 415chosen-option: field — dropped by Council 411superseded-by:, depended-on-by:, implemented-by:) — derived onlysupersedes: or implements: targeting a different corpus)Supersedes: / Depends on: / Related: / Amends patterns — typed-relation graph is canonical-frontmatter-onlyNNNN-slug.md without ADR- prefix) — all ADR files MUST use the project-canonical ADR- prefixRequired file shape (post-Council-415, post-ADR-prefix-rename):
---
status: proposed | accepted | rejected | deprecated | superseded
date: YYYY-MM-DD
tags: [tag1, tag2]
supersedes: [ADR-NNNN, ...]
depends-on: [ADR-NNNN, ODR-NNNN, ...]
implements: [ADR-NNNN]
---
# <Title>
## Context and Problem Statement
...
## Considered Options
...
## Decision Outcome
Chosen option: "X", because Y.
### Consequences
* Good, because ...
* Bad, because ...
* Neutral, because ...
### Confirmation
...
## More Information
- Human-readable references and supporting evidence.
For each .md file in docs/adr/ (namespace adr):
README.md, INDEX.md, _template.md (filename-only filter). Skip subdirectories (diagrams/, panels/, templates/, 0152-examples/, 0167/, 0168/, 0185/, 0188/, 0189/, hive-laika-platform-*, laika-runtime-tooling-review-*).---\n. Files without frontmatter are reported and the indexer exits non-zero. There is no bullet-list-metadata fallback.status, date, tags, supersedes, depends-on, implements are valid. Any other key (including DACI, chosen-option, superseded-by, depended-on-by, implemented-by, format, ratified, related-prov-activity) → fail loud with the offending key name and source file.status enum. MUST be one of proposed | accepted | rejected | deprecated | superseded. Lowercase exactly. Mixed case or other values → fail.date. MUST be ISO YYYY-MM-DD. Other formats → fail.supersedes / depends-on / implements MUST be lists (or absent). Scalar values → fail. Each item MUST match ^(ADR|ODR)-\d{4}[a-m]?$. Other forms → fail.ADR-NNNN-<slug>.md → ID = ADR-NNNNADR-NNNN<letter>-<slug>.md → ID = ADR-NNNN<letter>ADR-NNNN.<descriptor>.md → ID = ADR-NNNN-<slug-of-descriptor>NNNN-<slug>.md without ADR- → fail loud with "filename missing ADR- prefix" — corpus migration incomplete..md), slug-normalised. Warn loudly; this should never trigger on a clean corpus.For each typed-relation list, emit one edge per entry: (source-id, predicate, target-id).
Cross-corpus rule (HARD). supersedes and implements targets MUST share the source's namespace prefix (ADR↔ADR or ODR↔ODR). Cross-corpus violations → fail loud with source ID, slot, and offending target. depends-on may cross corpora.
Self-reference (HARD). An ID MUST NOT appear in its own typed slots. Self-references → fail loud.
Referential integrity (HARD). Every typed-relation target MUST resolve to an existing record file:
ADR-NNNN → docs/adr/ADR-NNNN-*.md (note: ADR- prefix, post-rename canonical)ADR-NNNN<letter> → docs/adr/ADR-NNNN<letter>-*.mdODR-NNNN → docs/ontology/odr/ODR-NNNN*-*.mdMissing targets → fail loud.
Body-prose extraction is REMOVED. No Supersedes: / Depends on: / Related: / Amends / Builds on Pass 1 fallback. No bare-ADR-NNNN Pass 2 fallback. No status-string supersession regex. The typed-relation graph is the frontmatter-typed graph, period.
For each forward edge (A, p, B), emit the inverse (B, p⁻¹, A):
| Forward | Inverse |
|---|---|
supersedes | superseded-by |
depends-on | depended-on-by |
implements | implemented-by |
Inverses live alongside forward edges, scoped by namespace; never authored. The indexer is the only writer of inverse edges. Authored inverses are caught by step 2.3a-4 (whitelist).
Deduplicate edges — if the same (from, to, relation) triple is produced more than once, emit it only once.
Alongside typed edges, emit a per-record metadata entry with the file's status, date, tags, file path, and last-modified timestamp. Idempotent on subsequent runs (upsert; no duplicates).
related-legacy advisory edges. Council 411 dropped related; the strict-mode indexer does not emit advisory body-prose edges. If a project genuinely needs body-prose discovery, run grep directly.Scan directory — Glob for docs/adr/ADR-*.md. Skip README.md, INDEX.md, _template.md, and all subdirectories listed in 2.3a step 1.
Parse each ADR (strict — see 2.3a above). For each file:
# Title). MUST NOT have an ADR-NNNN: self-prefix; canonical MADR 4.x form has the number in the filename only. ADR with self-prefix → warning (not error; pre-existing form may persist on legacy migrated records); strip the prefix to get the title.## Decision Outcome first paragraph, ~500 char cap).## Considered Options).### Consequences flat bullets under ## Decision Outcome, classified by Good, because… / Bad, because… / Neutral, because… leading prefix).### Confirmation H3 under ## Decision Outcome, ~500 char cap, optional).2.5. Uniqueness check — After extracting IDs for ALL files, verify no two files mapped to the same ID. Collisions abort the index build with the colliding file paths.
Store record metadata (contract 2.3d) — For each ADR, call mcp__ruflo__agentdb_hierarchical-store with:
adr/<adr-id>{
"id": "<id>",
"title": "<title>",
"status": "<status>",
"date": "<date>",
"tags": [...],
"supersedes": [...],
"depends-on": [...],
"implements": [...],
"decision_summary": "<first paragraph of Decision Outcome, ~500 chars>",
"considered_options": ["<option A>", "<option B>", ...],
"consequences": { "good": [...], "bad": [...], "neutral": [...], "other": [...] },
"confirmation": "<Confirmation section text, ~500 chars>",
"file": "<filepath>",
"mtime": "<ISO timestamp>"
}
Build forward edges (contract 2.3b — strict) — For each typed-relation slot in frontmatter, emit (current, predicate, target). Apply hard rules: cross-corpus check, self-reference check, referential-integrity check. Any violation aborts the build.
Build derived inverse edges (contract 2.3c) — For each forward edge, emit the inverse. Deduplicate.
Store in memory — For each ADR, mcp__ruflo__memory_store in namespace adr-patterns, key <adr-id>, value <title> — <body excerpt>.
Body excerpt rule (canonical): first paragraph of ## Context and Problem Statement (~500 chars). Skip frontmatter, H1, blank lines, tables, lists. If the section is missing or empty → fail loud (Phase 3.3 ensures all ADRs have this section; missing = drift).
Verify graph — Call mcp__ruflo__agentdb_causal-query:
supersedes edge from their successor (i.e. successor's supersedes: slot lists them) AND status superseded. Mismatches → fail.Report — Output:
## ADR Index Summary
Namespace: adr/
Total ADRs: N
By status:
- proposed: X
- accepted: Y
- deprecated: Z
- superseded: W
- rejected: R
Tag distribution (top 10):
- <tag>: <count>
...
Typed relations:
- supersedes / superseded-by: A
- depends-on / depended-on-by: B
- implements / implemented-by: C
Cross-corpus depends-on (allowed): E
Issues found: 0 (strict mode; any failure would have aborted the build above)
This skill was tightened for Council 414/415 + Phase 3 migrated corpora (post-2026-05-09 ADR-0211 ratification) AND for the post-ADR-prefix-rename shape (2026-05-10). The previous permissive mode tolerated:
chosen-option field tolerance^superseded by ADR-NNNN)related-legacy advisory edgesNNNN-slug.md without ADR- prefix)All of those are removed. If you need to onboard a project whose ADR corpus is not yet migrated, run the migration scripts in ADR-0211 §Phase 3 first (frontmatter conversion, DACI removal, typed-prose lift), then run the ADR-prefix rename. Then run this strict indexer.
The strict mode is symmetric with odr-index's strict mode — same predicates, same edge model, same DCAP-style enforcement; only the namespace and filename pattern differ. A clean run produces zero warnings and zero advisory output.
Convene a dialectic expert-panel review (the Linked Data Council Hive) on an ontology/ADR/ODR proposition or a set of outstanding questions, then produce a session record. Use when a modelling decision has a credible split, a contested mapping or identity-criterion question needs adjudicating, or a precedent needs recording. Spawns a SCOPED panel via the Agent tool (Queen + Devil's Advocate + only the relevant experts), collects per-question verdicts, writes the synthesis, and routes dispositions to the ODRs/ADRs.
Create professional diagrams using Mermaid or DOT/Graphviz. Mermaid for flowcharts, sequences, classes, ER, Gantt, architecture with semantic coloring and WCAG AA accessibility. DOT/Graphviz for pure network graphs, semantic webs, and maximum layout control.
Lint ODR frontmatter, section structure, and references against the DCAP profile
Create a new Ontology Decision Record (ODR) with sequential numbering and AgentDB registration
Build or rebuild the ODR index and dependency graph in AgentDB (strict mode — unified MADR DCAP: 6 required + 3 optional frontmatter keys, MADR body spine, matching odr-create / odr-review)
Create a new Architecture Decision Record with sequential numbering (ADR- prefixed filename) and AgentDB registration