PDF Book → GoodNotes Handwritten Study Notes
What This Skill Does
Given a PDF book or large text, produce:
<BookName>_source_normalized.txt — normalized text extraction used as the semantic source of truth
<BookName>_concept_inventory.json — semantic concept inventory extracted from the PDF/book + chapter map
<BookName>_visual_briefs.json — mandatory per-chapter semantic visual briefs used by the Art Director phase before any sketch is drawn
<BookName>_Flashcards.csv — mandatory active-recall export with header Front, Back, Tags
<BookName>_GoodNotes_detailed.md — ADHD-friendly handwritten study notes, chunked by chapter/section or micro-section when needed
<BookName>_GoodNotes_detailed_A4.pdf — A4 PDF for GoodNotes import
<BookName>_book_mindmap_clean.mm — semantic Freemind mindmap
<BookName>_book_mindmap_fixed.xmind — semantic XMind mindmap (concept-enriched)
<BookName>_narrative_manifest.json — semantic narrative manifest for v2 deck generation
<BookName>_pitch_deck.html — mandatory v2 cinematic Reveal.js deck generated from the narrative manifest
<BookName>_Teleprompter_Script_<timestamp>.md — teleprompter script generated by xmind-notes-to-deck-v2
assets/ folder — Excalidraw source scenes (.excalidraw) plus compiled PNG sketches for key concepts
assets/INDEX.md — Visual reference guide with sketch metadata
<BookName>_INDEX.md — Master topic index with all pages and key concepts
<BookName>_AI_Elaboration.json or <BookName>_AI_Elaboration.md — optional external AI synthesis for page-level elaboration used by the XMind enrichment step
All outputs go into a <BookName>/ 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:
- Phase 1 (Ingestion and Bulk Extraction):
- Route raw PDF/book 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.
- 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.
- Phase 3 (AI Elaboration and Lateral Analysis):
- Fork clean conceptual outputs to an advanced reasoning model (for example GPT-5 or equivalent).
- Generate
<BookName>_AI_Elaboration.json by extrapolating edge cases and downstream implications without hallucination or source-text repetition.
Dynamic Content Archetype Classification
Classify each chapter/section into one archetype before generating markdown pages or mindmap nodes. Use only the associated mandatory node set.
- 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: chapter inventory must be present and non-empty.
B after Step 2 preflight: each chapter/section must include mechanism, archetype, analogy, label-fusion intent, and composition intent.
C after Step 2 generation: visuals must not be template clones across chapters.
D after Step 2 validation: PNG count must be >= chapter count and all PNGs must pass integrity checks.
E after Step 3: notes must be non-empty, page count >= chapter count, and required sections must be present.
F after Step 4: .mm must parse and Level 1 chapter nodes must be >= chapter count.
G after Step 5: .xmind must exist and be valid.
H after Step 6.6: flashcards CSV header and minimum chapter 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.
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.
- Include
rollback/retry strategy for the first failed checkpoint.
- Record the plan in
<BookName>/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 PDF/Book Source
- Extract the text from the PDF/book excerpt in full.
- Identify chapter, part, or major section boundaries.
- Note the document title, module structure, and key themes.
- Flag dense chapters that should be split into multiple micro-pages.
- Build an explicit lesson inventory table:
Section, Chapter, Order.
- Write the normalized extraction to
<BookName>_source_normalized.txt.
Coverage requirement:
- Use the chapter inventory as the source of truth for page counts, mindmap Level 1 nodes, flashcards, and PNG counts.
Checkpoint A:
- PASS when the chapter inventory exists and contains at least 1 detected chapter/major section.
- FAIL when boundaries are missing/ambiguous and inventory is empty.
Step 1.5 — Generate Semantic Chapter Briefs Before Any Sketching
Create <BookName>_visual_briefs.json from the extracted book text + chapter inventory.
This is the mandatory semantic bridge between source ingestion and image generation. Do not jump directly from chapter headings into sketch rendering.
Every chapter brief must include:
chapterTitle
chapterSlug
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 chapter 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 chapter 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
- Excalidraw JSON generation with required style contract
- Headless compilation via
scripts/compile-excalidraw.js → .png
- All validation gates
Brief to pass to content-to-sketch for each chapter:
- Input: the corresponding object from
<BookName>_visual_briefs.json — not just the chapter title
- Output target:
<BookName>/assets/<BookName>_chapter<N>_<slug>.png
- Minimum: 1 PNG per chapter
- Archetype selection must be justified by the semantic visual brief and confirmed by the Art Director phase
- The brief must explicitly carry the chapter 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:
- Confirm
assets/ folder exists with one .excalidraw and one .png per chapter.
- Validate all PNGs with Pillow.
- Run structural QA on
.excalidraw sources (text containment + arrow hygiene):
node <path-to-copilot-skills>/skills/content-to-sketch/scripts/validate-excalidraw-quality.js \
--dir "<BookName>/assets" \
--report "<BookName>/assets/validation_report.txt"
- Record the confirmed filename list — used verbatim in Steps 3, 4, 5, and 5.4.
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 chapter briefs.
- Treat direct, one-off diagram edits as exceptions only after the skill pipeline passes all gates.
- If a sketch could plausibly fit any random chapter with only label changes, treat that as a semantic failure and regenerate.
Checkpoints C, D:
C PASS only when chapter visuals are not near-identical templates and visibly encode the chapter 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.
The notebook must begin with a dedicated index page, then continue with chapter pages. If a chapter is dense, split it into 2-3 micro-pages. Use the same notebook structure contract as transcript-to-notes, adapted for chapters.
Required page sections:
## Real-World Anchor
## What You'll Learn
## Deep Dive Explanation
## Mental Model / Analogy
## Visual Summary
## Visual Sketch
## Real-World Use First
## Process Flow / Steps
## Key Concepts
## Try This Right Now
Formatting rules mirror transcript-to-notes:
- Keep bullets short and concrete.
- Put the real-world example before deeper explanation.
- 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.
- Export all cards directly into
<BookName>_Flashcards.csv from page content anchors.
Checkpoint E:
- PASS only when notes are non-empty, include required sections, and pages >= detected chapter count.
- FAIL if notes are placeholder-only or under-covered.
Step 4 — Create Freemind Mindmap (.mm)
See mindmap format reference.
Build a hierarchical XML Freemind file:
- Root node: book title
- Level 1: page/chapter titles
- Level 2: use only the mandatory node set for the assigned archetype
- Level 3+: elaborative subnodes from page content
Archetype requirements match transcript-to-notes exactly.
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.
Make Level 3+ child nodes complete, context-rich phrases.
Critical: escape ALL & as & in node TEXT attributes.
Checkpoint F:
- PASS only when
.mm parses and Level 1 chapter nodes >= chapter count.
- FAIL on XML parse errors or coverage mismatch.
Step 5 — Convert .mm → .xmind
Run the converter script (uses Python venv):
source .venv/bin/activate
python scripts/generate_valid_xmind.py <BookName>/<file>.mm <BookName>/<file>.xmind <BookName>/<BookName>_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 <BookName>/<BookName>_narrative_manifest.json from:
- the final notes markdown
- the finalized
.xmind blueprint
- generated PNGs in
<BookName>/assets/
Use the shared extraction prompt template and JSON skeleton from xmind-notes-to-deck-v2.
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):
cd skills/xmind-notes-to-deck-v2
npm run build
npm run deck -- \
--input "<BookName>/<BookName>_narrative_manifest.json" \
--out "<BookName>/<BookName>_pitch_deck.html" \
--script-out "<BookName>/<BookName>_Teleprompter_Script.md"
Hard rule:
pdf-to-notes must invoke xmind-notes-to-deck-v2; manifest generation alone is not considered complete.
- No fallback deck workflow is allowed.
- If v2 prerequisites, deck HTML, or teleprompter script are missing, fail the run.
Step 6 — PNG Generation Reference (Delegated)
PNG generation is fully delegated to content-to-sketch in Step 2.
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:
<BookName>_AI_Elaboration.json
- Markdown:
<BookName>_AI_Elaboration.md
Rules mirror transcript-to-notes.
Step 6.6 — Extract Flashcards CSV (Mandatory)
Create a CSV file named <BookName>_Flashcards.csv semantically from extracted book content + concept inventory + mindmap relationships.
Generation method and rules:
- Use the chapter inventory + mindmap concept graph to draft active-recall cards directly.
- Keep generation independent of notebook formatting sections.
- Exact header must be
Front, Back, Tags.
- Add
section:<section-slug> and chapter:<chapter-slug> tags.
- Hard fail if any parsed chapter has fewer than 3 cards.
Checkpoint H:
- PASS only when CSV header is exact and per-chapter minimum card rules pass.
- FAIL on header mismatch or weak coverage.
Step 7 — Generate Topic Index
Create <BookName>_INDEX.md inside the book folder.
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
source .venv/bin/activate
python scripts/md_to_pdf_a4.py <BookName>/<file>.md <BookName>/<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 Book Folder
Ensure all outputs are inside <BookName>/ and scripts remain in scripts/.
Python Environment
- Virtualenv:
.venv at workspace root
- Required packages:
reportlab, markdown, xmind-sdk, svglib, pypdf
- 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
PNG Sketch Quality (content-to-sketch integration)
Completion and Validation Gate
Do not mark any run successful until all gates pass:
- All generated PNG files pass strict image integrity checking.
- All bare ampersands in
.mm are escaped to &.
- Semantic Depth Quality Gate passes for all Level 1 and Level 2 concepts.
<BookName>_Flashcards.csv is present with valid header and import-safe escaping.
- Notes page count is greater than or equal to detected chapter count.
- Mindmap Level 1 chapter nodes are greater than or equal to detected chapter count.
- PNG count is greater than or equal to detected chapter count.
<BookName>_pitch_deck.html exists and is generated via xmind-notes-to-deck-v2.
- A teleprompter script exists for the generated deck.
- Checkpoints
P through J are all PASS.
- 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
- md-to-notes — Alternative for markdown input
1---2name: pdf-to-notes3description: Transform a PDF book into GoodNotes-style handwritten study notes with strategic chunking, memory-retention techniques, and real-world applications. Optimized for large texts with ADHD-friendly features. Use when: converting book to notes; creating handwritten study materials; breaking down dense textbooks; "make notes from this PDF"; "create study notes from book"; "organize book into notes".4---56# PDF Book → GoodNotes Handwritten Study Notes78## What This Skill Does9Given a PDF book or large text, produce:101. **`<BookName>_source_normalized.txt`** — normalized text extraction used as the semantic source of truth112. **`<BookName>_concept_inventory.json`** — semantic concept inventory extracted from the PDF/book + chapter map123. **`<BookName>_visual_briefs.json`** — mandatory per-chapter semantic visual briefs used by the Art Director phase before any sketch is drawn134. **`<BookName>_Flashcards.csv`** — mandatory active-recall export with header `Front, Back, Tags`144. **`<BookName>_GoodNotes_detailed.md`** — ADHD-friendly handwritten study notes, chunked by chapter/section or micro-section when needed155. **`<BookName>_GoodNotes_detailed_A4.pdf`** — A4 PDF for GoodNotes import166. **`<BookName>_book_mindmap_clean.mm`** — semantic Freemind mindmap177. **`<BookName>_book_mindmap_fixed.xmind`** — semantic XMind mindmap (concept-enriched)188. **`<BookName>_narrative_manifest.json`** — semantic narrative manifest for v2 deck generation199. **`<BookName>_pitch_deck.html`** — mandatory v2 cinematic Reveal.js deck generated from the narrative manifest2010. **`<BookName>_Teleprompter_Script_<timestamp>.md`** — teleprompter script generated by `xmind-notes-to-deck-v2`2111. **`assets/` folder** — Excalidraw source scenes (`.excalidraw`) plus compiled PNG sketches for key concepts2212. **`assets/INDEX.md`** — Visual reference guide with sketch metadata2313. **`<BookName>_INDEX.md`** — Master topic index with all pages and key concepts2414. **`<BookName>_AI_Elaboration.json` or `<BookName>_AI_Elaboration.md`** — optional external AI synthesis for page-level elaboration used by the XMind enrichment step2526All outputs go into a `<BookName>/` subfolder.2728## Systemic Execution Contract2930### Execution Modes31- `--standard`: output clean, hierarchical, engineering-focused outlines that map the exact technical architecture.32- `--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.3334### Balanced Stack Multi-Model Orchestration Pipeline35Every run must execute this strict routed backend architecture:361. Phase 1 (Ingestion and Bulk Extraction):37 - Route raw PDF/book input to a primary mid-tier extractor model (for example GPT-5.4 or another 1M+ context model).38 - Perform comprehensive fact extraction and archetype classification before formatting.392. Phase 2 (Markdown and Schema Formatting):40 - Route the extracted conceptual payload to a strict coding/schema model (for example Claude Sonnet 4.6).41 - This phase is solely responsible for GoodNotes markdown formatting, PNG orchestration, and flawless XML serialization for XMind.423. Phase 3 (AI Elaboration and Lateral Analysis):43 - Fork clean conceptual outputs to an advanced reasoning model (for example GPT-5 or equivalent).44 - Generate `<BookName>_AI_Elaboration.json` by extrapolating edge cases and downstream implications without hallucination or source-text repetition.4546### Dynamic Content Archetype Classification47Classify each chapter/section into one archetype before generating markdown pages or mindmap nodes. Use only the associated mandatory node set.4849- Type A: Conceptual Architecture or Frameworks50 - `Core Architecture Blueprint`51 - `Core Components & Governance`52 - `Key Integration Points`53 - `Systemic Trade-offs`54- Type B: Procedural Workflows or Pipelines55 - `Execution Pipeline / Steps`56 - `Environment Prerequisites & Setup`57 - `Failure Recovery & Verification`58 - `Performance Optimizations`59- Type C: Discrete Technical Components or Tools60 - `Functional Mechanics`61 - `Concrete Configuration & Code Snippets`62 - `Edge Cases & System Constraints`6364## ADHD-Friendly Handwritten GoodNotes Design6566### ✓ What's Included for ADHD Brains67- **Micro-chunking**: 3–5 min read per page (prevents hyperfocus derailment + working memory overload)68- **Handwritten aesthetic**: Warm, friendly fonts that feel personal and engaging69- **Sepia paper background**: Warm aged-paper tone with handwritten fonts for authentic GoodNotes feel70- **Frequent visual breaks**: Icons, ASCII diagrams, color-coded sections prevent text fatigue71- **Index-first navigation**: a dedicated notebook index page reduces search friction and supports non-linear study72- **Progressive challenge ordering**: foundational pages appear before advanced pages without adding metadata headers to every page73- **Progress checkboxes**: ✓ dopamine hits after each micro-section (engagement + completion feedback)74- **Action-first approach**: "Try This Right Now" before abstract explanation (executive scaffolding)75- **Quick facts**: Flashcard Q&A format forces active retrieval (combat working memory limits)76- **Real-world examples first**: Concrete scenarios before theory (interest-dependent attention)77- **Hyperlinks + anchor navigation**: Jump to topics non-linearly (supports scattered attention patterns)78- **Emoji + icons**: Visual cues for quick section identification (supports ADHD scanning)79- **Whitespace heavy**: Breathing room between concepts (reduces cognitive load)8081### ✗ What's Avoided82- Long paragraphs (max 2–3 sentences per bullet)83- Abstract language without concrete examples84- Dense, wall-of-text sections that trigger avoidance85- Vague or open-ended learning goals86- Passive voice or hedging language ("might", "could")87- More than 1 idea per bullet point88- Review schedules that require memory ("study sometime next week")8990## Procedure9192### Mandatory Checkpoint Protocol (Fail-Fast)93Apply this protocol after each procedure step. Do not continue when a checkpoint fails.9495Checkpoint format (required):96- `CHECKPOINT <ID>: PASS - <brief reason>`97- `CHECKPOINT <ID>: FAIL - <brief reason>`9899Fail-fast rule (required):100- If any checkpoint is `FAIL`, stop immediately.101- Do not proceed to the next step.102- Do not attempt downstream regeneration until the failed step is fixed and re-validated.103104Checkpoint map:105- `P` before Step 1: workflow plan exists and is approved before any generation starts.106- `A` after Step 1: chapter inventory must be present and non-empty.107- `B` after Step 2 preflight: each chapter/section must include mechanism, archetype, analogy, label-fusion intent, and composition intent.108- `C` after Step 2 generation: visuals must not be template clones across chapters.109- `D` after Step 2 validation: PNG count must be >= chapter count and all PNGs must pass integrity checks.110- `E` after Step 3: notes must be non-empty, page count >= chapter count, and required sections must be present.111- `F` after Step 4: `.mm` must parse and Level 1 chapter nodes must be >= chapter count.112- `G` after Step 5: `.xmind` must exist and be valid.113- `H` after Step 6.6: flashcards CSV header and minimum chapter coverage rules must pass.114- `I` after Step 7: index TOC row count must be >= page count minus the notebook index page.115- `J` after Step 8: PDF must exist and be non-trivial.116- `K` final: all checkpoints must be PASS.117118### Step 0 — Plan the Workflow Before Running119Create a short execution plan before any generation step runs.120121Plan requirements:122- Include `Inputs`, `Outputs`, `Dependencies`, and `Execution order`.123- Include a per-step `checkpoint expectation`.124- Include `rollback/retry strategy` for the first failed checkpoint.125- Record the plan in `<BookName>/checkpoints/workflow-plan.md`.126127Checkpoint `P`:128- PASS when `workflow-plan.md` exists and covers all procedure steps with checkpoint criteria.129- FAIL when planning is missing, incomplete, or execution starts before plan approval.130131### Step 1 — Read and Normalize the PDF/Book Source132- Extract the text from the PDF/book excerpt in full.133- Identify chapter, part, or major section boundaries.134- Note the document title, module structure, and key themes.135- Flag dense chapters that should be split into multiple micro-pages.136- Build an explicit lesson inventory table: `Section`, `Chapter`, `Order`.137- Write the normalized extraction to `<BookName>_source_normalized.txt`.138139Coverage requirement:140- Use the chapter inventory as the source of truth for page counts, mindmap Level 1 nodes, flashcards, and PNG counts.141142Checkpoint `A`:143- PASS when the chapter inventory exists and contains at least 1 detected chapter/major section.144- FAIL when boundaries are missing/ambiguous and inventory is empty.145146### Step 1.5 — Generate Semantic Chapter Briefs Before Any Sketching147Create `<BookName>_visual_briefs.json` from the extracted book text + chapter inventory.148149This is the mandatory semantic bridge between source ingestion and image generation. Do **not** jump directly from chapter headings into sketch rendering.150151Every chapter brief must include:152- `chapterTitle`153- `chapterSlug`154- `archetype`155- `coreMechanism`156- `what`157- `how`158- `why`159- `realWorldAnchor`160- `mentalModel`161- `edgeCase`162- `primaryEntities`163- `primaryFlow`164- `mainConstraint`165- `tradeoff`166- `physicalAnalogy`167- `labelFusion`168- `compositionIntent`169- `hotPath`170- `secondaryPaths`171- `mustShow`172- `mustNotShow`173- `visualSceneType`174- `sceneObjects`175- `objectToConceptMap`176- `spatialLayout`177- `entryPoint`178- `exitPoint`179- `failureBranch`180- `comparisonAxis`181- `evidenceArtifact`182- `dominantMotion`183- `forbiddenTemplate`184- `objectPalette`185- `shapeQuota`186- `forbiddenGeometry`187- `labelBudget`188- `sceneTest`189- `silhouettePlan`190- `propDensity`191- `asymmetryPlan`192- `antiCardFraming`193- `sceneTexture`194- `premiumSceneTest`195- `diagramIntent`196- `formalFramework`197- `sceneFamilyCandidates`198- `selectedSceneFamily`199- `selectionReason`200- `formalCompanionSuggested`201- `salienceGoal`202- `silhouetteContrastRules`203- `propInventory`204- `textureInventory`205206Hard rule:207- Full final notes are not required yet.208- Strong semantic understanding is required before image generation.209- If a chapter cannot produce a strong visual brief, stop and deepen extraction before sketching.210- 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.211- Resolve `diagramIntent`, `formalFramework`, `sceneFamilyCandidates`, `selectedSceneFamily`, and `selectionReason` before finalizing `visualSceneType`.212- Prefer selecting `visualSceneType` and `objectPalette` from `content-to-sketch/references/canonical-scene-families.md` before inventing a new scene family.213- 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.214- 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.215- 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.216- The final learner-facing image must not expose planning metadata such as scene names, mechanism lines, analogy lines, or must-show rules.217218Checkpoint `B`:219- PASS only when every chapter has a complete semantic visual brief with mechanism, analogy, composition, and hot-path detail.220- FAIL when briefs are shallow, title-only, or generic.221222### Step 2 — Generate PNG Sketches (invoke content-to-sketch skill)223**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.224225**Invoke the `content-to-sketch` skill** — do not reimplement its pipeline here. The skill owns:226- Art Director metaphor extraction preflight227- Excalidraw JSON generation with required style contract228- Headless compilation via `scripts/compile-excalidraw.js` → `.png`229- All validation gates230231**Brief to pass to content-to-sketch for each chapter:**232- Input: the corresponding object from `<BookName>_visual_briefs.json` — not just the chapter title233- Output target: `<BookName>/assets/<BookName>_chapter<N>_<slug>.png`234- Minimum: 1 PNG per chapter235- Archetype selection must be justified by the semantic visual brief and confirmed by the Art Director phase236- The brief must explicitly carry the chapter 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 inventory237238**After the skill completes:**2391. Confirm `assets/` folder exists with one `.excalidraw` and one `.png` per chapter.2402. Validate all PNGs with Pillow.2413. Run structural QA on `.excalidraw` sources (text containment + arrow hygiene):242```bash243node <path-to-copilot-skills>/skills/content-to-sketch/scripts/validate-excalidraw-quality.js \244 --dir "<BookName>/assets" \245 --report "<BookName>/assets/validation_report.txt"246```2474. Record the confirmed filename list — used verbatim in Steps 3, 4, 5, and 5.4.2485. `assets/INDEX.md` is created by the skill.249250Flow integrity rule:251- Do not directly patch generated diagram files as the primary fix path.252- If visuals are weak or generic, re-run `content-to-sketch` with improved semantic chapter briefs.253- Treat direct, one-off diagram edits as exceptions only after the skill pipeline passes all gates.254- If a sketch could plausibly fit any random chapter with only label changes, treat that as a semantic failure and regenerate.255256Checkpoints `C`, `D`:257- `C` PASS only when chapter visuals are not near-identical templates and visibly encode the chapter 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.258- `C` also requires structural QA with zero text-overflow errors and zero critical arrow endpoint-inside-node errors in `assets/validation_report.txt`.259- `D` PASS only when every required PNG exists and integrity validation passes.260261### Step 3 — Generate ADHD-Friendly GoodNotes Notebook262See [handwritten-notebook-format-adhd](./references/handwritten-notebook-format-adhd.md).263264The notebook must begin with a dedicated index page, then continue with chapter pages. If a chapter is dense, split it into 2-3 micro-pages. Use the same notebook structure contract as `transcript-to-notes`, adapted for chapters.265266Required page sections:267- `## Real-World Anchor`268- `## What You'll Learn`269- `## Deep Dive Explanation`270- `## Mental Model / Analogy`271- `## Visual Summary`272- `## Visual Sketch`273- `## Real-World Use First`274- `## Process Flow / Steps`275- `## Key Concepts`276- `## Try This Right Now`277278Formatting rules mirror `transcript-to-notes`:279- Keep bullets short and concrete.280- Put the real-world example before deeper explanation.281- Prefer one idea per bullet.282- Ensure every Level 1 and Level 2 concept passes the Triad Test (What, How, Why).283- Do not create sections titled `Intro`, `Introduction`, `Core Idea`, `Quick Facts`, or `Common Mistakes`.284- In `--adhd` mode, every page must start with an immediate visual memory hook.285- **Embed the real PNG path from assets/ — never write a placeholder.**286- In `--adhd` mode, do not include sections named `Header`, `Active Recall Prompts`, or `One-Page Revision`.287- Export all cards directly into `<BookName>_Flashcards.csv` from page content anchors.288289Checkpoint `E`:290- PASS only when notes are non-empty, include required sections, and pages >= detected chapter count.291- FAIL if notes are placeholder-only or under-covered.292293### Step 4 — Create Freemind Mindmap (`.mm`)294See [mindmap format reference](./references/mindmap-format.md).295296Build a hierarchical XML Freemind file:297- Root node: book title298- Level 1: page/chapter titles299- Level 2: use only the mandatory node set for the assigned archetype300- Level 3+: elaborative subnodes from page content301302Archetype requirements match `transcript-to-notes` exactly.303304Do not include Flashcards as mindmap nodes.305Never 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.306Never include instructional/meta coaching text as node content.307Do not add `One-Page Revision` nodes.308Make Level 3+ child nodes complete, context-rich phrases.309310**Critical**: escape ALL `&` as `&` in node TEXT attributes.311312Checkpoint `F`:313- PASS only when `.mm` parses and Level 1 chapter nodes >= chapter count.314- FAIL on XML parse errors or coverage mismatch.315316### Step 5 — Convert .mm → .xmind317Run the converter script (uses Python venv):318```bash319source .venv/bin/activate320python scripts/generate_valid_xmind.py <BookName>/<file>.mm <BookName>/<file>.xmind <BookName>/<BookName>_GoodNotes_detailed.md321```322323Checkpoint `G`:324- PASS only when `.xmind` opens as a valid archive and conversion succeeds.325- FAIL on conversion error or invalid package.326327### Step 5.4 — Build Narrative Manifest for V2328Create `<BookName>/<BookName>_narrative_manifest.json` from:329- the final notes markdown330- the finalized `.xmind` blueprint331- generated PNGs in `<BookName>/assets/`332333Use the shared extraction prompt template and JSON skeleton from `xmind-notes-to-deck-v2`.334335### Step 5.5 — Generate Pitch Deck (V2 Only)336After `.xmind` is produced and narrative manifest JSON is available, use v2 only.337338Required (v2 manifest-first, mandatory invocation of `xmind-notes-to-deck-v2`):339```bash340cd skills/xmind-notes-to-deck-v2341npm run build342npm run deck -- \343 --input "<BookName>/<BookName>_narrative_manifest.json" \344 --out "<BookName>/<BookName>_pitch_deck.html" \345 --script-out "<BookName>/<BookName>_Teleprompter_Script.md"346```347348Hard rule:349- `pdf-to-notes` must invoke `xmind-notes-to-deck-v2`; manifest generation alone is not considered complete.350- No fallback deck workflow is allowed.351- If v2 prerequisites, deck HTML, or teleprompter script are missing, fail the run.352353### Step 6 — PNG Generation Reference (Delegated)354PNG generation is fully delegated to `content-to-sketch` in Step 2.355356### Step 6.5 — Generate External AI Elaboration Artifact357Create a separate AI synthesis file when you want richer XMind elaboration that is not limited to the notebook markdown text.358359Recommended format:360- **JSON**: `<BookName>_AI_Elaboration.json`361- **Markdown**: `<BookName>_AI_Elaboration.md`362363Rules mirror `transcript-to-notes`.364365### Step 6.6 — Extract Flashcards CSV (Mandatory)366Create a CSV file named `<BookName>_Flashcards.csv` semantically from extracted book content + concept inventory + mindmap relationships.367368Generation method and rules:369- Use the chapter inventory + mindmap concept graph to draft active-recall cards directly.370- Keep generation independent of notebook formatting sections.371- Exact header must be `Front, Back, Tags`.372- Add `section:<section-slug>` and `chapter:<chapter-slug>` tags.373- Hard fail if any parsed chapter has fewer than 3 cards.374375Checkpoint `H`:376- PASS only when CSV header is exact and per-chapter minimum card rules pass.377- FAIL on header mismatch or weak coverage.378379### Step 7 — Generate Topic Index380Create `<BookName>_INDEX.md` inside the book folder.381382Structure:383- title384- table of contents with one row per note page after the notebook index page385- All Key Concepts (A–Z)386- Flashcard export summary387- Quick-Find by Topic388389Checkpoint `I`:390- PASS only when index TOC rows >= content page count.391- FAIL when index is incomplete.392393### Step 8 — Export A4 PDF394```bash395source .venv/bin/activate396python scripts/md_to_pdf_a4.py <BookName>/<file>.md <BookName>/<file_A4>.pdf397```398399Checkpoint `J`:400- PASS only when PDF generation succeeds and output is non-empty.401- FAIL on blank/near-empty output.402403### Step 9 — Move Files Into Book Folder404Ensure all outputs are inside `<BookName>/` and scripts remain in `scripts/`.405406## Python Environment407- Virtualenv: `.venv` at workspace root408- Required packages: `reportlab`, `markdown`, `xmind-sdk`, `svglib`, `pypdf`409- Install once: `python3 -m venv .venv && .venv/bin/pip install -r requirements.txt`410- Use the venv Python at `.venv/bin/python` — **not** the system Python411412## Quality Checklist413- [ ] Step 2 (PNG) runs before Step 3 (notes)414- [ ] Every chapter has at least one compiled PNG in `assets/`415- [ ] PNG paths embedded in notes, `.mm`, `.xmind`, and narrative manifest visuals[] all resolve to real files416- [ ] Notebook begins with a dedicated index page before chapter pages417- [ ] No per-page time/difficulty metadata header is emitted418- [ ] Every content page has: Real-World Anchor, What You'll Learn, Deep Dive Explanation, Mental Model / Analogy, Visual Summary419- [ ] `<BookName>_INDEX.md` exists in the book folder420- [ ] `<BookName>_Flashcards.csv` exists with exact header `Front, Back, Tags`421- [ ] `<BookName>_pitch_deck.html` exists422- [ ] teleprompter script exists for the generated deck423424### PNG Sketch Quality (content-to-sketch integration)425- [ ] PNG count is explicit or derived from topic count426- [ ] Every topic/chapter has at least one PNG427- [ ] All PNGs in `assets/` with `INDEX.md`428- [ ] All PNGs pass structural image validation429- [ ] Each sketch has 15+ text labels430- [ ] Text labels stay inside intended containers (no overflow errors)431- [ ] Arrow endpoints attach to shape edges (no endpoint-inside-node errors)432- [ ] validation_report.txt shows 0 errors (warnings should be reviewed and reduced)433434## Completion and Validation Gate435Do not mark any run successful until all gates pass:4361. All generated PNG files pass strict image integrity checking.4372. All bare ampersands in `.mm` are escaped to `&`.4383. Semantic Depth Quality Gate passes for all Level 1 and Level 2 concepts.4394. `<BookName>_Flashcards.csv` is present with valid header and import-safe escaping.4405. Notes page count is greater than or equal to detected chapter count.4416. Mindmap Level 1 chapter nodes are greater than or equal to detected chapter count.4427. PNG count is greater than or equal to detected chapter count.4438. `<BookName>_pitch_deck.html` exists and is generated via `xmind-notes-to-deck-v2`.4449. A teleprompter script exists for the generated deck.44510. Checkpoints `P` through `J` are all PASS.44611. Final checkpoint `K` is PASS.447448## Related Skills449- **content-to-sketch** — Generates the PNG sketches (auto-invoked in Step 2)450- **transcript-to-notes** — Source of the canonical end-to-end step contract451- **md-to-notes** — Alternative for markdown input