Communitygithub.com

Pixel Science Workshop

Turns short educational / legal / government-awareness stories into 16-bit pixel RPG-style short videos (code-drawn visuals, original chip-tune music, Volcengine narration, subtitles, covers). Helps with scripting, setup, and optional narration key configuration.

What is Pixel Science Workshop?

The Pixel Science Workshop skill enables AI agents to transform brief narrative texts into retro 16-bit pixel RPG-style short videos, ideal for science communication, legal awareness, and government propaganda. It eliminates the need for image assets or external video generation by using a JavaScript engine to code-draw every visual, synthesize music and sound effects programmatically, and optionally add voiceover via the user's Volcengine TTS account. The skill provides a comprehensive, step-by-step workflow: it first assists users in writing a 10–20 second script if none is provided, then checks the environment, selects characters, creates a detailed beat sheet, generates keyframes and a silent preview, and finally produces the full video with subtitles, music, and voiceover. It is designed to work across multiple industries, including healthcare, police, fire safety, food safety, taxation, and various government departments (human resources, civil affairs, judiciary, urban management, ecology, emergency, agriculture, medical insurance, health, education, women's federation, statistics, veterans affairs, and more), and users can also add custom industries. The skill is intended for use with AI agents that can execute commands (e.g., WorkBuddy desktop, Claude Code, Codex) and cannot function in pure chat-only environments. It proactively guides users through every step, handling environment setup, script writing, casting, directing, automated quality checks, and final delivery, with only one deliberate pause for user confirmation of the beat sheet, keyframes, preview, and audition files.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/heshuhuan6/pixel-explainer/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does Pixel Science Workshop do?

Turn a short story into a pixel-style short video: one little story explains one piece of knowledge. If the user doesn't have a script, help them write one; once they confirm, that's the final script. All visuals are drawn with code by the engine in this folder – no image assets, no image/video generation services. Music and sound effects are also code-synthesized. Only voiceover uses Volcengine (the user's own account).

Final video specs: landscape 1920×1080, 24 fps; 320×180 native pixels scaled 6x; dialog boxes double as subtitles; loudness –14 LUFS.

Before You Start: Newbie Guide (do this every time, but it only takes a few seconds for experienced users)

The person using this skill might know nothing: can't install software, has no script, hasn't heard of a TTS key. So:

  • All commands should be run by you (the AI), not by the user.
  • Only say one step at a time; ask at most three questions at once.
  • Don't use technical jargon – say things they can understand.

On Windows, replace python3 with python (or py if that doesn't work).

A. First, check if you can run commands on this machine. Try running python3 --version (Windows: python --version).

  • If it works: proceed.
  • If you can't run any commands at all (e.g., on a web/mobile chat-only AI): tell the user, "I need to run programs on a computer to make videos, and I can't do that here." Recommend they switch to an AI assistant that can run commands (e.g., WorkBuddy desktop, Claude Code, Codex) and import the whole skill folder first. Until then, you can help them write the script (step C).

B. Check the environment. Run python3 engine/make.py doctor. It will list what's missing and how to install each thing.

  • If something is missing: tell the user what's missing in one sentence (and what it's for), then ask "Do you want me to help you install it?" If they agree, follow the install commands doctor gives (Windows: use winget; Mac: use brew), then run python3 engine/make.py setup.
  • After installing new software on Windows, you must re-open the command window for it to be found.
  • Keep running doctor until it says "Environment ready."

C. Script. Ask: "Do you have an existing script?"

  • Yes: use it as-is, don't change a word.
  • No (only a title, or a long article): help them write a 10–20 second short script following references/writing-guide.md, with official sources, and show it to them. Once they approve, that's the final script.

D. Voiceover. Ask: "Do you want voiceover?" and clarify:

  • No voiceover: subtitles and music only, completely free. Use silent to produce the final video.
  • Yes voiceover: they need their own Volcengine account; charged by character count – a 15-second video is about 40–70 characters, costing less than 2 cents.
  • If they want voiceover but doctor shows the key is missing: guide them through references/voiceover-guide.md step by step. Once they have the key:
    • Run python3 engine/make.py key, open the file and ask them to paste it.
    • Then run python3 engine/make.py keycheck to test it.
  • Never ask them to send the key in the chat.

E. Tell them what's coming next. "I'll break down the script, choose characters, write the storyboard, and produce a silent preview (plus an audition if voiceover is needed). Then I'll stop for you to review. Once you give the go-ahead, I'll produce the final video." Then start from step 1.

0. Understand These Things First

  • Workshop root = the folder containing this file. All commands are run from the root.
  • Final script is the single source of truth: the user's script, or the short script you wrote that they confirmed – the spoken lines must not be changed. Pronunciation issues are handled only in the tts field of lines.json (e.g., 110 written as "一一零"). If you find problems in the script itself (typos, questionable legal wording), ask the user during the confirmation point; do not change it yourself.
  • One line = one shot: each spoken line is a beat, which can be a single shot (wide shot, close-up, prop close-up, screen close-up, map). The length of that shot = the duration of that line's voiceover.
  • Characters must be acting: every shot should have a visible result (see) that the audience can see; characters must have actions. The environment moves on its own, but cannot replace character actions.
  • Only stop once (besides script writing): script breakdown, casting, directing, self-check, and audition – do all of them yourself, then present the user with the "beat sheet + keyframes + silent preview + audition" all at once (step 6). No audition if no voiceover. After confirmation, go all the way to delivery.
  • Self-verify: each step has a check command; if it fails, fix it; if it can't be fixed, document it at delivery time.
  • Taking over someone else's work: first read progress.md in the episode directory.

For details, read these (all in references/):

FileWhen to read
writing-guide.mdWhen the user has no script, only a title, or gives a long article
voiceover-guide.mdWhen the user wants voiceover but doesn't have a Volcengine key – guide them step by step
director-handbook.mdMust read before writing the beat sheet: story structure, one-line-one-shot, rules for movement, camera angles, self-check list
beat-sheet-format.mdCheck fields, actions, camera, timing when writing beats.js
voiceover.mdChoosing voice tones, writing tone descriptors, auditioning, voiceover production
industry-pack-format.mdWhen adding new scenes, props, characters, or industries
voice-profiles.jsonChoosing voice profiles (age group, gender, audition notes)
asset-list_*.pngReference when choosing scenes and characters (open the images if you can)
industries/<pack>/content-redlines.mdWhen breaking down the script and self-checking; common redlines are in industries/common/content-redlines.md

Reference samples: samples/ contains 13 demo videos (S1–S6: one short video per industry, ~40 seconds; D1: comprehensive demo; G1–G6: one video per government department). Beat sheets, character files, and script files can all be used as templates.

1. Prepare + Break Down the Script

python3 engine/make.py doctor                                 # Environment self-check (skip if already done in Newbie Guide B)
python3 engine/tools/new_episode.py <episode-name> --packs food --script <final-script-file>   # Create episodes/<episode-name>/; use --long for intro/outro
python3 engine/tools/check_script.py episodes/<episode-name> --draft                  # Draft lines.json from the final script

Check lines.json line by line:

  • who must match the final script; narration is "Narrator".
  • tts: write numbers as they should be spoken (phone numbers, ID numbers read digit by digit; amounts, ratios written in Chinese characters). Only change tts, not text.
  • pages: split dialog across screens – no more than 20 characters per screen (24 for narration).
  • tone: specific emotion for each line (e.g., "panicked, voice trembling, speeding up" "relieved after a scare, long sigh, crying but then laughing"). Without a tone, the voiceover will sound flat.
python3 engine/tools/check_script.py episodes/<episode-name>    # Must have zero "errors"; review each "warning" individually

2. Casting

List all speaking characters in cast.json:

  • If the character already exists in the library, use directly: { "use": "food:inspector" } (pack-name:code; without pack name = common pack, e.g., { "use": "elder_f" }). Can override who, name, look, voice.
  • For new characters, write key / who / name / age / gender / look / voice. age is required (child / young / middle / elder).
  • voice.speaker is selected from references/voice-profiles.json – the age group and gender must match; the voiceover script will check and throw an error if they don't. voice.direction only describes "who this person is, what their voice sounds like" – do not include emotion or speed (emotion goes in each line's tone).
  • A character's voice is written only once in the character card; never changed throughout the video.
  • Characters that are only heard (on the phone): add "voiceOnly": true; they don't appear on screen; their dialog bubble avatar is a phone.
  • Each character in the same episode must be visually distinguishable: at least one of hairstyle or clothing color must be clearly different.

3. Directing: Write the Beat Sheet

First read references/director-handbook.md, then write beats.js. Industry packs used are listed in export const packs = ['food'].

python3 engine/make.py episodes/<episode-name> check     # Errors, missing characters, text overflow must be zero; review each "self-check" warning

4. Self-Check

python3 engine/make.py episodes/<episode-name> preview

Generates out/beat-sheet.md, out/keyframes_*.png, out/preview_no-voiceover.mp4. Check keyframes frame by frame (if you can view images, you must): overlapping characters, window blocking faces, bubble positions, actions not matching lines, props disappearing, character going out of frame after a zoom. Fix issues and re-run.

5. Audition (skip if no voiceover)

python3 engine/make.py episodes/<episode-name> audition     # Requires config/volc.env; charged by character count

Three methods: A (each line separately), B (same character shares multiple rounds of sessions), C (same character reads consecutively then split). Generates voice/audition/listen_<character>.mp3 and voice/audition/audition-sheet.md (pitch reference, speech recognition check). If whisper-cli is installed locally, set WHISPER_MODEL=<model-path> – it will automatically mark sentences that may be misread or poorly split. Method C splitting is unstable and is generally only used for comparison.

6. [Confirmation Point] (the only time you stop during the entire process)

Present these to the user: beat sheet, keyframes, silent preview, audition files and audition sheet. Also list the things the user needs to decide on (only what's truly necessary):

  • Voice profile for each character: does it sound like the right person? Is the age right? Can you hear emotional transitions? Choose A or B?
  • Issues found in the script (regulations, titles, potentially misread characters).
  • Should new characters be saved to the character library for future use?

Wait for user confirmation. Make any changes the user requests, then regenerate the keyframes for a quick review.

7. Voiceover

No voiceover: just run the command below to produce the final video with subtitles, music, and sound effects: out/<name>_no-voiceover.mp4. Then jump to step 9.

python3 engine/make.py episodes/<episode-name> silent

With voiceover:

python3 engine/make.py episodes/<episode-name> adopt A      # Use the audition voiceover for the final video (no additional cost)
python3 engine/make.py episodes/<episode-name> voice        # Only re-voice sentences that haven't been voiced or whose config changed
python3 engine/make.py episodes/<episode-name> voice --only L05     # Only re-voice specific sentences
python3 engine/make.py episodes/<episode-name> voice --dry-run      # See which sentences would be re-voiced and why (no cost)

If you change a character's voice profile → all that character's sentences are re-voiced. If you only change one sentence's text or tone → only that sentence is re-voiced. Do not print, copy, or log the key.

8. Build + Auto-Verification

python3 engine/make.py episodes/<episode-name> build

All "FAIL" items in out/verification-report.md must be zero. The check catches: spoken lines not matching the final script, missing voiceover, character voice not matching character card, age group mismatch, props declared in beat sheet not appearing, subtitles not matching dialog boxes, incorrect loudness. Finally, review the new out/keyframes_*.png again: actual voiceover may have changed duration; confirm that windows and actions still align.

9. Cover + Delivery

python3 engine/make.py episodes/<episode-name> cover       # Use the first frame of meta.coverRefs (without dialog box) + pixel-font title (meta.coverTitle, or meta.title if none)
python3 engine/make.py episodes/<episode-name> deliver     # Final video, subtitles, cover, voiceover log, verification report → deliverables/

Tell the user: where the deliverables are; the auto-verification results; what needs their careful listening and viewing (items marked "Manual Check" in verification-report.md, with timestamps). Pronunciation, tone, and character listening perception can only be judged by a human.

Troubleshooting

IssueSolution
Don't know what's missingpython3 engine/make.py doctor: it lists what's missing and how to install each thing
"playwright not found" / browser won't startpython3 engine/make.py setup (automatically switches to mirror in China); if browser download fails, it will automatically use Chrome or Edge on the system; if none exist, install one, or set CHROME_PATH
python3 not found on WindowsReplace with python or py; after installing Python, re-open the command window
Chinese garbled characters or encoding errors on WindowsAlways run via engine/make.py (it forces UTF-8 read/write for all scripts); do not run scripts in engine/tools/ directly
Voiceover error: "Volcengine key not found" / keycheck failsFollow references/voiceover-guide.md; keycheck tells you exactly if the key is wrong, not activated, insufficient balance, or incorrectly formatted
Beat sheet error: "unrecognized time format"Refer to beat-sheet-format.md; use L03.end for cross-beat timing
Missing character in pixel fontChange the text (only the words you wrote in windows/subtitle bars; if a dialog line has a missing character, ask the user)
Self-check: no character action in the scene / only one thing moving at a timeAdd actions to characters (movement, gestures, expressions, bubbles), or make the camera move
Self-check: scene is completely staticFor close-ups that need to hold for viewing, write still: true in the beat; otherwise, add movement
Voiceover error: "age group mismatch"Change to a voice profile whose age group matches; if it truly fits, use --ignore-age and update the voice profile's age group and audition notes
Volcengine returns "requested grant not found"Key type and input format don't match: new console uses VOLC_API_KEY; old console uses VOLC_APP_ID + VOLC_ACCESS_TOKEN
Engine code needs modificationAfter making changes, re-run samples/D1_NoSafetyAccount (comprehensive demo) preview to verify nothing broke

Related Skills