Files
claudetools/.claude/commands/wiki-lint.md
Mike Swanson b1e5a7bb3b wiki: recompile overview.md + add /wiki-lint skill + /save unseeded check
overview.md recompiled with all 24 client articles and 7 project articles.
Captures ~80 action items sorted by priority; top urgent items: Neptune
cert (2026-05-31), Western Tire SSL (2026-05-30), Kittle eval license.

.claude/commands/wiki-lint.md: new skill — scans clients/ and projects/
for directories with session-logs but no wiki article, checks broken
[[backlinks]], stale last_compiled dates, index gaps, and stale queue
entries. Emits a structured lint report.

.claude/commands/save.md: added Phase 4 unseeded-wiki check — after sync,
if the session log was written for a client/project with no wiki article,
emit a /wiki-compile reminder. Informational only, no blocking behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 06:13:22 -07:00

3.5 KiB

Health-check the wiki for missing articles, stale content, broken backlinks, and cross-reference gaps.

Run this after any session where new session logs were created, or when starting a new session and the wiki may be out of date. Also run before any /wiki-compile all pass.


Step 1 — Missing Articles (Primary Check)

Scan for clients and projects that have session logs but no wiki article.

# List all client slugs that have session-logs but no wiki article
cd D:/claudetools
for dir in clients/*/session-logs; do
  slug=$(echo "$dir" | sed 's|clients/||;s|/session-logs||')
  wiki="wiki/clients/$slug.md"
  if [ ! -f "$wiki" ]; then
    count=$(ls "$dir"/*.md 2>/dev/null | wc -l)
    echo "MISSING: $wiki  ($count session logs)"
  fi
done
# List all project slugs that have session-logs but no wiki article
for dir in projects/*/session-logs; do
  slug=$(echo "$dir" | sed 's|projects/||;s|/session-logs||')
  wiki="wiki/projects/$slug.md"
  if [ ! -f "$wiki" ]; then
    count=$(ls "$dir"/*.md 2>/dev/null | wc -l)
    echo "MISSING: $wiki  ($count session logs)"
  fi
done

Report each missing article as:

[MISSING] wiki/clients/<slug>.md — <N> session logs, oldest: <YYYY-MM-DD>

Suggest: Run /wiki-compile client:<slug> to seed.


Step 2 — Stale Articles

Check last_compiled date in all wiki article frontmatter. Flag any article where:

  • last_compiled is more than 90 days ago AND there are session logs newer than last_compiled
  • Report as [STALE] with days since compile and count of new logs

Use grep -r "last_compiled:" wiki/ to collect dates, then compare against session log mtimes.


Scan all [[link]] references in wiki articles. For each [[slug]], check:

  • Does wiki/clients/<slug>.md exist? Or wiki/projects/<slug>.md? Or wiki/systems/<slug>.md?
  • If none match → flag as [BROKEN_LINK]
grep -rh '\[\[' wiki/ | grep -oP '\[\[\K[^\]]+' | sort -u

For each unique slug found, verify the file exists.


Step 4 — Index Gaps

Read wiki/index.md. For every .md file in wiki/clients/, wiki/projects/, wiki/systems/:

  • Is it listed in wiki/index.md? If not → flag as [NOT_INDEXED]

Conversely, for every row in wiki/index.md:

  • Does the linked file actually exist? If not → flag as [DEAD_INDEX_ENTRY]

Step 5 — Compilation Queue Cleanup

Read the ## Compilation Queue section in wiki/index.md. For each entry:

  • Does the corresponding wiki/<type>/<slug>.md file now exist? If yes → flag the queue entry as stale, suggest removing it.

Output Format

Emit a clean lint report:

## Wiki Lint Report — YYYY-MM-DD

### Missing Articles (N)
[MISSING] wiki/clients/evs.md — 1 session log (2026-04-17)
...

### Stale Articles (N)
[STALE] wiki/clients/cascades-tucson.md — compiled 2026-05-24, 3 new logs since
...

### Broken Backlinks (N)
[BROKEN_LINK] wiki/clients/kittle.md → [[gururmm]] (no file found)
...

### Index Gaps (N)
[NOT_INDEXED] wiki/clients/new-client.md — not listed in index.md
...

### Compilation Queue — Stale Entries (N)
[QUEUE_STALE] client:birthbiologic — wiki/clients/birth-biologic.md exists; remove from queue
...

### Summary
- N missing articles → run /wiki-compile for each
- N stale articles → run /wiki-compile to refresh
- N broken links → fix manually or after recompile
- N index gaps → update wiki/index.md

After the report, ask: "Run /wiki-compile for any of the missing articles now?"