vault-cleanup-auditor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVault Cleanup Auditor
知识库清理审计工具
Runs 4 targeted checks against your Obsidian vault and saves a prioritized audit report to . Takes under 30 seconds. No APIs, no paid services.
vault-audit/YYYY-MM-DD-audit.mdRun it monthly or whenever the vault starts feeling messy.
针对你的Obsidian知识库执行4项针对性检查,并将按优先级排序的审计报告保存到 ,全程耗时不超过30秒,无需调用API,无需使用付费服务。
vault-audit/YYYY-MM-DD-audit.md你可以每月运行一次,或者在知识库内容变得杂乱时随时运行。
How to Use
使用方法
Open Claude Code and say:
Run the Vault Cleanup Auditor skill against my vault at /path/to/vault.打开Claude Code并输入:
Run the Vault Cleanup Auditor skill against my vault at /path/to/vault.Skill Instructions (for Claude Code)
技能说明(适用于Claude Code)
When this skill is invoked, follow these phases exactly.
当该技能被调用时,请严格遵循以下阶段执行。
PHASE 1: INTAKE
阶段1:信息收集
Check whether the user has provided:
- — absolute path to their Obsidian vault root
vault_path
If missing, ask:
What's the absolute path to your Obsidian vault? (e.g. /root/obsidian-vault)Do not proceed until confirmed.
检查用户是否提供了:
- — Obsidian知识库根目录的绝对路径
vault_path
如果缺失该信息,请询问:
What's the absolute path to your Obsidian vault? (e.g. /root/obsidian-vault)在获得确认前不要进行后续操作。
PHASE 2: ANALYZE
阶段2:分析检查
Run all 4 checks. Capture raw output from each before writing the report.
Check 1 — Stale drafts (30+ days, unposted):
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 1: STALE DRAFTS ==="
find "$VAULT/content/ready-to-post" -name "*.md" -mtime +30 2>/dev/null | while read f; do
if grep -q '\*\*Posted:\*\* ❌' "$f" 2>/dev/null; then
days=$(( ($(date +%s) - $(stat -c %Y "$f")) / 86400 ))
echo "${days}d|${f##$VAULT/}"
fi
done
echo "=== END CHECK 1 ==="Check 2 — Incomplete files (no headings, 5+ lines):
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 2: INCOMPLETE FILES ==="
find "$VAULT" -name "*.md" \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" \
-not -path "*/.openclaw/*" | while read f; do
if ! grep -qE '^#{1,6} ' "$f" 2>/dev/null; then
lines=$(wc -l < "$f")
if [ "$lines" -gt 5 ]; then
echo "${lines}lines|${f##$VAULT/}"
fi
fi
done
echo "=== END CHECK 2 ==="Check 3 — Duplicate filenames:
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 3: DUPLICATE FILENAMES ==="
find "$VAULT" -name "*.md" \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" \
-not -path "*/.openclaw/*" \
-printf "%f\n" | sort | uniq -d | while read name; do
echo "DUPE:$name"
find "$VAULT" -name "$name" \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" | while read f; do
echo " PATH:${f##$VAULT/}"
done
done
echo "=== END CHECK 3 ==="Check 4 — Empty folders:
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 4: EMPTY FOLDERS ==="
find "$VAULT" -type d -empty \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" \
-not -path "*/.openclaw/*" | while read d; do
echo "${d##$VAULT/}/"
done
echo "=== END CHECK 4 ==="运行全部4项检查,在编写报告前先记录每项检查的原始输出。
检查1 — 过时草稿(30天以上未发布):
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 1: STALE DRAFTS ==="
find "$VAULT/content/ready-to-post" -name "*.md" -mtime +30 2>/dev/null | while read f; do
if grep -q '\*\*Posted:\*\* ❌' "$f" 2>/dev/null; then
days=$(( ($(date +%s) - $(stat -c %Y "$f")) / 86400 ))
echo "${days}d|${f##$VAULT/}"
fi
done
echo "=== END CHECK 1 ==="检查2 — 不完整文件(无标题,行数超过5行):
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 2: INCOMPLETE FILES ==="
find "$VAULT" -name "*.md" \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" \
-not -path "*/.openclaw/*" | while read f; do
if ! grep -qE '^#{1,6} ' "$f" 2>/dev/null; then
lines=$(wc -l < "$f")
if [ "$lines" -gt 5 ]; then
echo "${lines}lines|${f##$VAULT/}"
fi
fi
done
echo "=== END CHECK 2 ==="检查3 — 重复文件名:
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 3: DUPLICATE FILENAMES ==="
find "$VAULT" -name "*.md" \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" \
-not -path "*/.openclaw/*" \
-printf "%f\n" | sort | uniq -d | while read name; do
echo "DUPE:$name"
find "$VAULT" -name "$name" \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" | while read f; do
echo " PATH:${f##$VAULT/}"
done
done
echo "=== END CHECK 3 ==="检查4 — 空文件夹:
bash
VAULT="VAULT_PATH_HERE"
echo "=== CHECK 4: EMPTY FOLDERS ==="
find "$VAULT" -type d -empty \
-not -path "*/.git/*" \
-not -path "*/.obsidian/*" \
-not -path "*/.openclaw/*" | while read d; do
echo "${d##$VAULT/}/"
done
echo "=== END CHECK 4 ==="PHASE 3: OUTPUT
阶段3:输出结果
3a. Create the report directory and file:
bash
VAULT="VAULT_PATH_HERE"
DATE=$(date +%Y-%m-%d)
mkdir -p "$VAULT/vault-audit"
REPORT="$VAULT/vault-audit/${DATE}-audit.md"
echo "Report path: $REPORT"3b. Write the report using this exact structure:
markdown
undefined3a. 创建报告目录和文件:
bash
VAULT="VAULT_PATH_HERE"
DATE=$(date +%Y-%m-%d)
mkdir -p "$VAULT/vault-audit"
REPORT="$VAULT/vault-audit/${DATE}-audit.md"
echo "Report path: $REPORT"3b. 按照以下固定结构编写报告:
markdown
undefinedVault Cleanup Audit — YYYY-MM-DD
Vault Cleanup Audit — YYYY-MM-DD
Generated: YYYY-MM-DD HH:MM
Summary: 🔴 [N] stale | 🟡 [N] incomplete | 🟡 [N] dupes | 🟢 [N] empty
Generated: YYYY-MM-DD HH:MM
Summary: 🔴 [N] stale | 🟡 [N] incomplete | 🟡 [N] dupes | 🟢 [N] empty
🔴 Stale Drafts (30+ days, unposted)
🔴 Stale Drafts (30+ days, unposted)
- [Nd old] path/to/file.md [cap at 15 items — add "...and N more" if over]
- [Nd old] path/to/file.md [cap at 15 items — add "...and N more" if over]
🟡 Incomplete Files (no headings, 5+ lines)
🟡 Incomplete Files (no headings, 5+ lines)
- path/to/file.md (N lines) [cap at 15]
- path/to/file.md (N lines) [cap at 15]
🟡 Duplicate Filenames
🟡 Duplicate Filenames
- filename.md
- path/one/filename.md
- path/two/filename.md [cap at 15 duplicate names]
- filename.md
- path/one/filename.md
- path/two/filename.md [cap at 15 duplicate names]
🟢 Empty Folders
🟢 Empty Folders
- path/to/folder/ [cap at 15]
What to do:
- 🔴 Stale drafts: post them, delete them, or archive to
content/posted/ - 🟡 Incomplete files: finish or trash
- 🟡 Duplicates: merge or rename the less important one
- 🟢 Empty folders: safe to delete (or keep if you're about to use them)
**3c. Print the summary to terminal:**
✅ Audit saved to: vault-audit/YYYY-MM-DD-audit.md
Summary:
🔴 [N] stale drafts
🟡 [N] incomplete files
🟡 [N] duplicate filenames
🟢 [N] empty folders
---- path/to/folder/ [cap at 15]
What to do:
- 🔴 Stale drafts: post them, delete them, or archive to
content/posted/ - 🟡 Incomplete files: finish or trash
- 🟡 Duplicates: merge or rename the less important one
- 🟢 Empty folders: safe to delete (or keep if you're about to use them)
**3c. 在终端打印汇总信息:**
✅ Audit saved to: vault-audit/YYYY-MM-DD-audit.md
Summary:
🔴 [N] stale drafts
🟡 [N] incomplete files
🟡 [N] duplicate filenames
🟢 [N] empty folders
---PHASE 4: SELF-CRITIQUE
阶段4:自检核对
Before finalizing, check:
- All 4 checks ran — Confirm output exists between each /
=== CHECK N ===marker. If a check produced no output, note "0 issues found" in the report — do not skip the section.=== END CHECK N === - Counts are accurate — The summary line counts must match the actual items listed in each section. Re-count if unsure.
- Report saved correctly — Confirm the file exists at . If the write failed, report the error and provide the report content inline.
vault-audit/YYYY-MM-DD-audit.md - No blank sections — Every section must either list items OR say "No issues found." Never leave a section header with nothing below it.
Fix any failures before delivering the final output.
在最终输出前,请检查:
- 4项检查全部执行完成 — 确认每个/
=== CHECK N ===标记之间都有输出内容。如果某项检查没有输出结果,请在报告中注明“0 issues found”,不要跳过该部分。=== END CHECK N === - 统计数量准确 — 汇总行的计数必须和每个部分列出的实际条目数量匹配,如有疑问请重新计数。
- 报告保存正确 — 确认文件已保存到路径下,如果写入失败,请报告错误并直接提供报告内容。
vault-audit/YYYY-MM-DD-audit.md - 没有空白部分 — 每个部分要么列出条目,要么标注“No issues found”,绝对不能出现只有标题没有内容的情况。
在交付最终输出前修复所有问题。
Example Report
报告示例
markdown
undefinedmarkdown
undefinedVault Cleanup Audit — 2026-03-01
Vault Cleanup Audit — 2026-03-01
Generated: 2026-03-01 08:14
Summary: 🔴 3 stale | 🟡 2 incomplete | 🟡 1 dupe | 🟢 2 empty
Generated: 2026-03-01 08:14
Summary: 🔴 3 stale | 🟡 2 incomplete | 🟡 1 dupe | 🟢 2 empty
🔴 Stale Drafts (30+ days, unposted)
🔴 Stale Drafts (30+ days, unposted)
- [47d old] content/ready-to-post/linkedin/2026-01-12-ai-systems-post.md
- [38d old] content/ready-to-post/twitter/2026-01-21-founder-ops.md
- [31d old] content/ready-to-post/newsletter/2026-01-28-tools-roundup.md
- [47d old] content/ready-to-post/linkedin/2026-01-12-ai-systems-post.md
- [38d old] content/ready-to-post/twitter/2026-01-21-founder-ops.md
- [31d old] content/ready-to-post/newsletter/2026-01-28-tools-roundup.md
🟡 Incomplete Files (no headings, 5+ lines)
🟡 Incomplete Files (no headings, 5+ lines)
- bambf/research/untitled-notes.md (23 lines)
- thinking/random-thoughts.md (11 lines)
- bambf/research/untitled-notes.md (23 lines)
- thinking/random-thoughts.md (11 lines)
🟡 Duplicate Filenames
🟡 Duplicate Filenames
- README.md
- bambf/brand/README.md
- bambf/tracking/README.md
- README.md
- bambf/brand/README.md
- bambf/tracking/README.md
🟢 Empty Folders
🟢 Empty Folders
- content/queue/rejected/
- bambf/clients/archived/
What to do:
- 🔴 Stale drafts: post them, delete them, or archive to
content/posted/ - 🟡 Incomplete files: finish or trash
- 🟡 Duplicates: merge or rename the less important one
- 🟢 Empty folders: safe to delete (or keep if you're about to use them)
---- content/queue/rejected/
- bambf/clients/archived/
What to do:
- 🔴 Stale drafts: post them, delete them, or archive to
content/posted/ - 🟡 Incomplete files: finish or trash
- 🟡 Duplicates: merge or rename the less important one
- 🟢 Empty folders: safe to delete (or keep if you're about to use them)
---Requirements
运行要求
- Claude Code with bash tool access
- Bash + standard Unix tools: ,
find,grep,wc,stat,dateawk - Read access to vault directory
- Write access to inside the vault (auto-created)
vault-audit/ - No APIs, no paid services, no external dependencies
- 具备bash工具调用权限的Claude Code
- Bash + 标准Unix工具:、
find、grep、wc、stat、dateawk - 对知识库目录有读权限
- 对知识库内的目录有写权限(会自动创建)
vault-audit/ - 无需API、无需付费服务、无外部依赖