Agent skill

ADR Reindex

by ruvnet in ruvnet/ruflo

Rebuilds the ADR pattern and edge indexes from the files on disk, clearing stale rows left behind after an ADR file or relation line is deleted.

MITAuto-check: notesDevelopment

Install ADR Reindex

skills CLI
$ npx skills add ruvnet/ruflo --skill adr-reindex -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ruvnet/ruflo adr-reindex --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ruvnet/ruflo.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/ruflo-adr/skills/adr-reindex .claude/skills/adr-reindex && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
adr-reindex
GitHub stars
74k
Token cost
~1.1k tokens
SKILL.md length
619 words
Files
1
Skills in repo
265
Repo updated
First seen
Licence
MIT

At a glance

Rebuilds the ADR pattern and edge indexes from the files on disk, clearing stale rows left behind after an ADR file or relation line is deleted.

  • Works in 3 steps: Purge — hard-deletes every row in… → Rebuild — re-scans every ADR currently… → Post-condition — re-lists adr-patterns…
  • After deleting an ADR file or a relation line from one
  • SKILL.md covers When to use, Steps, What it does and Why not adr-index + memory…, plus 2 more sections
  • Calls node

What it does

The companion `adr-index` skill only adds or updates rows, so deleting an ADR file, or one relation line inside it, leaves its row behind indefinitely. `adr-verify` does not notice, because an orphan row with no edges is invisible to its checks. This skill handles that case by treating the files on disk as the source of truth and rebuilding the derived records from them.

Running `node plugins/ruflo-adr/scripts/reindex.mjs` hard-deletes every row in the `adr-patterns` and `adr-edges` namespaces with `memory purge`, rescans the ADRs on disk and stores them fresh. It then recounts `adr-patterns` and exits non-zero if the count differs from the files scanned. Environment variables switch output to JSON (`REINDEX_FORMAT=json`), preview without changes (`REINDEX_DRY_RUN=1`) or set the scan root (`ADR_ROOT`), which must match the root last used with `adr-index`.

When your agent uses it

  • After deleting an ADR file or a relation line from one
  • Running a periodic reconcile of the ADR index
  • adr-verify reports more ADRs than exist under docs/adr

Example prompts

  • “I deleted one of the ADR files, so rebuild the ADR index to drop its row.”
  • “Do a dry run of the ADR reindex and show what would be purged.”
  • “The ADR count in adr-verify looks too high, so reconcile it against the files in docs/adr.”

Requirements

  • Node.js to run `reindex.mjs`
  • The ruflo-adr plugin with its memory CLI
  • Pre-approved tools (allowed-tools): Bash, mcp__plugin_ruflo-core_ruflo__memory_list

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Purge — hard-deletes every row in adr-patterns and adr-edges via memory purge --namespace --force (the CLI's real DELETE FROM…
  2. Rebuild — re-scans every ADR currently on disk (same dual-format parser adr-index uses) and stores it fresh.
  3. Post-condition — re-lists adr-patterns and asserts the count equals the number of ADR files just scanned. This is stronger than…

What it can do on your machine

Read from SKILL.md and the folder at commit 72255a2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • mcp__plugin_ruflo-core_ruflo__memory_list

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

ADR Reindex loads about 1.1k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 619 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, mcp__plugin_ruflo-core_ruflo__memory_list

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ruvnet/ruflo at commit 72255a2, republished under its MIT licence (© ruvnet). 619 words, ~1,146 tokens.

Download SKILL.mdSave it as .claude/skills/adr-reindex/SKILL.md (or your agent's skills folder).
name
adr-reindex
description
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.
allowed-tools
Bash, mcp__plugin_ruflo-core_ruflo__memory_list

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 subprocesses run from (must match whatever root adr-index was last run with, or you'll reconcile the wrong repo's namespace)

What it does

  1. Purge — hard-deletes every row in adr-patterns and adr-edges via memory purge --namespace <ns> --force (the CLI's real DELETE FROM memory_entries, not memory delete's soft tombstone that still blocks a same-key re-store — see "Why not adr-index + memory delete" below).
  2. Rebuild — re-scans every ADR currently on disk (same dual-format parser adr-index uses) and stores it fresh.
  3. Post-condition — re-lists adr-patterns and asserts the count equals the number of ADR files just scanned. This is stronger than adr-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.

Show full SKILL.md (274 more words)Show less

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 purge directly against adr-patterns/adr-edges outside 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-on edges 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 in adr-edges — they only come back if the sibling repo's ADRs are indexed in the same run. This matches adr-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 confirm adrCount matches disk
  • scripts/reindex.mjs — implementation
  • ADR-0002 (docs/adrs/) — the decision record for this skill

© ruvnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/ruflo-adr/skills/adr-reindex of ruvnet/ruflo.

Open the folder on GitHubat commit 72255a2

Compare with similar skills

ADR Reindex next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

ADR Reindex compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
ADR Reindex this skillruvnet/ruflo74k—~1.1kAutomated safety check: NotesMIT
PR Design DocOpenHands/OpenHands91k—~2.4kAutomated safety check: PassMIT
Cto AdvisorIbrahim-3d/orchestrator-supaconductor3814 repos~2.4kAutomated safety check: PassMIT
Domain Modelingbrim-borium/spotify_sdk1667 repos~806Automated safety check: PassApache-2.0
Architecture DecisionDonchitos/Claude-Code-Game-Studios26k—~1.7kAutomated safety check: PassMIT
Improve Codebase Architectureywwynm/EverythingDone14415 repos~1.3kAutomated safety check: PassGPL-3.0

Similar skills

  • PR Design Doc

    OpenHands/OpenHands

    For a non-trivial pull request, write a self-contained HTML design doc under the temporary .pr/ directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the…

    91k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Cto Advisor

    Ibrahim-3d/orchestrator-supaconductor

    Technical leadership guidance for engineering teams, architecture decisions, and technology strategy.

    381 GitHub starsUsed in 4 repos~2.4k tokens
    DevelopmentAuto-check passed
  • Domain Modeling

    brim-borium/spotify_sdk

    Build and sharpen a project's domain model. An agent skill from brim-borium/spotify_sdk.

    166 GitHub starsUsed in 7 repos~806 tokens
    DevelopmentAuto-check passed
  • Architecture Decision

    Donchitos/Claude-Code-Game-Studios

    Create an ADR documenting a technical decision: context, alternatives considered, consequences.

    26k GitHub stars~1.7k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Improve Codebase Architecture

    ywwynm/EverythingDone

    Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/.

    144 GitHub starsUsed in 15 repos~1.3k tokens
    DevelopmentAuto-check passed
  • Design Doc Mermaid

    SpillwaveSolutions/design-doc-mermaid

    Create Mermaid diagrams (flowchart, sequence, class, ER, state, C4, architecture) from text or source code.

    176 GitHub starsUsed in 1 repo~5.6k tokens
    DevelopmentAuto-check passed

More from ruvnet/ruflo

All 265 skills in this repo
  • Stores, searches, and retrieves successful patterns with HNSW-indexed semantic search so agents can reuse past solutions instead of relearning them.

    74k GitHub starsUsed in 1 repo~830 tokens
    Auto-check passed
  • Sets up and drives Ruflo, an npm-installed orchestration layer for multi-agent swarms, persistent memory, routing, hooks and its MCP tool catalog.

    74k GitHub starsUsed in 1 repo~975 tokens
    Auto-check passed
  • Runs claude-flow CLI security scans for input validation, path traversal, SQL injection, XSS, hardcoded secrets and known CVEs, and writes an audit report.

    74k GitHub starsUsed in 1 repo~823 tokens
    Auto-check passed
  • Applies the SPARC method (specification, pseudocode, architecture, refinement, completion) with 17 specialized modes and multi-agent orchestration, from research to deployment.

    74k GitHub starsUsed in 1 repo~829 tokens
    Auto-check passed
  • Coordinates a hierarchical swarm of specialized agents through the claude-flow CLI for work that spans several files or modules at once.

    74k GitHub starsUsed in 1 repo~779 tokens
    Auto-check passed
  • Finds models on the Hugging Face router that lack descriptions in chat-ui's prod.yaml and dev.yaml, researches each one and adds short descriptions.

    74k GitHub starsUsed in 1 repo~600 tokens
    Auto-check passed

Categories

Questions about ADR Reindex

What does ADR Reindex do?

Rebuilds the ADR pattern and edge indexes from the files on disk, clearing stale rows left behind after an ADR file or relation line is deleted. The companion `adr-index` skill only adds or updates rows, so deleting an ADR file, or one relation line inside it, leaves its row behind indefinitely. `adr-verify` does not notice, because an orphan row with no edges is invisible to its checks.

When should I use ADR Reindex?

ADR Reindex fits situations like: after deleting an ADR file or a relation line from one; running a periodic reconcile of the ADR index; adr-verify reports more ADRs than exist under docs/adr.

How do I install ADR Reindex in Claude Code?

Run `npx skills add ruvnet/ruflo --skill adr-reindex -a claude-code`. Or copy the skill folder (plugins/ruflo-adr/skills/adr-reindex in ruvnet/ruflo) into .claude/skills/adr-reindex in your project. Claude Code loads it when a task matches its description.

How do I install ADR Reindex in Codex?

Run `npx skills add ruvnet/ruflo --skill adr-reindex -a codex`. Or copy the skill folder (plugins/ruflo-adr/skills/adr-reindex in ruvnet/ruflo) into .agents/skills/adr-reindex in your project. Codex loads it when a task matches its description.

Can I use ADR Reindex in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ruvnet/ruflo --skill adr-reindex -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adr-reindex, .gemini/skills/adr-reindex, .github/skills/adr-reindex and .opencode/skills/adr-reindex in your project.

What does ADR Reindex need to run?

Going by SKILL.md and its folder, ADR Reindex needs the command-line tools its instructions call (node). Our summary lists: Node.js to run `reindex.mjs`; The ruflo-adr plugin with its memory CLI. Its frontmatter pre-approves these tools: Bash, mcp__plugin_ruflo-core_ruflo__memory_list.

Does ADR Reindex access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is ADR Reindex safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does ADR Reindex use?

ADR Reindex is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does ADR Reindex use?

About 1.1k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to ADR Reindex?

Skills that share tags, products or a category with ADR Reindex: PR Design Doc (OpenHands/OpenHands, 91k stars), Cto Advisor (Ibrahim-3d/orchestrator-supaconductor, 381 stars), Domain Modeling (brim-borium/spotify_sdk, 166 stars) and Architecture Decision (Donchitos/Claude-Code-Game-Studios, 26k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains ADR Reindex?

ruvnet (a GitHub user) maintains it in ruvnet/ruflo, which has 74,309 GitHub stars. The repository holds 265 skills in this directory. The repository was last updated on October 11, 2026.

Source: ruvnet/ruflo on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.