볼트 최적화기 (한국어판)
⚠️ 이 블록은 영어 원본을 한국어 볼트용으로 감싸는 마스터 오버라이드입니다. 아래 본문·references의 어떤 영어 지시와 충돌하더라도 이 블록이 우선합니다. 프레임워크의 판단 로직·정규식·구조는 그대로 따르되, 아래 두 가지만 한국어 기준으로 바꿉니다: (1) 사용자에게 보이는 출력 언어, (2) 언어 종속적 수치·치환 규칙.
오버라이드 0 — 출력 언어: 무조건 한국어
references 파일들은 영어로 쓰여 있습니다. 이건 에이전트(클로드)가 읽는 지시층이라 그대로 둡니다. 하지만 사용자가 실제로 보는 모든 출력은 예외 없이 한국어입니다:
- Step 0/1/1.5의 안내 문구, 발견 요약 블록, 분류 표
- 프레임워크 진행 라인(예: "F1 … → 22건 발견")
- 모든 walk 질문과 선택지
- 각 finding의 ·· 설명(원문 인용 excerpt는 원본 유지, 그에 대한 설명은 한국어)
- HTML 리포트의 모든 라벨·헤더·설명(한국어 템플릿 사용 — 아래 오버라이드 4)
- 최종 요약 블록
finding의
은 "규칙을 다시 말하기"가 아니라
이 파일의 이 맥락에서 왜 문제인지를 한국어로 구체적으로 씁니다. 존댓말을 기본으로 합니다.
오버라이드 1 — 토큰 추정 공식 (가장 중요한 한국어 조정)
영어 pass 파일들은 토큰을
또는
로 추정합니다.
이 공식은 한국어를 심하게 과소평가합니다. 한글은 글자당 토큰 밀도가 영어보다 높기 때문입니다. references의 모든
·
·
표현은 아래 공식으로 대체합니다:
한글_글자수 = 유니코드 Hangul(음절 AC00–D7A3, 자모 1100–11FF, 3130–318F) 개수
그외_글자수 = 공백 제외 나머지 글자수 (영문·숫자·기호·코드)
추정_토큰 ≈ (한글_글자수 × 1.5) + (그외_글자수 × 0.25)
- 계수 (한글)와 (그 외)는 근사치이며 토크나이저·내용 구성에 따라 변합니다. 안전을 위해 살짝 과대 추정하는 방향으로 잡았습니다(예산 초과를 놓치는 것보다 일찍 경고하는 게 낫다)
- 토큰 예산 수치 자체는 바꾸지 않습니다. 예산(F4 자동로드 ~3K, daily 2K, F5 파일당 권장 ~2.5K / 하드 25K)은 언어 중립적 목표입니다. 바뀌는 건 오직 "이 파일이 몇 토큰인가"를 세는 방법뿐입니다
- 결과: 영어 공식으로는 예산 안에 들어 보이던 한국어 파일이 실제로는 초과인 경우를 정확히 잡아냅니다. 리포트의 "절감 토큰" 수치도 한국어 기준으로 맞습니다
오버라이드 2 — 파일 크기 예산: 바이트가 아니라 토큰으로
F5(Anthropic Memory)와 G7.4는 "권장 <10KB", "sparse <200B", "bloated >8KB"처럼 바이트 기준을 씁니다. 한글은 UTF-8에서 글자당 3바이트라 바이트 수가 오해를 부릅니다(한글 3,333자 = 10KB지만 토큰은 ~5,000). 한국어 볼트에서는:
- F5 파일당 권장 예산을 바이트가 아니라 토큰으로 판정합니다: 오버라이드 1 공식으로 추정한 토큰이 권장 ~2,500토큰 초과 → warn, 하드 25,000토큰(또는 100KB) 초과 → fail. 바이트(KB)는 참고용 보조 지표로만 리포트에 병기
- G7.4 README 밀도: "sparse"·"bloated" 판정도 바이트가 아니라 토큰/내용 충실도로 봅니다. 한글 README는 같은 정보량이라도 바이트가 크니 8KB 기준을 그대로 쓰면 멀쩡한 문서가 bloated로 잘못 잡힙니다. sparse는 "개요·상태·다음 단계 중 빠진 게 있는가", bloated는 "한 파일에 분리돼야 할 하위 주제가 여럿인가"로 판정(바이트는 참고만)
오버라이드 3 — em대시(G7.1) & 한국어 문체 위생(G7.5 신설)
G7.1 치환은 한국어 문장부호 기준으로 바꿉니다. 한국어 AI 글쓰기도 영어에서 옮겨온 em대시(—)를 남용하므로 탐지는 유지하되, 치환은 영어식 콜론/세미콜론이 아니라 한국어 자연스러움을 따릅니다:
- 두 절을 잇고 뒤 절이 앞을 부연 → 마침표로 문장 분리, 또는 "즉,"·"곧"·쉼표로 연결 (콜론 은 한국어 산문에서 어색하니 지양)
- 삽입구 설정 → 쉼표() 또는 괄호()
- 절 끝에서 마침표 역할 → 마침표()로 문장 분리
- 숫자·날짜 범위의 엔대시(, )는 유지(위반 아님)
- 인용문 안의 대시는 원문 보존
G7.5 — 한국어 AI 문체 냄새 (신설, severity: warn, fixable: 사용자 opt-in). 한국어 콘텐츠 노트(role: note/context/decision/meeting)에서 아래 번역체·AI체 신호를 후보로 잡고, 맥락을 읽어 진짜 군더더기일 때만 finding을 냅니다(진짜 필요한 표현은 제외):
- 문장 끝 "~것입니다"·"~할 수 있습니다"의 기계적 반복(한 문단 3회 이상)
- 상투적 마무리어 뭉침: "종합적으로"·"결론적으로"·"요컨대"·"정리하자면"의 남발
- 접속어 스태킹: "또한"·"게다가"·"뿐만 아니라"의 연속 사용
- 강조어 인플레이션: "매우"·"굉장히"·"정말"·"너무"의 습관적 삽입
- 번역체 조사구 남발: "~에 대해"·"~을 통해"·"~에 있어서"·"~와 관련하여"
- 3개 병렬(rule of three)이 기계적으로 반복되는 문장
reasoning은 "이 문장이 왜 번역체이고 어떻게 고치면 자연스러운지"를 구체적으로 씁니다. CLAUDE.md·SKILL.md·.claude/rules·프론트매터·코드·URL·위키링크는 G7.5 대상에서 제외합니다(지시층·보호구역). 점수에는 G7의 일부로 반영(warn 가중치)
오버라이드 4 — HTML 리포트: 한국어 템플릿 사용
Step 6에서 리포트를 만들 때
references/report-template.html
등은
이미 한국어 라벨로 번역돼 있습니다. 그대로 사용하고, 치환하는 값(reasoning·action·excerpt 설명)도 한국어로 채웁니다. Step 6.4의 최종 요약 블록도 한국어로 출력합니다(형식은 오버라이드 5).
오버라이드 5 — 한국어 출력 문자열 (원본 영어 블록 대체)
본문에 나오는 아래 사용자 대면 문자열은 한국어로 출력합니다. 원본 영어 code block이 보이면 같은 정보를 한국어로 바꿔 냅니다:
- Step 0 시작 안내: "9개 프레임워크로 볼트를 감사합니다. 먼저 폴더 구조를 파악하고(Step 1.5 — 폴더 이름을 가정하지 않습니다), 이후 모든 수정안을 항목별로 함께 검토합니다. 각 단계는 작업(task)으로 표시됩니다."
- 볼트 아님 판정: "마크다운 볼트로 보이지 않습니다 — .md 파일이나 CLAUDE.md를 찾지 못했습니다. 볼트 루트로 이동한 뒤 다시 실행해 주세요."
- 프레임워크 진행 라인: "F1 Anthropic CLAUDE.md — CLAUDE.md 14개 읽고 후보 312건 판단 → 22건 발견 (fail 5 · warn 17)" 형식
- 최종 요약(Step 6.4 Part 3):
✅ 최적화 실행 완료 — 이번에 바뀐 내용입니다:
리포트: {결정폴더}/{YYYY-MM-DD}-vault-audit.html
JSON 원본: {결정폴더}/{YYYY-MM-DD}-vault-audit-findings.json
점수(F1–G7): {전} → {후} ({부호}{델타}) — "{해석_전}" → "{해석_후}"
파일 {N}개 감사 · 수정 {적용수}건 적용 · 기계적 실패 {실패수}건 (사유는 리포트 참고)
em대시: {전} → {후} · 프론트매터 완결: {전}% → {후}% · 폴더 인덱스 커버리지: {전}% → {후}%
절감 토큰: {절감}(에이전트 로드 {비율}% 감소) · 주 {세션}회 기준 연 ~{연간절감} 토큰 절약
선택-walk 모드면 "계획 저장 {n}건 · 거절 {n}건" 줄을 덧붙입니다
오버라이드 6 — 점수 해석 표 (한국어)
| 점수 | 해석 |
|---|
| 90–100 | 잘 다듬어짐. 월 1회 감사 권장 |
| 70–89 | 드리프트 감지됨. 상위 발견 항목부터 처리 |
| 50–69 | 비대화가 성능을 해치는 중 |
| <50 | 볼트 부패. 대대적 정리 필요 |
Vault Optimizer (영어 원본 지시층 — 출력은 한국어)
아래 본문은 영어 원본 지시입니다. 로직·구조·정규식은 그대로 따르되, 사용자에게 보이는 모든 출력은 상단 오버라이드 0에 따라 한국어로 냅니다.
Apply 9 frameworks to every markdown file in the vault. For each framework, read its pass-implementation file, run every check, log findings, walk the user through fixes per item, apply (or save to a plan). Save one comprehensive HTML report grouped by framework. Do not inline the HTML in chat — only the saved path and a one-paragraph summary.
Operating philosophy — read carefully, this is what makes this skill different
- Every finding ships a concrete fix. No flag-only. No "warn and forget." No manual-review pile. When the user runs apply-mode, every finding becomes either an applied edit, a saved migration step in a dated reorg plan, or (only if the user explicitly declines this finding in walk) a recorded decline. Nothing lingers as an open warning across runs.
- Severity is informational, not gating. / / describes how load-bearing the issue is; it does not gate whether a fix is offered. Every check produces fixes.
- Walk per item, user picks the target. Bulk-apply is reserved for purely mechanical fixes (em dashes, duplicate H1). Anything semantic — wikilink repointing, merges, routing rewrites, Plot.md generation, reorganizations — is walk-only with the user confirming the destination/winner/wording per item.
- Two modes for every fix: apply now (executes in this run) or save to plan (writes the change as a checklist step into
Intelligence/decisions/{date}-reorg.md
for staged execution). User picks per finding for high-blast-radius items. Smaller fixes default to apply-now.
- Visible progress, never silent. Step 0.5 creates one TaskCreate entry per stage and per framework; tasks update → as the run unfolds. The user watches the audit walk through the vault rather than waiting for one big report at the end.
- Read and reason, don't just match. Every framework's triggers surface candidates; every finding requires the agent to read context, judge alignment with the user's stated world, and produce reasoning specific to the case. No paraphrased rule restatements as "reasoning."
- Discover structure, never assume folder names. Vaults vary. One user's curated layer is ; another's is , , frontmatter on root, or scattered across topic folders. The optimizer runs Step 1.5 (role discovery) before any framework, and every framework references roles (context-equivalent, decisions-equivalent, daily-equivalent, folder-index convention…) discovered from content — never hardcoded names. If a role is missing, it surfaces as a finding with a proposed fix ("you have no decisions-equivalent folder; here's a recommendation"), not as a silent assumption. Static path references in pass files are always abstractions; the agent resolves them through the role registry at run time.
Frameworks
| # | Framework | Reference (the why) | Pass file (the how) | Applies to |
|---|
| F1 | Anthropic CLAUDE.md | references/anthropic-claude-md.md
| references/passes-anthropic-claude-md.md
| every |
| F2 | Karpathy LLM Wiki | references/karpathy-llm-wiki.md
| references/passes-karpathy-wiki.md
| wiki content notes |
| F3 | Caveman compression | references/caveman-compression.md
| references/passes-caveman.md
| instruction-layer files |
| F4 | Chroma context rot | references/chroma-context-rot.md
| references/passes-chroma-context-rot.md
| every |
| F5 | Anthropic Memory | references/anthropic-managed-memory.md
| references/passes-anthropic-memory.md
| every |
| F6 | Progressive Disclosure | references/progressive-disclosure.md
| references/passes-progressive-disclosure.md
| every |
| G7 | General Hygiene | (project rules + practitioner notes) | references/passes-general-hygiene.md
| every |
| F8 | Reflection (Anthropic Dreams) | references/anthropic-dreams.md
| references/passes-reflection.md
| curated layer (, , , ); reads recent + as evidence |
| F9 | Architecture & Discoverability | references/anthropic-architecture.md
| references/passes-architecture.md
| whole vault — root CLAUDE.md, routing, every folder's , the navigation chain end-to-end |
When running a check, read the pass-implementation file and follow its regex / heuristic / finding format exactly. Don't paraphrase. Cite the framework reference in every finding.
Flow
- Verify the cwd looks like a vault — light check (Step 0)
- Create the visible task list — TaskCreate one task per stage + framework (Step 0.5)
- Discover & classify every file — only technical skips (Step 1)
- Iterate frameworks F1 → F9, applying each framework's lens with agent judgment; F8 = cross-vault synthesis, F9 = whole-vault structural reasoning + discoverability walk (Step 2)
- Aggregate findings + write the architectural read paragraph (Steps 3 and 3.5)
- Walk every finding through apply-now / save-to-plan — no skip option for fixes; every finding becomes an applied edit, a saved migration step, or an explicit per-item user decline (Step 4)
- Apply approved fixes (Step 5)
- Render HTML dashboard, save, open in browser, emit as artifact (Step 6)
Step 0 — Verify the cwd looks like a vault
Don't require any specific folder layout. Check (any one is sufficient):
bash
test -f CLAUDE.md || test -f claude.md
[ "$(find . -maxdepth 4 -name 'CLAUDE.md' | head -1)" ]
[ "$(find . -maxdepth 1 -name '*.md' | wc -l)" -gt 0 ]
If none are true → stop:
마크다운 볼트로 보이지 않습니다 —
파일이나
를 찾지 못했습니다. 볼트 루트로
한 뒤 다시 실행해 주세요.
Otherwise tell the user one line (한국어로 출력):
9개 프레임워크로 볼트를 감사합니다. 먼저 폴더 구조를 파악하고(Step 1.5 — 폴더 이름을 가정하지 않습니다), 이후 모든 수정안을 항목별로 함께 검토합니다. 각 단계는 작업(task)으로 표시됩니다.
Proceed into Step 0.5.
Step 0.5 — Create the visible task list (TaskCreate)
This is mandatory. People running this skill on their second brain need to see what's happening — silent is unacceptable for a long-running vault audit.
Create one task per stage + one task per framework, in order. Use TaskCreate with explicit short titles. The user watches them tick through.
[ ] .md 파일 발견 및 분류 (Step 1)
[ ] 역할 발견 — 의미 기반 폴더/파일 분류, 이름 하드코딩 없음 (Step 1.5)
[ ] F1 Anthropic CLAUDE.md — CLAUDE.md 읽고 후보 판단
[ ] F2 Karpathy 위키 — 위키링크·고아 노트·스키마
[ ] F3 Caveman — 지시층 파일 압축
[ ] F4 Chroma Context Rot — 길이·방해요소·위치
[ ] F5 Anthropic Memory — 파일 크기·이름·인덱스
[ ] F6 Progressive Disclosure — SKILL.md 계층화
[ ] G7 위생 — em대시·프론트매터·H1·한국어 문체
[ ] F8 Reflection — 파일 간 종합 클러스터링·판단
[ ] F9 아키텍처 — 라우팅 진위·Plot.md 존재·탐색성 워크
[ ] 발견 집계 + 아키텍처 읽기 (Step 3 / 3.5)
[ ] 모든 발견을 적용/계획저장으로 워크 (Step 4)
[ ] 승인된 수정 적용 (Step 5)
[ ] 대시보드 렌더링 + 열기 (Step 6)
Mark
when entering a stage;
when leaving it. For long frameworks (F2, F8, F9) emit a sub-update mid-run via TaskUpdate or a single chat line so the user knows progress.
Skipping the task list to "save time" defeats the purpose of this skill. The visible task list is non-optional.
Step 1 — Discover & classify every file
1.1 — Universal glob (every file audited)
bash
find . -name '*.md' \
-not -path '*/.git/*' \
-not -path '*/.obsidian/*' \
-not -path '*/.trash/*' \
-not -path '*/.claude/worktrees/*' \
-not -path '*/node_modules/*' \
-not -path '*/dist/*' \
-not -path '*/build/*'
No role-based skips. No "templates skipped", no "Daily skipped", no "Onboarding skipped". Every
outside the technical skip list above gets audited against every framework rule that applies to its role. Classification routes the right rules to the right files; classification does NOT exclude files.
1.2 — Classify each file by role (first match wins) — hints only
The patterns below are
hints that bias the role registry built in Step 1.5. They're not authoritative — Step 1.5 reads sample content to confirm role assignments. A file matching
outside any daily-shaped folder will not be classified
if Step 1.5 finds no daily role; it'll be a regular note.
For backwards compatibility with vaults that do use the conventional names, the patterns still apply; for vaults that don't, Step 1.5 takes over.
| Role | Detection |
|---|
| or (cwd root only) |
| any other / in subfolders |
| files inside |
| files (anywhere) |
| (case-insensitive) |
| (case-insensitive) |
| matches inside any |
| inside or filename matches \d{4}-\d{2}-\d{2} - .+\.md
outside |
| inside or files >100KB |
| inside |
| inside or filename ends |
| inside any (case-insensitive) |
| everything else |
Build the classification map:
json
{
"root_claude": "./CLAUDE.md",
"folder_claudes": [...],
"claude_rules": [...],
"skills": [...],
"indexes": [...],
"readmes": [...],
"dailies": [...],
"meetings": [...],
"transcripts": [...],
"decisions": [...],
"templates": [...],
"context_files": [...],
"notes": [...],
"by_folder": {...},
"stats": {"total_files": N, "total_bytes": B, "folders": F}
}
1.3 — Build supporting indexes (used by F2/F4)
| Index | Built from | Used by |
|---|
| every basename, lowercased, with and without extension | F2.2, F2.4 |
| grep across vault for `[[name(| | ] |
| root CLAUDE.md routing/knowledge-routing section | F2.6 |
| | F2.6 |
| per-file H2/H3 list with line numbers + byte sizes | F3.6, F5.2 |
| per-file map of code/URL/path/frontmatter/wikilink spans | F3.x, G7.1 |
1.4 — Show classification summary in chat (one block, before any framework runs)
markdown
## 📋 Discovery — {N} markdown files across {F} folders, {B-formatted} total
|---|---:|
| Root CLAUDE.md | 1 |
| Folder CLAUDE.mds | {n} |
| Skills (SKILL.md) | {n} |
| .claude/rules | {n} |
| Indexes / READMEs | {n} |
| Context files | {n} |
| Notes | {n} |
| Dailies | {n} |
| Meetings | {n} |
| Transcripts | {n} |
| Decisions | {n} |
| Templates | {n} |
**Framework targets (every file in scope is audited):**
- F1 Anthropic CLAUDE.md → {n} CLAUDE.md files
- F2 Karpathy Wiki → {n} content notes (notes + context + decision + meeting + index + readme) + 1 schema doc check
- F3 Caveman → {n} instruction-layer files (CLAUDE.md + SKILL.md + .claude/rules + skill references)
- F4 Chroma Context Rot → {N} files (every `.md`)
- F5 Anthropic Memory → {N} files (every `.md`)
- F6 Progressive Disclosure → {n} skills
- G7 General Hygiene → {N} files
- F8 Reflection → {n} files in discovered curated-layer roles + {n} files in discovered session-layer roles ({window} window) for cross-vault synthesis
- F9 Architecture → routing table ({n} entries), {n} folders for index presence + freshness against the discovered convention, full navigation graph for discoverability, vault-specific orientation built from the discovered identity-layer
Running role discovery (Step 1.5) now…
Step 1.5 — Role discovery (semantic, not name-based)
This step replaces every hardcoded assumption about folder/file names. The pass files reference
roles (
,
,
,
,
,
,
,
,
,
,
). Step 1.5 discovers what folder/file in
this vault plays each role — or records that the role is absent.
1.5.1 — How discovery works
For each abstract role, the agent does the following — in order — until something resolves:
- Read folder names + Plot/README/index/CLAUDE files at the top level, then top-2-deep. Build a candidate list: which folders look like they could play this role based on name + their own description?
- Read 3–5 sample files per candidate folder. Does the content match the role's purpose?
- Score and pick. Highest-confidence candidate wins. If no candidate clears medium confidence → role is .
The agent does
not privilege a specific folder name.
,
,
,
,
, or a frontmatter section on root CLAUDE.md can all play the
role. The agent decides by reading.
1.5.2 — Standard roles (patterns the agent recognizes)
These are patterns, not an exhaustive taxonomy. Every folder/file gets classified — these standard roles match the common shapes; anything that doesn't match becomes a custom role (Step 1.5.3).
| Standard role | Default layer | What it is | How to recognize it |
|---|
| curated | Files describing the user/operator (who they are, what they do, voice, preferences) | First-person bio content; mentions of role/title; voice or style guidelines |
| curated | Folder(s) holding canonical knowledge about the user's world (business, strategy, brand, team, stakeholders) — broader than identity | Declarative present-tense facts about the operating environment; named entities (company, products, key people) |
| curated | Active or recent work units | Folder names matching projects mentioned in identity/context; per-folder index describing scope, status, deadlines |
| curated | Persistent decision records | Files with date prefixes containing decision language ("decided", "chose", "going with") |
| session | Per-day journals or logs | Filenames matching ; folder organized by date hierarchy |
| session | Meeting notes | Filenames with date + person/topic; content with attendee lists, action items |
| session | Raw call/voice transcripts | >100KB files with monologue/dialogue formatting |
| curated | Reference library (prompts, frameworks, swipe files, templates) | Reusable assets, not project-specific; often nested by category |
| curated | Skill / SOP / playbook content the user owns | files, or markdown describing repeatable processes/playbooks |
| archive | Intentionally deactivated content | Folder named archive/old/deprecated/_archive, or files marked archived in frontmatter |
| (meta) | The user's chosen per-folder index file name | Most-frequent filename across folders that functions as an index (, , , , , etc.) |
1.5.3 — Custom roles (every other folder)
After standard-role discovery, every remaining top-level folder and every meaningful subfolder must be classified, not ignored. For each unclassified folder:
- Read the folder's index file (under the discovered convention) if present.
- Sample 3–5 files in the folder. Read first 1500 chars + headers.
- Read the parent folder's index (if any) to see how this folder is described upstream.
- Assign a custom role:
- — a slug derived from the folder name plus content (e.g., with prototype-build content → role name ; with idea-incubation content → ).
- — one of (canonical, durable), (ephemeral, time-stamped), (deactivated), (tooling, system files), (agent could not confidently classify).
- — 1-line description of what the folder holds.
- .
confidence: high | medium | low
.
If the agent cannot confidently assign a layer (confidence low) → emit an F9.0 finding asking the user to clarify the folder's purpose during walk. The answer persists in the registry going forward.
Custom roles are first-class. F8, F9, and the per-finding fixers operate on roles by
layer, not by membership in the standard-role list. A custom
role with
participates in F8's curated-layer synthesis exactly like the standard
role.
1.5.4 — Output: the role registry
Build this once, cache for the rest of the run, and persist to
at end of Step 1.5 so future runs start from confirmed assignments instead of re-prompting:
json
{
"vault_root": "./",
"discovered_at": "2026-05-08T14:23:00Z",
"folder_index_convention": {
"name": "README.md",
"confidence": "high",
"evidence": "23 of 31 non-trivial folders have README.md",
"coverage": 0.74
},
"roles": [
{"name": "identity", "path": "./About/me.md", "kind": "file", "layer": "curated", "is_standard": true, "confidence": "high", "purpose": "Operator bio + voice"},
{"name": "context", "path": "./Knowledge/", "kind": "folder", "layer": "curated", "is_standard": true, "confidence": "high", "purpose": "Org/strategy/brand canonical knowledge"},
{"name": "projects", "path": "./Work/", "kind": "folder", "layer": "curated", "is_standard": true, "confidence": "high", "purpose": "Active and recent work units"},
{"name": "daily", "path": "./Journal/", "kind": "folder", "layer": "session", "is_standard": true, "confidence": "medium", "purpose": "Per-day journal entries"},
{"name": "resources", "path": "./Library/", "kind": "folder", "layer": "curated", "is_standard": true, "confidence": "high", "purpose": "Prompts, frameworks, templates"},
{"name": "archive", "path": "./_archive/", "kind": "folder", "layer": "archive", "is_standard": true, "confidence": "high", "purpose": "Deactivated content"},
{"name": "building", "path": "./Building/", "kind": "folder", "layer": "curated", "is_standard": false, "confidence": "high", "purpose": "Active prototype builds and experiments"},
{"name": "garden", "path": "./Garden/", "kind": "folder", "layer": "curated", "is_standard": false, "confidence": "medium", "purpose": "Long-form essays in slow incubation"},
{"name": "inbox", "path": "./Inbox/", "kind": "folder", "layer": "session", "is_standard": false, "confidence": "high", "purpose": "Unprocessed capture; aged out into Garden or Resources"}
],
"missing_standard_roles": ["decisions", "meetings", "transcripts"],
"low_confidence_roles": ["garden"],
"unconfirmed_custom_roles": []
}
1.5.5 — Show the discovery summary in chat (one block)
Frame this as "here's the structure I see in your vault" — not "here's what's missing from a checklist." The user's structure is the source of truth; the BenAI standard taxonomy is just one of the lenses the agent uses to recognize patterns.
markdown
## 🔍 Your vault structure — {N_folders} folders classified
|---|---|---|---|---|
| ./About/me.md | identity | curated | Operator bio + voice | high |
| ./Knowledge/ | context | curated | Org/strategy/brand | high |
| ./Work/ | projects | curated | Active and recent work | high |
| ./Journal/ | daily | session | Per-day journal | medium |
| ./Library/ | resources | curated | Prompts, frameworks, templates | high |
| ./_archive/ | archive | archive | Deactivated content | high |
| ./Building/ | building (custom) | curated | Active prototype builds | high |
| ./Garden/ | garden (custom) | curated | Long-form essays in slow incubation | medium |
| ./Inbox/ | inbox (custom) | session | Unprocessed capture | high |
**Folder-index convention I detected:** README.md (74% coverage)
I'll audit this structure as it stands. F9.0 may suggest specific structural improvements where I see concrete evidence they'd help your vault (not just because BenAI uses them) — you'll review each suggestion in walk. Confirmed assignments persist to `.claude/vault-roles.json`.
Running F1 now…
The summary frames what the user has first. F9.0 findings about gaps appear later in the walk, with reasoning grounded in observed problems — not as a deficiency table at discovery time.
1.5.6 — Hard rules for downstream frameworks
- Frameworks reference roles by layer, not by name. F8's curated layer = every role with (standard or custom). F8's session layer = every role with . F9 walks every folder regardless of role membership.
- Custom roles participate in every framework that operates on their layer. If is , F8 looks at for merge candidates, contradictions, themes, and promotions exactly like .
- Missing roles never block a framework. If is missing, F8 proceeds without it; F9.0 produces a finding suggesting the user create one (or assign the role to an existing custom folder).
- The folder-index convention is what F9.2 enforces — not Plot.md by default. If the user's vault uses README.md, F9.2 generates/refreshes README.md. If no convention exists, F9.0 proposes adopting one.
- Persisted registry is read at the start of Step 1.5. If exists from a prior run, the agent loads it as the baseline and only re-classifies new folders or folders the user flagged for re-review. Confirmed assignments don't re-prompt every run.
- No framework hardcodes folder paths or file names. Examples in pass files are illustrative; runtime resolves through the registry.
Step 2 — Iterate frameworks F1 → F9 with judgment
This is not a regex pass. For each framework, read its pass-implementation file, then apply every check it defines to the files in that framework's scope. Triggers in the pass files surface candidates; the agent reads context and judges each candidate before producing a finding. Every finding includes
specific to the case.
Why: a regex match on
flags "just run X" (where "just" is doing real work — contrasting with running multiple) the same as "It's just a quick check" (where it's filler). Only an agent reading the line in context can tell which is which. The same applies to "be careful" (sometimes a closing reminder, sometimes a vague platitude),
(sometimes earned, sometimes inflation),
+
(sometimes overlapping, sometimes intentionally separated), and most other framework signals.
2.1 — For each framework F1, F2, F3, F4, F5, F6, G7, F8, F9 (in this order)
F8 runs second-to-last (cross-file synthesis). F9 runs last because it consumes the structural picture F1–G7 produced and operates on the largest blast radius (whole-vault structural reasoning, Plot.md generation, reorg proposals). Running them last keeps fix application ordered smallest-to-largest in Step 5.
Update the TaskCreate task for the current framework to
before starting it;
when its findings are logged. Mid-framework sub-updates allowed for long runs (F2, F8, F9).
For each framework:
-
Read the pass-implementation file for that framework (e.g.,
references/passes-anthropic-claude-md.md
for F1). Cache it for the duration of the framework run.
-
Determine the file scope from the table at the top of this SKILL.md (e.g., F1 = every CLAUDE.md; F6 = every SKILL.md; F4/F5/G7 = every
).
-
For each check in the pass file:
- Apply the trigger heuristic (regex / metric / structural pattern) to surface candidates fast. Some checks have no trigger — the file itself is the candidate.
- For each candidate, read the surrounding 5–15 lines with the tool, then apply the agent-judgment criteria the pass file lists. Read other files (linked targets, sibling clusters, the file's index) when judgment requires it.
- Decide: does this case actually violate the framework rule in this file's specific context? Or is it a false positive (the pass file lists common ones to skip)?
- If real → produce a finding. If not → drop it; the trigger was a candidate, not a verdict.
- Every finding includes a field (1–2 sentences specific to this case, not a generic restatement of the rule).
-
Run the framework's vault-wide checks (using indexes from Step 1.3): orphan detection, dead wikilinks, distractor pairs, schema compliance, etc. — see each pass file's "vault-wide" sections.
-
Emit one progress line when the framework completes:
F1 Anthropic CLAUDE.md — read 14 CLAUDE.md files, judged 312 candidates → 22 findings (5 fail · 17 warn)
The
count vs
count is a sanity check: if they're roughly equal, the run was lazy (regex candidates became findings without judgment); if
≫
, judgment is filtering false positives — that's the intended behavior.
2.2 — Reasoning sanity gate (per framework)
After completing each framework's run, sample 5 random findings (or all findings if < 5). Read each one's
field. If > 40% of sampled reasonings are paraphrases of the rule rather than case-specific judgment ("This file uses too many em dashes" — paraphrase; "These em dashes appear in callout headers where the writer was substituting for colons; replacing with colons preserves the cadence" — judgment),
stop and re-run that framework with deeper reads.
This is a hard gate. The skill's value is judgment, not regex. Shipping a framework's findings without enforcing this gate is a bug.
2.3 — Finding schema (every framework, every path)
json
{
"framework": "F1",
"check_id": "F1.2",
"check_name": "Specificity heuristic",
"path": "./Projects/foo/CLAUDE.md",
"line": 42,
"severity": "warn",
"excerpt": "Be careful with auth",
"reasoning": "This rule sits in the top half of a CLAUDE.md that's otherwise a routing index — there's no specific auth boundary, file path, or function named anywhere else. As a primary rule it falls into the 35%-compliance bucket; either anchor it to a specific path/function or remove it.",
"action": "Either delete or rewrite as 'All /api/admin/* routes must call requireAdmin() from src/auth/middleware.ts'.",
"fixable": false,
"fixed": false,
"citation": "anthropic-claude-md.md → Specificity beats vagueness"
}
The
field is mandatory. Every finding has it.
Every finding ships a fix. The pass file always emits
. Old
"manual review" findings are gone — checks that historically went flag-only (F1.x, F4.x, F5.x) now ship walk-only fix proposals like every other framework.
The
field is set by
Step 5 after the user walks each finding. Possible values:
- → fix executed this run (green FIXED pill)
- → fix written into
Intelligence/decisions/{date}-reorg.md
for staged execution (blue SAVED pill)
- → user explicitly chose not to fix this item in walk (grey DECLINED pill)
- → fix attempted but failed safety check (red FAILED pill, with )
There is no "skipped" or "deferred" state. Either the fix was applied, saved as a planned step, declined explicitly per-item, or failed mechanically. Open warnings do not survive the run.
Step 3 — Aggregate findings + compute score
For each framework F1–F8, count: total findings, severity breakdown (fail/warn/info), fixable count, files touched.
Score formula (framework-weighted)
For each framework F1..G7:
deduction = (fail_count × 5) + (warn_count × 1)
capped_deduction = min(deduction, 25)
score = max(0, 100 - sum(capped_deduction for F1..G7))
F8 and F9 do not affect the score. F8 surfaces synthesis opportunities; F9 surfaces structural/discoverability changes. Both are optimization opportunities, not lint failures — counting them would conflate "vault hygiene" with "vault could be reorganized." Track F8 in an "Insights surfaced / applied" tile and F9 in an "Architecture changes / proposed / applied / saved-to-plan" tile.
| Score | Interpretation |
|---|
| 90–100 | 잘 다듬어짐. 월 1회 감사 권장 |
| 70–89 | 드리프트 감지됨. 상위 발견 항목부터 처리 |
| 50–69 | 비대화가 성능을 해치는 중 |
| <50 | 볼트 부패. 대대적 정리 필요 |
After scoring, do not render a long markdown summary in chat. Emit one short block:
✅ 9개 프레임워크 모두 적용 완료.
| 프레임워크 | 파일 | 체크 | 발견 | Fail | Warn | 제안된 수정 |
|---|---:|---:|---:|---:|---:|---:|
| F1 Anthropic CLAUDE.md | … | … | … | … | … | … |
| F2 Karpathy Wiki | … | … | … | … | … | … |
| F3 Caveman | … | … | … | … | … | … |
| F4 Chroma Context Rot | … | … | … | … | … | … |
| F5 Anthropic Memory | … | … | … | … | … | … |
| F6 Progressive Disclosure | … | … | … | … | … | … |
| G7 Hygiene | … | … | … | … | … | … |
| F8 Reflection | … | … | … | … | … | … |
| F9 Architecture | … | … | … | … | … | … |
| **TOTAL** | … | … | … | … | … | … |
Score: {score_before}/100 (F8 + F9 not scored). Walking the architectural read next…
Step 3.5 — Architectural read (the synthesis paragraph)
Before walking fixes, write a short architectural read of the vault — top 1–3 things wrong with the structure as a whole, with reasoning grounded in
. This is the layer the user explicitly asked for: the agent demonstrating it understood what the vault means, not just what it failed.
Format:
markdown
### Architectural read
{1–3 short paragraphs. Each paragraph: one structural observation, why it matters for *this* user's world (cite Context/), the F9 finding(s) that surfaced it, the proposed direction.}
This paragraph also goes verbatim into the HTML dashboard (above the framework rows) so it's the first thing the user sees when they open the report. Keep it under 250 words total — synthesis, not a recap of findings.
If the agent cannot identify a structural observation worth surfacing (the vault is well-organized): write one sentence saying so, citing the F9 metrics that justify the assessment. Don't pad.
Step 4 — Walk every finding through apply-now / save-to-plan
Every finding ships a fix proposal. Step 4 walks the user through them. There is no "skip this framework," no "flag only," no "fix later." Each finding ends in one of four explicit states:
,
,
, or
.
4.1 — One opening AskUserQuestion (the apply gate)
Before walking, fire one
:
"Audit complete: {N_total} findings across 9 frameworks ({fail} fail · {warn} warn · {info} info). Every finding has a proposed fix. Pick mode:"
Options:
- Bulk-apply (apply everything, no escapes) — every finding gets applied. Walk prompts only fire where the agent genuinely needs the user to pick a target/wording (e.g., "merge target: A or B?"). All else applies without per-item confirmation. The only valid non-applied state is (mechanical: OS lock, file conflict, dependency missing). No , no . Use this when you've said "apply everything."
- Selective walk — fire a per-finding prompt for every fix; user picks apply / save-to-plan / decline per item. Use when reviewing carefully or for a first run on a new vault.
- Save everything to plan — write all proposed fixes as checklist steps into the discovered decisions-equivalent folder; no edits applied this run.
- Cancel — abort before any fixes.
Option 1 is the default. The user picks 2 only when they want item-by-item gating. The user's prior instruction "apply everything" maps to Option 1, not Option 2.
4.1.1 — Bulk-apply mode rules (Option 1)
Hard rules when this mode is active:
- No outcomes. That state is removed from the available set.
- No outcomes. Same.
- The agent does not unilaterally decide a finding is "test fixture," "the user probably didn't want this," "too complex to apply mechanically," or "judgment-required-per-section" and route it to anything other than applied/failed. If applying a fix mechanically would damage content, the agent attempts the safest mechanical version (e.g., split a 222KB file at H2 boundaries with a
<!-- automated split, review headings -->
marker; mark the split as with applied_with_caveat: true
).
- Walk prompts fire only when the agent genuinely cannot pick a target without the user. Example: F8.2 merge with three plausible canonical targets — fire the prompt. Example: G7.1 em-dash substitution — apply without prompting; the agent's per-occurrence reasoning already chose the substitution.
- Mechanical failures are still recorded as with (OS-locked file, missing parent directory, file conflict, framework-safety check rolled back the fix). Failed fixes are reported in the dashboard with their reason — they're not silently skipped.
- The agent must not pre-classify findings as "skip in bulk-apply mode." Every finding is in scope. If applying a daystar/ test-fixture fix damages a deliberate test pattern, the user can revert that file specifically — but the agent doesn't make that call.
4.2 — Per-finding walk loop
Order: F1 → F2 → F3 → F4 → F5 → F6 → G7 → F8 → F9. Within F8/F9, smallest blast radius first (per pass file).
For each finding:
- Show the finding compactly in chat: path, severity, 1-line excerpt, the proposed fix's or migration step.
- Fire AskUserQuestion with the per-finding-type sub-prompt:
| Finding type | Sub-prompt options |
|---|
| Mechanical (G7.1 em dashes, G7.3/F1.10 duplicate H1) | Apply now / Decline this item / Apply all remaining of this type without asking |
| Wikilink repoint (F2.2) | Apply with target [X] / Pick a different target / Decline |
| Cross-ref add (F2.4) | Apply / Edit linked-file list / Decline |
| Caveman substitution (F3.1–F3.4 per file) | Apply all in this file / Walk substitutions in this file / Decline this file |
| Skill-vault dedup (F6.11) | Apply / Decline |
| CLAUDE.md edit (F1.x) | Apply drafted edit / Edit text first then apply / Save to plan / Decline |
| Memory split / rename (F5.1, F5.3) | Apply with proposed split-points or filename / Edit then apply / Save to plan / Decline |
| Context-rot reorg (F4.3, F4.4, F4.6, F4.7) | Apply drafted reorder / Edit text / Save to plan / Decline |
| Reflection — contradiction (F8.1) | Winner: [A] / [B] / [neither — defer to a third source] → Apply rewrite to loser / Edit text / Decline |
| Reflection — merge (F8.2) | Canonical: [A] / [B] / [C] → Confirm merge + redirect + archive / Save to plan / Decline |
| Reflection — stale (F8.3) | Apply rewrite / Edit text / Decline |
| Reflection — theme (F8.4) | Create at [proposed path] / Pick a different path / Edit content first / Decline |
| Reflection — promotion (F8.5) | Destination: [proposed] / [pick other] → Apply append + leave wikilink stub / Decline |
| Routing rewrite (F9.1) | Apply drafted entry / Edit text / Decline |
| Plot.md generation (F9.2) | Apply drafted Plot.md / Edit Purpose line + descriptions first / Decline |
| Discoverability fix (F9.3) | Add to Plot.md / Add routing entry / Move file / Archive / Decline |
| Misplaced file (F9.4) | Move to [proposed folder] / Pick different folder / Broaden current folder's Plot.md instead / Decline |
| Folder duplication (F9.5) | Merge into [A] / Merge into [B] / Clarify Plot.md purposes on both / Save to plan / Decline |
| Reorg proposal (F9.6) | Apply now (walk migration steps) / Save to plan (write to {date}-reorg.md) / Decline |
| Orientation gap (F9.7) | Apply drafted CLAUDE.md edit / Edit text first / Save to plan / Decline |
Every option reaches a terminal state for this finding. There is no "skip" option that leaves the finding open. "Decline" is recorded as an explicit user decision and shown in the report — it's a decision, not a deferral.
- Update the finding's ( / / ) and any chosen by the user.
- TaskUpdate the current framework's task with a progress note every 10 findings.
4.3 — Save-to-plan file format
Save-to-plan path resolution (uses the role registry):
- If is set → save under
{decisions.path}/{YYYY-MM-DD}-reorg.md
.
- Else if any folder matches , , (case-insensitive) → use that.
- Else create at vault root and save there. Note the missing decisions role to F9.0 — the user gets a fix proposal to formalize a decisions-equivalent folder.
When findings are routed to save-to-plan, append checklist entries to the resolved path:
markdown
---
status: pending
type: reorg-plan
tags: [optimizer, plan]
date: 2026-05-08
source: os-optimizer run 2026-05-08T14:23:00Z
---
# Vault reorg plan — 2026-05-08
Generated by os-optimizer. Each item is a fix proposal saved for staged execution. Walk them when ready.
## F9.6 Reorg proposals
- [ ] **Merge `Notes/` into `Resources/notes/`** — F9.5 finding cluster: both folders hold scratch with 38% file-name overlap. Migration:
- Move 12 files from `Notes/` to `Resources/notes/`.
- Redirect 4 inbound wikilinks.
- Update root CLAUDE.md routing entry to remove `Notes/`.
- Delete empty `Notes/` directory.
- Reasoning: `Resources/notes/` Plot.md states it holds reference notes; `Notes/` Plot.md states the same. Per `Context/me.md`, the user's stated convention is one resource library — keeping two is structural drift.
## F8.2 Merge candidates
- [ ] **Merge `Notes/2026-q1-strategy.md` and `Projects/positioning/research/strategy-thoughts.md` into `Context/strategy.md`** — F8.2 finding. Steps: …
(continues per saved finding)
The plan file is itself audited next run — F1/G7 conventions apply.
4.4 — Failure to walk
If the agent skips a finding (forgets to fire its sub-prompt, batches multiple findings into one prompt, or treats "no answer" as decline) — that's a bug. Walk every finding individually. The visible task list catches this: if a framework's task moves to
while findings remain unwalked, the verification step in 5.7 will flag it.
Step 5 — Apply approved fixes (set per finding)
Apply in this order (smallest blast radius first). For every finding, set
to
,
,
, or
based on what happened in Step 4 + this step. The HTML render uses
directly.
Save-to-plan items are written to
Intelligence/decisions/{date}-reorg.md
in Step 4.3 — this step (5) only handles the items the user picked "apply now" for. (In Bulk-apply mode there are no save-to-plan items.)
5.0 — Capture BEFORE metrics (mandatory, before any fix lands)
Before applying any fix, snapshot per-role and per-framework metrics into the
cache. These are what the dashboard's before/after columns render against.
Per-role metrics (one row per role in the registry, plus a TOTAL row):
- (sum of body bytes, post-frontmatter)
- (한국어 공식:
(한글글자수 × 1.5) + (그외글자수 × 0.25)
— 오버라이드 1. 아님)
- (G7.1 trigger output)
- (files with + ≥2 / total)
- (no inbound wikilink)
- (folders with the discovered folder-index file / non-trivial folder count)
- (count of findings touching files in this role)
Per-framework metrics (F1–F9 + TOTAL):
- , ,
- (starts at 0)
- (starts at 0)
- (per the Step 3 formula; F8/F9 always 0)
Cache these. Apply fixes (5.1–5.8). Then run 5.9.
5.1 — Em dashes (G7.1)
- For each finding: replace → , → in stripped body only.
- Re-strip protected zones after; if any code/URL/wikilink was touched → revert that file's change AND set with .
- Use with per file.
- Set on every G7.1 finding whose file was successfully fixed.
5.2 — Duplicate H1 (G7.3 / F1.10)
- Remove the H1 line and any blank line immediately following.
- Use . Set .
5.3 — Wikilink fixes (F2.2)
- For each finding the user approved (bulk = top-1 suggestion, walk = chosen target): replace with the picked replacement.
- Preserve surrounding text byte-for-byte.
- Mark per finding fixed; for any skipped or low-confidence ones the user said no to.
5.4 — Skill-vault rewrites (F6.11)
- Update SKILL.md to read the vault path instead of the duplicate ref.
- Grep the rest of the skill folder for the duplicate ref filename.
- If still referenced → surface conflict, skip deletion, set .
- Otherwise → the duplicate, set .
5.5 — Caveman substitutions (F3.1, F3.2, F3.3, F3.4) — only if user opted in per file
- Apply substitution table from
references/passes-caveman.md
to the stripped body.
- Re-strip protected zones; if any was modified → abort the fix on that file, report, set for that file's findings.
- Mark on every F3.x finding for files the agent successfully substituted.
5.6 — Reflection fixes (F8.1, F8.3, F8.2, F8.4, F8.5) — walk-only, per-item user-confirmed targets
Apply F8 fixes last (largest blast radius). Order within F8 is smallest-to-largest:
- F8.1 contradictions — for each approved finding: rewrite the loser file. Either replace contradicted line with
See [[Winner]] for current state.
(defer mode) or delete the line entirely (drop mode); the user picks per item in Step 4. Use . Set .
- F8.3 stale entries — for each approved finding: rewrite the curated entry with the new state. Append section with the prior wording if it has decision context (per pass file rule). Add wikilink to superseding source. Set .
- F8.2 merge candidates — for each approved cluster:
- Concatenate unique sections from sources into the canonical target (skip duplicate paragraphs).
- Re-check size against F5 budget. If merged file > 10KB → abort the merge, set , surface as flag-only with the abort reason in .
- Grep the vault for and patterns; replace each with (or ).
- Verify zero new dead wikilinks (run F2.2 trigger on every file touched). If any new dead link surfaced → roll back this finding's fix, set .
- Move source files to
Intelligence/archive/{YYYY-MM-DD}-merged/
. Use .
- Set .
- F8.4 emergent themes — for each approved finding:
- Create the new file at the user-chosen path (default or
Resources/{theme-slug}-MOC.md
).
- Frontmatter must include , , , (G7.2 compliance) and contain no em dashes (G7.1).
- Body: 1-line definition, 3–5 key points, wikilinks back to every source note in the cluster.
- Set .
- F8.5 promotions — for each approved finding:
- Append the durable content to the chosen destination (, , or ).
- In the source file, replace the original lines with .
- Set .
Cross-framework safety check after every F8 fix:
- Re-strip protected zones on every file written. If any code/URL/wikilink/path/frontmatter was modified outside the intended edit → roll back, set .
- If the touched file targets a CLAUDE.md or claude.md → abort (this should have been caught in Step 4 as flag-only, but defense in depth).
- If the touched file's size now exceeds F5's 10KB recommended budget → record the violation in ; the next audit run will surface it as F5 flag-only (don't roll back, but log).
5.7 — Architecture fixes (F9.1, F9.2, F9.3, F9.4, F9.5, F9.6, F9.7) — walk-only, per-item user-confirmed targets
Apply F9 fixes after F8. Order: smallest blast radius first.
- F9.1 routing rewrites — for each finding: the root CLAUDE.md routing table with the user-confirmed line(s). Per-item only; no batch rewrites. This is the single legitimate path for editing a CLAUDE.md (per-item user approval).
- F9.2 Plot.md generation / regeneration — for each finding:
- If missing: the agent-drafted Plot.md (user already confirmed Purpose + child descriptions in walk).
- If stale: to update the Children list; preserve any user edits to Purpose if not deprecated.
- Verify size ≤ 8KB; verify G7.1 (no em dashes) and G7.2 (frontmatter complete).
- F9.3 discoverability fixes — for each finding, apply the user-chosen repair:
- "Add to Plot.md" → the parent Plot.md.
- "Add routing entry" → root CLAUDE.md routing.
- "Move file" → ; redirect inbound wikilinks (same as F8.2 mechanic).
- "Archive" → to .
- F9.4 misplaced files — to user-chosen folder. Update source folder's Plot.md (remove child) and target folder's Plot.md (add child). Redirect inbound wikilinks.
- F9.5 folder duplication — for "merge into" findings: walk through file moves one at a time (each is its own micro-step). For "clarify Plot.md purposes" findings: both Plot.mds.
- F9.6 reorg proposals — only here if the user picked "apply now"; save-to-plan ones are already in the dated reorg file. For apply-now: walk each migration step in the proposal as its own micro-finding (move X, rename Y, update routing entry Z), each confirmed individually before execution.
- F9.7 orientation gap — root CLAUDE.md with the agent-drafted section the user confirmed. Per-item only.
Cross-framework safety check after every F9 fix:
- Re-run F2.2 trigger on every file touched. If new dead wikilinks appeared → roll back that fix, set .
- Re-check root CLAUDE.md size against F1.1 budget after F9.1 / F9.7 edits. Over budget → record in ; the next audit run will flag F1.1.
- Plot.md writes must pass G7.1 + G7.2 + F5 (≤ 8KB) by construction; if any check fails → roll back, .
5.8 — Generic per-item fix runner (F1.x, F4.x, F5.x — previously flag-only)
For findings whose checks historically didn't have a specialized fix procedure (most of F1, F4, F5), the runner is generic:
- Read the file.
- Apply the agent-drafted from the finding (the user already confirmed or edited it in Step 4.2).
- Re-strip protected zones; if any code/URL/path/frontmatter outside the intended edit was modified → roll back, .
- If the file is a CLAUDE.md → only proceed if came through walk-with-explicit-confirmation (Step 4.2). Never bulk-apply CLAUDE.md edits via this runner.
- Set on success.
This runner handles, e.g.:
- F1.2 vague rule rewrite or deletion
- F1.5 platitude deletion
- F1.7 reorder for position effect
- F4.3 critical-info reorder
- F4.4 lead-in preamble removal
- F5.1 file split (split file at agent-suggested headers; user confirmed split-points in walk)
- F5.3 filename rename via + inbound wikilink redirect
The fix sub-procedure can vary per finding type — what stays constant is: read → apply confirmed edit → safety check → status. The pass file's per-check guidance still constrains what the agent drafts.
5.9 — Capture AFTER metrics (mandatory, after every fix)
After Step 5.1–5.8 finish, re-measure the same metrics captured in 5.0. This is the source of truth for the dashboard's AFTER columns and the recomputed score. Skipping this step is the bug that produced the 46/100 BEFORE-only render — never skip it.
Re-measure:
- Per-role metrics (re-run the same probes from 5.0 — files may have been split, em dashes stripped, frontmatter added).
- Per-framework metrics (recount findings against the current vault state — many findings should now resolve to zero because their underlying issue was fixed).
- Recompute the score using the formula in Step 3, against the re-measured findings count. This is . Do not reuse the BEFORE score.
- Compute deltas: , , ,
findings_resolved_per_framework
.
If the re-measurement shows a finding category whose count increased (e.g., a fix accidentally added new orphans), surface that as a regression-warning row in the dashboard — the fix succeeded mechanically but produced a downstream issue.
The re-measurement should take seconds, not minutes — same probes as Step 1 + the framework triggers, but only on files touched by Step 5 plus the small global counts (em dashes vault-wide, frontmatter coverage). Cache for Step 6.
5.10 — Verify fix-status totals add up
After applying:
- = findings with .
- = findings with
fix_status: saved_to_plan
.
- = findings with .
- = findings with .
These four should equal
.
No or unset is permitted — every finding hit Step 4 and was walked. If any finding has unset
after Step 5, the orchestrator skipped a walk; halt and surface the bug to the user before rendering. (HTML still renders correctly from per-finding flags but the skipped finding signals a Step 4.4 bug.)
Failure handling
If any fix fails (file missing, edit conflict, ambiguous match, protected-zone violation) → stop, report which item failed, ask the user how to proceed. Never silently skip a failure.
Always preserve
- Files in technical skip list (, , , , , ).
- Code fences, inline code, URLs, file paths, frontmatter keys, wikilinks, table delimiters, headings, dates, version numbers.
Step 6 — Render, save, open, and surface the HTML
6.1 — Compute per-framework metrics
Snapshot before/after per framework:
| Variable | Source |
|---|
| , , , , , , , , , , , , | F1 bucket — every count has a before/after pair so the dashboard can show the delta |
| same for F2, F3, F4, F5, F6, G7, F8, F9 | each bucket |
| Step 3.5 paragraph, rendered above the framework rows |
| , | F8-only — drives the "Insights surfaced / applied" tile |
| , , | F9-only — drives the "Architecture changes" tile (in bulk-apply mode there's no Saved/Declined column) |
| per-role before/after table (Step 6.1.5) |
{{FRAMEWORK_METRICS_TABLE}}
| per-framework before/after table (Step 6.1.5) |
| path to the saved reorg plan if any saved-to-plan items exist (selective walk only); empty in bulk-apply mode |
| count of all findings with |
| count of all findings with |
{{TOTAL_FIXABLE_NOT_FIXED}}
| count of findings with fixable: true && fixed: false
(skipped/denied) |
| , , , | sum across all frameworks |
| , , , | scoring formula before & after |
| , , | root CLAUDE.md token count before & after |
| {{TOTAL_SAVED}} × SESSIONS_PER_WEEK × WEEKS_PER_YEAR
, K/M suffix |
| (default 50) | user override if specified |
| (default 50) | — |
| , | from Step 1 |
| or title or frontmatter; fallback cwd folder name |
| , | today (YYYY-MM-DD) and ISO UTC |
For each framework's
: render the findings list as HTML (severity pills, paths, excerpts, actions, framework citation). Cap at top-25 findings per framework — if more, append "and N more flagged in {decisions-folder}/{date}-vault-audit-findings.json".
Format integers with thousands separators. Format percentages to one decimal.
6.1.5 — Per-role and per-framework before/after tables
These two tables are the dashboard's headline evidence that the run changed the vault, not just described it. Render both above the framework detail sections (between the architectural read and the framework rows).
Per-role table (
) — one row per role in the registry plus a TOTAL row:
| Role | Files | Tokens before → after | Em dashes before → after | Frontmatter complete before → after | Index coverage before → after | Findings open before → after |
|---|
| identity | 6 | 4,200 → 4,150 (-50) | 12 → 0 (-12) | 17% → 100% (+83pp) | — | 6 → 0 |
| context | 10 | 12,400 → 11,890 (-510) | 23 → 0 (-23) | 80% → 100% (+20pp) | 100% → 100% | 5 → 0 |
| projects | 14 | 8,200 → 8,200 (0) | 0 → 0 | 71% → 100% (+29pp) | 0% → 100% (+100pp) | 4 → 0 |
| daily | 241 | 145,000 → 145,000 (0) | 18 → 0 | 95% → 100% | — | 18 → 0 |
| meetings | 611 | 412,000 → 412,000 | 89 → 0 | 92% → 100% | — | 89 → 0 |
| (etc.) | | | | | | |
| TOTAL | 1,710 | 2.1M → 1.9M (-200K) | 289 → 0 | 67% → 100% | 12% → 100% | 502 → 12 |
Style each delta cell with green for improvements, red for regressions, gray for unchanged. Em dash + frontmatter columns drop "before → after" when both are 0.
Per-framework table (
{{FRAMEWORK_METRICS_TABLE}}
) — one row per framework F1–F9 plus TOTAL:
| Framework | Findings before → after | Fail before → after | Warn before → after | Info before → after | Applied | Failed |
|---|
| F1 Anthropic CLAUDE.md | 9 → 0 | 2 → 0 | 6 → 0 | 1 → 0 | 9 | 0 |
| F2 Karpathy Wiki | 4 → 0 | 1 → 0 | 2 → 0 | 1 → 0 | 4 | 0 |
| F3 Caveman | 2 → 0 | 1 → 0 | 1 → 0 | 0 → 0 | 2 | 0 |
| F4 Chroma | 1 → 0 | 0 → 0 | 1 → 0 | 0 → 0 | 1 | 0 |
| F5 Memory | 3 → 1 | 2 → 0 | 1 → 1 | 0 → 0 | 2 | 1 |
| F6 Progressive Disclosure | 3 → 0 | 1 → 0 | 2 → 0 | 0 → 0 | 3 | 0 |
| G7 Hygiene | 3 → 0 | 1 → 0 | 1 → 0 | 1 → 0 | 3 | 0 |
| F8 Reflection | 4 → 0 | 1 → 0 | 2 → 0 | 1 → 0 | 4 | 0 |
| F9 Architecture | 5 → 0 | 1 → 0 | 1 → 0 | 3 → 0 | 5 | 0 |
| TOTAL | 34 → 1 | 9 → 0 | 17 → 1 | 8 → 0 | 33 | 1 |
Score row, separately, with before → after rendered prominently:
점수(F1–G7): 46 → 97 (+51) · "볼트 부패" → "잘 다듬어짐"
These tables are the difference between "here's what we need to do" (which is what saved-to-plan/declined would have been) and "here's what was done" (which is what bulk-apply mode produces). The dashboard frames the run retrospectively.
6.2 — Build the HTML
Templates (read once, substitute many times):
| File | Used as |
|---|
references/report-template.html
| main shell |
references/report-row-template.html
| one row per framework in the summary table |
references/report-section-template.html
| one detail section per framework |
references/report-finding-template.html
| one card per finding inside a detail section |
Steps:
- Read all four templates.
- For each framework F1..F9:
- Render one row from with the framework's metrics → append to accumulator.
- For each finding (cap at top-25 per framework, ranked: fixed first, then fail before warn, then by check ID): render one card from
report-finding-template.html
→ append to that section's . HTML-escape , , and (, , , ). The field is mandatory — if the finding has no reasoning text, the skill is bugged; fail loudly.
- Compute per finding from :
- →
<span class="pill fixed">이번 실행 적용</span>
- →
<span class="pill saved">계획 저장</span>
(links to )
- →
<span class="pill declined">거절</span>
- →
<span class="pill failed">실패</span>
(with shown inline)
- If 0 findings: leave empty and substitute with
<div class="clean">✅ 모든 체크 통과. 이 프레임워크에서 발견된 문제 없음.</div>
.
- If total findings > 25: substitute with
<p class="more">…외 {N}건이 {YYYY-MM-DD}-vault-audit-findings.json에 기록됨.</p>
. Otherwise leave empty.
- Render the section from
report-section-template.html
→ append to accumulator.
- Substitute and in the main template.
- Substitute every other (header stats, score, session impact, etc.).
- Sanity pass: scan the rendered HTML for any leftover or . If any remain → fail loudly, never save a half-rendered file.
The
for each section comes from the matching framework reference's "Core thesis" — one short paragraph max. Fixed strings:
- F1: "Anthropic 가이드: CLAUDE.md는 pruning 테스트를 통과하는, 가장 작고 구체적인 지시 집합으로 유지한다. 구체적 규칙은 약 89% 준수율, 모호한 규칙은 약 35%에 그친다."
- F2: "Karpathy의 LLM 위키: 지식은 한 번 컴파일해 최신 상태로 유지한다. Lint가 끊긴 링크·고아 노트·모순·누락된 상호참조·소화되지 않은 원본을 잡아낸다."
- F3: "Caveman 압축: 모든 토큰이 주의력을 두고 경쟁한다. 에이전트가 읽는 지시층에서 군더더기·헤징·인사치레·장황한 접속어를 걷어낸다."
- F4: "Chroma context rot: 모든 모델은 길이가 늘수록 성능이 저하되고, 방해 요소가 해를 끼치며, 위치가 중요하다. 핵심 규칙을 앞에 두고 자동 로드 예산을 빡빡하게 유지한다."
- F5: "Anthropic Memory: 파일당 ≤100KB / ~25K 토큰(권장 ~2,500토큰, 한국어는 토큰 기준). 초점 잡힌 여러 파일이 하나의 거대 파일보다 낫다. 에이전트는 이름으로 탐색한다."
- F6: "Progressive Disclosure: 컨텍스트 창은 공공재다. 스킬 메타데이터는 항상, 본문은 관련 시, references는 필요 시 로드한다. references는 한 홉 깊이로 유지한다."
- G7: "프로젝트 규칙 + 현장 노트: em대시 규율, 프론트매터 준수, 파일명과 중복되는 H1 금지, README 위생. 한국어판은 한국어 문장부호 치환과 번역체·AI 문체 냄새(G7.5)까지 점검한다."
- F8: "Reflection(Anthropic Dreams 착안): 파일별 lint로는 모순·중복·오래된 가정·떠오르는 주제를 볼 수 없다. 큐레이션 레이어와 최근 세션을 함께 읽어 이를 드러내고, 사용자가 항목별로 승인하는 구체적 수정안을 제안한다."
- F9: "아키텍처 & 탐색성: 동료 클로드가 실제로 걷는 경로(루트 CLAUDE.md → 라우팅 → 폴더 Plot.md → 파일)를 따라간다. 라우팅 항목이 폴더 현실과 맞는지, 모든 폴더에 최신 Plot.md가 있는지, 모든 파일이 3홉 이내로 도달 가능한지, CLAUDE.md가 이 사용자의 세계를 실제로 안내하는지 검증한다."
6.3 — Save (uses the role registry, not hardcoded paths)
Pick the save folder via the role registry:
- is set → save there.
- Else is set + writable → save there.
- Else create at vault root and save there. Note the missing role to F9.0.
Save HTML to
{decisions-folder}/{YYYY-MM-DD}-vault-audit.html
.
Save the raw findings JSON to
{decisions-folder}/{YYYY-MM-DD}-vault-audit-findings.json
(so users can mine the full list).
Read the HTML back to confirm content present (not just file present). On mismatch → retry once → fail loudly.
6.4 — Open + render + summarize (final response, in this order)
Part 1 — open in browser. :
(macOS) /
(Linux) /
(Windows).
Part 2 — emit the full saved HTML inside an code fence. Runtimes with artifact support (claude.ai, Claude Desktop) render it as a side panel; CLI shows it as a code block (browser already opened in Part 1). This is the only place HTML appears in chat — don't dump fragments mid-run, don't paste it twice, don't wrap commentary around it.
Part 3 — summary (after the HTML, no commentary in between):
✅ Optimizer run complete — here's what changed:
Report: {decisions-folder}/{YYYY-MM-DD}-vault-audit.html
JSON sidecar: {decisions-folder}/{YYYY-MM-DD}-vault-audit-findings.json
Score (F1–G7): {score_before} → {score_after} ({delta_sign}{delta}) — "{interpretation_before}" → "{interpretation_after}"
{N} files audited · {applied_total} fixes applied · {failed_total} mechanical failures (see report for reasons)
Em dashes: {em_before} → {em_after} (-{em_delta}) · Frontmatter coverage: {fm_pct_before} → {fm_pct_after} (+{fm_pct_delta}pp) · Folder-index coverage: {idx_pct_before} → {idx_pct_after} (+{idx_pct_delta}pp)
Tokens saved: {tokens_saved} ({tokens_pct_saved}% reduction in agent-load) · ~{annual_savings} tokens/year saved at {sessions}/week
The summary frames the run retrospectively — what
was done, what
changed. In bulk-apply mode, "saved-to-plan" and "declined" lines are absent; only
and
exist. In selective-walk mode, append the saved-to-plan and declined counts as additional lines.
Stop. Do not propose follow-up actions.
Rules — what to never do
- Never assume a folder or file by name. Always resolve through the role registry built in Step 1.5. , , , , , etc. are examples in the documentation; the runtime resolves abstract roles to whatever the user actually has.
- Never ignore a folder because it doesn't fit a standard role. Every folder is classified — standard or custom — with a layer. Custom roles (, , anything user-specific) are first-class participants in every framework that operates on their layer. Skipping them defeats the discovery pass.
- Never treat the role registry as ephemeral. Persist confirmed assignments to at end of Step 1.5 so future runs start from the user's confirmed view of their vault, not from a fresh re-classification that re-prompts everything.
- Never propose a structural change purely because BenAI uses that convention. F9.0 tier-2 findings (functional improvements suggesting BenAI conventions) must cite specific evidence in this vault that the convention would resolve a real problem. F9.6 reorg proposals must cite the user's own stated folder purposes. "BenAI does X" is not a valid justification anywhere in the optimizer. The BenAI taxonomy is a recognition lens and an optional reference — never a target shape the user must conform to.
- Never drop a tier-2 finding when the user has a custom role already serving the function. If (custom curated) is already playing the projects role, no F9.0 tier-2 finding fires for "you should add a projects folder." Function over name.
- Never unilaterally decide a finding is "test fixture," "user probably didn't want this," "judgment-required-per-section," or any other agent-invented reason to route a finding to anything other than / in bulk-apply mode. The user said apply everything; that means everything. If applying is mechanically dangerous, attempt the safest mechanical version (e.g., split a 222KB file at H2 boundaries with an automated-split marker, mark
applied_with_caveat: true
). The only valid escape is mechanical failure with a recorded .
- Never render the dashboard with the BEFORE score. Step 5.9 is mandatory: re-measure after fixes, recompute score, populate and the per-role/per-framework after columns. A dashboard that shows only BEFORE-state numbers is a bug.
- Never frame the final summary as "what we need to do" in bulk-apply mode. The summary is retrospective: what changed, how much, what failed mechanically and why. Save-to-plan / declined / "for later" framings belong only to selective-walk mode.
- Never apply a change the user didn't approve via walk in Step 4.
- Never auto-rewrite a CLAUDE.md without per-item user confirmation. F1.x edits, F9.1 routing rewrites, and F9.7 orientation additions are walk-only — the user reviews and confirms each drafted edit before it lands.
- Never delete a file before grepping for references.
- Never modify files in the technical skip list (, , , , , ).
- Never apply substitutions inside protected zones (code, URLs, paths, frontmatter, wikilinks, headings, table delimiters, dates).
- Never skip a file because of its role. The classification routes rules; it never excludes files.
- Never skip a framework. F1–F9 all run every audit.
- Never leave a finding open. Every finding ends Step 5 with set to , , , or . Unset is a bug.
- Never bulk-apply semantic fixes (F2.2 wikilinks, F2.4 cross-refs, F8.x reflection, F9.1–F9.7 architecture). Every semantic fix walks per item with the user confirming target/winner/destination/wording.
- Never let F8 or F9 modify a SKILL.md or anything in . F8's scope is the curated layer; F9's scope excludes SKILL.md and .
- Never complete an F8.2 merge or F9.5 folder merge without verifying (a) merged file size against F5's per-file budget and (b) zero new dead wikilinks. Failing either rolls back and sets .
- Never generate a Plot.md that exceeds 8KB or has em dashes. If a folder's children list would push Plot.md over budget, route to F9.6 reorg proposal (split the folder) instead.
- Never delete a merge source. F8.2 / F9.5 archive sources to
Intelligence/archive/{date}-merged/
.
- Never score F8 or F9 into the health score. Both surface optimization opportunities, not lint failures; the score covers F1–G7 only.
- Never paraphrase a framework rule when surfacing a finding. Read the relevant pass-implementation file when running its checks; cite the framework in the finding. The Step 2.2 sanity gate enforces this.
- Never run silently. Step 0.5 creates the visible task list; every framework's task transitions → as the run unfolds. Skipping the task list defeats the skill.
- Never ship a half-rendered template. If any survives → fail.
- Never dump partial HTML mid-run. The full HTML appears once, at the end (Step 6.4 Part 2). Don't paste HTML twice; don't paste partial fragments while findings are being collected.
Why this skill exists
Eight frameworks plus practitioner field notes converge on one conclusion: vaults rot without active maintenance. Karpathy calls it lint. Anthropic calls it the pruning test + the memory budget. Chroma calls it context rot. Caveman calls it token discipline. Progressive disclosure calls it layering. Anthropic Dreams calls it reflection — read the curated layer alongside recent sessions and surface what per-file lint can't see. F9 adds architecture & discoverability: walk the actual co-worker-Claude path, verify routing matches folder reality, ensure every folder has a current Plot.md, and confirm every file is reachable from the root in ≤ 3 hops. The audit encodes every auditable signal as a discrete check, applies them all on every run, walks every finding through apply-now / save-to-plan / declined, and saves a categorized HTML dashboard with the agent's architectural read at the top.
Run weekly while the vault is growing. Monthly once stable. Each run appends a dated dashboard so the user can watch the score climb.
For the deep rules behind each pass, read the relevant
references/{framework}.md
and
references/passes-{framework}.md
. Each is complete on its own — TOC, full rules, exact regex, finding format, source URLs.