First-Use Vault Setup
Treat root configuration as background setup, not a JSON-file task for the user. If normal resolution has no root, run python "<runtime-script>" root discover --format json. Show returned existing absolute paths as numbered candidates and ask the user to select one or provide another absolute Vault path. Resolve the selected path and state vault_root, control_center, and wiki_root. Only after the user confirms it should become the default, run root configure --root <path> --activate --confirm.
Do not read note content or scan the whole disk during discovery. Continue the user's original request after setup succeeds.
Runtime Resolution
Before running any command, resolve this skill's SKILL.md directory, take its
parent as <skills-root>, and set:
<runtime-script> = <skills-root>/obsidian-wiki-runtime/scripts/llm_wiki.py
Verify that <runtime-script> exists, then invoke it by absolute path. If it is
missing, stop with missing-runtime, report the expected path, and recommend:
npx skills add huajiexiewenfeng/obsidian-llm-wiki --skill '*' --copy --yes
Do not fall back to a repository-relative scripts/llm_wiki.py path.
Obsidian Wiki Init
Initialize or adopt an Obsidian vault as an LLM Wiki, then guide the user into the first knowledge-building steps.
When To Use
Use this skill when the user wants to:
- create the wiki control center
- adopt an existing Obsidian vault
- generate a vault inventory or knowledge map
- establish wiki page and safety rules
- prepare the vault before ingesting content
- create a step-by-step roadmap for building the wiki from an existing vault
- decide what to ingest first when the vault already contains many notes
Do not use this skill for answering knowledge questions. Use obsidian-wiki-query for that.
Required Context
Before writing files, inspect:
- current working directory
- whether it appears to be an Obsidian vault
- existing
00-知识库中控/,index.md,log.md, orAGENTS.md - existing
00-知识库中控/ingest/index.md - whether the user requested full scanning or structure-only scanning
Wiki Root Resolution
Before writing, resolve and state vault_root, control_center, and
wiki_root using this shared order:
- User-provided Vault, control-center, or wiki path.
- Nearest
.obsidian-llm-wiki.jsonfrom the current working directory upward. OBSIDIAN_LLM_WIKI_ROOT.- Exactly one active Vault in the user configuration.
- Otherwise stop with
missing-configor ask the user to choose when multiple roots exist.
Do not search the whole disk. For init, the confirmed target may be a new Vault whose control center does not yet exist; create it only after the user confirms the resolved Vault. Before writing, run or follow the equivalent of:
python "<runtime-script>" root resolve --cwd <working-directory> --format json
Workflow
- Confirm the target vault path from context or user instruction.
- Check for existing wiki control files.
- Create missing control structure conservatively.
- Preview Phase 2 machine state without writing:
python "<runtime-script>" state init --root <vault-or-control-center> --format json. - Show the
.metafiles that would be created. After explicit confirmation, run the same command with--confirm. State initialization alone does not mean any source has been ingested. - Inventory directories and file types.
- Classify the vault into practical next-step buckets:
- high-value / frequently used
- project material
- learning material
- temporary or messy material
- sensitive or cautious material
- external-material candidates
- Generate or update:
00-知识库中控/wiki/index.md00-知识库中控/wiki/log.md00-知识库中控/wiki/AGENTS.md00-知识库中控/ingest/index.md00.知识库地图.md00.整理范围确认.md00.LLM Wiki 建设路线图.md
- Do not vendor doctor scripts or deterministic enforcement files into the vault in V0. Use the installed shared runtime.
- Recommend running
obsidian-wiki-doctorafter initialization to validate the structure and produce a read-only report. - Recommend the first 1-3 ingest candidates and ask which batch to process with
obsidian-wiki-ingest.
Phase 2 stores machine state under 00-知识库中控/.meta/. Later phases treat
.meta/sources.json and .meta/pages.json as authority; Markdown index and log
files remain human-readable projections.
Output Files
Use the structure in references/vault-structure.md.
Use the templates in references/page-templates.md.
Use references/onboarding-roadmap.md when generating 00.LLM Wiki 建设路线图.md and the final guidance message.
Safety Rules
Follow references/safety-rules.md.
Key points:
- Do not move existing notes.
- Do not delete existing notes.
- Do not rewrite original notes.
- Do not copy secrets into generated wiki pages.
- If the user asks for structure-only scanning, do not read note bodies.
- Existing vaults should be guided progressively. Do not suggest full-vault ingestion as the default next step.
Confirmation Points
Ask for confirmation before:
- scanning very large folders deeply
- reading note bodies when the user asked for metadata-only inventory
- changing existing wiki rules
- replacing an existing index, log, or AGENTS file
- proceeding from inventory into the first ingest batch
- reading note bodies when the next step can be decided from directory names and metadata
Report Format
End with:
## Init Summary
- Vault:
- Created:
- Updated:
- Inventory:
- Roadmap:
- Recommended first batch:
- Skipped:
- Doctor recommendation:
- Risks:
- Next:
The Next field should be a concrete onboarding question, not a generic completion message. Example:
I recommend starting with one of these first ingest batches:
1. 高频使用目录
2. 项目资料目录
3. 学习资料目录
Before ingest, I recommend running obsidian-wiki-doctor once to validate the new structure. Which batch should we process first with obsidian-wiki-ingest after that?
Examples
Input:
Initialize the current Obsidian vault as an LLM Wiki. Do not move my existing files.
Expected behavior:
Create missing control directories and files, generate a knowledge map and scope confirmation, and report that no existing files were moved.
Input:
Only scan directory structure and file types.
Expected behavior:
Produce a metadata-only inventory without reading note bodies.
Input:
My Obsidian vault already has many folders. Guide me step by step to build the LLM Wiki after initialization.
Expected behavior:
Generate a roadmap, classify the vault into first-batch candidates, and ask the user which batch to ingest first.