$npx -y skills add AgriciDaniel/claude-obsidian --skill wiki-ingestIngest sources into the Obsidian wiki vault. Reads a source, extracts entities and concepts, creates or updates wiki pages, cross-references, and logs the operation. Supports files, URLs, and batch mode. Triggers on: ingest, process this source, add this to the wiki, read and fil
| 1 | # wiki-ingest: Source Ingestion |
| 2 | |
| 3 | Read the source. Write the wiki. Cross-reference everything. A single source typically touches 8-15 wiki pages. |
| 4 | |
| 5 | **Syntax standard**: Write all Obsidian Markdown using proper Obsidian Flavored Markdown. Wikilinks as `[[Note Name]]`, callouts as `> [!type] Title`, embeds as `![[file]]`, properties as YAML frontmatter. If the kepano/obsidian-skills plugin is installed, prefer its canonical obsidian-markdown skill for Obsidian syntax reference. Otherwise, follow the guidance in this skill. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Transport (v1.7+) |
| 10 | |
| 11 | Before mutating any vault file, consult `.vault-meta/transport.json` (auto-created by `bash scripts/detect-transport.sh`). Use the `preferred` transport per the fallback chain: |
| 12 | |
| 13 | - **cli** — `obsidian-cli write "$VAULT" "$NOTE" < content.md` (or `append`, `property:set`); see [`skills/wiki-cli/SKILL.md`](../wiki-cli/SKILL.md) |
| 14 | - **mcp-obsidian** / **mcpvault** — `mcp__obsidian-vault__write_note` and friends; see [`skills/wiki/references/mcp-setup.md`](../wiki/references/mcp-setup.md) |
| 15 | - **filesystem** — Claude's `Write`/`Edit` tools with absolute vault-rooted paths (final floor; always works) |
| 16 | |
| 17 | Full decision tree: [`wiki/references/transport-fallback.md`](../../wiki/references/transport-fallback.md). |
| 18 | |
| 19 | --- |
| 20 | |
| 21 | ## Mode awareness (v1.8+) |
| 22 | |
| 23 | Before creating any new wiki page, consult the vault's methodology mode via `python3 scripts/wiki-mode.py route <type> "<name>"`. The router returns the vault-relative path where the page should be filed. |
| 24 | |
| 25 | ```bash |
| 26 | SRC_PATH=$(python3 scripts/wiki-mode.py route source "Karpathy 2025 LLM Wiki essay") |
| 27 | # generic: wiki/sources/Karpathy-2025-LLM-Wiki-essay.md |
| 28 | # lyt: wiki/notes/Karpathy-2025-LLM-Wiki-essay.md (also update relevant MOC) |
| 29 | # para: wiki/resources/incoming/Karpathy-2025-LLM-Wiki-essay.md |
| 30 | # zettelkasten: wiki/20260517123456-Karpathy-2025-LLM-Wiki-essay.md |
| 31 | |
| 32 | ENT_PATH=$(python3 scripts/wiki-mode.py route entity "Andrej Karpathy") |
| 33 | CON_PATH=$(python3 scripts/wiki-mode.py route concept "Compounding Vault Pattern") |
| 34 | ``` |
| 35 | |
| 36 | If `.vault-meta/mode.json` is absent, the router returns mode=generic paths (identical to v1.7 behavior). No special-casing needed in this skill. |
| 37 | |
| 38 | Mode-specific follow-up: |
| 39 | - **LYT**: after filing the atomic note, update the relevant MOC (`wiki/mocs/<topic>-moc.md`) to link the new note. If no MOC exists for the topic, create one using `skills/wiki-mode/templates/lyt/moc-template.md`. |
| 40 | - **Zettelkasten**: filename already includes the timestamp ID. Populate the `id:` frontmatter field to match. |
| 41 | - **PARA**: new ingests land in `wiki/resources/incoming/` by default. Do NOT auto-guess the topic; leave in incoming/ for user review. |
| 42 | |
| 43 | ## Concurrency (v1.7+) |
| 44 | |
| 45 | **Multi-writer is safe in v1.7.** The latent corruption bug from v1.6 — where two parallel sub-agents writing to the same page could silently trample each other — is closed by per-file advisory locking. Every wiki page write MUST be preceded by `wiki-lock acquire <path>`. |
| 46 | |
| 47 | ```bash |
| 48 | # Acquire — blocks (returns 75 EX_TEMPFAIL) if another writer holds the lock |
| 49 | if bash scripts/wiki-lock.sh acquire wiki/concepts/Foo.md; then |
| 50 | # ... do the write via the §Transport-selected method ... |
| 51 | bash scripts/wiki-lock.sh release wiki/concepts/Foo.md |
| 52 | else |
| 53 | # rc=75: another writer is in flight. Retry once after 2s; if still held, |
| 54 | # log to wiki/log.md and skip this page rather than overwrite. |
| 55 | sleep 2 |
| 56 | bash scripts/wiki-lock.sh acquire wiki/concepts/Foo.md && { |
| 57 | # write … |
| 58 | bash scripts/wiki-lock.sh release wiki/concepts/Foo.md |
| 59 | } || echo "skipped wiki/concepts/Foo.md (locked); logged to wiki/log.md" |
| 60 | fi |
| 61 | ``` |
| 62 | |
| 63 | Properties: |
| 64 | - **Per-file granularity.** Locks key on `sha1(<vault-relative-path>)`; concurrent writes to DIFFERENT pages run in parallel. |
| 65 | - **Age-based staleness.** Default `STALE_AFTER_SEC=60`. A crashed holder unblocks in ≤60 seconds without manual intervention. See `scripts/wiki-lock.sh` header for the full semantics. |
| 66 | - **Cross-process release.** Release is `rm -f` (no PID match required). Skill authors are trusted to release locks they acquire; cross-skill release is allowed by design (a janitor running `wiki-lock clear-stale --max-age 0` is the canonical recovery path). |
| 67 | - **The PostToolUse hook now defers `git add` if any locks are currently held**, so the auto-commit doesn't fire mid-ingest and produce torn commits. See `hooks/hooks.json`. |
| 68 | |
| 69 | `wiki-lock` is unconditional in v1.7+ — there is no feature gate, no fallback. Skills that don't acquire locks are racing against any other writer. The script is in core, not opt-in. |
| 70 | |
| 71 | Sub-agent rule from v1.6 — *"Sub-agents MUST NOT call `scripts/a |