adr-reindex
Qué hace
Esta skill reconstruye el índice guardado de registros de decisiones de arquitectura a partir de los archivos que existen ahora, para que los registros que borraste no sigan apareciendo. Es para equipos que eliminan o cambian archivos de decisiones y quieren que el índice se mantenga exacto.
Cuándo usarla
- ✓Cuando has borrado un archivo de decisión de arquitectura.
- ✓Cuando has quitado una línea de enlace de un archivo de decisión.
- ✓Cuando el número de decisiones del índice es mayor que el número de archivos.
Link de la skill
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-adr/skills/adr-reindex/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Borré dos archivos de decisiones. Limpia el índice para que solo liste los registros que todavía existen.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente vacía los registros y enlaces guardados y luego los reconstruye a partir de los archivos de decisiones que están en disco.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
Preguntas frecuentes
¿Por qué no basta con el índice normal?
El índice normal solo añade o actualiza entradas, así que no puede eliminar registros de archivos borrados.
¿Puedo ver los cambios antes?
Sí. La skill tiene una opción de simulación que informa qué cambiaría sin escribir nada.
¿Debo ejecutarla de forma programada?
La skill sugiere conciliar el índice periódicamente como buena práctica.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 81 mil
- Posición en el ranking
- #1553
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
agent-adaptive-coordinator
81 milAyuda a tu agente a dividir y reequilibrar un grupo de agentes de IA cuando cambia la carga de trabajo, eligiendo una distribución que encaje con la tarea.
agent-agent
81 milEnseña a tu agente a convertir una meta grande en un plan ordenado de acciones, y a replanificar cuando cambien las condiciones.
agent-agentic-payments
81 milAyuda a tu agente a administrar mandatos de gasto para compras con IA, con topes de gasto, ventanas de tiempo, reglas por comercio y aprobaciones firmadas.
agent-analyze-code-quality
81 milAyuda a tu agente a revisar la calidad del código, encontrando malos olores, deuda técnica e ideas de refactorización sin cambiar los archivos.
Skills parecidas
technical-documentation
394 milAyuda a tu agente a escribir y revisar documentación técnica clara y archivos de instrucciones para agentes, para que personas y herramientas de IA puedan seguirlos fácilmente.
architecture-decision-records
280 milHace que tu agente registre las decisiones importantes sobre la estructura del proyecto. Así se entiende el motivo de cada elección y se mantiene un historial claro.
code-tour
280 milPermite que tu agente cree recorridos paso a paso por el código, con referencias exactas a archivos y líneas. Útil para introducciones, explicaciones y revisiones.