Back to catalog

wiki-audit

Weekly wiki health audit: structure, duplicates, navigation.

Category 📝 Note Taking
Version v1.0.0
wikiaudithealth-checkstructureweekly

Wiki Audit

Weekly health check of /opt/data/wiki — structure, files, content freshness, duplicates, navigation accuracy. Report-only; no auto-fixes.

When to Use

  • Weekly cron job (Sunday 11:45 AM IST)
  • After major wiki restructuring or bulk ingestion
  • When Joseph asks for a wiki health check

Output Location

/opt/data/wiki/produce/hermes/hermes-audit/wiki-YYYY-MM-DD.md

Use today's date in ISO format.

Canonical Structure (source of truth)

wiki/
├── consume/
│   ├── articles/  comparisons/  concepts/  entities/  highlights/
│   ├── queries/
│   ├── raw/          articles/  assets/  papers/  voice-notes/
│   └── transcripts/
├── produce/
│   ├── blogs/
│   │   ├── ctofieldnotes/          ← Mac-synced, READ ONLY
│   │   └── jjude/  books/{hs,ww}  cpn  pages  posts  sermons  tech-notes  travel  ← Mac-synced, READ ONLY
│   └── hermes/                     ← Hermes writes here
│       ├── blogs/ctofieldnotes/  drafts/
│       ├── books/
│       ├── commercial/
│       ├── hermes-audit/
│       ├── homeschooling/
│       ├── library/  writing-concepts/  writing-themes/
│       ├── plans/
│       ├── products/
│       ├── self/  archive/  assessments/  bible/  decisions/  frameworks/  goals/  patterns/  retros/
│       └── social/
├── wealth/
│   ├── expense/
│   └── invest/  fd/  mf/  stock/  charts/
├── index.md
├── log.md
├── schema.md
├── readme.md
└── agents.md

Audit Checklist — 6 Checks

Check 1: Structure Conformance

Compare actual directories against canonical map above.

find /opt/data/wiki -type d -not -path '/.' | sort

Flag:

  • Directories on disk not in canonical map (undocumented drift)
  • Canonical directories missing on disk
  • Unexpected nesting depth or misplaced dirs

Check 2: Empty Directories

find /opt/data/wiki -type d -empty -not -path '/.' | sort

Classify each:

  • Legitimate placeholder — expected future use (e.g. wealth/invest/fd, consume/queries)
  • Possibly abandoned — was created for a project that never materialized
  • Structural drift — shouldn't exist per canonical map

Check 3: File Location Compliance

Mac-synced protection:
find /opt/data/wiki/produce/blogs/jjude -type f -mtime -30 2>/dev/null | head -20
find /opt/data/wiki/produce/blogs/ctofieldnotes -type f -mtime -30 2>/dev/null | head -20
Misplaced files:
find /opt/data/wiki -maxdepth 1 -type f | sort

Should only be: index.md, log.md, schema.md, readme.md, agents.md

Check 4: Stale Content Detection

Orphaned concepts — concepts whose source transcript is missing:
grep -rl 'sources:' /opt/data/wiki/consume/concepts/ | while read f; do
  sources=$(grep 'sources:' "$f" | sed 's/.sources:\s//')
  # Check if referenced transcripts exist
done
ls /opt/data/wiki/consume/transcripts/
Stale index/log entries:
grep -oE '\[.*\]\(([^)]+)\)' /opt/data/wiki/index.md | while read -r link; do
  path=$(echo "$link" | grep -oE '\(([^)]+)\)' | tr -d '()')
  [ ! -f "/opt/data/wiki/$path" ] && echo "MISSING: $path"
done
Old files in active areas:
find /opt/data/wiki/consume/concepts /opt/data/wiki/consume/highlights /opt/data/wiki/consume/transcripts /opt/data/wiki/produce/hermes -type f -mtime +60 | wc -l

Check 5: Duplicate Detection

Concept name overlaps:
ls /opt/data/wiki/consume/concepts/ | sed 's/\.md$//' | sort | awk '{print tolower($0)}' | uniq -d
Duplicate index/log entries:
sort /opt/data/wiki/index.md | uniq -d
sort /opt/data/wiki/log.md | uniq -d
Cross-location duplicates:
find /opt/data/wiki/produce -name ".md" -path "/drafts/" | sed 's/.drafts\///' | sort | uniq -d

Check 6: Navigation Accuracy

wc -l /opt/data/wiki/index.md /opt/data/wiki/log.md /opt/data/wiki/schema.md /opt/data/wiki/readme.md /opt/data/wiki/agents.md

Verify:

  • Page counts match actual file counts on disk
  • Structure described matches actual directory layout
  • References to pages/dirs that no longer exist
  • consume/log.md consistent with root log.md

Report Format

# Wiki Audit — YYYY-MM-DD

Summary

[X directories, Y files, Z issues found]

1. Structure Conformance

✅ Healthy

⚠️ Drift

2. Empty Directories

Legitimate Placeholders

Possibly Abandoned

Structural Drift

3. File Location Compliance

Issues Found

4. Stale Content

Orphaned Concepts

Stale Index/Log Entries

Old Files (>60 days)

5. Duplicates

Concept Overlaps

Duplicate Entries

Cross-location Duplicates

6. Navigation Accuracy

index.md

log.md

Other nav files

Recommendations

Fix Now

Worth Improving

Optional

Pitfalls

  • Full absolute paths — never use relative paths
  • Audit only — no file modifications, no auto-fixes
  • Mac-synced dirs are sacred — never write to produce/blogs/jjude/ or produce/blogs/ctofieldnotes/
  • Don't count hermes-audit/ in staleness — those files are intentionally archived
  • Don't flag library/ as stale — writing-concepts and writing-themes are reference material
  • Concept source extractionsources: field format varies; some YAML frontmatter, some inline. Grep broadly.

After the Audit

Write report to wiki/produce/hermes/hermes-audit/wiki-YYYY-MM-DD.md. Present summary to Joseph. Do NOT execute fixes without explicit go-ahead.