wiki-rebuild
ar9av/obsidian-wiki
Archive, rebuild, or restore your wiki from scratch with full safety and version control.
What is wiki-rebuild?
This skill manages destructive wiki operations: snapshot the current state before major changes, rebuild from all sources with a clean slate, or restore from a previous archive. Use it when you need to start fresh, recover from drift, or keep versioned backups of your knowledge base.
- Archive the current wiki state with metadata and reason tracking
- Rebuild the wiki from scratch by clearing live content and preparing for re-ingest
- Restore a previous wiki version from timestamped archives
- List available archives with page and source counts
- Refresh QMD search index after archive, rebuild, or restore operations
- Preserve Obsidian config and environment settings during all operations
How to install wiki-rebuild
npx skills add https://github.com/ar9av/obsidian-wiki --skill wiki-rebuild- Obsidian vault with configured OBSIDIAN_VAULT_PATH
- Config resolution via .env, ~/.obsidian-wiki/config, or interactive setup
- Optional: QMD CLI installed if using search index refresh (qmd or $QMD_CLI)
How to use wiki-rebuild
- 1.Resolve config to obtain OBSIDIAN_VAULT_PATH and optional QMD settings
- 2.Read .manifest.json to understand current wiki state
- 3.Confirm your intent: archive only, archive + rebuild, or restore from archive
- 4.For archive only: create timestamped archive directory and copy all wiki content
- 5.For archive + rebuild: archive current state, clear live wiki directories, then run wiki-status and ingest skills in your chosen order
- 6.For restore: list available archives, select one, archive current state first, then restore selected archive content
- 7.Optionally refresh QMD search index if QMD_WIKI_COLLECTION is configured
- 8.Review log.md to confirm the operation was recorded
Use cases
- Start a fresh wiki rebuild when incremental fixes are insufficient
- Snapshot the wiki before a major restructuring or migration
- Recover to a known-good state by restoring a previous archive
- Archive the current state before attempting experimental changes
- Clean up a wiki that has drifted too far from its sources
- Knowledge base managers maintaining large Obsidian vaults
- Users performing major wiki restructures or migrations
- Teams needing versioned backups of collaborative knowledge bases
- Anyone wanting to safely experiment with wiki changes
wiki-rebuild FAQ
The .obsidian/ directory is never touched. Your plugins, themes, and Obsidian config remain intact.
Yes. Archives are always created before destructive operations. You can restore from any previous archive using Mode 3.
Yes. After clearing the live wiki, you choose which sources to re-ingest and in what order using wiki-status, claude-history-ingest, codex-history-ingest, and wiki-ingest.
The rebuild or restore completes successfully and your markdown vault is intact. QMD is a search index, not the source of truth. Report the failure and manually refresh QMD later if needed.
Each archive is a full copy of your wiki at that point. Plan for multiple copies of your vault size if keeping many archives.
Full instructions (SKILL.md)
Source of truth, from ar9av/obsidian-wiki.
name: wiki-rebuild description: > 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.
Wiki Rebuild — Archive, Rebuild, Restore
You are performing a destructive operation on the wiki. Always archive first, always confirm with the user before proceeding.
Before You Start
- Resolve config — follow the Config Resolution Protocol in
llm-wiki/SKILL.md(inline@nameoverride → walk up CWD for.env→~/.obsidian-wiki/config→ prompt setup). This givesOBSIDIAN_VAULT_PATHand optional QMD settings such asQMD_WIKI_COLLECTION - Read
.manifest.jsonto understand current state - Confirm the user's intent. This skill supports three modes:
- Archive only — snapshot current wiki, no rebuild
- Archive + Rebuild — snapshot, then reprocess all sources from scratch
- Restore — bring back a previous archive
The Archive System
Archives live at $OBSIDIAN_VAULT_PATH/_archives/. Each archive is a timestamped directory containing a full copy of the wiki state at that point.
$OBSIDIAN_VAULT_PATH/
├── _archives/
│ ├── 2026-04-01T10-30-00Z/
│ │ ├── archive-meta.json
│ │ ├── concepts/
│ │ ├── entities/
│ │ ├── skills/
│ │ ├── references/
│ │ ├── synthesis/
│ │ ├── journal/
│ │ ├── projects/
│ │ ├── index.md
│ │ ├── log.md
│ │ └── .manifest.json
│ └── 2026-03-15T08-00-00Z/
│ └── ...
├── concepts/ ← live wiki
├── entities/
└── ...
archive-meta.json
{
"archived_at": "2026-04-06T10:30:00Z",
"reason": "rebuild",
"total_pages": 87,
"total_sources": 42,
"total_projects": 6,
"vault_path": "/Users/name/Knowledge",
"manifest_snapshot": ".manifest.json"
}
Mode 1: Archive Only
When the user wants to snapshot the current state without rebuilding.
Steps:
- Create archive directory:
_archives/YYYY-MM-DDTHH-MM-SSZ/ - Copy all category directories,
index.md,log.md,.manifest.json, andprojects/into the archive - Write
archive-meta.jsonwith reason"snapshot" - Append to
log.md:- [TIMESTAMP] ARCHIVE reason="snapshot" pages=87 destination="_archives/2026-04-06T10-30-00Z" - Optionally refresh QMD if
log.mdis indexed andQMD_WIKI_COLLECTIONis configured (see "QMD Refresh After Live Wiki Changes"). - Report: "Archived 87 pages. Current wiki is untouched."
Mode 2: Archive + Rebuild
When the user wants to start fresh. This is the full sequence:
Step 1: Archive current state
Same as Mode 1 above, but with reason "rebuild".
Step 2: Clear live wiki
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).
Step 3: Rebuild
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 data
Each 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.
Step 4: Log the rebuild
Append to log.md:
- [TIMESTAMP] REBUILD archived_to="_archives/2026-04-06T10-30-00Z" previous_pages=87
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.
Mode 3: Restore from Archive
When the user wants to go back to a previous state.
Step 1: List available archives
Read _archives/ directory. For each archive, read archive-meta.json and present:
## Available Archives
| Date | Reason | Pages | Sources |
|---|---|---|---|
| 2026-04-06 10:30 | rebuild | 87 | 42 |
| 2026-03-15 08:00 | snapshot | 65 | 31 |
Step 2: Confirm which archive to restore
Ask the user which archive they want. Warn them that restoring will overwrite the current live wiki.
Step 3: Archive current state first
Before restoring, archive the current state (reason: "pre-restore") so nothing is lost.
Step 4: Restore
- Clear the live wiki (same as Mode 2, Step 2)
- Copy all content from the chosen archive back into the live wiki directories
- Restore
index.md,log.md, and.manifest.jsonfrom the archive - Append to
log.md:- [TIMESTAMP] RESTORE from="_archives/2026-03-15T08-00-00Z" pages_restored=65
Step 5: Report
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 Refresh After Live Wiki Changes
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:
${QMD_CLI:-qmd} update
If the output says new hashes need vectors, or if restore replaced live pages and embeddings may be stale, run:
${QMD_CLI:-qmd} embed
Verify the wiki collection reflects the operation:
${QMD_CLI:-qmd} ls "$QMD_WIKI_COLLECTION"
For restore, also verify one restored page if the archive has a known page path:
${QMD_CLI:-qmd} get "qmd://$QMD_WIKI_COLLECTION/<restored-page>.md" -l 5
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>
Safety Rules
- Always archive before destructive operations. No exceptions.
- Always confirm with the user before clearing the live wiki.
- Never delete archives unless the user explicitly asks. Archives are cheap insurance.
- The
.obsidian/directory is sacred. Never touch it during archive/rebuild/restore — it contains the user's Obsidian settings, plugins, and themes. - If something goes wrong mid-rebuild, the archive is there. Tell the user they can restore.
Related skills
More from ar9av/obsidian-wiki and the wider catalog.

wiki-research
Autonomously research topics via multi-round web search and synthesize findings into your Obsidian wiki.

wiki-setup
Initialize a new Obsidian wiki vault with structure, config, and special files.

wiki-stage-commit
>

wiki-status
Audit your wiki's ingest status, delta, and token footprint—decide whether to append or rebuild.

wiki-switch
Switch between multiple Obsidian vault profiles and manage named configurations.

wiki-synthesize
Discover and create synthesis pages connecting co-occurring concepts across your Obsidian wiki.