| name | wiki-init |
| description | User-invoked setup: point commonplace at a folder for the first time or reconfigure the active vault. Writes the vault marker, scaffolds `.wiki/`, discovers initial domains/genres. Invoke explicitly via /wiki-init. |
| disable-model-invocation | true |
Wiki Init
Initialize the wiki plugin for any folder of markdown files — an Obsidian vault, a plain directory, or anything in between. Detects structure automatically and writes the config files needed for all other skills to work.
Obsidian is not required. The plugin works on any folder of .md files with YAML frontmatter and [[wikilinks]]. Obsidian is just a good browser for this format if the user has it.
What This Does
- Detects vault structure by sampling frontmatter tags (
paper, concept, moc) across up to 200 notes
- Writes
.wiki/config.json in the vault with detected structure, stub pattern, and MOC count pattern
- Writes
.vault-path to CLAUDE_PLUGIN_DATA (persistent across plugin updates) so all commands auto-discover the vault
- Generates or updates vault
CLAUDE.md with a domain registry sentinel block
- Discovers genre detection signals (cssclasses values, top-level dirs) and writes
.wiki/conventions.json with empty rules — the wiki-conventions-tuner agent fills in the rules afterwards
Workflow
Step 1: Identify the folder
Resolution order:
- Explicit path: user said "use
/path/to/folder" → use that
- Current directory: user said "this folder", "here", "this is my knowledge depot", or similar → use
pwd (run pwd to get the absolute path)
- Discovery: check if cwd or a parent has
.obsidian/ or .wiki/ → use that
- Ask: if none of the above, ask the user which folder to use
Any folder works — no Obsidian required. If the folder is empty or has no existing notes, that's fine: the plugin will initialize a skeleton structure.
Step 2: Run init
commonplace init --vault "<vault-path>"
Read the JSON output directly — it reports what was written and flags any low-confidence detections.
Step 3: Handle low-confidence detections
If the output includes lowConfidence entries, review them with the user:
- Show the detected value
- Ask if it's correct or if they want to override
- If override needed, edit
.wiki/config.json directly to correct the value
Step 4: Add domains (if new vault)
Init auto-discovers domains from vault directories and writes .wiki/domains.json. Review with the user:
- Show what was detected
- Ask if scope should be
public or private for any unclear domains
- Edit
$VAULT_PATH/.wiki/domains.json to correct scopes or add missing domains
Step 5: Tune genre conventions (if new genres discovered)
Init writes .wiki/conventions.json with discovered genre detection signals (cssclasses values, top-level dirs) but leaves rules: {} empty for each. The init output's conventions.untuned field lists genres needing rules.
If conventions.untuned is non-empty, dispatch the wiki-conventions-tuner agent. Pass the vault path inline (do not let it discover). The agent samples notes per genre and proposes lead-link and external-source-citation rules, then writes them back after user approval.
If conventions.untuned is empty (everything already tuned from a previous run), skip this step.
The indexer also re-runs genre discovery automatically (auto-detects when new genres cross the 3-note threshold). To re-run discovery on demand without a full init, use commonplace discover-genres.
Step 6: Run initial index
commonplace index --vault "<vault-path>"
Step 7: Report
After init, the vault path is stored in CLAUDE_PLUGIN_DATA (persistent directory that survives plugin updates). All commonplace commands auto-discover the vault — no --vault flag needed.
Tell the user:
- Vault path that was configured
- Structure detected (sources/concepts/mocs directories)
- Whether CLAUDE.md was generated or updated
- Any domains detected
- How to update config later: re-run
init.ts or edit .wiki/config.json directly