wiki-deep
Skill16 starsChanged 3 months agoApache-2.0View on GitHub
Periodic deep pass (day end · weekly · when a close-out report recommends it) — file what is important from the transcript backlog and skip the rest, run the semantic review, work the gap queue, re-distill oversized topic pages. Unfiled records expire by design; the per-session close-out is `/wiki-save`
In this repository4 other files it gives its agents.
- wiki-askSkill
- wiki-doctorSkill
- wiki-quizSkill
- wiki-saveSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
If the backlog is repeatedly large, propose enabling the unattended fact-layer daemon (bash <clone>/daemon/autoupdate-schedule.sh — gated …
- Very specific: line 45
no mutations at all (chat-only) → it belongs to this bucket.
- Distinctive: line 55
Keep the snapshot file until the distilled page has been committed to git.
- Very specific: line 94
Use /wiki-save to close out a session, /wiki-ask for a question, /wiki-deep (this skill) for the periodic deep pass.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Engine invocation — resolve it ONCE, in this order, and use the first that exists:
bun "<plugin-root>/src/cli.ts", where<plugin-root>is the directory TWO levels above this skill's base directory (skills/<name>/ → plugin root). This is the plugin and clone install — the normal case. Stop here when that file exists.bun "$LLMWIKI_ROOT/src/cli.ts"whenLLMWIKI_ROOTis set — a host that copied this skill folder OUT of the plugin (OpenClaw, Hermes,skills add) leaves step 1 pointing at that host's skills directory, not at an engine.llmwikion PATH — the launchersetup.shwrites to~/.local/bin, or the npm bin.If none of the three resolve, say so once and stop. Do NOT guess a path: the engine writes into a repository, and a guessed root writes into the wrong one. Every
llmwiki …or engine-CLI reference below means the invocation you resolved here.
/wiki-deep — periodic deep pass (backlog · review · gaps · re-distill)
The volume half of the two-pass model: /wiki-save closes each session warm, O(this session); /wiki-deep periodically consumes everything deferred. Run it at day end, weekly, or whenever a close-out report recommends it. A session that never got a warm close-out is still in the transcript backlog (byte watermarks); this pass files what in it is important — decisions, direction changes, root causes, measured results, contradictions — and explicitly skips the rest. The backlog is raw material, not debt: unfiled records expiring is by design, and marking sessions done without reading them is worse than an honest skip. Gap-filling and backlog grunt work are the LLM's bookkeeping, not the human's (humans abandon wikis when maintenance lands on them) — just never in the latency-critical per-session close-out.
Prerequisite — Read the /wiki-save skill FIRST: the execution rules, categories, writing philosophy, filing procedure, topic-consolidation rubric, page formats, and close-out checks are all defined in the /wiki-save skill and are used by every step below. If it is not already in context, Read <plugin-root>/skill/wiki-save.md before starting. This file adds only the deep extras.
(deep as an argument is accepted for backward compatibility — it is now the default and only mode of this command.)
$ARGUMENTS
Procedure
- Announce scope first (the bail-out gate): before doing anything, print the workload so the human can bail to
/wiki-saveif they only wanted a quick session close: pending backlog count (llmwiki update-status <repo>), open gap count (from0_review/gap-queue.md), oversized topic count (plainllmwiki lint <repo>→topic-oversize), and a wall-clock estimate (measured ~40s+/pending session). REPO = cwd ($CLAUDE_PROJECT_DIR); ifdocs/wiki/is missing,llmwiki skeleton <repo>then proceed.
0b. Structure-drift preflight (before ANY writing): run llmwiki migrate <repo> — the dry-run doubles as the detector. If it plans renames (or cold-start showed a [llmwiki config drift] line), resolve that FIRST: this pass writes pages into category folders, and writing on a drifted structure grows the split-brain (new pages land in the config's dirs while old pages sit in the old ones) — and deferred drift degrades from automatic pairing to manual --map. Show the human the dry-run plan, get ONE OK, then llmwiki migrate <repo> --commit (add --map old=new for any ⚠ unmapped dir that still holds pages; empty ones are cleaned automatically). Reverse drift (".schema-version differs from this engine's config") means YOUR engine clone is the stale side — git pull the engine clone instead of migrating. Never migrate without the human's OK; never defer it until after the volume work.
- Run the full
/wiki-saveclose-out for THIS session — its steps 1b–9 (0_review Q./A. items → file this session → consolidate its topics → L0 → overview → log → deterministic close-out). Deep is a superset: everything below expands on those steps. In thelog.mdline (step 6 there), use the marker## [YYYY-MM-DD] sync | <one-line>instead.
D1. File what matters from the backlog (expands filing beyond this session), oldest first, per the /wiki-save filing procedure (step 2 there): update-next → read the extract → file only the important items (validate-as-you-write) → update-done; a session with nothing important → update-done … --skipped. Sub-agent/fork threads never reach this list (the engine records them as skipped).
- Never mark
update-donewithout--skippedon a session whose extract you did not read. The engine accepts only thenew_offsetits lastupdate-nextissued for that transcript; do not work around the refusal. - Large backlog (more than ~20 pending, or more than the time the human accepted in step 0) → triage deterministically first: per transcript, read only the extract header (
llmwiki update-next <repo> <transcript> | head -3→users=human-turn count,# touched:roots,# ⚠ route:). Read in full only sessions with substantive human text;--skippedthe rest at the header'snew_offset. Then decide file-or-skip one session at a time — never batch-mark. - If the backlog is repeatedly large, propose enabling the unattended fact-layer daemon (
bash <clone>/daemon/autoupdate-schedule.sh— gated write→independent-verify→grounding→lint, default OFF) — volume belongs there, judgment stays warm. - Per-session scope judgment (mandatory): capture buckets a session by its START cwd, so a session that began in this repo (or an enrolled home) while working on ANOTHER project lands here anyway — and
cwd=on the header cannot detect it, because bucket and cwd agree by construction. Read the deterministic signal instead: the header's# touched:line (git roots where the segment's file mutations landed) and the# ⚠ route:advisory that appears when the dominant root is not this repo. Then choose:- dominant root is another repo you maintain (enrolled) → file the session into THAT repo's wiki (per
/wiki-savestep 2) and advance the watermark here:update-done <this-repo> <transcript> <offset>; - genuinely foreign work (someone else's project, a throwaway clone) →
update-done <repo> <transcript> <offset> --skippedand note it in the report (one line:skipped N cross-project: <names>); - no mutations at all (chat-only) → it belongs to this bucket; file or skip on content as usual.
Every
⚠ routesession goes into the report with what was done with it. Filing cross-project sessions into this wiki is mis-filing; the transcript stays immutable for that project's own wiki. This scope gate is warm-only (LLM judgment on top of the deterministic line) — an unattended daemon has no such judgment, so cross-scope wikis are not yet safe to automate.
- dominant root is another repo you maintain (enrolled) → file the session into THAT repo's wiki (per
D2. Full semantic review + work the gap queue: run llmwiki review <repo> --commit (no --if-due; the no-change cache still applies, --force only if you must). Announce findings in chat; for a real contradiction, add a > [conflict] … callout to the relevant 5_topic page (never overwrite); route only direction-level conflicts to 0_review. Then llmwiki gaps <repo> to fold findings into the self-closing queue, and fill up to 5 open gaps, oldest first: a missing-concept gap → create-or-update the 5_topic/ page by the topic-consolidation rules (re-ground from transcripts/raw evidence — never re-summarize other wiki pages); a next-question cross-link gap → add the wikilinks with explicit relation words. Near-duplicate gaps are filled ONCE. Leave open only what genuinely needs human judgment (contradictory measurements, direction calls) — announce those. Never hand-edit the queue's <!-- gap:… --> markers.
D3. Re-distill oversized topic pages: enumerate targets with a plain llmwiki lint <repo> (the close-out's --errors-only output only shows the topic-oversize count, not the paths). Then, for each oversized page:
- Snapshot FIRST:
D=$(llmwiki state-path <repo> distill --ensure) && cp <page> "$D/<filename>.<YYYY-MM-DD>.md"— derived state is engine-held, so this never writes into the repository. The recovery net must hold the page's CURRENT state — git history cannot (commits happen only when instructed, so bullets accreted by recent per-session close-outs are routinely uncommitted; a git diff would never show them being dropped). - Rebuild only from its cited transcripts (raw re-grounding — the one rewrite the anti-drift rule allows; never from other wiki pages), collapsing accreted bullets into a current synthesis.
status: superseded/superseded_byfrontmatter is preserved verbatim. - Engine-verified no-loss gate (hard):
llmwiki distill-verify <snapshot> <page>must pass — it deterministically checks that the citation set did not shrink (every[^sN]source on the snapshot is still cited; merging true duplicate footnotes is fine — set semantics — but say so in the report) and that every> [conflict]callout survived verbatim. Do not proceed on failure; restore the dropped items. - Claim check against the snapshot: diff the new page against the SNAPSHOT (not git) and confirm every grounded claim is still represented and still attached to its own citation. Then run the scoped lint (validate-as-you-write). Keep the snapshot file until the distilled page has been committed to git; from then on git history really is the recovery net and the snapshot may be deleted.
D4. Prune dead capture rows (deterministic, zero LLM): llmwiki capture-prune. Pending rows whose transcript — and .zst sibling — is gone past the 30-day age guard (--older-than N) become lost tombstones; rows of deleted temp-root repos and sub-agent/fork threads become skipped. Rows stay on the books, distilled rows are never touched. The daemon runs the same prune daily; this is the explicit catch-up.
D5. Index maintenance escalation (deterministic; no semantic cleanup): rebuild the fresh index and finish its structural lint before consulting the health signal:
sh
llmwiki index <repo>
llmwiki lint <repo> --errors-only
llmwiki db-health <repo> --notice
- Record the pre-maintenance databaseBytes, freeBytes, freeRatio = freeBytes / databaseBytes, and liveIndexedBytes. Only when the CLI reports compaction eligible, run the bounded storage repair, then recheck:
sh
llmwiki compact <repo> --commit
llmwiki db-health <repo>
Otherwise report action: no-action; do not run compact just because a database exists.
- Compare the before/after measurements. If compaction cleared a free-ratio-only pressure, report action: compacted; wiki-clean: not recommended — no semantic cleanup follows storage-only reclamation.
- Recommend cleanup only when the post-compact liveIndexedBytes remains above 30 MiB. Print this exact manual, dry-run command in the report; do not execute it, do not add --commit, and do not run wiki-clean-apply:
sh
llmwiki wiki-clean <repo>
wiki-clean is a reversible tiering review, not a deep-pass side effect: dirty worktrees, protected pages, ambiguous cases, and human approval remain its own command's responsibility.
R. Report — the /wiki-save report line plus the deep extras: "backlog filed F · skipped S · pending left P (F and S = the difference of the ledger: line of llmwiki update-status <repo> before vs after this pass — engine counts, never your own tally) / ⚠ route sessions: <transcript → filed into <repo> | skipped> each / review: findings F / gaps filled K (open M) / topics distilled D (distill-verify: pass) / capture pruned P / maintenance before: db D free F ratio R live L / after: db D free F ratio R live L / action: no-action|compacted|recommend llmwiki wiki-clean <repo> / L0 refreshed / lint error·warn counts".
Deep-specific engine CLI (bun "<plugin-root>/src/cli.ts"; the rest is listed in /wiki-save)
llmwiki review <repo> --commit— full semantic review (deep runs it WITHOUT--if-due; the per-session close-out relies on the cadence gate).llmwiki distill-verify <snapshot.md> <page.md>— deterministic no-loss gate for a topic re-distill (D3): fails (exit 1) if the new page dropped any citation source or> [conflict]callout present in the pre-distill snapshot.llmwiki lint <repo>(plain, no--errors-only) — enumeratetopic-oversizepaths for D3.llmwiki gaps <repo>— fold review findings into the tracked, self-closing0_review/gap-queue.md.llmwiki capture-prune [--older-than N]— tombstone pending rows whose transcript is gone past the age guard, skip dead temp-repo and sub-agent rows (D4; default 30 days).llmwiki db-health <repo> [--notice]— cheap storage/integrity report; plain health is read-only, while--noticerecords the maintenance-notice cooldown used by D5.llmwiki compact <repo>/--commit— default dry-run versus the D5-only committed FTS optimize + VACUUM after the CLI marks compaction eligible.llmwiki wiki-clean <repo>— manual, reversible dry-run tiering review; D5 may recommend it only after post-compact live indexed bytes remain above 30 MiB.
Principles
- All
/wiki-saveprinciples apply (supersession, anti-drift re-grounding, routine judgment vs human direction, defer-don't-drain, commits in the user's name only when instructed, team merge recovery). - Important, not everything: file what matters, skip the rest explicitly, let unfiled records expire. An honest skip is a result; an unread session marked filed is a false record. If deep passes stop happening, propose the unattended daemon rather than bulk-marking the backlog.
- Volume here, judgment warm: this pass does the grunt work (backlog, gaps, re-distill), but direction shifts and unresolved contradictions still go to
0_reviewfor the human — never auto-resolve them. - Use
/wiki-saveto close out a session,/wiki-askfor a question,/wiki-deep(this skill) for the periodic deep pass.
<!-- generated by src/plugin/build-assets.ts — edit skill/*.md, then re-run -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

