adr-reindex
Fungsinya
Skill ini membangun ulang indeks catatan Architecture Decision Record yang tersimpan dari berkas yang ada sekarang, sehingga catatan yang sudah Anda hapus tidak tertinggal. Skill ini untuk tim yang menghapus atau mengubah berkas keputusan dan ingin indeksnya tetap akurat.
Kapan dipakai
- โSaat Anda sudah menghapus sebuah berkas keputusan arsitektur.
- โSaat Anda sudah menghapus baris tautan dari sebuah berkas keputusan.
- โSaat jumlah keputusan di indeks lebih banyak daripada jumlah berkas.
Link skill
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-adr/skills/adr-reindex/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya menghapus dua berkas keputusan. Bersihkan indeksnya agar hanya mendaftar catatan yang masih ada.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mengosongkan catatan dan tautan yang tersimpan, lalu membangunnya ulang dari berkas keputusan yang ada di disk saat ini.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Mengapa tidak menjalankan indeks biasa saja?
Indeks biasa hanya menambah atau memperbarui entri, sehingga tidak bisa menghapus catatan milik berkas yang sudah dihapus.
Bisakah saya melihat pratinjau perubahannya lebih dulu?
Bisa. Skill ini memiliki opsi dry run yang melaporkan apa yang akan berubah tanpa menulis apa pun.
Apakah saya sebaiknya menjalankannya secara terjadwal?
Skill ini menyarankan rekonsiliasi berkala sebagai praktik yang baik.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 81k
- Peringkat
- #1553
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
agent-adaptive-coordinator
81kMembantu agent Anda membagi dan menyeimbangkan kembali sekelompok agent AI saat beban kerja berubah, dengan memilih tata letak yang sesuai tugas.
agent-agent
81kMengajari agent Anda mengubah tujuan besar menjadi rencana tindakan yang berurutan, dan menyusun ulang rencana saat kondisi berubah.
agent-agentic-payments
81kMembantu agent Anda mengelola mandat belanja untuk belanja AI, dengan batas pengeluaran, jendela waktu, aturan merchant, dan persetujuan yang ditandatangani.
agent-analyze-code-quality
81kMembantu agent Anda meninjau kualitas kode, menemukan bau kode, utang teknis, dan ide refaktor tanpa mengubah berkas.
Skill serupa
technical-documentation
394kMembantu agent Anda menulis dan meninjau dokumentasi teknis serta file instruksi agent yang jelas, agar orang dan alat AI dapat mengikutinya dengan mudah.
architecture-decision-records
280kMembuat agent Anda mencatat keputusan penting terkait struktur proyek. Membantu memahami alasan di balik pilihan dan menjaga riwayat perubahan yang jelas.
code-tour
280kMembuat agent Anda menyusun panduan kode langkah demi langkah dengan referensi file dan nomor baris yang tepat. Berguna untuk pengenalan, penjelasan, dan review.