Tutor Setup — Knowledge to Obsidian StudyVault
CWD Boundary Rule (Document Mode & Codebase Mode)
NEVER access files outside the current working directory (CWD).
All source scanning, reading, and vault output MUST stay within CWD and its subdirectories.
If the user provides an external path, ask them to copy the files into CWD first.
Wiki Mode exception: Wiki Mode reads from a user-specified wiki path, which may
be outside CWD. StudyVault output (sync target) still goes into CWD.
Mode Detection
On invocation, detect mode automatically:
- Check for wiki indicators in CWD:
SCHEMA.md + index.md present (llm-wiki structure)
raw/ directory with articles/ or papers/ subdirectories
- If found → Wiki Mode (confirm with user)
- Check for project markers in CWD:
package.json, pom.xml, build.gradle, Cargo.toml, go.mod, Makefile,
*.sln, pyproject.toml, setup.py, Gemfile
- If any marker found → Codebase Mode
- If no marker found → Document Mode
- Tie-break: If
.git/ is the sole indicator and no source code files (*.ts, *.py, *.java, *.go, *.rs, etc.) exist, default to Document Mode.
- Announce detected mode and ask user to confirm or override.
Document Mode
Transforms knowledge sources (PDF, text, web, epub) into study notes.
Templates: templates.md
Phase D1: Source Discovery & Extraction
- Auto-scan CWD for
**/*.pdf, **/*.txt, **/*.md, **/*.html, **/*.epub (exclude node_modules/, .git/, dist/, build/, StudyVault/). Present for user confirmation.
- Extract text (MANDATORY tools):
- Read extracted
.txt files — understand scope, structure, depth. Work exclusively from the converted text, never from the raw PDF.
- Source Content Mapping (MANDATORY for multi-file sources):
- Read cover page + TOC + 3+ sample pages from middle/end for EVERY source file
- NEVER assume content from filename — file numbering often ≠ chapter numbering
- Build verified mapping:
{ source_file → actual_topics → page_ranges }
- Flag non-academic files and missing sources
- Present mapping to user for verification before proceeding
Phase D2: Content Analysis
- Identify topic hierarchy — sections, chapters, domain divisions.
- Separate concept content vs practice questions.
- Map dependencies between topics.
- Identify key patterns — comparisons, decision trees, formulas.
- Full topic checklist (MANDATORY) — every topic/subtopic listed. Drives all subsequent phases.
Equal Depth Rule: Even a briefly mentioned subtopic MUST get a full dedicated note supplemented with textbook-level knowledge.
- Classification completeness: When source enumerates categories ("3 types of X"), every member gets a dedicated note. Scan for: "types of", "幾種", "幾類", "categories", "there are N".
- Source-to-note cross-verification (MANDATORY): Record which source file(s) and page range(s) cover each topic. Flag untraceable topics as "source not available".
Phase D3: Tag Standard
Define tag vocabulary before creating notes:
- Format: English, lowercase, kebab-case (e.g.,
#data-hazard)
- Hierarchy: top-level → domain → detail → technique → note-type
- Registry: Only registered tags allowed. Detail tags co-attach parent domain tag.
Phase D4: Vault Structure
Create StudyVault/ with numbered folders per templates.md. Group 3-5 related concepts per file.
Phase D5: Dashboard Creation
Create 00-Dashboard/: MOC, Quick Reference, Exam Traps. See templates.md.
- MOC: Topic Map + Practice Notes + Study Tools + Tag Index (with rules) + Weak Areas (with links) + Non-core Topic Policy
- Quick Reference: every heading includes
→ [[Concept Note]] link; all key formulas
- Exam Traps: per-topic trap points in fold callouts, linked to concept notes
Phase D6: Concept Notes
Per templates.md. Key rules:
- YAML frontmatter:
source_pdf, part, keywords (MANDATORY)
- source_pdf MUST match verified Phase D1 mapping — never guess from filename
- If unavailable:
source_pdf: 未持有原文
[[wiki-links]], callouts ([!tip], [!important], [!warning]), comparison tables > prose
- ASCII diagrams for processes/flows/sequences
- Simplification-with-exceptions: general statements must note edge cases
Phase D7: Practice Questions
Per templates.md. Key rules:
- Every topic folder MUST have a practice file (8+ questions)
- Active recall: answers use
> [!answer]- 查看答案 fold callout
- Patterns use
> [!hint]- / > [!summary]- fold callouts
- Question type diversity: ≥60% recall, ≥20% application, ≥2 analysis per file
## Related Concepts with [[wiki-links]]
Phase D8: Interlinking
## Related Notes on every concept note
- MOC links to every concept + practice note
- Cross-link concept ↔ practice; siblings reference each other
- Quick Reference sections →
[[Concept Note]] links
- Weak Areas → relevant note + Exam Traps; Exam Traps → concept notes
Phase D9: Self-Review (MANDATORY)
Verify against quality-checklist.md Document Mode section. Fix and re-verify until all checks pass.
Codebase Mode
Generates a new-developer onboarding StudyVault from a source code project.
Full workflow: codebase-workflow.md
Templates: codebase-templates.md
Phase Summary
| Phase |
Name |
Key Action |
| C1 |
Project Exploration |
Scan files, detect tech stack, read entry points, map directory layout |
| C2 |
Architecture Analysis |
Identify patterns, trace request flow, map module boundaries and data flow |
| C3 |
Tag Standard |
Define #arch-*, #module-*, #pattern-*, #api-* tag registry |
| C4 |
Vault Structure |
Create StudyVault/ with Dashboard, Architecture, per-module, DevOps, Exercises folders |
| C5 |
Dashboard |
MOC (Module Map + API Surface + Getting Started + Onboarding Path) + Quick Reference |
| C6 |
Module Notes |
Per-module notes: Purpose, Key Files, Public Interface, Internal Flow, Dependencies |
| C7 |
Onboarding Exercises |
Code reading, configuration, debugging, extension exercises (5+ per major module) |
| C8 |
Interlinking |
Cross-link modules, architecture ↔ implementations, exercises ↔ modules |
| C9 |
Self-Review |
Verify against quality-checklist.md Codebase Mode section |
See codebase-workflow.md for detailed per-phase instructions.
Wiki Mode
Imports an llm-wiki knowledge base into a StudyVault for learning and progress tracking.
Wiki pages become concept notes; practice questions are auto-generated from wiki content.
Supports incremental sync — new/changed wiki pages are detected and synced without
regenerating the entire StudyVault.
Note: Wiki Mode reads from a user-specified wiki path, which may be outside CWD.
This is the only mode that does not enforce the CWD Boundary Rule for source reads.
StudyVault output still goes into CWD.
Phase W1: Locate Wiki
- User specifies wiki path → use it.
- No path given → scan CWD for wiki indicators (
SCHEMA.md + index.md).
- If found in CWD → confirm with user.
- If not found → ask user for the wiki path.
- Verify wiki structure: check for
SCHEMA.md, index.md, concepts/ directory.
If incomplete, warn the user and ask whether to proceed.
Phase W2: Orient (MANDATORY)
Read the wiki before any operation:
① Read SCHEMA.md — understand domain, tag taxonomy, conventions.
② Read index.md — learn what pages exist.
③ Read last 20 entries of log.md — recent activity.
Only after orientation should you sync or create StudyVault content.
Phase W3: Diff Detection
Check for existing sync state:
- Look for
StudyVault/.sync-manifest.json.
- If not found → first-time sync (full import).
- If found → read manifest, compute sha256 for each wiki page, compare:
# Single file sha256 (body only, frontmatter excluded)
python scripts/sha256_wiki.py "<wiki>/concepts/transformer.md"
# Batch — all .md files under wiki, outputs JSON
python scripts/sha256_wiki.py "<wiki>/concepts/"
- Compare results with manifest:
- NEW: wiki page not in manifest → needs import
- CHANGED: sha256 differs → needs re-import (preserve learning progress)
- DELETED: manifest entry has no matching wiki page → remove from StudyVault, archive learning progress
The script at scripts/sha256_wiki.py handles frontmatter extraction automatically.
For the initial sync (no manifest yet), compute sha256 for all wiki pages and write
the full manifest.
Phase W4: Concept Grouping
Wiki already has topic-based structure. Use it directly:
- Read wiki's
topics/ directory — each subdirectory is a research topic.
- Read each topic's
index.md to understand its scope.
- Map wiki topics to StudyVault folders (
topics/ai-safety/ → 01-AI-Safety/, etc.).
- Global
concepts/ and entities/ (cross-topic pages) → map to a "Cross-Topic" StudyVault folder or distribute to relevant topic folders based on tags.
- User can override mapping via manifest
grouping.tag_to_folder config.
Phase W5: Transform & Generate
For each new or changed wiki page:
Wiki page → StudyVault concept note mapping:
| Wiki field |
StudyVault field |
title |
Note title |
tags |
#tag markers |
sources |
source_pdf frontmatter |
confidence / contested |
Flag as Exam Trap candidates |
| Content (definition, state, questions) |
Overview Table + Exam Patterns |
[[wikilinks]] |
[[wiki-links]] preserved |
Practice question generation:
- Generate ≥8 questions per concept note
- Mix: ≥60% recall, ≥20% application, ≥2% analysis
- Apply zero-hint policy from the
tutor skill's references/quiz-rules.md
- High-risk content (
contested: true, confidence: low) → prioritize analysis questions
Phase W6: Dashboard Update + Manifest Write
- Dashboard: Recalculate proficiency table from
concepts/{area}.md.
- New topics default to ⬜ (unmeasured).
- Existing topics retain their progress.
- Update MOC Topic Map to link all concept notes.
- Sync manifest: Write/update
StudyVault/.sync-manifest.json with:
- All wiki page paths + sha256 + vault_path + synced_at timestamp
- Report: List what was added, updated, and removed.
Incremental Sync
When the user has new research to add:
- New sources → ingest into wiki (via llm-wiki skill).
- Run Wiki Mode again → diff detection finds new/changed pages → sync only those.
- StudyVault expands automatically; dashboard updates; learning progress preserved.
Sync Manifest Format
{
"version": 1,
"wiki_path": "/path/to/wiki",
"last_sync": "2026-07-09T10:00:00Z",
"pages": {
"concepts/transformer-architecture.md": {
"sha256": "abc123...",
"vault_path": "01-AI/transformer-architecture.md",
"synced_at": "2026-07-09T10:00:00Z"
}
}
}
Edge Cases
| Scenario |
Handling |
| Wiki page renamed |
Manifest path mismatch → delete old + create new. Learning progress archived, auto-linked by tags when possible. |
| Wiki page split |
Reported as orphaned during sync. User decides how to regroup. |
| User adds manual notes in StudyVault |
Not tracked by manifest. Sync will not touch them. |
| Wiki and StudyVault on different machines |
Not supported. Wiki path must be accessible from the same environment. |
| Wiki page exceeds 200 lines |
Wiki should split first (llm-wiki lint catches this). StudyVault does not re-process. |
Language
- Match source material language (Korean → Korean notes, etc.)
- Tags/keywords: ALWAYS English
1---2name: tutor-setup3description: Transforms knowledge sources into an Obsidian StudyVault. This skill MUST be used when the user asks to build a StudyVault from documents, a codebase, or an llm-wiki. Three modes: (1) Document Mode — PDF/text/web sources → study notes with practice questions. (2) Codebase Mode — source code project → onboarding vault for new developers. (3) Wiki Mode — llm-wiki knowledge base → StudyVault with incremental sync. Mode is auto-detected based on project markers and wiki presence.4---56# Tutor Setup — Knowledge to Obsidian StudyVault78## CWD Boundary Rule (Document Mode & Codebase Mode)910> **NEVER access files outside the current working directory (CWD).**11> All source scanning, reading, and vault output MUST stay within CWD and its subdirectories.12> If the user provides an external path, ask them to copy the files into CWD first.1314**Wiki Mode exception:** Wiki Mode reads from a user-specified wiki path, which may15be outside CWD. StudyVault output (sync target) still goes into CWD.1617## Mode Detection1819On invocation, detect mode automatically:20211. **Check for wiki indicators** in CWD:22 - `SCHEMA.md` + `index.md` present (llm-wiki structure)23 - `raw/` directory with `articles/` or `papers/` subdirectories24 - If found → **Wiki Mode** (confirm with user)252. **Check for project markers** in CWD:26 - `package.json`, `pom.xml`, `build.gradle`, `Cargo.toml`, `go.mod`, `Makefile`,27 `*.sln`, `pyproject.toml`, `setup.py`, `Gemfile`283. **If any marker found** → **Codebase Mode**294. **If no marker found** → **Document Mode**305. **Tie-break**: If `.git/` is the sole indicator and no source code files (`*.ts`, `*.py`, `*.java`, `*.go`, `*.rs`, etc.) exist, default to Document Mode.316. Announce detected mode and ask user to confirm or override.3233---3435## Document Mode3637> Transforms knowledge sources (PDF, text, web, epub) into study notes.38> Templates: [templates.md](references/templates.md)3940### Phase D1: Source Discovery & Extraction41421. **Auto-scan CWD** for `**/*.pdf`, `**/*.txt`, `**/*.md`, `**/*.html`, `**/*.epub` (exclude `node_modules/`, `.git/`, `dist/`, `build/`, `StudyVault/`). Present for user confirmation.432. **Extract text (MANDATORY tools)**:44 - **PDF → `pdftotext` CLI ONLY** (run via Bash tool). NEVER use the Read tool directly on PDF files — it renders pages as images and wastes 10-50x more tokens. Convert to `.txt` first, then Read the `.txt` file.45 ```bash46 pdftotext "source.pdf" "/tmp/source.txt"47 ```48 - If `pdftotext` is not installed, install it first: `brew install poppler` (macOS) or `apt-get install poppler-utils` (Linux).49 - URL → WebFetch50 - Other formats (`.md`, `.txt`, `.html`) → Read directly.513. **Read extracted `.txt` files** — understand scope, structure, depth. Work exclusively from the converted text, never from the raw PDF.524. **Source Content Mapping (MANDATORY for multi-file sources)**:53 - Read **cover page + TOC + 3+ sample pages from middle/end** for EVERY source file54 - **NEVER assume content from filename** — file numbering often ≠ chapter numbering55 - Build verified mapping: `{ source_file → actual_topics → page_ranges }`56 - Flag non-academic files and missing sources57 - Present mapping to user for verification before proceeding5859### Phase D2: Content Analysis60611. Identify topic hierarchy — sections, chapters, domain divisions.622. Separate concept content vs practice questions.633. Map dependencies between topics.644. Identify key patterns — comparisons, decision trees, formulas.655. **Full topic checklist (MANDATORY)** — every topic/subtopic listed. Drives all subsequent phases.6667> **Equal Depth Rule**: Even a briefly mentioned subtopic MUST get a full dedicated note supplemented with textbook-level knowledge.68696. **Classification completeness**: When source enumerates categories ("3 types of X"), every member gets a dedicated note. Scan for: "types of", "幾種", "幾類", "categories", "there are N".707. **Source-to-note cross-verification (MANDATORY)**: Record which source file(s) and page range(s) cover each topic. Flag untraceable topics as "source not available".7172### Phase D3: Tag Standard7374Define tag vocabulary before creating notes:7576- **Format**: English, lowercase, kebab-case (e.g., `#data-hazard`)77- **Hierarchy**: top-level → domain → detail → technique → note-type78- **Registry**: Only registered tags allowed. Detail tags co-attach parent domain tag.7980### Phase D4: Vault Structure8182Create `StudyVault/` with numbered folders per [templates.md](references/templates.md). Group 3-5 related concepts per file.8384### Phase D5: Dashboard Creation8586Create `00-Dashboard/`: MOC, Quick Reference, Exam Traps. See [templates.md](references/templates.md).8788- **MOC**: Topic Map + Practice Notes + Study Tools + Tag Index (with rules) + Weak Areas (with links) + Non-core Topic Policy89- **Quick Reference**: every heading includes `→ [[Concept Note]]` link; all key formulas90- **Exam Traps**: per-topic trap points in fold callouts, linked to concept notes9192### Phase D6: Concept Notes9394Per [templates.md](references/templates.md). Key rules:9596- YAML frontmatter: `source_pdf`, `part`, `keywords` (MANDATORY)97- **source_pdf MUST match verified Phase D1 mapping** — never guess from filename98- If unavailable: `source_pdf: 未持有原文`99- `[[wiki-links]]`, callouts (`[!tip]`, `[!important]`, `[!warning]`), comparison tables > prose100- ASCII diagrams for processes/flows/sequences101- **Simplification-with-exceptions**: general statements must note edge cases102103### Phase D7: Practice Questions104105Per [templates.md](references/templates.md). Key rules:106107- Every topic folder MUST have a practice file (8+ questions)108- **Active recall**: answers use `> [!answer]- 查看答案` fold callout109- Patterns use `> [!hint]-` / `> [!summary]-` fold callouts110- **Question type diversity**: ≥60% recall, ≥20% application, ≥2 analysis per file111- `## Related Concepts` with `[[wiki-links]]`112113### Phase D8: Interlinking1141151. `## Related Notes` on every concept note1162. MOC links to every concept + practice note1173. Cross-link concept ↔ practice; siblings reference each other1184. Quick Reference sections → `[[Concept Note]]` links1195. Weak Areas → relevant note + Exam Traps; Exam Traps → concept notes120121### Phase D9: Self-Review (MANDATORY)122123Verify against [quality-checklist.md](references/quality-checklist.md) **Document Mode** section. Fix and re-verify until all checks pass.124125---126127## Codebase Mode128129> Generates a new-developer onboarding StudyVault from a source code project.130> Full workflow: [codebase-workflow.md](references/codebase-workflow.md)131> Templates: [codebase-templates.md](references/codebase-templates.md)132133### Phase Summary134135| Phase | Name | Key Action |136| ----- | --------------------- | ------------------------------------------------------------------------------------------------ |137| C1 | Project Exploration | Scan files, detect tech stack, read entry points, map directory layout |138| C2 | Architecture Analysis | Identify patterns, trace request flow, map module boundaries and data flow |139| C3 | Tag Standard | Define `#arch-*`, `#module-*`, `#pattern-*`, `#api-*` tag registry |140| C4 | Vault Structure | Create `StudyVault/` with Dashboard, Architecture, per-module, DevOps, Exercises folders |141| C5 | Dashboard | MOC (Module Map + API Surface + Getting Started + Onboarding Path) + Quick Reference |142| C6 | Module Notes | Per-module notes: Purpose, Key Files, Public Interface, Internal Flow, Dependencies |143| C7 | Onboarding Exercises | Code reading, configuration, debugging, extension exercises (5+ per major module) |144| C8 | Interlinking | Cross-link modules, architecture ↔ implementations, exercises ↔ modules |145| C9 | Self-Review | Verify against [quality-checklist.md](references/quality-checklist.md) **Codebase Mode** section |146147See [codebase-workflow.md](references/codebase-workflow.md) for detailed per-phase instructions.148149---150151## Wiki Mode152153> Imports an llm-wiki knowledge base into a StudyVault for learning and progress tracking.154> Wiki pages become concept notes; practice questions are auto-generated from wiki content.155> Supports incremental sync — new/changed wiki pages are detected and synced without156> regenerating the entire StudyVault.157158**Note:** Wiki Mode reads from a user-specified wiki path, which may be outside CWD.159This is the only mode that does not enforce the CWD Boundary Rule for source reads.160StudyVault output still goes into CWD.161162### Phase W1: Locate Wiki1631641. **User specifies wiki path** → use it.1652. **No path given** → scan CWD for wiki indicators (`SCHEMA.md` + `index.md`).166 - If found in CWD → confirm with user.167 - If not found → ask user for the wiki path.1683. **Verify wiki structure**: check for `SCHEMA.md`, `index.md`, `concepts/` directory.169 If incomplete, warn the user and ask whether to proceed.170171### Phase W2: Orient (MANDATORY)172173Read the wiki before any operation:174175① Read `SCHEMA.md` — understand domain, tag taxonomy, conventions.176② Read `index.md` — learn what pages exist.177③ Read last 20 entries of `log.md` — recent activity.178179Only after orientation should you sync or create StudyVault content.180181### Phase W3: Diff Detection182183Check for existing sync state:1841851. Look for `StudyVault/.sync-manifest.json`.1862. **If not found** → first-time sync (full import).1873. **If found** → read manifest, compute sha256 for each wiki page, compare:188189```bash190# Single file sha256 (body only, frontmatter excluded)191python scripts/sha256_wiki.py "<wiki>/concepts/transformer.md"192193# Batch — all .md files under wiki, outputs JSON194python scripts/sha256_wiki.py "<wiki>/concepts/"195```1961974. Compare results with manifest:198 - **NEW**: wiki page not in manifest → needs import199 - **CHANGED**: sha256 differs → needs re-import (preserve learning progress)200 - **DELETED**: manifest entry has no matching wiki page → remove from StudyVault, archive learning progress201202The script at `scripts/sha256_wiki.py` handles frontmatter extraction automatically.203For the initial sync (no manifest yet), compute sha256 for all wiki pages and write204the full manifest.205206### Phase W4: Concept Grouping207208Wiki already has topic-based structure. Use it directly:2092101. Read wiki's `topics/` directory — each subdirectory is a research topic.2112. Read each topic's `index.md` to understand its scope.2123. Map wiki topics to StudyVault folders (`topics/ai-safety/` → `01-AI-Safety/`, etc.).2134. Global `concepts/` and `entities/` (cross-topic pages) → map to a "Cross-Topic" StudyVault folder or distribute to relevant topic folders based on tags.2145. User can override mapping via manifest `grouping.tag_to_folder` config.215216### Phase W5: Transform & Generate217218For each new or changed wiki page:219220**Wiki page → StudyVault concept note mapping:**221222| Wiki field | StudyVault field |223| -------------------------------------- | ------------------------------ |224| `title` | Note title |225| `tags` | `#tag` markers |226| `sources` | `source_pdf` frontmatter |227| `confidence` / `contested` | Flag as Exam Trap candidates |228| Content (definition, state, questions) | Overview Table + Exam Patterns |229| `[[wikilinks]]` | `[[wiki-links]]` preserved |230231**Practice question generation:**232233- Generate ≥8 questions per concept note234- Mix: ≥60% recall, ≥20% application, ≥2% analysis235- Apply zero-hint policy from the `tutor` skill's `references/quiz-rules.md`236- High-risk content (`contested: true`, `confidence: low`) → prioritize analysis questions237238### Phase W6: Dashboard Update + Manifest Write2392401. **Dashboard**: Recalculate proficiency table from `concepts/{area}.md`.241 - New topics default to ⬜ (unmeasured).242 - Existing topics retain their progress.243 - Update MOC Topic Map to link all concept notes.2442. **Sync manifest**: Write/update `StudyVault/.sync-manifest.json` with:245 - All wiki page paths + sha256 + vault_path + synced_at timestamp2463. **Report**: List what was added, updated, and removed.247248### Incremental Sync249250When the user has new research to add:2512521. New sources → ingest into wiki (via llm-wiki skill).2532. Run Wiki Mode again → diff detection finds new/changed pages → sync only those.2543. StudyVault expands automatically; dashboard updates; learning progress preserved.255256### Sync Manifest Format257258```json259{260 "version": 1,261 "wiki_path": "/path/to/wiki",262 "last_sync": "2026-07-09T10:00:00Z",263 "pages": {264 "concepts/transformer-architecture.md": {265 "sha256": "abc123...",266 "vault_path": "01-AI/transformer-architecture.md",267 "synced_at": "2026-07-09T10:00:00Z"268 }269 }270}271```272273### Edge Cases274275| Scenario | Handling |276| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |277| Wiki page renamed | Manifest path mismatch → delete old + create new. Learning progress archived, auto-linked by tags when possible. |278| Wiki page split | Reported as orphaned during sync. User decides how to regroup. |279| User adds manual notes in StudyVault | Not tracked by manifest. Sync will not touch them. |280| Wiki and StudyVault on different machines | Not supported. Wiki path must be accessible from the same environment. |281| Wiki page exceeds 200 lines | Wiki should split first (llm-wiki lint catches this). StudyVault does not re-process. |282283---284285## Language286287- Match source material language (Korean → Korean notes, etc.)288- **Tags/keywords**: ALWAYS English