# Md To Notes

> Transform markdown files into GoodNotes-style handwritten study notes with ADHD-friendly chunking, active recall. Perfect for converting notes, documentation, or research into optimized study materials. Use when: converting markdown to study notes; organizing documentation into study guides; creating handwritten notebooks from .md files; "make study notes from this markdown"; "convert markdown to study format"; "organize markdown into learning materials".

- Skill: `arn-nj/md-to-notes` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add arn-nj/md-to-notes`
- Raw SKILL.md: https://api.skillmd.com/api/skills/arn-nj/md-to-notes/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: arn-nj (https://skillmd.com/u/arn-nj)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/arn-nj/md-to-notes

---


# Markdown → GoodNotes Handwritten Study Notes

## What This Skill Does
Given a markdown file, produce:
1. **`<FileName>_source_normalized.md`** — normalized markdown copy used as the semantic source of truth
2. **`<FileName>_concept_inventory.json`** — semantic concept inventory extracted from the markdown + section map
3. **`<FileName>_visual_briefs.json`** — mandatory per-section semantic visual briefs used by the Art Director phase before any sketch is drawn
4. **`<FileName>_Flashcards.csv`** — mandatory active-recall export with header `Front, Back, Tags`
4. **`<FileName>_GoodNotes_detailed.md`** — ADHD-friendly handwritten study notes, chunked by section or micro-section when needed
5. **`<FileName>_GoodNotes_detailed_A4.pdf`** — A4 PDF for GoodNotes import
6. **`<FileName>_Study_Mindmap_clean.mm`** — semantic Freemind mindmap
7. **`<FileName>_Study_Mindmap_fixed.xmind`** — semantic XMind mindmap (concept-enriched)
8. **`<FileName>_narrative_manifest.json`** — semantic narrative manifest for v2 deck generation
9. **`<FileName>_pitch_deck.html`** — mandatory v2 cinematic Reveal.js deck generated from the narrative manifest
10. **`<FileName>_Teleprompter_Script_<timestamp>.md`** — teleprompter script generated by `xmind-notes-to-deck-v2`
11. **`assets/` folder** — Excalidraw source scenes (`.excalidraw`) plus compiled PNG sketches for key concepts
12. **`assets/INDEX.md`** — Visual reference guide with sketch metadata
13. **`<FileName>_INDEX.md`** — Master topic index with all pages and key concepts
14. **`<FileName>_AI_Elaboration.json` or `<FileName>_AI_Elaboration.md`** — optional external AI synthesis for page-level elaboration used by the XMind enrichment step

All outputs go into a `<FileName>_StudyNotes/` subfolder.

## Systemic Execution Contract

### Execution Modes
- `--standard`: output clean, hierarchical, engineering-focused outlines that map the exact technical architecture.
- `--adhd`: prohibit introductory summaries, conversational text, and sections titled `Intro`; require immediate visual memory hooks (ASCII tables/diagrams), bold technical syntax anchors, and real-world-use-first ordering. Also exclude sections named `Header`, `Active Recall Prompts`, and `One-Page Revision` from notebook pages.

### Balanced Stack Multi-Model Orchestration Pipeline
Every run must execute this strict routed backend architecture:
1. Phase 1 (Ingestion and Bulk Extraction):
   - Route raw markdown input to a primary mid-tier extractor model (for example GPT-5.4 or another 1M+ context model).
   - Perform comprehensive fact extraction and archetype classification before formatting.
2. Phase 2 (Markdown and Schema Formatting):
   - Route the extracted conceptual payload to a strict coding/schema model (for example Claude Sonnet 4.6).
   - This phase is solely responsible for GoodNotes markdown formatting, PNG orchestration, and flawless XML serialization for XMind.
3. Phase 3 (AI Elaboration and Lateral Analysis):
   - Fork clean conceptual outputs to an advanced reasoning model (for example GPT-5 or equivalent).
   - Generate `<FileName>_AI_Elaboration.json` with edge-case and downstream implication synthesis, without hallucination or source-text repetition.

### Dynamic Content Archetype Classification
Classify each section into one archetype before page generation or mindmap serialization. Use only the associated mandatory nodes.

- Type A: Conceptual Architecture or Frameworks
   - `Core Architecture Blueprint`
   - `Core Components & Governance`
   - `Key Integration Points`
   - `Systemic Trade-offs`
- Type B: Procedural Workflows or Pipelines
   - `Execution Pipeline / Steps`
   - `Environment Prerequisites & Setup`
   - `Failure Recovery & Verification`
   - `Performance Optimizations`
- Type C: Discrete Technical Components or Tools
   - `Functional Mechanics`
   - `Concrete Configuration & Code Snippets`
   - `Edge Cases & System Constraints`

## ADHD-Friendly Handwritten GoodNotes Design

### ✓ What's Included for ADHD Brains
- **Micro-chunking**: 3–5 min read per page (prevents hyperfocus derailment + working memory overload)
- **Handwritten aesthetic**: Warm, friendly fonts that feel personal and engaging
- **Sepia paper background**: Warm aged-paper tone with handwritten fonts for authentic GoodNotes feel
- **Frequent visual breaks**: Icons, ASCII diagrams, color-coded sections prevent text fatigue
- **Index-first navigation**: a dedicated notebook index page reduces search friction and supports non-linear study
- **Progressive challenge ordering**: foundational pages appear before advanced pages without adding metadata headers to every page
- **Progress checkboxes**: ✓ dopamine hits after each micro-section (engagement + completion feedback)
- **Action-first approach**: "Try This Right Now" before abstract explanation (executive scaffolding)
- **Quick facts**: Flashcard Q&A format forces active retrieval (combat working memory limits)
- **Real-world examples first**: Concrete scenarios before theory (interest-dependent attention)
- **Hyperlinks + anchor navigation**: Jump to topics non-linearly (supports scattered attention patterns)
- **Emoji + icons**: Visual cues for quick section identification (supports ADHD scanning)
- **Whitespace heavy**: Breathing room between concepts (reduces cognitive load)

### ✗ What's Avoided
- Long paragraphs (max 2–3 sentences per bullet)
- Abstract language without concrete examples
- Dense, wall-of-text sections that trigger avoidance
- Vague or open-ended learning goals
- Passive voice or hedging language ("might", "could")
- More than 1 idea per bullet point
- Review schedules that require memory ("study sometime next week")

## Procedure

### Mandatory Checkpoint Protocol (Fail-Fast)
Apply this protocol after each procedure step. Do not continue when a checkpoint fails.

Checkpoint format (required):
- `CHECKPOINT <ID>: PASS - <brief reason>`
- `CHECKPOINT <ID>: FAIL - <brief reason>`

Fail-fast rule (required):
- If any checkpoint is `FAIL`, stop immediately.
- Do not proceed to the next step.
- Do not attempt downstream regeneration until the failed step is fixed and re-validated.

Checkpoint map:
- `P` before Step 1: workflow plan exists and is approved before any generation starts.
- `A` after Step 1: section inventory must be present and non-empty.
- `B` after Step 2 preflight: each section must include mechanism, archetype, analogy, label-fusion intent, and composition intent.
- `C` after Step 2 generation: visuals must not be template clones across sections.
- `D` after Step 2 validation: PNG count must be >= section count and all PNGs must pass integrity checks.
- `E` after Step 3: notes must be non-empty, page count >= section count, and required sections must be present.
- `F` after Step 4: `.mm` must parse and Level 1 section nodes must be >= section count.
- `G` after Step 5: `.xmind` must exist and be valid.
- `H` after Step 6.6: flashcards CSV header and minimum section coverage rules must pass.
- `I` after Step 7: index TOC row count must be >= page count minus the notebook index page.
- `J` after Step 8: PDF must exist and be non-trivial (not blank output).
- `K` final: all checkpoints must be PASS.

### Step 0 — Plan the Workflow Before Running
Create a short execution plan before any generation step runs.

Plan requirements:
- Include `Inputs`, `Outputs`, `Dependencies`, and `Execution order`.
- Include a per-step `checkpoint expectation` (what constitutes PASS/FAIL).
- Include `rollback/retry strategy` for the first failed checkpoint.
- Record the plan in `<FileName>_StudyNotes/checkpoints/workflow-plan.md`.

Checkpoint `P`:
- PASS when `workflow-plan.md` exists and covers all procedure steps with checkpoint criteria.
- FAIL when planning is missing, incomplete, or execution starts before plan approval.

### Step 1 — Read and Normalize the Markdown
- Read the `.md` file in full.
- Identify section boundaries from headings (`#`, `##`, `###`, `####`).
- Note the document title, module structure, and key themes.
- Flag dense sections that should be split into multiple micro-pages instead of one long page.
- Build an explicit section inventory table: `Section`, `Subsection`, `Order`.
- Write a normalized markdown copy to `<FileName>_source_normalized.md`.

Coverage requirement:
- Use the section inventory as the source of truth for page counts, mindmap Level 1 nodes, flashcards, and PNG counts.

Checkpoint `A`:
- PASS when the section inventory exists and contains at least 1 detected section.
- FAIL when boundaries are missing/ambiguous and inventory is empty.

### Step 1.5 — Generate Semantic Section Briefs Before Any Sketching
Create `<FileName>_visual_briefs.json` from the markdown + section inventory.

This is the mandatory semantic bridge between source ingestion and image generation. Do **not** jump directly from section headings into sketch rendering.

Every section brief must include:
- `sectionTitle`
- `sectionSlug`
- `archetype`
- `coreMechanism`
- `what`
- `how`
- `why`
- `realWorldAnchor`
- `mentalModel`
- `edgeCase`
- `primaryEntities`
- `primaryFlow`
- `mainConstraint`
- `tradeoff`
- `physicalAnalogy`
- `labelFusion`
- `compositionIntent`
- `hotPath`
- `secondaryPaths`
- `mustShow`
- `mustNotShow`
- `visualSceneType`
- `sceneObjects`
- `objectToConceptMap`
- `spatialLayout`
- `entryPoint`
- `exitPoint`
- `failureBranch`
- `comparisonAxis`
- `evidenceArtifact`
- `dominantMotion`
- `forbiddenTemplate`
- `objectPalette`
- `shapeQuota`
- `forbiddenGeometry`
- `labelBudget`
- `sceneTest`
- `silhouettePlan`
- `propDensity`
- `asymmetryPlan`
- `antiCardFraming`
- `sceneTexture`
- `premiumSceneTest`
- `diagramIntent`
- `formalFramework`
- `sceneFamilyCandidates`
- `selectedSceneFamily`
- `selectionReason`
- `formalCompanionSuggested`
- `salienceGoal`
- `silhouetteContrastRules`
- `propInventory`
- `textureInventory`

Hard rule:
- Full final notes are not required yet.
- Strong semantic understanding is required before image generation.
- If a section cannot produce a strong visual brief, stop and deepen extraction before sketching.
- A title plus generic `what/how/why` summary is not enough; the brief must drive geometry, motion, object choice, visual salience, and scene-object diversity.
- Resolve `diagramIntent`, `formalFramework`, `sceneFamilyCandidates`, `selectedSceneFamily`, and `selectionReason` before finalizing `visualSceneType`.
- Prefer selecting `visualSceneType` and `objectPalette` from `content-to-sketch/references/canonical-scene-families.md` before inventing a new scene family.
- For final learner-facing visuals, also apply `content-to-sketch/references/premium-sketch-language.md` so the brief carries silhouette, prop-density, asymmetry, anti-card-framing, and scene-texture intent.
- When premium visuals are requested, structure the downstream render around `content-to-sketch/references/premium-generation-playbook.md` rather than jumping straight from brief text to final layout.
- If the concept clearly maps to a formal framework (for example C4, BPMN, sequence, state, Wardley, or service blueprint), record that choice even if the final output will be a semantic sketch.
- The final learner-facing image must not expose planning metadata such as scene names, mechanism lines, analogy lines, or must-show rules.

Checkpoint `B`:
- PASS only when every section has a complete semantic visual brief with mechanism, analogy, composition, and hot-path detail.
- FAIL when briefs are shallow, title-only, or generic.

### Step 2 — Generate PNG Sketches (invoke content-to-sketch skill)
**This step MUST run before notes, mindmap, or XMind generation.** PNG filenames produced here are embedded directly into notes, `.mm`, `.xmind`, and the narrative manifest.

**Invoke the `content-to-sketch` skill** — do not reimplement its pipeline here. The skill owns:
- Art Director metaphor extraction preflight (mandatory before any diagram is drawn)
- Excalidraw JSON generation with required style contract (roughness, hachure, Virgil, palette)
- Headless compilation via `scripts/compile-excalidraw.js` → `.png`
- All validation gates

**Brief to pass to content-to-sketch for each section:**
- Input: the corresponding object from `<FileName>_visual_briefs.json` — not just the section title
- Output target: `<FileName>_StudyNotes/assets/<FileName>_section<N>_<slug>.png`
- Minimum: 1 PNG per section
- Archetype selection must be justified by the semantic visual brief and confirmed by the Art Director phase
- The brief must explicitly carry the section mechanism, analogy, label-fusion plan, composition intent, hot path, main constraint, scene objects, scene type, object palette, shape quota, forbidden geometry, label budget, scene test, silhouette plan, prop density, asymmetry plan, anti-card-framing plan, scene texture, premium scene test, diagram intent, formal framework, scene-family candidates, selected scene family, selection reason, formal companion suggestion, salience goal, silhouette contrast rules, prop inventory, and texture inventory

**After the skill completes:**
1. Confirm `assets/` folder exists with one `.excalidraw` source and one compiled `.png` per section.
2. Validate all PNGs with Pillow.
3. Run structural QA on `.excalidraw` sources (text containment + arrow hygiene):
```bash
node <path-to-copilot-skills>/skills/content-to-sketch/scripts/validate-excalidraw-quality.js \
  --dir "<FileName>_StudyNotes/assets" \
  --report "<FileName>_StudyNotes/assets/validation_report.txt"
```
4. Record the confirmed filename list — used verbatim in Steps 3, 4, 5, and 5.4.
5. `assets/INDEX.md` is created by the skill.

Flow integrity rule:
- Do not directly patch generated diagram files as the primary fix path.
- If visuals are weak or generic, re-run `content-to-sketch` with improved semantic section briefs and let it regenerate the entire affected section set.
- Treat direct, one-off diagram edits as exceptions only after the skill pipeline passes all gates.
- If a sketch could plausibly fit any random section with only label changes, treat that as a semantic failure and regenerate.

Checkpoints `C`, `D`:
- `C` PASS only when section visuals are not near-identical templates and visibly encode the section mechanism/analogy through scene-specific geometry, motion, object mapping, hot-path salience, clean connector routing, non-box object diversity, and premium sketch-language cues where required.
- `C` also requires structural QA with zero text-overflow errors and zero critical arrow endpoint-inside-node errors in `assets/validation_report.txt`.
- `D` PASS only when every required PNG exists and integrity validation passes.

### Step 3 — Generate ADHD-Friendly GoodNotes Notebook
See [handwritten-notebook-format-adhd](../pdf-to-notes/references/handwritten-notebook-format-adhd.md).

The notebook must begin with a dedicated index page, then continue with content pages. If a section is dense, split it into 2-3 micro-pages. Use this exact structure:
```
-- Page 1: Notebook Index

## Course Map
| Page | Section | Core Focus |
|---|---|---|
| 2 | <Section 1> | <Core concept> |

## How to Use This Notebook
- Start with the section that matches your immediate problem.
- Use the visual sketch first, then the deep dive, then the try-this block.
- Use `<FileName>_INDEX.md` for the full cross-reference and glossary.

## Fast Lanes
- Core architecture pages
- Process-heavy pages
- Comparison or trade-off pages

-- Page N: <Section Title or Micro-Section>

## Real-World Anchor
Scenario: <1-2 sentence industry scenario>

## What You'll Learn
(1 sentence on why this matters to the learner right now)

## Deep Dive Explanation
- Explain the mechanism in 2-4 concrete bullets
- Add at least one cause-and-effect relationship
- Include one concrete example tied to the section

## Mental Model / Analogy
Think of this like: <short relatable analogy>

## Visual Summary
(ASCII diagram, compact table, flowchart)

## Visual Sketch
![Sketch](./assets/<FileName>_section<N>_<slug>.png)

## Real-World Use First
Scenario: ...
Why it matters: ...

## Process Flow / Steps
1. Step one
2. Step two

## Key Concepts
- **Term**: definition in simple words
- **Term**: definition in simple words

## Try This Right Now
- 30-second action
- Observable result
```

Formatting rules for every page:
- Keep bullets short and concrete.
- Put the real-world example before deeper explanation.
- Use icons and whitespace for quick scanning.
- Keep jargon paired with plain-English meaning.
- Prefer one idea per bullet.
- Ensure every Level 1 and Level 2 concept passes the Triad Test (What, How, Why).
- Do not create sections titled `Intro`, `Introduction`, `Core Idea`, `Quick Facts`, or `Common Mistakes`.
- In `--adhd` mode, every page must start with an immediate visual memory hook.
- **Embed the real PNG path from assets/ — never write a placeholder.**
- In `--adhd` mode, do not include sections named `Header`, `Active Recall Prompts`, or `One-Page Revision`.
- Do not include markdown flashcard tables in the notebook schema.
- Export all cards directly into `<FileName>_Flashcards.csv` from page content anchors.

Checkpoint `E`:
- PASS only when notes are non-empty, include required sections, and pages >= detected section count.
- FAIL if notes are mostly empty, placeholder-only, or under-covered.

### Step 4 — Create Freemind Mindmap (`.mm`)
See [mindmap format reference](./references/mindmap-format.md).

Build a hierarchical XML Freemind file:
- Root node: document name
- Level 1: page/section titles
- Level 2: use only the mandatory node set for the assigned archetype (Type A, Type B, or Type C)
- Level 3+: elaborative subnodes from page content

Archetype requirements:
- Type A must contain exactly:
   - `Core Architecture Blueprint`
   - `Core Components & Governance`
   - `Key Integration Points`
   - `Systemic Trade-offs`
- Type B must contain exactly:
   - `Execution Pipeline / Steps`
   - `Environment Prerequisites & Setup`
   - `Failure Recovery & Verification`
   - `Performance Optimizations`
- Type C must contain exactly:
   - `Functional Mechanics`
   - `Concrete Configuration & Code Snippets`
   - `Edge Cases & System Constraints`

Do not include Flashcards as mindmap nodes.
Never include nodes titled or themed as Flashcards, Q/A, Questions & Answers, Interesting Talking Points, Pitfalls & Clarifications, Narrative Flow, In This Section, or What You'll Learn.
Never include instructional/meta coaching text as node content.
Do not add `One-Page Revision` nodes to the mindmap.
Make Level 3+ child nodes complete, context-rich phrases.

**Critical**: escape ALL `&` as `&amp;` in node TEXT attributes. No bare `&` allowed.

Checkpoint `F`:
- PASS only when `.mm` parses and Level 1 section nodes >= section count.
- FAIL on XML parse errors or coverage mismatch.

### Step 5 — Convert .mm → .xmind
Run the converter script (uses Python venv):
```bash
source .venv/bin/activate
python scripts/generate_valid_xmind.py <FileName>_StudyNotes/<file>.mm <FileName>_StudyNotes/<file>.xmind <FileName>_StudyNotes/<FileName>_GoodNotes_detailed.md
```

Checkpoint `G`:
- PASS only when `.xmind` opens as a valid archive and conversion succeeds.
- FAIL on conversion error or invalid package.

### Step 5.4 — Build Narrative Manifest for V2
Create `<FileName>_StudyNotes/<FileName>_narrative_manifest.json` from:
- the final notes markdown
- the finalized `.xmind` blueprint
- generated PNGs in `<FileName>_StudyNotes/assets/`

Use the shared extraction prompt template:
- `skills/xmind-notes-to-deck-v2/templates/narrative_manifest_prompt_template.md`

Use the shared JSON skeleton:
- `skills/xmind-notes-to-deck-v2/templates/narrative_manifest.template.json`

Strict JSON contract (must be exact):
- `deckTitle` (string)
- `deckSubtitle` (string)
- `slides` (array)
  - `slideId` (string slug)
  - `visualArchetype` (`split-screen-analogy`, `hero-metric`, `execution-pipeline`, `technical-deep-dive`)
  - `pacingSeconds` (integer speaking estimate)
  - `speakerProtocol` object with `hook`, `teleprompterVO`, `stageDirections`, `theDelta`
  - `blocks` (array of `{ title, bodyText, items }`)
  - `visuals` (array of local assets/image paths)

Cognitive load guardrail:
- Never create wall-of-text slides.
- If a concept needs more than 3 bullet points or more than 40 words of text, split it into two consecutive slide objects.

### Step 5.5 — Generate Pitch Deck (V2 Only)
After `.xmind` is produced and narrative manifest JSON is available, use v2 only.

Required (v2 manifest-first, mandatory invocation of `xmind-notes-to-deck-v2`):
```bash
cd skills/xmind-notes-to-deck-v2
npm run build
npm run deck -- \
  --input "<FileName>_StudyNotes/<FileName>_narrative_manifest.json" \
  --out "<FileName>_StudyNotes/<FileName>_pitch_deck.html" \
  --script-out "<FileName>_StudyNotes/<FileName>_Teleprompter_Script.md"
```

Hard rule:
- `md-to-notes` must invoke `xmind-notes-to-deck-v2`; manifest generation alone is not considered complete.
- No fallback deck workflow is allowed.
- If v2 skill folder, manifest, deck HTML, or teleprompter script is missing, fail the run and regenerate missing semantic artifacts.

### Step 6 — PNG Generation Reference (Delegated)
PNG generation is fully delegated to `content-to-sketch` in Step 2.

Rules:
- Do not duplicate, fork, or partially reimplement the sketch-generation logic in this skill.
- Use the confirmed artifact list from Step 2 (`assets/INDEX.md` + validated PNG list) as the only source for embeddings.
- If quality fails, return to Step 2 and regenerate through `content-to-sketch` instead of editing local diagram files directly.

### Step 6.5 — Generate External AI Elaboration Artifact
Create a separate AI synthesis file when you want richer XMind elaboration that is not limited to the notebook markdown text.

Recommended format:
- **JSON**: `<FileName>_AI_Elaboration.json`
- **Markdown**: `<FileName>_AI_Elaboration.md`

Rules:
- Keep the elaboration separate from the main GoodNotes markdown.
- Use concise, page-specific synthesis instead of repeating the note text.
- Prefer JSON if the content is generated by another tool or model.
- The XMind converter will auto-detect this file when it sits beside the study files.
- If you generate it for the whole document, include an entry for every page, even if some pages only need a short `Concept Focus` line.

### Step 6.6 — Extract Flashcards CSV (Mandatory)
Create a CSV file named `<FileName>_Flashcards.csv` semantically from source markdown + concept inventory + mindmap relationships.

Generation method:
- Use the section inventory + mindmap concept graph to draft active-recall cards directly.
- Keep flashcard generation independent of notebook formatting sections.

Density-driven generation policy:
- low-density section: `3-5` cards
- medium-density section: `8-15` cards
- high-density section: `15-25` cards (soft cap)

CSV schema rules:
- Exact header must be: `Front, Back, Tags`
- Add both tags to each card:
  - `section:<section-slug>`
  - `topic:<topic-slug>`
- Use `density-layer:<n>` when adaptive layering is used.

Card quality rules:
- Rotate at least 4 recall types.
- Every question must include at least one explicit section anchor.
- Hard fail if any parsed section has fewer than 3 cards.

Checkpoint `H`:
- PASS only when CSV header is exact and per-section minimum card rules pass.
- FAIL on header mismatch, weak coverage, or repeated boilerplate patterns.

### Step 7 — Generate Topic Index
Create `<FileName>_INDEX.md` inside the study-notes folder. This file is a master index of everything in the notebook.

Structure:
- title
- table of contents with one row per note page after the notebook index page
- All Key Concepts (A–Z)
- Flashcard export summary
- Quick-Find by Topic

Checkpoint `I`:
- PASS only when index TOC rows >= content page count.
- FAIL when index is incomplete.

### Step 8 — Export A4 PDF
```bash
source .venv/bin/activate
python scripts/md_to_pdf_a4.py <FileName>_StudyNotes/<file>.md <FileName>_StudyNotes/<file_A4>.pdf
```

Checkpoint `J`:
- PASS only when PDF generation succeeds and output is non-empty.
- FAIL on blank/near-empty output.

### Step 9 — Move Files Into StudyNotes Folder
Ensure all outputs are inside `<FileName>_StudyNotes/` and scripts remain in `scripts/`.

## Python Environment
- Virtualenv: `.venv` at workspace root
- Required packages: `reportlab`, `markdown`, `xmind-sdk`, `svglib`
- Install once: `python3 -m venv .venv && .venv/bin/pip install -r requirements.txt`
- Use the venv Python at `.venv/bin/python` — **not** the system Python

## Quality Checklist
- [ ] Step 2 (PNG) runs before Step 3 (notes)
- [ ] Every section has at least one compiled PNG in `assets/`
- [ ] PNG paths embedded in notes, `.mm`, `.xmind`, and narrative manifest visuals[] all resolve to real files
- [ ] Notebook begins with a dedicated index page before content pages
- [ ] No per-page time/difficulty metadata header is emitted
- [ ] Every content page has: Real-World Anchor, What You'll Learn, Deep Dive Explanation, Mental Model / Analogy, Visual Summary
- [ ] No notebook page includes sections named `Header`, `Active Recall Prompts`, or `One-Page Revision`
- [ ] Bullets are short, concrete, and one idea each
- [ ] Real-world example appears before abstract explanation
- [ ] All Level 1 and Level 2 concepts pass the Triad Test (What, How, Why)
- [ ] `.xmind` opens without "not a valid XMind File" errors
- [ ] `<FileName>_INDEX.md` exists in the study-notes folder
- [ ] `<FileName>_Flashcards.csv` exists with exact header `Front, Back, Tags`
- [ ] `<FileName>_pitch_deck.html` exists
- [ ] teleprompter script exists for the generated deck

### PNG Sketch Quality (content-to-sketch integration)
- [ ] PNG count is explicit or derived from topic count
- [ ] Every topic/section has at least one PNG
- [ ] All PNGs in `assets/` with `INDEX.md`
- [ ] All PNGs pass structural image validation
- [ ] All ampersands escaped as `&amp;`
- [ ] Each sketch has 15+ text labels (accessibility)
- [ ] High contrast colors and clear primary-path salience
- [ ] Arrows/markers for visual flow
- [ ] Text labels stay inside intended containers (no overflow errors)
- [ ] Arrow endpoints attach to shape edges (no endpoint-inside-node errors)
- [ ] validation_report.txt shows 0 errors (warnings should be reviewed and reduced)

## Completion and Validation Gate
Do not mark any run successful until all gates pass:
1. All generated PNG files pass strict image integrity checking.
2. All bare ampersands in `.mm` are escaped to `&amp;`.
3. Semantic Depth Quality Gate passes for all Level 1 and Level 2 concepts.
4. `<FileName>_Flashcards.csv` is present with valid header and import-safe escaping.
5. Notes page count is greater than or equal to detected section count.
6. Mindmap Level 1 section nodes are greater than or equal to detected section count.
7. PNG count is greater than or equal to detected section count.
8. `<FileName>_pitch_deck.html` exists and is generated via `xmind-notes-to-deck-v2`.
9. A teleprompter script exists for the generated deck.
10. Checkpoints `P` through `J` are all PASS.
11. Final checkpoint `K` is PASS.

## Related Skills
- **content-to-sketch** — Generates the PNG sketches (auto-invoked in Step 2)
- **transcript-to-notes** — Source of the canonical end-to-end step contract
- **pdf-to-notes** — Alternative for PDF/book input

