claudegoodies
Skill

adr-reindex

From ruvnet

Reconcile the ADR index against a DELETED ADR file or relation line by dropping and rebuilding adr-patterns + adr-edges from scratch (scripts/reindex.mjs). Use when adr-index alone leaves stale rows behind.

Facts

Repository
ruvnet/ruflo
Status
Actively maintained
Last commit
Declared tools
Bash mcp__claude-flow__memory_list

Source preview

The instructions Claude Code reads when this skill runs.

# ADR Reindex

`adr-index` only ever **adds** or upserts rows — it has no way to remove one. Delete an ADR file (or a single relation line from a surviving file) and the row `adr-index` wrote for it survives every future `adr-index` run, forever, with no dangling-ref or cycle ever pointing at it. `adr-verify` then certifies the resulting graph as healthy, because an orphan row with zero edges in or out is invisible to both its checks. See issue #2666.

This is a different failure mode from staleness (an ADR that changed but whose stored record didn't) — that's convergence, `adr-index`'s job. This is **reaping** — the source of truth (the ADR file) is gone, so the derived cache row for it must be gone too. The only reliable way to reap is to drop both namespaces and rebuild from what's actually on disk right now.

## When to use

- After deleting an ADR file (or removing a relation line from one)
- Periodically, as a scheduled reconcile (`adr-verify` can't catch what `adr-reindex` catches — see below)
- If `adr-verify`'s ADR count looks higher than `find docs/adr -name '*.md' | wc -l`

## Steps

```bash
node plugins/ruflo-adr/scripts/reindex.mjs
```

Optional env:
- `REINDEX_FORMAT=json` — JSON instead of markdown
- `REINDEX_DRY_RUN=1` — report what would happen, purge/write nothing
- `ADR_ROOT=/path` — scan root **and** the root the underlying `memory purge`/`memory store` subp
View full source on GitHub →

Other skills