Claude Code skill: Khan Academy style explainer videos. A pen draws while a voice explains. Free, local, no API keys.
# Add to your Claude Code skills
git clone https://github.com/haiderfarooq3/khan-explainerGuides for using ai agents skills like khan-explainer.
Last scanned: 10/11/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-10-11T10:38:52.841Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how khan-explainer compares with popular alternatives.
khan-explainer is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by haiderfarooq3. Claude Code skill: Khan Academy style explainer videos. A pen draws while a voice explains. Free, local, no API keys. It has 152 GitHub stars.
Yes. khan-explainer passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/haiderfarooq3/khan-explainer" and add it to your Claude Code skills directory (see the Installation section above). khan-explainer ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
khan-explainer is primarily written in JavaScript. It is open-source under haiderfarooq3 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh khan-explainer against similar tools.
No comments yet. Be the first to share your thoughts!
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
A pen draws while a voice explains. Three modes, one renderer:
One scene file in, one MP4 out, in seconds. Free and local: HTML canvas, Playwright, macOS say, ffmpeg. No keys.
Every mode renders as chalk on a blackboard or marker on a whiteboard, landscape or vertical.
Made by Haider Farooq (github.com/haiderfarooq3). Free for anyone to use and change (MIT).
Core principle: the voice drives the clock. A scene is a list of beats. A beat is one spoken clause plus the drawing that happens while it is said. The renderer speaks each beat first, measures it, and fits that beat's drawing to it. Never hardcode seconds or guess when a word lands.
scene.js in a scratch folder. Copy examples/ai-agents.js for a lesson or examples/ui-tutorial.js for a tutorial.node ~/.claude/skills/khan-explainer/scripts/render.js scene.js out.mp4sheet image it prints. It shows the board at the end of every beat. The same folder holds every beat full-size as b000.jpg, b001.jpg and so on. Open those to check that a ring really sits on a small button. Fix every WARN (text off the board, or one label on another), overlap and spill, then re-render. A render takes seconds, so iterate.Each output line is beat N start +duration. The sheet path is new on every render.
First run on a machine: cd scripts && npm install && npx playwright install chromium.
| Pace | Settings | Seconds, roughly |
|---|---|---|
| Quick explainer | defaults: rate: 170, gap: 0.15 |
words ÷ 3 + beats × 0.15 + 1.3 |
| Tutorial | rate: 150, gap: 0.6 |
words ÷ 2.9 + beats × 0.6 + 1.3 |
A 10-second explainer is about 24 words in 5 beats. A 60-second tutorial is about 145 words in 15 beats. The formula lands within about 5%, and the render prints the real length. To hit a target, change the words, not rate.
Use the tutorial pace whenever the viewer has to find something on a screen. The quick pace feels rushed there.
scene({
voice: 'Samantha', rate: 170, size: [1280, 720], // all optional. [720, 1280] = vertical
lang: 'ar', // the language spoken: picks the voice (see "Other languages")
gap: 0.15, dim: 0.2, // seconds between beats; screenshot darkening
theme: 'light', // whiteboard and marker. Leave it out for the blackboard.
beats: [
{ say: 'Spoken clause.', draw: p => { /* p runs 0 to 1 while it is spoken */ } },
{ dur: 1.5, draw: p => {} }, // silent beat, in seconds
{ clear: true, say: 'Next idea.', draw: p => {} }, // wipes the board first
{ bg: 'shots/home.png', say: 'Start here.', draw: p => {} }, // screenshot as the board
{ theme: 'dark', say: 'Lights off.', draw: p => {} } // flips the board from this beat on
// With `audio: 'audio.wav'` on the scene, nothing is spoken by the computer: each beat takes
// `at: 12.4` (seconds into that file) and `say` is only a note. See "Real-audio clips".
],
})
Every draw call is (geometry, p, style). Points are [x, y] in board units.
| Call | Draws |
|---|---|
write(str, x, y, p, {size, color, center, lang}) |
Handwriting, letter by letter. y is the baseline. Arabic, Urdu and Hebrew run left from x. |
stroke(points, p, {color, width}) |
Any shape, drawn progressively. |
arrow(from, to, p, {color, ctrl}) |
Arrow. ctrl is a point that bends it. |
check(x, y, p, {size, color}) |
Tick mark. |
line(a, b) curve(a, b, ctrl) oval(cx, cy, rx, ry) box(x, y, w, h) |
Return points for stroke. |
ring(rect, pad) around(rect, pad) |
An oval or a frame around a {x, y, w, h} rectangle, for stroke. |
view(captureWidth, cropTop) |
Maps screenshot positions to the board. .r(rect) for a rectangle, .p(x, y) for a point. |
seg(p, from, to) |
A slice of the beat, to order strokes: seg(p, 0, .4) then seg(p, .4, 1). |
C.yellow blue orange pink green red purple white |
Chalk colours. On the whiteboard the same names are marker inks, and white is black. |
Text width is about 0.45 × size per character for a normal label and 0.63 × size per capital. Work it out before placing a label beside anything.
write takes any script and writes it the way that script is written by hand. The first letter of the string decides the direction; its script picks the face.
| Script | Direction | Set in | Width per letter, roughly |
|---|---|---|---|
| Arabic, Persian | right to left | naskh, regular weight | 0.3–0.5 × size (vowel marks add none). Give it about twice a Latin label's size. |
| Urdu | right to left | nastaliq: letters slope down to the left and stack about 1.6 × size tall |
0.5 × size. Keep it near 0.7× a Latin size and leave a tall line. |
| Hebrew | right to left | regular weight, points (niqqud) kept | 0.65 × size |
| Hindi, Bengali, Tamil and other Indic | left to right, hung from a headline | regular weight | 0.7–0.9 × size per syllable |
| Thai, Lao, Khmer, Burmese | left to right, no spaces between words | looped, regular weight | 0.6 × size |
| Chinese, Japanese, Korean | left to right, one square per character | bold | 1.0 × size per character |
| Cyrillic, Greek | left to right | bold | 0.65 × size |
x is the right end of the text, where the pen starts (the centre with center: true), and the word is uncovered right to left.write spots it only by a letter Arabic does not use (ٹ ڈ ڑ ں ہ ھ ے). Put lang: 'ur' on the scene or on the call to be sure of the nastaliq hand.lang on the scene picks the built-in voice: ar Majed, he Carmit, hi Lekha, zh Tingting, ja Kyoko, ko Yuna, th Kanya, ru Milena, el Melina, tr Yelda, id Damayanti, es Mónica, fr Thomas, de Anna, it Alice, pt Luciana, bn Piya, ta Vani, te Geeta, kn Soumya, uk Lesya, vi Linh, pl Zosia, nl Xander, sv Alva, ms Amira. A missing voice stops the render with where to download it. macOS has no voice for Urdu or Persian: use eleven (its multilingual model speaks them) or audio. An English scene can still show foreign words: then say spells the sound ("kitaab") and the board shows the word.See examples/arabic.js (an Arabic lesson) and examples/languages.js (one word in eight languages).
node tests/run.js renders every example and the same short scene in fifteen languages (tests/languages/), and fails on any warning. node tests/fonts.js prints which face each script gets on this machine: a Mac face, a Noto face, or none.
The board is a blackboard unless told otherwise. Three ways to change that:
theme: 'light' on the scene: a whiteboard, with the colour names mapped to marker inks.KHAN_THEME=light node scripts/render.js scene.js out-light.mp4: re-skins a finished scene without editing it.theme on a beat: flips the board from that beat on. The ink already on it changes colour with it.Read C.blue inside draw, never into a variable at the top of the file, or it keeps the first theme's colour.
On a white board every hard edge shows, so look at the light sheet separately from the dark one.
say is free and robotic. For a human voice, export ELEVENLABS_API_KEY and name a voice on the scene:
scene({ eleven: '<voice id>', beats: [...] })
scene({ eleven: { voice: '<voice id>', model: 'eleven_multilingual_v2', settings: { speed: 1.1 } }, beats: [...] })
gap defaults to 0 here, because the take has its own pauses. At speed: 1.1 expect about 3.3 words a second..voice/ beside the scene. Re-rendering the same words is free, so lay the board out with say first, then switch the voice on and change only drawings.say buys a new take of the whole script.Kokoro: a free local human voice. pip install kokoro soundfile once (for Japanese add "misaki[ja]" and run python -m unidic download; for Chinese add "misaki[zh]"), then put kokoro: true on the scene, or a voice name (kokoro: 'am_michael'), or { voice, speed }. KHAN_TTS=kokoro tries it on any scene without editing it. It speaks English, Spanish, French, Hindi, Italian, Japanese, Portuguese and Chinese, and lang picks its voice. For Arabic, Urdu, Hebrew and the rest, KHAN_TTS leaves the built-in voice on; use eleven for a human voice there. The model downloads on first use (about 330 MB), then runs offline. Takes are cached in .voice/kokoro/. KHAN_PYTHON names the Python that has it installed.
clear: true only when it is full, roughly every 5–6 beats.bg puts a screenshot on the board from that beat on and wipes earlier ink. Paths are relative to the scene file. Repeat the same bg on a later beat to wipe the annotations and mark up that screen again. clear: true takes the screenshot away as well, back to the plain board. dim darkens screenshots so the chalk reads, and a beat can override it, for example dim: 0 on a showcase image.
Capture. Pick the path that fits:
| Situation | Capture with | Coordinates |
|---|---|---|
| Public page, or a script can sign in | Playwright, viewport: {width: 1280, height: 720}, deviceScaleFactor: 1.5 |
CSS pixels are board units. Use them as they are, or through view(1280). |
| Needs the user's own logged-in browser, or video previews a bundled browser cannot play | A full screenshot in that browser, cropped to 16:9 | view(captureWidth, cropTop) |
For the second path, crop with ffmpeg. A 1440×900 window at 2× density, cut 90 CSS pixels from the top:
ffmpeg -i full.png -vf "crop=2880:1620:0:180,scale=1920:1080" shot.png
While capturing:
getBoundingClientRect() for every target. Never read coordinates off the image.dim under Build.visibility: hidden on the nodes), then look at every still. A broad rule hides things you need: "anything near the top" also matches content scrolled above the viewport.Build.
view() into ring or around. Place labels in board units, in empty areas of the screen.dim washes the screenshot towards the board's colour: on a mismatched or crowded screen, raise it to about 0.55 so the ink reads.A YouTube video or podcast in, a folder of vertical shorts out: the speaker's own audio, our board.
Still free and local. scripts/clip_audio.py does the transcribing and cutting.
yt-dlp goes stale and YouTube answers 403 or a bot check, so run the newest one:
uvx --from 'yt-dlp[default]@latest' yt-dlp --cookies-from-browser chrome -f "bestaudio[ext=m4a]/bestaudio" -o "src.%(ext)s" <url>uvx --with faster-whisper python scripts/clip_audio.py transcribe src.m4a work writes work/transcript.txt, one timed line per sentence. About 3 minutes for a 20-minute video.clips.json with each clip's first and last line times.... clip_audio.py cut src.m4a work clips.json writes work/clips/NN-slug/audio.wav and words.txt. Every cut is transcribed again, so words.txt holds word times inside the clip. Fix any line marked CHECK before drawing: the cut caught a stray word or lost one.scene.js per clip folder:scene({
size: [720, 1280], audio: 'audio.wav', // vertical; the recording is the clock
beats: [
{ at: 0, say: 'note of what he says', draw: p => {} }, // `at` = seconds, read from words.txt
{ at: 4.44, say: 'next phrase', draw: p => {} }, // a beat lasts until the next `at`
],
})
at comes from words.txt, never from a guess. To land a word inside a beat, seg takes (wordTime - at) / (nextAt - at).clear: true every 12 to 20 seconds. End on the punchline, written big.Both looks. Render every clip twice, once plain and once with KHAN_THEME=light (see "Light and dark"). The scene does not change.
Talking head (TikTok green-screen look). scripts/cutout (source cutout.swift, build with swiftc -O cutout.swift -o cutout) lifts the speaker off their background with macOS Vision: raw BGRA frames in, the same frames out with the matte as alpha. It hides itself on b-roll (no face to camera) and fades the bottom rows. scripts/talking_head_example.sh <clip-folder> <source-video> [light] is the working recipe: cut out once per clip into a ProRes 4444 cutout.mov, shrink the board to the top of the frame, overlay the speaker at the bottom with soft side edges.
CROP (w:h:x:y) to where the speaker sits in the source frame, above any captions the editor burned onto their chest, and check a frame from every clip.For many clips, finish one as the worked example, write the rules above into a brief, and give each parallel agent three clip folders plus that brief and the example.
| Mistake | Fix |
|---|---|
| Label wider than its oval or box | Work out the width from the rule above. Widen the shape or shorten the label. |
| One long sentence in one beat | The pen crawls. Split it into clauses. |
| Splitting a beat mid-clause | Each beat is a separate take, so it sounds choppy. Split at punctuation. |
Emoji, ticks or arrow glyphs in write |
The font lacks them. Draw them with stroke, as check does. Keyboard symbols such as $ % + ! are fine. |
| An arrow pointing at something not drawn yet | It points at empty space until a later beat. Aim arrows only at what is already on the board. |
| An arrow drawn through a label | Start it from the side of the label that faces the target. |
| A key word drawn early in a long beat | p spans the whole beat. Use seg to place the stroke where the word falls, or split the beat. |
| A mispronounced word or a number | Respell it in say only ("one hundred ten"). Keep the written label correct ("$110"). |
| Old annotations still on screen | Ink carries over until a beat has bg or clear. Repeat the bg to start clean on the same screenshot; clear goes back to the plain board. |
Calling your own variable box, line, ring or check |
It hides the helper of that name inside your scene. Name rectangles after the thing: searchBox, sendBtn. |
| Converting screenshot coordinates by hand | Use view(). Hand arithmetic is where rings miss buttons. |
| Arabic or Hebrew placed by its left edge | For right-to-left text x is the right end. Use center: true to place it by its middle. |
| Urdu written in naskh | Add lang: 'ur' to the scene. Without an Urdu-only letter the text looks Arabic. |
| A sentence in another language read by the English voice | Set lang on the scene so the matching voice reads it. |
| Skipping the sheet | Coordinates are written blind. The sheet is the only check. |
| A real-audio beat timed by ear or by sentence length | Read at from words.txt. A guess drifts and the pen runs ahead of the voice. |
Built for macOS. On Linux the free voice falls back to espeak-ng (apt install espeak-ng), which speaks about a hundred languages but sounds rougher still; install the Noto fonts for the scripts you write. The free voice is robotic: use eleven or real audio when the voice matters. tts() in scripts/render.js is the one place to swap in another engine.
A Claude Code skill that makes Khan Academy style explainer videos: a pen draws while a voice explains. You describe the video, Claude writes a scene file, and one command renders the MP4.
Write-up: Claude Code skills for content: how I make Khan Academy style videos for free

It runs on your Mac with an HTML canvas, Playwright, ffmpeg and the built-in say voice. No API keys, no accounts, no editor.
| Mode | What you get |
|---|---|
| Blackboard lesson | A diagram drawn stroke by stroke while the voice explains it. |
| Draw-over-UI tutorial | Arrows, circles and numbered steps drawn over your product screenshots. |
| Real-audio clip | A YouTube video or podcast in, vertical shorts out. The speaker's own voice plays while the board is drawn to their words. It can also cut the speaker out and stand them in front of the board. |
Every mode renders as chalk on a blackboard or marker on a whiteboard, landscape or vertical. One flag switches between them, and a single beat can flip the board mid-video.
The voice drives the clock. A scene is a list of beats, and a beat is one spoken clause plus the drawing that happens while it is said. The renderer speaks each beat first, measures it, and fits that beat's drawing to its length. Nobody types a timestamp, so the pen cannot run ahead of the words.
scene({
beats: [
{ say: 'What is an AI agent?', draw: p => {
write('What is an AI agent?', 60, 85, p, { size: 56, color: C.yellow });
} },
{ say: "It's software that uses a language model to think,", draw: p => {
stroke(oval(300, 330, 155, 82), seg(p, 0, .4), { color: C.blue });
write('1. THINK', 300, 328, seg(p, .4, 1), { size: 40, color: C.blue, center: true });
} },
],
})
You need macOS, Node 20 or newer, and ffmpeg (brew install ffmpeg).
git clone https://github.com/haiderfarooq3/khan-explainer ~/.claude/skills/khan-explainer
cd ~/.claude/skills/khan-explainer/scripts && npm install && npx playwright install chromium
Ask Claude Code for the video you want:
Make a 30-second Khan-style explainer on how DNS works.
Draw over these screenshots and show a new user how to send their first invoice.
Khanify this YouTube video: find the best moments and clip them, light and dark.
Or render one of the examples yourself:
cd ~/.claude/skills/khan-explainer
node scripts/render.js examples/ai-agents.js agents.mp4 # blackboard
KHAN_THEME=light node scripts/render.js examples/ai-agents.js light.mp4 # whiteboard
node scripts/render.js examples/ui-tutorial.js tutorial.mp4 # drawn over screenshots
node scripts/render.js examples/arabic.js arabic.mp4 # right-to-left writing
node scripts/render.js examples/languages.js languages.mp4 # one word in eight languages
Each render also prints the path of a contact sheet: the board at the end of every beat, in one image. That sheet is how Claude checks its own layout before it shows you anything.
SKILL.md is the full reference: the scene API, layout rules, the capture recipe for tutorials and the clip pipeline.
ELEVENLABS_API_KEY and add eleven: '<voice id>' to a scene. The script is read in one take and cut back into beats, and takes are cached, so re-rendering the same words is free.pip install kokoro soundfile, then kokoro: true on a scene or KHAN_TTS=kokoro for any scene. English, Spanish, French, Hindi, Italian, Japanese, Portuguese and Chinese.lang: 'ar' on a scene picks the matching voice. node tests/run.js renders them all.scripts/clip_audio.py transcribes locally with faster-whisper.swiftc the first time, which needs the Xcode command line tools.Made by Haider Farooq. MIT licensed: use it, change it, ship videos with it.
Not affiliated with or endorsed by Khan Academy. "Khan Academy style" describes the look: handwriting on a board, drawn as it is explained.