adr-index — скилл для Claude Code: что делает и как установить
Собирает индекс архитектурных решений и граф связей между ними одним запуском scripts/import.mjs. Пригодится, когда ADR-файлы на диске разошлись с графом в памяти агента.
npx skills add ruvnet/ruflo --skill adr-index -a claude-codeЧто делает adr-index
Скилл обходит */docs/adr/ и */docs/adrs/, разбирает найденные файлы и раскладывает результат по двум namespace: в adr-patterns кладёт записи решений, в adr-edges связи supersedes, amends, related и depends-on. Понимает оба формата из монорепозитория Ruflo: заголовок # ADR-097: Название со строкой **Status**: Proposed и YAML frontmatter с id: ADR-NNNN.
Вся работа — один вызов Bash: node plugins/ruflo-adr/scripts/import.mjs. Опции задаются через окружение: IMPORT_FORMAT=json отдаёт JSON вместо markdown, IMPORT_DRY_RUN=1 парсит и суммирует без записи, ADR_ROOT=/path сканирует другой корень. После прогона смотрите сводку: сколько решений нашлось и записалось, разбивка по статусам, число связей, висячие ссылки.
Скилл только добавляет и обновляет. Удалили файл ADR — запись останется навсегда, и adr-verify её не поймает: у сироты нет висячей ссылки, цикла тоже нет. Такие хвосты разгребает соседний adr-reindex. Поэтому перед первым прогоном стоит выставить IMPORT_DRY_RUN=1 и посмотреть, что попадёт в граф, прежде чем писать в память.
Какие задачи решает
- пересобрать индекс решений после импорта ADR из другого проекта
- найти решение по смыслу через
memory_search, а не грепом по файлам - посмотреть, какие решения ссылаются на устаревший ADR
- получить висячие ссылки и расхождения статусов одной сводкой
- накатить ADR-трекинг на существующий репозиторий
Примеры запросов агенту
- Пересобери индекс ADR: запусти
node plugins/ruflo-adr/scripts/import.mjsи покажи сводку. - Сначала сухой прогон с
IMPORT_DRY_RUN=1— хочу увидеть, сколько записей появится. - Найди в namespace
adr-patternsрешения про бюджет федерации.
Как установить adr-index
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill adr-index -a claude-code2Вручную: положить файлы
~/.claude/skills/adr-index/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/adr-index/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill adr-index -a codex2Вручную: положить файлы
.agents/skills/adr-index/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill adr-index -a cursor2Вручную: положить файлы
.cursor/skills/adr-index/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo adr-index2Вручную: положить файлы
.github/skills/adr-index/SKILL.md1Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill adr-index -a gemini-cli2Командой платформы
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-adr/skills/adr-indexВручную: положить файлы
.devin/skills/adr-index/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill adr-index -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о adr-index
Как установить adr-index в Claude Code?
Одной командой: npx skills add ruvnet/ruflo --skill adr-index -a claude-code. Файл скилла появится в ~/.claude/skills/adr-index/SKILL.md.
Что делает adr-index?
Читает ADR-файлы, пишет записи в adr-patterns и связи между решениями в adr-edges. Работает и с v3-стилем, и с plugin-стилем оформления.
Что будет, если удалить файл ADR?
Запись останется, потому что скилл умеет только добавлять и обновлять. adr-verify такой случай не отловит, для чистки есть adr-reindex.
Исходный текст
SKILL.md · MIT
---
name: adr-index
description: 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)
argument-hint: ""
allowed-tools: Bash mcp__plugin_ruflo-core_ruflo__memory_list mcp__plugin_ruflo-core_ruflo__memory_search
---
# 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**:
```bash
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:
```json
{ "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)
© ruvnet · MIT · ruvnet/ruflo