Wiki Import — Reconstruct Pages from an Export skill

Import a wiki knowledge graph into the current vault — either from a graph.json export file (stubs) or from an OKF (Open Knowledge Format) markdown bundle (full page bodies).

by Ar9av·MIT license·★ 3,520 Stars on the repo·GitHub ↗

Use now

Files of Wiki Import — Reconstruct Pages from an Export

Ar9av/main1 file shown
SKILL.md
Show the full text270 lines

Wiki Import — Reconstruct Pages from an Export

You are importing a vault's knowledge into the current vault from one of two sources produced by wiki-export:

  • graph.json — the graph skeleton. Reconstructs page stubs (frontmatter, typed relationships, a ## Related link list — no body). Lossy.
  • OKF bundle (a wiki-export/okf/ directory) — the actual markdown files. Reconstructs full pages with their real bodies. Lossless. Use this for true vault-to-vault transfer.

Either way, the import writes pages with correct frontmatter and wikilinks, then updates all vault metadata. Step 2, Step 3 (graph only), and Step 5 are shared; Step 4 forks by source type.

Before You Start

Writing profile: Before drafting or rewriting natural-language Markdown, read and apply the Writing Profile Resolution section in llm-wiki/SKILL.md. Framework schema, provenance, safety, and operation-specific requirements take precedence. Preserve imported source prose; apply WRITING.md preferences only to newly generated metadata or stubs.

  1. Resolve config — follow the Config Resolution Protocol in llm-wiki/SKILL.md (inline @name override → walk up CWD for .env → global config → prompt setup). This gives OBSIDIAN_VAULT_PATH.
  2. Read $OBSIDIAN_VAULT_PATH/AGENTS.md if it exists — apply any owner-specific conventions.

Step 1: Locate and Detect Source Type

Find the import source:

  • If the user provided a path argument, use it directly.
  • Otherwise auto-detect, in order: ./wiki-export/okf/ (a directory) → ./wiki-export/graph.json (a file).
  • If neither exists, ask the user for the path.

Detect the source type:

  • The path is a file ending in .json → graph.json import (validate below, then Step 3 + Step 4-Graph).
  • The path is a directory containing .md files with OKF frontmatter (a type: key), and/or a root index.md with okf_version → OKF bundle import (skip Step 3; go to Step 4-OKF). Both okf_version 0.1 and 0.2 bundles are accepted; Step 4-OKF reads either.
  • Anything else → report what's wrong and stop.

Validate a graph.json source:

  • Must be valid JSON
  • Must have top-level keys: nodes (array), links (array), graph (object)
  • Must have at least 1 node

If validation fails, report what's wrong and stop.

Validate an OKF bundle source:

  • Must contain at least 1 non-reserved .md file (i.e. not index.md/log.md) with parseable YAML frontmatter containing a non-empty type.
  • A .md with no frontmatter or no type is skipped (with a count), not fatal — OKF consumers are permissive (OKF §11).

Show a preview before importing:

graph.json:

Import preview (graph.json — stubs)
  Source: <path>  (exported at <graph.exported_at>)
  Nodes:  N total  (concepts: A, entities: B, skills: C, references: D, ...)
  Links:  M edges  (X typed, Y untyped)
  Target: $OBSIDIAN_VAULT_PATH

OKF bundle:

Import preview (OKF bundle — full pages)
  Source: <dir>  (okf_version <ver if present>)
  Pages:  N total  (concepts: A, entities: B, skills: C, references: D, ...)
  Target: $OBSIDIAN_VAULT_PATH

Step 2: Determine Conflict Resolution Mode

Read the user's phrasing to determine mode. Default is merge.

Mode Trigger phrases Behaviour
merge (default, no special phrasing) Existing pages: update frontmatter tags/summary/relationships and add missing wikilinks; new pages: create stub.
skip "skip existing", "don't overwrite", "only new pages" Leave existing pages completely untouched; only create pages that don't exist yet.
overwrite "overwrite", "replace existing", "force import" Replace all matched pages with freshly reconstructed stubs regardless of existing content.

Step 3: Build Internal Maps (graph.json only — skip for OKF bundles)

Before writing anything, build two maps from the links array:

Adjacency map — for each node id, collect all neighbour ids (edges in either direction):

adjacency["concepts/transformers"] = ["entities/vaswani", "concepts/lstm", ...]

Typed edge map — for each node id, collect outgoing typed edges only (typed: true):

typed_edges["concepts/transformers"] = [
  {target: "concepts/lstm", relation: "contradicts"},
  ...
]

Step 4-Graph: Reconstruct Pages from graph.json (graph.json source only)

Record counts: created = 0, skipped = 0, merged = 0.

For each node in nodes:

  1. Compute page_path = $VAULT/<node.id>.md
  2. Ensure the parent directory exists (e.g. $VAULT/concepts/)
  3. Check if the file already exists:
    • merge mode (default) + exists → read existing file, apply merge logic (see below), increment merged
    • merge mode (default) + doesn't exist → proceed to create stub, increment created
    • skip mode + exists → increment skipped, continue to next node
    • skip mode + doesn't exist → proceed to create stub, increment created
    • overwrite mode + exists → proceed to write fresh stub (overwrite), increment merged
    • overwrite mode + doesn't exist → proceed to create stub, increment created
Page template (new or overwrite)
---
title: <node.label>
category: <node.category>
tags: <node.tags as YAML list>
sources:
  - "imported from <graph.json path>"
<if node.summary exists>
summary: "<node.summary>"
</if>
<if typed_edges[node.id] is non-empty>
relationships:
<for each {target, relation} in typed_edges[node.id]>
  - target: "[[<target>]]"
    type: <relation>
</for>
</if>
lifecycle: draft
lifecycle_changed: <today YYYY-MM-DD>
base_confidence: 0.5
tier: supporting
created: <ISO timestamp>
updated: <ISO timestamp>
---

# <node.label>

<node.summary paragraph if available, else omit>

## Related

<for each neighbour in adjacency[node.id], sorted alphabetically>
<if edge is typed>
- [[<neighbour>]] — <relation>
<else>
- [[<neighbour>]]
</if>
</for>

If adjacency[node.id] is empty, omit the ## Related section entirely.

Merge logic (merge mode, existing page)
  1. Read the existing page's frontmatter.
  2. Tags: union of existing tags and node.tags (deduplicated, keep existing order, append new ones).
  3. Summary: if the existing page has no summary field and node.summary exists, add it.
  4. Relationships: union of existing relationships: entries and typed_edges[node.id] — skip entries where the same (target, type) pair already exists.
  5. Updated: set updated to the current ISO timestamp.
  6. Body: scan for a ## Related section. If it exists, append any missing wikilinks from adjacency[node.id] that aren't already linked anywhere in the body. If no ## Related section exists, append one with the missing links.
  7. Leave the rest of the body untouched.

Step 4-OKF: Reconstruct Pages from an OKF bundle (OKF source only)

Record counts: created = 0, skipped = 0, merged = 0, unparseable = 0.

Walk the bundle directory tree. For each .md file that is not a reserved file (index.md, log.md):

  1. Parse the YAML frontmatter. If it has no frontmatter or no non-empty type, increment unparseable and skip the file.
  2. Compute the concept id = the file's path relative to the bundle root, with .md stripped (e.g. concepts/transformers.md → concepts/transformers). The target page is $VAULT/<concept-id>.md.
  3. Reverse-map frontmatter (the inverse of the canonical mapping table in wiki-export Step 3.5):
    • title ← title.
    • category ← the preserved category extension key if present; else lower-case the directory prefix of the concept id (concepts/… → concepts); else derive from type (Concept→concepts, Entity→entities, Skill→skills, Reference→references, Synthesis→synthesis, Project→projects, Journal→journal).
    • tags ← tags.
    • summary ← description.
    • updated ← the preserved updated extension key if present; else generated.at; else a legacy v0.1 timestamp; else now.
    • created ← the preserved created extension key if present, else now.
    • sources ← OKF sources, as a list of strings: for each entry that is a mapping, take its resource; keep plain strings as-is (that's how v0.1 bundles from older exports carried our native list). If the bundle has no sources, use ["imported from OKF bundle <bundle path>"]. If a top-level resource URL is present and not already in the list, add it.
    • lifecycle ← the preserved lifecycle extension key if present; else from status: draft → draft, deprecated → archived, stable or absent → leave lifecycle unset. (OKF has no equivalent of reviewed/verified/disputed, so only our own exports restore them, through the preserved key.)
    • Carry through any other preserved extension keys verbatim (relationships, lifecycle_changed, tier, base_confidence, …), and the OKF-only keys generated, verified, stale_after, and usage_window so a later export doesn't lose them. These make the round-trip lossless. Treat a bare verified mapping as a one-element list (OKF §5.2).
    • Except what our own exporter derived. Drop generated when generated.by starts with obsidian-wiki/ (it was computed from updated), and drop verified entries whose by is human:vault-owner (computed from the source vault's trust ledger, which doesn't travel). Keeping them would add keys the source page never had. Generated or verified blocks from any other producer are kept.
  4. Reverse-transform body links — markdown links that point at .md paths become wikilinks (this restores both real cross-links and forward-references the exporter preserved per wiki-export Step 3.5):
    • [text](../concepts/transformers.md) or [text](/concepts/transformers.md) → resolve the path (relative to this file's dir, or bundle-root for /-absolute) to a concept id → [[concepts/transformers]], or [[concepts/transformers|text]] when text differs from the target's title. The target's title comes from the bundle page when it exists; otherwise the exporter wrote the target's id as the link text, so treat text equal to the full id (or to its last path segment) as no alias.
    • Treat the markdown target as a file path first: normalize the .md path relative to the current file, then strip the trailing .md from the resolved file path to recover the page id. Do not try to infer the id from directory traversal segments before resolving the full file path. This preserves round-trips for folder-note layouts like projects/social-twitter.md plus projects/social-twitter/..., where ../../social-twitter.md must restore to projects/social-twitter.
    • This applies even when the target page is not in the bundle — a path-form link to a not-yet-written page round-trips back to a dangling [[wikilink]] (Obsidian supports these; OKF §11 forbids rejecting them). Do not leave it as a markdown link.
    • When OBSIDIAN_LINK_FORMAT=markdown is set in config, keep markdown links (just rewrite the path to be vault-relative); do not convert to wikilinks.
    • Leave external http(s):// links and # Citations sections untouched.
  5. Write the page using the conflict mode from Step 2:
    • merge + exists → reverse-map frontmatter and merge it into the existing page (union tags; fill summary/sources only if missing; union relationships; refresh updated). For the body, OKF carries a real body: replace the existing body with the bundle body only if the existing page is a stub (body is just a heading + ## Related); otherwise keep the existing body and append any bundle # Citations / new ## sections not already present. Increment merged.
    • merge + doesn't exist → write the full page (frontmatter + full bundle body). Increment created.
    • skip + exists → increment skipped, continue.
    • skip + doesn't exist → write the full page. Increment created.
    • overwrite + exists → write the full page, replacing the existing one. Increment merged (label as Replaced in the summary).
    • overwrite + doesn't exist → write the full page. Increment created.
  6. Ensure the parent directory ($VAULT/concepts/, etc.) exists before writing.

Unlike the graph.json path, do not generate a ## Related stub section — the bundle body already contains the real cross-links.

Step 5: Update Vault Metadata

.manifest.json

Add a new entry keyed by the canonical path of the graph.json file:

"<absolute path to source>": {
  "ingested_at": "<ISO timestamp>",
  "source_type": "wiki-export",
  "pages_created": ["list/of/created/pages.md"],
  "pages_updated": ["list/of/merged/pages.md"]
}

Set source_type to "wiki-export" for a graph.json import or "okf-bundle" for an OKF bundle import. Key the entry by the absolute path of the source (the graph.json file or the bundle directory).

Also increment:

  • stats.total_sources_ingested by 1
  • stats.total_pages by the count of pages actually created (not skipped/merged)

If .manifest.json doesn't exist, create it with the standard structure:

{
  "stats": {
    "total_sources_ingested": 1,
    "total_pages": <created count>
  },
  "<graph.json path>": { ... }
}
index.md, log.md, and hot.md

One locked call. The index is reconciled from the pages now on disk, so every created or merged page lands under its category with the documented ( #tag) spacing:

obsidian-wiki memory sync IMPORT \
  source="<bundle path>" \
  pages_created=<N> pages_skipped=<K> pages_merged=<M> \
  --takeaways "Imported <bundle>: <what it adds to the picture>"

Omit --takeaways if the import does not shift the overall picture; the previous takeaways carry across. Never hand-edit index.md, log.md, or hot.md — the command takes the lock that keeps a parallel writer from dropping your update.

See .skills/llm-wiki/references/MEMORY.md for the full procedure.

Step 6: Print Summary

Wiki import complete → $OBSIDIAN_VAULT_PATH
  Source:  <source path>  (<graph.json | OKF bundle>)
           <graph: exported at <graph.exported_at>, N nodes, M links | okf: N pages, okf_version <ver>>
  Created: <X> pages
  Merged:  <Z> pages  (existing pages updated)
  Skipped: <Y> pages  (only when --skip mode was used)

Only show the Skipped line if skip mode was explicitly requested. If overwrite mode was used, label merged pages as Replaced instead. For an OKF import, also report Unparseable: <U> files (no frontmatter/type, skipped) when U > 0.

Notes

  • Stub vs full pages: A graph.json import produces stubs — structure and wikilinks but no body, a starting point for future ingestion. An OKF bundle import produces full pages with real bodies — it is the lossless, content-bearing path and the right choice for vault-to-vault transfer.
  • Re-running is safe: The default merge mode is idempotent — re-running on an unchanged export will update timestamps but won't destroy content. Use overwrite only when you want to fully reset pages to stubs.
  • Directory creation: Always create missing category directories before writing pages.
  • Broken wikilinks: Since pages are being created together from the same export, most links will resolve. Any node referenced in links but absent from nodes (broken in the original export) will still appear as a wikilink — it just won't have a corresponding page file, which is valid.
  • Filtered exports: If the source graph.json was produced with visibility filtering (noted in graph.metadata), imported pages will only reflect the filtered set. Note this in the summary if graph.graph contains a filtered key.
1---
2name: wiki-import
3description: >
4 Import a wiki knowledge graph into the current vault — either from a graph.json export
5 file (stubs) or from an OKF (Open Knowledge Format) markdown bundle (full page bodies).
6 Use this skill when the user says "import wiki", "import from export", "load graph.json",
7 "import vault", "import OKF bundle", "import OKF", "load OKF", "import markdown bundle",
8 "/wiki-import", or wants to transfer pages from one vault to another using the output of wiki-export.
9---
10 
11# Wiki Import — Reconstruct Pages from an Export
12 
13You are importing a vault's knowledge into the current vault from one of two sources produced by `wiki-export`:
14 
15- **`graph.json`** — the graph skeleton. Reconstructs page **stubs** (frontmatter, typed relationships, a `## Related` link list — no body). Lossy.
16- **OKF bundle** (a `wiki-export/okf/` directory) — the actual markdown files. Reconstructs **full pages** with their real bodies. Lossless. Use this for true vault-to-vault transfer.
17 
18Either way, the import writes pages with correct frontmatter and wikilinks, then updates all vault metadata. **Step 2, Step 3 (graph only), and Step 5 are shared; Step 4 forks by source type.**
19 
20## Before You Start
21 
22**Writing profile:** Before drafting or rewriting natural-language Markdown, read and apply the `Writing Profile Resolution` section in `llm-wiki/SKILL.md`. Framework schema, provenance, safety, and operation-specific requirements take precedence.
23Preserve imported source prose; apply `WRITING.md` preferences only to newly generated metadata or stubs.
24 
251. **Resolve config** — follow the Config Resolution Protocol in `llm-wiki/SKILL.md` (inline `@name` override → walk up CWD for `.env` → global config → prompt setup). This gives `OBSIDIAN_VAULT_PATH`.
262. Read `$OBSIDIAN_VAULT_PATH/AGENTS.md` if it exists — apply any owner-specific conventions.
27 
28## Step 1: Locate and Detect Source Type
29 
30**Find the import source:**
31- If the user provided a path argument, use it directly.
32- Otherwise auto-detect, in order: `./wiki-export/okf/` (a directory) → `./wiki-export/graph.json` (a file).
33- If neither exists, ask the user for the path.
34 
35**Detect the source type:**
36- The path is a **file ending in `.json`** → **graph.json import** (validate below, then Step 3 + Step 4-Graph).
37- The path is a **directory** containing `.md` files with OKF frontmatter (a `type:` key), and/or a root `index.md` with `okf_version` → **OKF bundle import** (skip Step 3; go to Step 4-OKF). Both `okf_version` 0.1 and 0.2 bundles are accepted; Step 4-OKF reads either.
38- Anything else → report what's wrong and stop.
39 
40**Validate a graph.json source:**
41- Must be valid JSON
42- Must have top-level keys: `nodes` (array), `links` (array), `graph` (object)
43- Must have at least 1 node
44 
45If validation fails, report what's wrong and stop.
46 
47**Validate an OKF bundle source:**
48- Must contain at least 1 non-reserved `.md` file (i.e. not `index.md`/`log.md`) with parseable YAML frontmatter containing a non-empty `type`.
49- A `.md` with no frontmatter or no `type` is skipped (with a count), not fatal — OKF consumers are permissive (OKF §11).
50 
51**Show a preview before importing:**
52 
53graph.json:
54```
55Import preview (graph.json — stubs)
56 Source: <path> (exported at <graph.exported_at>)
57 Nodes: N total (concepts: A, entities: B, skills: C, references: D, ...)
58 Links: M edges (X typed, Y untyped)
59 Target: $OBSIDIAN_VAULT_PATH
60```
61 
62OKF bundle:
63```
64Import preview (OKF bundle — full pages)
65 Source: <dir> (okf_version <ver if present>)
66 Pages: N total (concepts: A, entities: B, skills: C, references: D, ...)
67 Target: $OBSIDIAN_VAULT_PATH
68```
69 
70## Step 2: Determine Conflict Resolution Mode
71 
72Read the user's phrasing to determine mode. Default is `merge`.
73 
74| Mode | Trigger phrases | Behaviour |
75|---|---|---|
76| `merge` | (default, no special phrasing) | Existing pages: update frontmatter tags/summary/relationships and add missing wikilinks; new pages: create stub. |
77| `skip` | "skip existing", "don't overwrite", "only new pages" | Leave existing pages completely untouched; only create pages that don't exist yet. |
78| `overwrite` | "overwrite", "replace existing", "force import" | Replace all matched pages with freshly reconstructed stubs regardless of existing content. |
79 
80## Step 3: Build Internal Maps *(graph.json only — skip for OKF bundles)*
81 
82Before writing anything, build two maps from the `links` array:
83 
84**Adjacency map** — for each node id, collect all neighbour ids (edges in either direction):
85```
86adjacency["concepts/transformers"] = ["entities/vaswani", "concepts/lstm", ...]
87```
88 
89**Typed edge map** — for each node id, collect outgoing typed edges only (`typed: true`):
90```
91typed_edges["concepts/transformers"] = [
92 {target: "concepts/lstm", relation: "contradicts"},
93 ...
94]
95```
96 
97## Step 4-Graph: Reconstruct Pages from graph.json *(graph.json source only)*
98 
99Record counts: `created = 0`, `skipped = 0`, `merged = 0`.
100 
101For each node in `nodes`:
102 
1031. Compute `page_path = $VAULT/<node.id>.md`
1042. Ensure the parent directory exists (e.g. `$VAULT/concepts/`)
1053. Check if the file already exists:
106 - **merge mode (default) + exists** → read existing file, apply merge logic (see below), increment `merged`
107 - **merge mode (default) + doesn't exist** → proceed to create stub, increment `created`
108 - **skip mode + exists** → increment `skipped`, continue to next node
109 - **skip mode + doesn't exist** → proceed to create stub, increment `created`
110 - **overwrite mode + exists** → proceed to write fresh stub (overwrite), increment `merged`
111 - **overwrite mode + doesn't exist** → proceed to create stub, increment `created`
112 
113### Page template (new or overwrite)
114 
115```markdown
116---
117title: <node.label>
118category: <node.category>
119tags: <node.tags as YAML list>
120sources:
121 - "imported from <graph.json path>"
122<if node.summary exists>
123summary: "<node.summary>"
124</if>
125<if typed_edges[node.id] is non-empty>
126relationships:
127<for each {target, relation} in typed_edges[node.id]>
128 - target: "[[<target>]]"
129 type: <relation>
130</for>
131</if>
132lifecycle: draft
133lifecycle_changed: <today YYYY-MM-DD>
134base_confidence: 0.5
135tier: supporting
136created: <ISO timestamp>
137updated: <ISO timestamp>
138---
139 
140# <node.label>
141 
142<node.summary paragraph if available, else omit>
143 
144## Related
145 
146<for each neighbour in adjacency[node.id], sorted alphabetically>
147<if edge is typed>
148- [[<neighbour>]] — <relation>
149<else>
150- [[<neighbour>]]
151</if>
152</for>
153```
154 
155If `adjacency[node.id]` is empty, omit the `## Related` section entirely.
156 
157### Merge logic (merge mode, existing page)
158 
1591. Read the existing page's frontmatter.
1602. **Tags**: union of existing tags and `node.tags` (deduplicated, keep existing order, append new ones).
1613. **Summary**: if the existing page has no `summary` field and `node.summary` exists, add it.
1624. **Relationships**: union of existing `relationships:` entries and `typed_edges[node.id]` — skip entries where the same `(target, type)` pair already exists.
1635. **Updated**: set `updated` to the current ISO timestamp.
1646. **Body**: scan for a `## Related` section. If it exists, append any missing wikilinks from `adjacency[node.id]` that aren't already linked anywhere in the body. If no `## Related` section exists, append one with the missing links.
1657. Leave the rest of the body untouched.
166 
167## Step 4-OKF: Reconstruct Pages from an OKF bundle *(OKF source only)*
168 
169Record counts: `created = 0`, `skipped = 0`, `merged = 0`, `unparseable = 0`.
170 
171Walk the bundle directory tree. For each `.md` file that is **not** a reserved file (`index.md`, `log.md`):
172 
1731. Parse the YAML frontmatter. If it has no frontmatter or no non-empty `type`, increment `unparseable` and skip the file.
1742. Compute the **concept id** = the file's path relative to the bundle root, with `.md` stripped (e.g. `concepts/transformers.md` → `concepts/transformers`). The target page is `$VAULT/<concept-id>.md`.
1753. **Reverse-map frontmatter** (the inverse of the canonical mapping table in `wiki-export` Step 3.5):
176 - `title` ← `title`.
177 - `category` ← the preserved `category` extension key if present; **else** lower-case the directory prefix of the concept id (`concepts/…` → `concepts`); **else** derive from `type` (`Concept`→`concepts`, `Entity`→`entities`, `Skill`→`skills`, `Reference`→`references`, `Synthesis`→`synthesis`, `Project`→`projects`, `Journal`→`journal`).
178 - `tags` ← `tags`.
179 - `summary` ← `description`.
180 - `updated` ← the preserved `updated` extension key if present; else `generated.at`; else a legacy v0.1 `timestamp`; else now.
181 - `created` ← the preserved `created` extension key if present, else now.
182 - `sources` ← OKF `sources`, as a list of strings: for each entry that is a mapping, take its `resource`; keep plain strings as-is (that's how v0.1 bundles from older exports carried our native list). If the bundle has no `sources`, use `["imported from OKF bundle <bundle path>"]`. If a top-level `resource` URL is present and not already in the list, add it.
183 - `lifecycle` ← the preserved `lifecycle` extension key if present; else from `status`: `draft` → `draft`, `deprecated` → `archived`, `stable` or absent → leave `lifecycle` unset. (OKF has no equivalent of `reviewed`/`verified`/`disputed`, so only our own exports restore them, through the preserved key.)
184 - Carry through any other preserved extension keys verbatim (`relationships`, `lifecycle_changed`, `tier`, `base_confidence`, …), and the OKF-only keys `generated`, `verified`, `stale_after`, and `usage_window` so a later export doesn't lose them. These make the round-trip lossless. Treat a bare `verified` mapping as a one-element list (OKF §5.2).
185 - **Except what our own exporter derived.** Drop `generated` when `generated.by` starts with `obsidian-wiki/` (it was computed from `updated`), and drop `verified` entries whose `by` is `human:vault-owner` (computed from the source vault's trust ledger, which doesn't travel). Keeping them would add keys the source page never had. Generated or verified blocks from any other producer are kept.
1864. **Reverse-transform body links** — markdown links that point at `.md` paths become wikilinks (this restores both real cross-links and forward-references the exporter preserved per `wiki-export` Step 3.5):
187 - `[text](../concepts/transformers.md)` or `[text](/concepts/transformers.md)` → resolve the path (relative to this file's dir, or bundle-root for `/`-absolute) to a concept id → `[[concepts/transformers]]`, or `[[concepts/transformers|text]]` when `text` differs from the target's title. The target's title comes from the bundle page when it exists; otherwise the exporter wrote the target's id as the link text, so treat text equal to the full id (or to its last path segment) as no alias.
188 - Treat the markdown target as a **file path first**: normalize the `.md` path relative to the current file, then strip the trailing `.md` from the resolved file path to recover the page id. Do not try to infer the id from directory traversal segments before resolving the full file path. This preserves round-trips for folder-note layouts like `projects/social-twitter.md` plus `projects/social-twitter/...`, where `../../social-twitter.md` must restore to `projects/social-twitter`.
189 - This applies **even when the target page is not in the bundle** — a path-form link to a not-yet-written page round-trips back to a dangling `[[wikilink]]` (Obsidian supports these; OKF §11 forbids rejecting them). Do not leave it as a markdown link.
190 - When `OBSIDIAN_LINK_FORMAT=markdown` is set in config, **keep** markdown links (just rewrite the path to be vault-relative); do not convert to wikilinks.
191 - Leave external `http(s)://` links and `# Citations` sections untouched.
1925. **Write the page** using the conflict mode from Step 2:
193 - **merge + exists** → reverse-map frontmatter and merge it into the existing page (union `tags`; fill `summary`/`sources` only if missing; union `relationships`; refresh `updated`). For the body, OKF carries a real body: replace the existing body with the bundle body **only if the existing page is a stub** (body is just a heading + `## Related`); otherwise keep the existing body and append any bundle `# Citations` / new `##` sections not already present. Increment `merged`.
194 - **merge + doesn't exist** → write the full page (frontmatter + full bundle body). Increment `created`.
195 - **skip + exists** → increment `skipped`, continue.
196 - **skip + doesn't exist** → write the full page. Increment `created`.
197 - **overwrite + exists** → write the full page, replacing the existing one. Increment `merged` (label as `Replaced` in the summary).
198 - **overwrite + doesn't exist** → write the full page. Increment `created`.
1996. Ensure the parent directory (`$VAULT/concepts/`, etc.) exists before writing.
200 
201Unlike the graph.json path, **do not** generate a `## Related` stub section — the bundle body already contains the real cross-links.
202 
203## Step 5: Update Vault Metadata
204 
205### `.manifest.json`
206 
207Add a new entry keyed by the canonical path of the graph.json file:
208 
209```json
210"<absolute path to source>": {
211 "ingested_at": "<ISO timestamp>",
212 "source_type": "wiki-export",
213 "pages_created": ["list/of/created/pages.md"],
214 "pages_updated": ["list/of/merged/pages.md"]
215}
216```
217 
218Set `source_type` to `"wiki-export"` for a graph.json import or `"okf-bundle"` for an OKF bundle import. Key the entry by the absolute path of the source (the `graph.json` file or the bundle directory).
219 
220Also increment:
221- `stats.total_sources_ingested` by 1
222- `stats.total_pages` by the count of pages actually created (not skipped/merged)
223 
224If `.manifest.json` doesn't exist, create it with the standard structure:
225```json
226{
227 "stats": {
228 "total_sources_ingested": 1,
229 "total_pages": <created count>
230 },
231 "<graph.json path>": { ... }
232}
233```
234 
235### `index.md`, `log.md`, and `hot.md`
236 
237One locked call. The index is reconciled from the pages now on disk, so every created or merged page lands under its category with the documented `( #tag)` spacing:
238 
239```bash
240obsidian-wiki memory sync IMPORT \
241 source="<bundle path>" \
242 pages_created=<N> pages_skipped=<K> pages_merged=<M> \
243 --takeaways "Imported <bundle>: <what it adds to the picture>"
244```
245 
246Omit `--takeaways` if the import does not shift the overall picture; the previous takeaways carry across. Never hand-edit `index.md`, `log.md`, or `hot.md` — the command takes the lock that keeps a parallel writer from dropping your update.
247 
248See `.skills/llm-wiki/references/MEMORY.md` for the full procedure.
249 
250## Step 6: Print Summary
251 
252```
253Wiki import complete → $OBSIDIAN_VAULT_PATH
254 Source: <source path> (<graph.json | OKF bundle>)
255 <graph: exported at <graph.exported_at>, N nodes, M links | okf: N pages, okf_version <ver>>
256 Created: <X> pages
257 Merged: <Z> pages (existing pages updated)
258 Skipped: <Y> pages (only when --skip mode was used)
259```
260 
261Only show the `Skipped` line if `skip` mode was explicitly requested. If `overwrite` mode was used, label merged pages as `Replaced` instead. For an OKF import, also report `Unparseable: <U> files (no frontmatter/type, skipped)` when `U > 0`.
262 
263## Notes
264 
265- **Stub vs full pages**: A **graph.json** import produces stubs — structure and wikilinks but no body, a starting point for future ingestion. An **OKF bundle** import produces full pages with real bodies — it is the lossless, content-bearing path and the right choice for vault-to-vault transfer.
266- **Re-running is safe**: The default `merge` mode is idempotent — re-running on an unchanged export will update timestamps but won't destroy content. Use `overwrite` only when you want to fully reset pages to stubs.
267- **Directory creation**: Always create missing category directories before writing pages.
268- **Broken wikilinks**: Since pages are being created together from the same export, most links will resolve. Any node referenced in `links` but absent from `nodes` (broken in the original export) will still appear as a wikilink — it just won't have a corresponding page file, which is valid.
269- **Filtered exports**: If the source `graph.json` was produced with visibility filtering (noted in `graph.metadata`), imported pages will only reflect the filtered set. Note this in the summary if `graph.graph` contains a `filtered` key.
270 

Discussion

Alternatives

Wiki Export — Knowledge Graph ExportExport the Obsidian wiki's knowledge graph to structured formats for use in external tools. Use this skill when the user says "export wiki", "export graph", "export to JSON", "export to Gephi", export to Neo4j", "export to Postgres", "export to SQL", "graphml", "visualize wiki", knowledge graph export", "export to OKF", "OKF bundle", "open knowledge format", export as markdown bundle", or wants to use their wiki data in another tool. Outputs graph.json, graph.graphml, cypher.txt (Neo4j), postgres.sql (Postgres), and graph.html (interactive browser visualization) into a wiki-export/ directory at the vault root, plus an optional OKF (Open Knowledge Format) markdown bundle under wiki-export/okf/.Business & ops · MIT/recall: session memory engineFind prior Claude Code and Codex sessions with an indexed local search engine, then continue the work, repeat it with fresh inputs, or distill it into a skill. Runs from Claude Code, Codex, or pi; the current index covers Claude Code and Codex transcripts. Use when the user names Recall, says "find that conversation where…", "what did we do last time about…", "continue what we did yesterday on X", "what did codex do on this branch", "turn what we did about Y into a skill", or "remember when you…". Not for searching code (use grep on the repo) or for facts already in MEMORY.md.Business & ops · MITKnowledge Graph Memory ServerA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across…Coding · MITDaskDistributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.Science · MIT