Internalized Wiki
Build and maintain a personal LLM wiki for Obsidian. The agent owns source ingestion and compiled knowledge articles; the user owns internalization notes and review readiness.
Core ideas:
- Sources are preserved under
raw/. - Durable synthesized knowledge compounds under
wiki/. - Obsidian YAML tracks internalization and review state.
- The
## 内化section is user-authored and must be preserved.
Architecture
All paths are under the user's project root:
raw/ - Immutable source material. Read existing raw files but do not rewrite them. Organize by topic subdirectories such as raw/machine-learning/.
wiki/ - Compiled knowledge articles. The agent may create and update these files, while preserving user-owned internalization content. Organize one topic level deep: wiki/<topic>/<article>.md.
wiki/index.md - Global index. One row per article, grouped by topic, with link, summary, and Updated date.
wiki/log.md - Append-only operation log.
Templates live in references/ relative to this file. Read them when exact formatting is needed:
references/raw-template.mdreferences/article-template.mdreferences/archive-template.mdreferences/index-template.md
Initialization
Initialize only on the first ingest. Check whether raw/ and wiki/ exist. Create only what is missing; never overwrite existing files:
raw/directory with.gitkeepwiki/directory with.gitkeepwiki/index.mdwith heading# Knowledge Base Indexwiki/log.mdwith heading# Wiki Log
If query or lint cannot find the wiki structure, tell the user: "Run an ingest first to initialize the wiki." Do not auto-create it.
Metadata Model
Normal wiki articles use YAML frontmatter for Obsidian and review automation:
---
内化: false
review:
state: new
due: null
last_reviewed: null
difficulty: null
stability: null
retrievability: null
---
Keep human-readable provenance immediately after the title:
> Sources: ...
> Raw: ...
Use YAML for machine-readable internalization and review state. Use blockquotes for source traceability. Do not replace one with the other.
Ingest
Fetch source material into raw/, then compile it into wiki/. Always do both steps.
Fetch Raw Source
- Get the source content with available web or file tools. If no tool can reach it, ask the user to paste it.
- Pick a topic directory. Check existing
raw/subdirectories first; reuse a close topic. Create a new topic only for genuinely distinct material. - Save as
raw/<topic>/YYYY-MM-DD-descriptive-slug.md.- Build the slug from the source title, kebab-case, max 60 characters.
- If published date is unknown, omit the date prefix from the filename and set metadata Published to
Unknown. - If the filename exists, append a numeric suffix such as
-2. - Include source URL or origin, collected date, and published date.
- Preserve source text faithfully. Clean formatting noise but do not rewrite opinions or meaning.
Use references/raw-template.md for exact format.
Compile Wiki Knowledge
Determine where the source belongs:
- Same core thesis as an existing article: merge into that article.
- New concept: create a new article in the most relevant topic directory.
- Spans multiple topics: place it in the most relevant topic and add See Also links.
A single source may both update an existing article and create another article if it introduces a distinct concept.
When creating a new article, use references/article-template.md.
When updating an existing article:
- Preserve any user-written
## 内化section exactly as-is. - If YAML frontmatter is missing, add the default metadata block.
- If YAML frontmatter exists, merge only required article metadata changes.
- Never overwrite non-null
reviewfields. Those belong to the review system. - Refresh the Updated date when article knowledge changes.
Check for factual conflicts. If a new source contradicts existing content, annotate the disagreement with source attribution. If conflicting content lives in separate articles, note it in both and cross-link them.
Cascade Updates
After the primary article:
- Scan articles in the same topic directory for materially affected content.
- Scan
wiki/index.mdentries in other topics for related concepts. - Update every article whose knowledge is materially affected.
Archive pages are point-in-time snapshots and are never cascade-updated.
Post-Ingest
Update wiki/index.md for every touched article. When adding a topic section, include a one-line description. Updated dates reflect when article knowledge changed, not filesystem timestamps.
Append to wiki/log.md:
## [YYYY-MM-DD] ingest | <primary article title>
- Updated: <cascade-updated article title>
- Updated: <another cascade-updated article title>
Omit - Updated: lines when no cascade updates occurred.
Internalization Workflow
The agent writes or updates compiled knowledge. The user reads the article in Obsidian, writes personal understanding under ## 内化, then changes YAML 内化 from false to true when the note is ready for review.
Treat ## 内化 as user-authored content:
- The agent may read it during ingest, query, or lint.
- The agent must not overwrite, rewrite, summarize, relocate, or delete it.
- Template comments or placeholders under
## 内化do not count as user-written internalization. - If
内化: true,## 内化must exist and contain non-placeholder content to be review-ready.
Query
Search the wiki and answer questions. Triggers include:
- "What do I know about X?"
- "Summarize everything related to Y"
- "Compare A and B based on my wiki"
Steps:
- Read
wiki/index.mdto locate relevant articles. - Read those articles and synthesize an answer.
- Prefer wiki content over training knowledge.
- Cite sources with project-root-relative markdown links, such as
[Article Title](wiki/topic/article.md). - Output the answer in conversation. Do not write files unless asked.
Archiving
When the user explicitly asks to archive or save a query answer to the wiki:
- Write the answer as a new wiki page using
references/archive-template.md.- Convert conversation citations to paths relative to the archive file.
- Use Sources links to cited wiki articles.
- Do not include a Raw field because archive content comes from synthesized wiki answers.
- Name the file after the query topic.
- Place it in the most relevant topic directory.
- Always create a new page. Never merge archive content into normal articles.
- Update
wiki/index.md. Prefix the Summary with[Archived]. - Append to
wiki/log.md:
## [YYYY-MM-DD] query | Archived: <page title>
Archive pages may keep YAML frontmatter if present and must preserve any existing user-written ## 内化 content if they are later touched.
Lint
Run quality checks on the wiki. Deterministic checks may be auto-fixed. Heuristic checks are report-only.
Deterministic Checks
Auto-fix these when safe:
Index consistency
- File exists but is missing from
wiki/index.md: add an entry with(no summary)placeholder. For Updated, use article metadata Updated date if present; otherwise use file last modified date. - Index entry points to a missing file: mark it
[MISSING]in the index. Do not delete it.
Internal links
- For markdown links in wiki article bodies and Sources metadata, excluding Raw field links and excluding index/log files: if the target is missing, search
wiki/for a same-named file. - Exactly one match: fix the path.
- Zero or multiple matches: report to the user.
Raw references
- Every Raw field link must point to an existing
raw/file. - Missing target with exactly one same-named raw match: fix the path.
- Zero or multiple matches: report to the user.
See Also
- Within each topic directory, add obvious missing cross-references between related articles.
- Remove links to deleted files.
Internalization metadata
- If YAML frontmatter is missing on a normal article, add the default internalization and review block.
- Do not overwrite non-null
reviewfields. - Preserve
## 内化content exactly.
Heuristic Checks
Report these without auto-fixing:
- Factual contradictions across articles.
- Outdated claims superseded by newer sources.
- Missing conflict annotations where sources disagree.
- Orphan pages with no inbound links from other wiki articles.
- Missing cross-topic references.
- Concepts frequently mentioned but lacking a dedicated page.
- Archive pages whose cited source articles have been substantially updated since archival.
内化: truearticles with missing or empty## 内化.## 内化sections that contain only comments, placeholders, or template text.
Post-Lint
Append to wiki/log.md:
## [YYYY-MM-DD] lint | <N> issues found, <M> auto-fixed
Conventions
- Use standard markdown with relative links in wiki files.
- In conversation, cite project-root-relative paths.
- Keep
wiki/one topic level deep. No deeper nesting. - Keep
raw/immutable after source capture. - Use today's date for log entries, collected dates, and archived dates.
- Published dates come from the source; use
Unknownwhen unavailable. - Updated dates reflect when article knowledge content changed.
- Ingest, archive, and lint update
wiki/log.md. - Ingest and archive update
wiki/index.md; lint updates the index only for deterministic index fixes. - Plain queries do not write files.
Common Mistakes
| Mistake | Correct behavior |
|---|---|
| Reading another wiki skill to fill gaps | This skill is self-contained; use its own workflow and templates. |
| Replacing blockquote provenance with YAML | Keep YAML for state and blockquotes for Sources/Raw provenance. |
Treating ## 内化 as generated content |
Preserve it exactly; it belongs to the user. |
| Marking empty internalization as review-ready | Report it; do not generate internalization for the user. |
| Updating archive pages during cascade | Leave archive pages as point-in-time snapshots. |