$npx -y skills add bevibing/tutor-skills --skill tutor-setupTransforms knowledge sources into an Obsidian StudyVault. Two modes: (1) Document Mode — PDF/text/web sources → study notes with practice questions. (2) Codebase Mode — source code project → onboarding vault for new developers. Mode is auto-detected based on project markers in CW
| 1 | # Tutor Setup — Knowledge to Obsidian StudyVault |
| 2 | |
| 3 | ## CWD Boundary Rule (ALL MODES) |
| 4 | |
| 5 | > **NEVER access files outside the current working directory (CWD).** |
| 6 | > All source scanning, reading, and vault output MUST stay within CWD and its subdirectories. |
| 7 | > If the user provides an external path, ask them to copy the files into CWD first. |
| 8 | |
| 9 | ## Mode Detection |
| 10 | |
| 11 | On invocation, detect mode automatically: |
| 12 | |
| 13 | 1. **Check for project markers** in CWD: |
| 14 | - `package.json`, `pom.xml`, `build.gradle`, `Cargo.toml`, `go.mod`, `Makefile`, |
| 15 | `*.sln`, `pyproject.toml`, `setup.py`, `Gemfile` |
| 16 | 2. **If any marker found** → **Codebase Mode** |
| 17 | 3. **If no marker found** → **Document Mode** |
| 18 | 4. **Tie-break**: If `.git/` is the sole indicator and no source code files (`*.ts`, `*.py`, `*.java`, `*.go`, `*.rs`, etc.) exist, default to Document Mode. |
| 19 | 5. Announce detected mode and ask user to confirm or override. |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | ## Document Mode |
| 24 | |
| 25 | > Transforms knowledge sources (PDF, text, web, epub) into study notes. |
| 26 | > Templates: [templates.md](references/templates.md) |
| 27 | |
| 28 | ### Phase D1: Source Discovery & Extraction |
| 29 | |
| 30 | 1. **Auto-scan CWD** for `**/*.pdf`, `**/*.txt`, `**/*.md`, `**/*.html`, `**/*.epub` (exclude `node_modules/`, `.git/`, `dist/`, `build/`, `StudyVault/`). Present for user confirmation. |
| 31 | 2. **Extract text (MANDATORY tools)**: |
| 32 | - **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. |
| 33 | ```bash |
| 34 | pdftotext "source.pdf" "/tmp/source.txt" |
| 35 | ``` |
| 36 | - If `pdftotext` is not installed, install it first: `brew install poppler` (macOS) or `apt-get install poppler-utils` (Linux). |
| 37 | - URL → WebFetch |
| 38 | - Other formats (`.md`, `.txt`, `.html`) → Read directly. |
| 39 | 3. **Read extracted `.txt` files** — understand scope, structure, depth. Work exclusively from the converted text, never from the raw PDF. |
| 40 | 4. **Source Content Mapping (MANDATORY for multi-file sources)**: |
| 41 | - Read **cover page + TOC + 3+ sample pages from middle/end** for EVERY source file |
| 42 | - **NEVER assume content from filename** — file numbering often ≠ chapter numbering |
| 43 | - Build verified mapping: `{ source_file → actual_topics → page_ranges }` |
| 44 | - Flag non-academic files and missing sources |
| 45 | - Present mapping to user for verification before proceeding |
| 46 | |
| 47 | ### Phase D2: Content Analysis |
| 48 | |
| 49 | 1. Identify topic hierarchy — sections, chapters, domain divisions. |
| 50 | 2. Separate concept content vs practice questions. |
| 51 | 3. Map dependencies between topics. |
| 52 | 4. Identify key patterns — comparisons, decision trees, formulas. |
| 53 | 5. **Full topic checklist (MANDATORY)** — every topic/subtopic listed. Drives all subsequent phases. |
| 54 | |
| 55 | > **Equal Depth Rule**: Even a briefly mentioned subtopic MUST get a full dedicated note supplemented with textbook-level knowledge. |
| 56 | |
| 57 | 6. **Classification completeness**: When source enumerates categories ("3 types of X"), every member gets a dedicated note. Scan for: "types of", "N가지", "categories", "there are N". |
| 58 | 7. **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". |
| 59 | |
| 60 | ### Phase D3: Tag Standard |
| 61 | |
| 62 | Define tag vocabulary before creating notes: |
| 63 | - **Format**: English, lowercase, kebab-case (e.g., `#data-hazard`) |
| 64 | - **Hierarchy**: top-level → domain → detail → technique → note-type |
| 65 | - **Registry**: Only registered tags allowed. Detail tags co-attach parent domain tag. |
| 66 | |
| 67 | ### Phase D4: Vault Structure |
| 68 | |
| 69 | Create `StudyVault/` with numbered folders per [templates.md](references/templates.md). Group 3-5 related concepts per file. |
| 70 | |
| 71 | ### Phase D5: Dashboard Creation |
| 72 | |
| 73 | Create `00-Dashboard/`: MOC, Quick Reference, Exam Traps. See [templates.md](references/templates.md). |
| 74 | |
| 75 | - **MOC**: Topic Map + Practice Notes + Study Tools + Tag Index (with rules) + Weak Areas (with links) + Non-core Topic Policy |
| 76 | - **Quick Reference**: every heading includes `→ [[Concept Note]]` link; all key formulas |
| 77 | - **Exam Traps**: per-topic trap points in fold callouts, linked to concept notes |
| 78 | |
| 79 | ### Phase D6: Concept Notes |
| 80 | |
| 81 | Per [templates.md](references/templates.md). Key rules: |
| 82 | - YAML frontmatter: `source_pdf`, `part`, `keywords` (MANDATORY) |
| 83 | - **source_pdf MUST match verified Phase D1 mapping** — never guess from filename |
| 84 | - If unavailable: `source_pdf: 원문 미보유` |
| 85 | - `[[wiki-links]]`, callouts (`[!tip]`, `[!important]`, `[!warning]`), comparison tables > prose |
| 86 | - ASCII diagrams for processes/flows/sequences |
| 87 | - **Simplification-with-exceptions**: general |