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>
This commit is contained in:
2026-05-25 06:13:22 -07:00
parent 2491660b88
commit b1e5a7bb3b
3 changed files with 464 additions and 102 deletions

View File

@@ -77,6 +77,28 @@ Wiki updates (if any): <count> articles updated (clients/projects/systems/patter
---
## Phase 4 — Unseeded Wiki Check
After sync completes, check whether the session log was written for a client or project that has no wiki article yet.
**Logic:**
- Determine the slug from the session log path (e.g., `clients/kittle/session-logs/...` → slug = `kittle`)
- Check: does `wiki/clients/<slug>.md` (or `wiki/projects/<slug>.md`) exist?
- If YES → no action needed
- If NO → emit after the post-commit summary:
```
[INFO] No wiki article for '<slug>' yet.
Session log saved to clients/<slug>/session-logs/<file>.
Run /wiki-compile client:<slug> to seed the wiki article.
```
For general (root) session logs, skip this check — no specific client/project is implied.
This check is informational only — do not block the save or prompt for confirmation.
---
## Cross-user note handling (CRITICAL)
If `sync.sh` surfaces a `## Note for <user>` or `## Message for <user>` block from an incoming session log, display it **prominently at the top of the response, before the sync summary**:

View File

@@ -0,0 +1,120 @@
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.
```bash
# 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
```
```bash
# 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.
---
## Step 3 — Broken Backlinks
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]`
```bash
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?"