Use when the user invokes /lecture-review to review lecture material and create cheat sheets. Supports three modes: review (default), condense <pages>, and status. Reads PDF lectures from the course Lectures/ folder, explains concepts via teach-back, and generates LaTeX/PDF cheat sheets.
Help the user review lecture material and generate exam-ready cheat sheets. Three modes: review (teach-back + per-lecture cheat sheet), condense (combine into N pages), and status (show progress).
This skill expects the following directory structure in the user's working directory:
<course-dir>/ # The directory where the user runs Claude Code
├── Lectures/ # PDF lecture files go here
│ ├── lecture01.pdf
│ ├── lecture02.pdf
│ └── ...
├── cheatsheets/ # Generated cheat sheets (auto-created)
│ ├── per-lecture/
│ └── final/
├── teach-back/ # Generated HTML teach-backs (auto-created)
└── .lecture-review-state.json # Progress tracking (auto-created)
COURSE_DIR is the current working directory (use or the absolute path from the environment).
.Parse the argument passed to the skill:
condense followed by a number → Condense Mode (extract the page count)status → Status ModeIf the argument is ambiguous, ask the user what they meant.
COURSE_DIR/.lecture-review-state.json
COURSE_DIR/Lectures/ using the Glob tool with pattern *.pdf| Lecture | Reviewed | Cheat Sheet |
|---|---|---|
| lecture01.pdf | Yes | cheatsheets/per-lecture/lecture01-cheatsheet.pdf |
| lecture02.pdf | No | — |
cheatsheets/final/, mention it at the bottom.COURSE_DIR/.lecture-review-state.json
{"reviewed": [], "cheatsheets": {}, "preferences": {}}COURSE_DIR/Lectures/ using Glob with *.pdfreviewed array) and ask:
"Which lecture would you like to review?"
pdfinfo <file> | grep Pages. If pdfinfo is not available, fall back to python3 -c "import fitz; print(fitz.open('<file>').page_count)" or simply try reading the first 20 pages and check if more exist.subagent_type: "general-purpose" with model: "haiku".pages parameter, then return a detailed, structured extraction of the content. The prompt must emphasize:
Do NOT output the teach-back as text to the console. Generate the full teach-back directly as an HTML file.
Why parallel generation: For large lectures, the combined extracted content + full HTML output can exceed context limits. To solve this, generate each HTML section independently via parallel subagents, then assemble the final file.
This is a two-step process: first create the plan, then review it as a learner.
Step 1 — Draft the learning plan. Review the extracted content from step 2a and create a learning plan — a list of 4-8 major sections that will become <section> blocks in the HTML. For each section, include:
<h2> text) — use narrative, question-based titles that tell a story (e.g., "The Problem — Why Do We Need All This?" rather than "Introduction")Also plan a final section for "Connections & Practical Takeaways" that ties the lecture to prior material and highlights implementation tips.
CRITICAL — SCOPE DISCIPLINE: The learning plan must ONLY include topics that appear in the extracted lecture content. Do NOT add topics, models, comparisons, or concepts that the lecture does not cover. The teach-back is a faithful companion to THIS lecture — not a general textbook on the subject.
Step 2 — Review the plan as a first-time learner. Now go back through the plan and adopt the mindset of someone encountering this material for the very first time. For each section and each concept within it, reason through:
Add the results as an intuition guidance field to each section in the plan:
Important: The learning plan is your handoff document. Each subagent will ONLY see its own section's plan entry — not the full extracted content. So be specific and thorough in the content summary. Include exact formulas with variable names, key definitions verbatim, and enough context for the subagent to write a complete section. The intuition guidance tells the subagent exactly where to invest depth and where to keep things concise.
Launch one subagent per section in parallel (all in a single message), each using subagent_type: "general-purpose" with model: "sonnet".
Each subagent's prompt should include:
Its section title and content summary from the plan (only its own section, not the full plan)
The HTML building blocks reference (copy this into each prompt):
Use these HTML building blocks:
- <section><h2>Section Title</h2>...</section> — wrap your entire output in ONE section tag
- <div class="equation-block">$$...$$<span class="label">Name</span></div> — for important equations (KaTeX $$ for display, $ for inline)
- <div class="key-insight">...</div> — for critical concepts to remember
- <div class="deep-dive"><span class="deep-dive-label">Deep Dive — Topic Name</span><p>Extended explanation...</p></div> — for hard-to-understand, non-intuitive, or exam-critical concepts that need extra depth: analogies, concrete numerical examples, alternative formula forms, common misconceptions, or intuition-building content. Aim for 2-4 per section on the hardest material.
- <div class="connection">...</div> — for connections to previous lectures
- <table class="comparison-table"><thead><tr><th>...</th></tr></thead><tbody>...</tbody></table> — for comparisons
- <div class="diagram"><svg>...</svg><div class="caption">...</div></div> — for visual diagrams (use colors: #e94560 accent, #4ecca3 green, #f0c040 yellow, #eee text, #0f3460 card bg)
- Use <h3> with class for subsections within the section
- Use <p>, <ul>, <ol>, <li>, <strong>, <code> for body content
Instructions: "Generate a single complete <section>...</section> HTML block for this topic.
CRITICAL — STAY IN SCOPE: Only explain concepts, formulas, and examples that are explicitly covered in the lecture content summary provided to you. Do NOT introduce topics, theorems, models, or comparisons that are not in the lecture notes. If the lecture doesn't mention GANs, don't discuss GANs. If the lecture doesn't derive a formula, don't derive it. The teach-back should be a faithful, intuitive explanation of WHAT THE LECTURE ACTUALLY COVERS — not a broader textbook treatment. Analogies and examples are encouraged to build intuition, but they must serve concepts that are IN the lecture.
CRITICAL — INTUITION-FIRST APPROACH: Write as if explaining to a smart person who has never seen this material before. The student finds dense mathematical presentations hard to follow. Build up concepts with intuition before formulas:
Read the template from ${CLAUDE_PLUGIN_ROOT}/skills/lecture-review/references/teach-back-template.html
Replace placeholders:
LECTURE_TITLE with the human-readable lecture name<!-- CONTENT_PLACEHOLDER --> and the comment block below it with all the section HTML blocks concatenated in order (as returned by the subagents)Review the assembled content as a first-time learner. Before writing the file, read through the concatenated sections and adopt the mindset of someone encountering this material for the first time. For each section, ask yourself:
Based on this review:
Write the file to COURSE_DIR/teach-back/<lecture-name>.html
teach-back/ directory if it doesn't exist<lecture-name> is the PDF filename without .pdfServe via local HTTP server and give the user a clickable link:
lsof -ti:8109 on macOS/Linux, or ss -tlnp | grep 8109 as a fallback if lsof is not availableIf the PDF was 20 pages or fewer (read directly without subagents in step 2a), the extracted content is small enough to generate HTML in one shot. In this case, skip the parallel subagent approach — generate all sections directly and write the file. Use the same building blocks and template assembly process described above, just do it inline instead of via subagents.
After completing the teach-back, ask:
"Any questions about this material, or are you ready to move on?"
Continue answering questions until the user says to move on. After each answer, ask again:
"Any more questions, or ready to move on?"
After the Q&A is complete, ask:
"Would you like to take a quiz on this lecture before we generate the cheat sheet?"
If the user declines, skip to Step 5 (Cheat Sheet Generation).
If the user accepts:
Generate questions: Create 10 multiple-choice questions (A-D) that progress from easy to challenging. Every question MUST be grounded in specific material covered in this lecture's notes — do not ask general knowledge questions or questions unrelated to what the lecture actually teaches.
Key principle: Comprehension over recall. The student is allowed to use cheat sheets during quizzes, so there is no value in testing memorization of formulas, definitions, or specific values. Instead, test whether the student truly understands the concepts — can they explain why something works, when to use it, and what happens when conditions change? A student who understands the material but needs to glance at a formula sheet should ace the quiz; a student who memorized formulas without understanding should struggle.
Difficulty progression (easy → hard, superficial → deep):
Question design rules:
Propose content: Present the key topics and formulas you'd include on the cheat sheet. Ask: "Here's what I'd put on the cheat sheet — anything to add or remove?"
Layout preferences (first time only):
Check the state file for stored preferences. If preferences is empty or missing, ask:
"Quick layout preferences for the cheat sheet:
- Columns: 2 (default) or 3?
- Font size: 9pt (default), 8pt, or 7pt?
- Margins: 0.75in (default) or 0.5in?"
Store the answers in the state file under preferences.
Page limit: Ask: "How many pages for this lecture's cheat sheet? (default: 1)"
Generate LaTeX:
${CLAUDE_PLUGIN_ROOT}/skills/lecture-review/references/per-lecture-template.texCHEATSHEET_TITLE with the lecture name (human-readable, derived from filename)% CONTENT_PLACEHOLDER and the comment lines below it with the actual cheat sheet content\begin{multicols}{2} to the chosen number[9pt] in \documentclass to the chosen size[margin=0.75in] in \usepackage[margin=...]{geometry}COURSE_DIR/cheatsheets/per-lecture/<name>-cheatsheet.tex
where <name> is the PDF filename without the .pdf extensionCompile:
cd COURSE_DIR/cheatsheets/per-lecture && pdflatex -interaction=nonstopmode <name>-cheatsheet.tex
pdflatex is available: which pdflatexInvoked with /lecture-review condense or /lecture-review condense <pages>. Also triggered when the user asks to generate an "exam cheat sheet" or "final cheat sheet".
The goal is to fit all the content from every per-lecture cheat sheet into the fewest pages possible, maximizing density. This is an exam reference sheet — every square millimeter counts.
If a page count was not provided as an argument, ask:
"How many pages for the exam cheat sheet?"
.tex files in COURSE_DIR/cheatsheets/per-lecture/ using Glob"No per-lecture cheat sheets found. Review some lectures first with
/lecture-review." Then stop.
.tex files in parallel using multiple Read tool calls in a single message (one per file)"Even at maximum density, all this material won't fit in [N] pages. Here's what I'd prioritize — should I weight certain lectures or topics more heavily?"
${CLAUDE_PLUGIN_ROOT}/skills/lecture-review/references/condensed-template.tex\documentclass[8pt]{extarticle}\usepackage[margin=0.15in, top=0.15in, bottom=0.15in]{geometry} — absolute minimum margins\pagestyle{empty} — remove all headers, footers, and page numbers. Every millimeter is for content.% CONTENT_PLACEHOLDER with the condensed contentCOURSE_DIR/cheatsheets/final/final-cheatsheet.texcd COURSE_DIR/cheatsheets/final && pdflatex -interaction=nonstopmode final-cheatsheet.tex
rm -f final-cheatsheet.aux final-cheatsheet.logAfter compilation, check the page count:
pdfinfo COURSE_DIR/cheatsheets/final/final-cheatsheet.pdf | grep Pages
If pdfinfo is not available, skip this check.
If page count exceeds the target:
"The sheet came out as X pages instead of [target]. Want me to trim more content, or is X pages OK?"
Location: COURSE_DIR/.lecture-review-state.json
{
"reviewed": ["lecture01.pdf"],
"cheatsheets": {
"lecture01.pdf": "cheatsheets/per-lecture/lecture01-cheatsheet.tex"
},
"preferences": {
"columns": 2,
"font_size": "9pt",
"margins": "0.75in"
},
"quiz_scores": {
"lecture01.pdf": {
"attempts": [
{"date": "2026-03-10", "score": 7, "total": 10, "breakdown": {"warmup": 3, "application": 2, "analysis": 1, "synthesis": 1}}
]
}
}
}
When reading: if file is missing or JSON is invalid, start with empty state:
{"reviewed": [], "cheatsheets": {}, "preferences": {}, "quiz_scores": {}}
When writing: use the Write tool to overwrite the entire file with the full updated JSON.
pages parameter. Max 20 pages per read call..tex file and inform the user how to install or compile manually.<div class=\"diagram\"><svg>...</svg><div class=\"caption\">...</div></div> with colors #e94560 (accent), #4ecca3 (green), #f0c040 (yellow), #eee (text), #0f3460 (card bg). Don't force diagrams where text suffices, but DO add them for spatial/architectural concepts that are hard to grasp from text alone.For concepts that are particularly important for exams, non-intuitive, or commonly misunderstood, add Deep Dive blocks using this HTML pattern:
<div class=\"deep-dive\">
<span class=\"deep-dive-label\">Deep Dive — [Topic]</span>
<p>Extended explanation with analogies, concrete examples, alternative formulations, or intuition-building content...</p>
</div>
Deep Dives should go beyond the surface explanation and include things like: rewriting a formula in a more intuitive form, concrete numerical examples with actual numbers plugged in, physical/real-world analogies, common misconceptions and why they're wrong, or connections to other concepts. Aim for 2-4 Deep Dives per section, focusing on the hardest and most exam-relevant material.
CRITICAL — DIAGRAM QUALITY: Only include SVG diagrams when the concept genuinely requires visual representation (architectures, data flow, spatial relationships). Do NOT create diagrams just to fill space. Every diagram must be logically correct — labels must match the formulas, arrows must point in the right direction, and the visual must accurately represent the concept. If you are not confident a diagram will be correct and helpful, omit it.
Output ONLY the raw HTML — no markdown fences, no explanation, just the <section> block."
cd COURSE_DIR/teach-back && python3 -m http.server 8109 &
http://localhost:8109/<lecture-name>.htmlConsole output: Only print a brief message, e.g.:
"Teach-back ready! Open http://localhost:8109/<lecture-name>.html to review the material. Take a look, then let me know when you're ready to continue."
Do not repeat the teach-back content as text in the console.
Present questions one at a time. For each question:
Score summary & state tracking. After all 10 questions:
Quiz results: X/10 correctWarm-up: a/3 | Application: b/3 | Analysis: c/3 | Synthesis: d/1quiz_scores object:
"quiz_scores": {
"lecture-filename.pdf": {
"attempts": [
{"date": "2026-03-11", "score": 7, "total": 10, "breakdown": {"warmup": 3, "application": 2, "analysis": 1, "synthesis": 1}}
]
}
}
Append the new attempt to the attempts array for that lecture. Preserve all existing scores.Post-quiz: Update teach-back with quiz and deep dives for weak areas. After the quiz is complete:
<div class="deep-dive"> block.Offer more questions: Ask:
"Want another round of 10 questions, or ready to move on to the cheat sheet?" If the user wants more, generate 10 new questions (don't repeat any from previous rounds). Focus the new round more heavily on topics the user got wrong. Otherwise proceed.
sudo apt-get install texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-sciencebrew install --cask mactex-no-guisudo apt-get install texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-science"rm -f <name>-cheatsheet.aux <name>-cheatsheet.logUpdate state:
reviewed array (if not already there)cheatsheets object: "<filename>": "cheatsheets/per-lecture/<name>-cheatsheet.tex"preferencesCOURSE_DIR/.lecture-review-state.jsonConfirm: Tell the user where the .tex and .pdf files were saved.