npx skills add ...
npx skills add ar9av/obsidian-wiki --skill wiki-rebuild
npx skills add ar9av/obsidian-wiki --skill wiki-rebuild
Archive existing wiki knowledge and rebuild from scratch, or restore from a previous archive. Use this skill when the user wants to start fresh, rebuild the wiki from all sources, archive current knowledge before a major change, or restore an older version. Triggers on "rebuild the wiki", "start over", "archive and rebuild", "restore from archive", "nuke and repave", "clean rebuild". Also use when the wiki has drifted too far from sources and incremental fixes won't cut it.
You are performing a destructive operation on the wiki. Always archive first, always confirm with the user before proceeding.
llm-wiki/SKILL.md (inline @name override → walk up CWD for .env → ~/.obsidian-wiki/config → prompt setup). This gives OBSIDIAN_VAULT_PATH and optional QMD settings such as QMD_WIKI_COLLECTION.manifest.json to understand current stateArchives live at $OBSIDIAN_VAULT_PATH/_archives/. Each archive is a timestamped directory containing a full copy of the wiki state at that point.
When the user wants to snapshot the current state without rebuilding.
_archives/YYYY-MM-DDTHH-MM-SSZ/index.md, log.md, .manifest.json, and projects/ into the archivearchive-meta.json with reason "snapshot"log.md:
log.md is indexed and QMD_WIKI_COLLECTION is configured (see "QMD Refresh After Live Wiki Changes").When the user wants to start fresh. This is the full sequence:
Same as Mode 1 above, but with reason "rebuild".
Remove all content from the category directories (concepts/, entities/, skills/, etc.) and the projects/ directory. Keep:
_archives/ (obviously).obsidian/ (Obsidian config).env (if present in vault)Reset index.md to the empty template. Reset log.md with just the rebuild entry. Delete .manifest.json (it'll be recreated during ingest).
Tell the user the vault is cleared and ready for a full re-ingest. They can now run:
wiki-status — to see all sources as "new"claude-history-ingest — to reprocess Claude historycodex-history-ingest — to reprocess Codex session historywiki-ingest — to reprocess documents and any other raw dataEach of these will rebuild the manifest as they go.
Important: Don't run the ingest yourself automatically. The user should choose what to re-ingest and in what order. Some sources may no longer be relevant.
Append to log.md:
Refresh QMD after clearing and logging the live wiki (see "QMD Refresh After Live Wiki Changes"), then report that the vault is ready for selected re-ingest skills.
When the user wants to go back to a previous state.
Read _archives/ directory. For each archive, read archive-meta.json and present:
Ask the user which archive they want. Warn them that restoring will overwrite the current live wiki.
Before restoring, archive the current state (reason: "pre-restore") so nothing is lost.
index.md, log.md, and .manifest.json from the archivelog.md:
Refresh QMD after restore (see "QMD Refresh After Live Wiki Changes"), then tell the user what was restored and suggest running wiki-lint to check for any issues with the restored state.
QMD is a search index, not the source of truth. If QMD refresh fails, do not roll back archive, rebuild, or restore work; report the failure and leave the markdown vault intact.
GUARD: If $QMD_WIKI_COLLECTION is empty or unset, skip this step.
When to run:
| Mode | Refresh QMD? | Reason |
|---|---|---|
| Archive only | Optional | Live wiki content is unchanged except log.md; refresh if log.md is indexed and QMD is configured. |
| Archive + Rebuild | Required after clearing live wiki | QMD must forget deleted pages or it will return stale search results. Later ingest skills will refresh again as sources are reprocessed. |
| Restore | Required after restore | The live wiki was replaced with archive content, so QMD must match the restored state. |
This refresh currently requires the local QMD CLI. Use $QMD_CLI if set; otherwise use qmd. If the CLI is unavailable, report QMD skipped: qmd CLI unavailable.
For CLI refresh:
If the output says new hashes need vectors, or if restore replaced live pages and embeddings may be stale, run:
Verify the wiki collection reflects the operation:
For restore, also verify one restored page if the archive has a known page path:
Record QMD refresh in the final report as one of:
QMD refreshed: update + embed + verifiedQMD refreshed: update only + verifiedQMD skipped: QMD_WIKI_COLLECTION unsetQMD skipped: archive-only live content unchangedQMD skipped: qmd CLI unavailableQMD failed: <short error summary>.obsidian/ directory is sacred. Never touch it during archive/rebuild/restore — it contains the user's Obsidian settings, plugins, and themes.