adr-reindex
O que ela faz
Esta skill reconstrói o índice salvo dos registros de decisão de arquitetura a partir dos arquivos que existem agora, para que os registros excluídos não permaneçam. Ela é para equipes que excluem ou alteram arquivos de decisão e querem o índice sempre preciso.
Quando usar
- ✓Quando você excluiu um arquivo de decisão de arquitetura.
- ✓Quando você removeu uma linha de link de um arquivo de decisão.
- ✓Quando a quantidade de decisões no índice é maior do que o número de arquivos.
Link da skill
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-adr/skills/adr-reindex/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Excluí dois arquivos de decisão. Limpe o índice para que ele liste apenas os registros que ainda existem.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente limpa os registros e os links salvos e depois os reconstrói a partir dos arquivos de decisão que estão no disco.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Por que não usar apenas o índice normal?
O índice normal apenas adiciona ou atualiza entradas, então não consegue remover registros de arquivos excluídos.
Posso ver as mudanças antes?
Sim. A skill tem uma opção de simulação que informa o que mudaria sem gravar nada.
Devo executá-la com alguma frequência?
A skill sugere a reconciliação periódica como boa prática.
Detalhes
Descrição original do 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
Popularidade
- Estrelas no GitHub
- 81 mil
- Posição no ranking
- #1553
- Licença
- MIT
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
agent-adaptive-coordinator
81 milAjuda seu agente a dividir e rebalancear um grupo de agentes de IA conforme a carga de trabalho muda, escolhendo um layout adequado à tarefa.
agent-agent
81 milEnsina seu agente a transformar um grande objetivo em um plano ordenado de ações e a replanejar quando as condições mudarem.
agent-agentic-payments
81 milAjuda seu agente a gerenciar mandatos de gasto para compras com IA, com tetos de valor, janelas de tempo, regras de lojistas e aprovações assinadas.
agent-analyze-code-quality
81 milAjuda seu agente a revisar código quanto à qualidade, encontrando code smells, dívida técnica e ideias de refatoração sem alterar os arquivos.
Skills parecidas
technical-documentation
394 milAjuda seu agente a escrever e revisar documentação técnica clara e arquivos de instruções, para que pessoas e ferramentas de IA sigam tudo com facilidade.
architecture-decision-records
280 milFaz seu agente registrar decisões importantes sobre a estrutura do projeto. Ajuda a entender o porquê das escolhas feitas e a manter um histórico claro das mudanças.
code-tour
280 milFaz seu agente criar guias passo a passo no código, com arquivos e linhas exatos. Útil para apresentar projetos, explicar código ou revisar mudanças.