adr-reindex
What it does
This skill rebuilds the saved index of architecture decision records from the files that exist now, so records you deleted no longer linger. It is for teams who delete or change decision files and want the index kept accurate.
When to use it
- βWhen you have deleted an architecture decision file.
- βWhen you have removed a link line from a decision file.
- βWhen the decision count in the index is higher than the number of files.
Skill link
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-adr/skills/adr-reindex/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI deleted two decision files. Clean up the index so it only lists the records that still exist.β
5 new skills a week. 1 minute to read.
How it works
The agent clears the saved records and links, then rebuilds them from the decision files currently on disk.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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-verifycan't catch whatadr-reindexcatches β see below) - If
adr-verify's ADR count looks higher thanfind docs/adr -name '*.md' | wc -l
Steps
node plugins/ruflo-adr/scripts/reindex.mjs
Optional env:
REINDEX_FORMAT=jsonβ JSON instead of markdownREINDEX_DRY_RUN=1β report what would happen, purge/write nothingADR_ROOT=/pathβ scan root and the root the underlyingmemory purge/memory storesubprocesses run from (must match whatever rootadr-indexwas last run with, or you'll reconcile the wrong repo's namespace)
What it does
- Purge β hard-deletes every row in
adr-patternsandadr-edgesviamemory purge --namespace <ns> --force(the CLI's realDELETE FROM memory_entries, notmemory delete's soft tombstone that still blocks a same-key re-store β see "Why notadr-index+memory delete" below). - Rebuild β re-scans every ADR currently on disk (same dual-format parser
adr-indexuses) and stores it fresh. - Post-condition β re-lists
adr-patternsand asserts the count equals the number of ADR files just scanned. This is stronger thanadr-index's "N stored, 0 errors" tally: if a concurrent memory.db writer clobbered the purge (see Caveats), the store loop would still report success on every call β only a fresh recount catches that.
Exits non-zero if the post-condition fails.
Why not adr-index + memory delete
memory delete is a soft delete (UPDATE ... SET status='deleted') β the row keeps occupying its UNIQUE(namespace, key) slot, so a later non-upsert memory store for that same key still fails. memory cleanup only reaps entries by age/TTL/quality, not by "does its source file still exist" β it has no orphan concept. Neither gets you back to a clean graph; only a real namespace-scoped DELETE FROM does, which is what memory purge (and this skill) uses.
Caveats
- Irreversible. This purges the entire namespace, not a diff β always safe here because step 2 immediately rebuilds from the current on-disk truth, but don't call
memory purgedirectly againstadr-patterns/adr-edgesoutside this flow. - #2621 (unaddressed): the purge is lock-protected against a second concurrent purge/delete on the same
memory.db, but not against every writer β a daemon or MCP server mid a read-modify-write cycle on the sql.js fallback path can still flush an older image afterward and resurrect what this just purged. The post-condition check exists specifically to surface this; re-run the skill if it fails. - Cross-repo
related/depends-onedges pointing at an ADR that was never scanned in this root (a legitimate sibling-repo reference, not an orphan) are dropped by the rebuild the same as everything else inadr-edgesβ they only come back if the sibling repo's ADRs are indexed in the same run. This matchesadr-verify's own documented "dangling ref, common cause: sibling repo" caveat; it isn't new drift introduced by this skill.
Cross-references
adr-indexβ convergence (add/upsert); this skill is reaping (remove what's gone)adr-verifyβ read-back integrity check; run after reindex to confirmadrCountmatches diskscripts/reindex.mjsβ implementation- ADR-0002 (
docs/adrs/) β the decision record for this skill
FAQ
Why not just run the normal index?
The normal index only adds or updates entries, so it cannot remove records for deleted files.
Can I preview the changes first?
Yes. The skill has a dry run option that reports what would change without writing anything.
Should I run it on a schedule?
The skill suggests periodic reconciling as a good practice.
Details
Original description by the author
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.
repo: ruvnet/ruflo
Popularity
- GitHub stars
- 81k
- Ranking position
- #1553
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-adaptive-coordinator
81kHelps your agent split and rebalance a group of AI agents as the workload changes, choosing a layout that fits the task.
agent-agent
81kTeaches your agent to turn a big goal into an ordered plan of actions, and to replan when conditions change.
agent-agentic-payments
81kHelps your agent manage spending mandates for AI shopping, with spend caps, time windows, merchant rules and signed approvals.
agent-analyze-code-quality
81kHelps your agent review code for quality, finding code smells, technical debt and refactoring ideas without changing the files.
Similar skills
technical-documentation
394kHelps your agent write and review clear technical docs and agent instruction files, so people and AI tools can follow them easily.
architecture-decision-records
280kHas your agent record important project structure decisions. It helps to understand the reasoning behind choices and maintain a clear history of changes.
code-tour
280kLets your agent create step-by-step code walkthroughs with exact file and line references. Useful for intros, explanations, and reviews.