adr-reindex
하는 일
이 스킬은 지금 존재하는 파일을 바탕으로 아키텍처 결정 기록의 저장된 색인을 다시 만들어, 삭제한 기록이 남지 않도록 합니다. 결정 파일을 지우거나 바꾸고 색인을 정확하게 유지하려는 팀을 위한 스킬입니다.
사용하는 경우
- ✓아키텍처 결정 파일을 삭제했을 때.
- ✓결정 파일에서 연결 줄을 지웠을 때.
- ✓색인의 결정 수가 파일 수보다 많을 때.
스킬 링크
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-adr/skills/adr-reindex/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“결정 파일 두 개를 지웠습니다. 현재 남아 있는 기록만 나오도록 색인을 정리해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 저장된 기록과 연결을 지운 뒤, 지금 디스크에 있는 결정 파일로부터 다시 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
일반 색인을 쓰면 안 되나요?
일반 색인은 항목을 추가하거나 갱신만 하므로, 삭제된 파일의 기록은 제거하지 못합니다.
변경 사항을 먼저 볼 수 있나요?
네. 시험 실행 옵션을 쓰면 아무것도 쓰지 않고 바뀔 내용만 보고합니다.
정기적으로 실행해야 하나요?
스킬은 주기적인 재정렬을 좋은 습관으로 제안합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 81k
- 순위
- #1553
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-adaptive-coordinator
81k작업량이 바뀔 때 에이전트 무리를 나누고 재배치해, 작업에 맞는 배치를 고르도록 에이전트를 돕습니다.
agent-agent
81k큰 목표를 순서가 있는 행동 계획으로 나누고, 조건이 바뀌면 다시 계획하도록 에이전트를 가르칩니다.
agent-agentic-payments
81kAI 쇼핑을 위한 지출 위임장을 관리합니다. 지출 상한, 시간 창, 판매자 규칙, 서명된 승인을 포함합니다.
agent-analyze-code-quality
81k에이전트가 파일을 바꾸지 않고, 코드 품질 문제와 코드 냄새, 기술 부채, 리팩터링 아이디어를 찾아 검토하도록 돕습니다.
비슷한 스킬
technical-documentation
394k에이전트가 명확한 기술 문서와 에이전트 지침 파일을 작성하고 검토하도록 도와, 사람과 AI 도구가 쉽게 따를 수 있게 합니다.
architecture-decision-records
280k에이전트가 프로젝트 구조에 관한 중요한 결정을 기록하도록 합니다. 선택의 이유를 이해하고 변경 이력을 명확히 유지하는 데 도움이 됩니다.
code-tour
280k에이전트가 정확한 파일과 줄 번호를 참조하는 단계별 코드 안내를 만들도록 합니다. 소개, 설명, 리뷰에 유용합니다.