Communitygithub.com

mografy-film

Use Mografy (MIT open-source, npm package mografy) with Claude Code to create motion graphics: the frame is a pure function of time. Preview frame-by-frame in a local player and export to MP4, WebM, Lottie, or SVGA. Excels at creating step-by-step tutorial videos from screenshots, product interface micro-animations, paper-theater style explainers, and social media short video templates, with built-in traditional Chinese vertical text and line-breaking.

What is mografy-film?

This skill enables AI agents (like Claude Code) to create motion graphics and animation films using the Mografy tool, a MIT-licensed npm package. The agent treats each film as a TypeScript scene module where every frame is a pure function of time (`t`), eliminating hidden state and enabling precise per-frame preview and review. It supports multiple output formats: MP4, WebM, Lottie (for app/web embedding), and SVGA. The skill is particularly strong for creating step-by-step tutorial videos from screenshots (one short clip per step plus a full compiled version), product interface micro-animations, paper-theater style concept explainers with a stop-motion feel, and short social media templates. It includes built-in support for traditional Chinese vertical text and line-breaking (CJK) and comes with detailed workflow guidance: reading the project configuration (`mografy.json`), writing a one-sentence film idea, building a storyboard, creating a beat table for all timing, using a single camera throughout the film, and careful review before export. The skill also provides explicit guidance on when to use Mografy versus other video skills (like `sui-motion-graphic-reel` for narrated films or `pixel-fx` for pixel effects), installation steps (requiring first-time user approval for third-party code execution), and security notes.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hamastar-hd5test/animation-skills/tree/HEAD/mografy-film

Ask in your favorite AI

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

Documentation

mografy-film: Create Motion Graphics with Mografy

A Mografy film is a TypeScript scene module that draws a single frame on Canvas as a pure function of time t. The player can jump to any frame for inspection, and the review tool draws the same frame twice to compare, ensuring no hidden state. It includes a very comprehensive English skill (located in the project's .claude/skills/mografy/ after installation), and details should defer to that version. This skill covers: when to use it, how to install, the key method principles, and how it divides work with our other video skills.

When to Use It and When Not To

GoalWhich Skill
Step-by-step tutorial from screenshots, one short clip per step plus a full versionMografy (its strongest area, the how-to-film workflow)
4–12 second product interface micro-animations, feature cards, mobile screen demosMografy (ten stage-* example films to copy structure from)
Paper theater, paper puppet style concept explainers, character storiesMografy (paper-theatre-* example films)
Need Lottie or SVGA output (for embedding in apps or web pages)Mografy (other tools don't support it; note it's frame-by-frame image packaging, without vector editing or sound)
Full narrated explainer film with voiceover, music, and storyboardsui-motion-graphic-reel (+ HyperFrames)
Same scene with multiple art stylesstyle-pack
Real web page capture for product promotion videosvideo-shotcraft
Pixel effectspixel-fx

Installation (Ask Dex First)

On Dex's computer, third-party code must be run; always ask first. After approval on 2026-11-23, it's installed at ~/mografy-lab/mografy/ (0.1.2). For new films, work within that workspace: npx mografy init projects/<name>. To reinstall or install elsewhere:

  1. In the folder where you want to place films: npx mografy@<version> init. Specify an exact version; do not use @latest as it floats. Installs into the folder (not globally), about 2 MB; Mografy's own skills will be installed alongside into .claude/ and .agents/.
  2. It uses the local Chrome for rendering; FFmpeg is downloaded to the project folder on first export, with SHA-256 verification.
  3. npx mografy dev opens the local player (localhost).
  4. To update: run npx mografy@<new version> from the project folder, and review the GitHub changelog first.

Security audit log (2026-11-23, 0.1.2): The skill only contains documentation and one Python script for compressing videos (calling ffmpeg/ffprobe only); the npm package has no install/postinstall scripts, with dependencies only on ws, zod, esbuild, and protobufjs. The CLI binary itself has not been audited file-by-file.

Workflow for Creating a New Film

  1. Read the project: mografy.json, scenes, style.md. Choose the closest example film via npx mografy add <name> <folder> as a starting point.
  2. Brief: Message, audience, length, aspect ratio, language on screen, whether music is needed. Write into the beginning of storyboards/storyboard.md.
  3. Storyboard: First, write a one-sentence film idea: a visual element that runs through every shot and causes every change (e.g., a ray of light sequentially filling each cup). A row of cards fading in and out is not an idea; it's a template. Then define the design system as tokens in style.md, followed by the storyboard table—one row per shot. Stop here once the storyboard is done.
  4. Production: One world, one camera, a beat table (beats([...])). Declare parts the user might want to adjust as layers; timing comes from the beat table.
  5. Music (only if needed).
  6. Review: Address all warnings from npx mografy check --motion; inspect every image generated by npx mografy review, including each transition strip.
  7. Export: Only when requested: npx mografy export --format mp4|webm|lottie|svga.

To adjust length, remove from static hold times—do not speed up motion.

Key Method Principles (Also Applicable to Our Other Videos)

  • One beat table manages all timing. Each shot has a title, end time, hold time, and handover duration; camera keyframes, layer appearance times, and review timestamps are all derived from this table. To change a shot's length, only edit the table; everything else follows.
  • One camera throughout the film. Cards, phones, and panels scale within the world; no second camera is created. No shot resets to a blank center.
  • Every cut is a handover. The next shot starts at the line, card, or point where the previous shot ended. For scene changes, let elements grow into the next form; do not fade out one and fade in another at the same position. Deliberate transitions (hard cuts, black frames, wipes) are used only when changing story sections.
  • Exits and entrances overlap by 0.2–0.5 seconds, so no frame is empty.
  • Fade out a group of elements together: The entire card and its rows become transparent through the same layer; otherwise, overlapping areas flicker.
  • Hold long enough: After the full subtitle is displayed, hold at least "0.5s + number of Chinese characters ÷ 4.5" (6 characters ≥ 1.8s, 12 characters ≥ 3.2s); after a state change, hold for 0.6–1.0s before the next action. One shot does one thing; interface and explanation shots last 2.5–4s each. (Note: style-pack/references/film.md recommends "hold after animation for characters ÷ 4.5 + 1.5s" which is more conservative; use that for beginner course films.)
  • Motion should be smooth, not fast: Crossing more than half the screen takes at least 0.6s; exits take at least 0.4s. The camera can move at most 0.5s before an action; do not move during clicks or reading.
  • Design system first: Four text roles (subhead, headline, item name, caption), five color roles (background, ink, secondary, one accent, body), repeated shots use the same layout, about 40% blank space on screen, one card style throughout the film, logo appears only at the end.
  • Font sizes (1920×1080): Headlines 96–160px, body text ≥ 40px, no text smaller than 24px; vertical-format films place subtitles in the top third. Redrawn interface text should be scaled to 1.3–1.6x original.

Traditional Chinese (CJK) Notes

  • Add CJK extension: npx mografy add cjk <project>, includes Noto Sans/Serif CJK TC subsets (OFL), vertical text, and Chinese line-breaking rules (punctuation not at line start).
  • After finalizing text, run its font subsetting script to keep only the characters used in the film (about 100–170 KB); re-run every time text changes.
  • Use English for plans, storyboards, and tool prompts; use the language specified in the brief for on-screen text.

Use in Our Projects

  • Practice hall and course tutorials: Step-by-step operations (submit homework, open treasure chests, ask questions via owl), one 4–8 second clip per step, plus a full compiled version. Always use test accounts for screenshots; only display fictional data on screen—never show real student names, answers, or conversations.
  • All-Age Association "AI Agent at Work" course: Step-by-step tutorial videos (vertical with large subtitles for mobile viewing).
  • Sanchangzhi / Brand: Paper-theater style concept explainer videos.

What Not to Do

  • Do not write animations in mografy.json; do not manually edit scenes/timeline.json (that's for user edits in the editor).
  • Do not modify example films in the project's examples/ folder; use npx mografy add to copy one and then edit.
  • Do not copy copywriting, logos, or music from other brands.
  • Do not export or overwrite files in renders/ unless requested.
  • Before capturing from real websites or accounts, ask Dex for test accounts and approval; always stop and ask before making payments, sending emails, deleting, or inviting people.

Field Test Log

First read references/field-notes.md: 2026-11-23 Sanchangzhi trial encountered pitfalls (missing params causes only ZodError on export, font subsetting script not included in npm package, default export uses HEVC).

Sources

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

pixel-fx

像素風的遊戲特效與動作:受擊、攻擊、技能、爆炸、拾取金幣、開寶箱、升級、轉場、會動的小生物,以及「角色先蓄力、打中時停格、目標被打退、再收招」的動作時序。用 pixelfx(MIT,244 種用程式寫成的像素特效,可換色、鏡像、匯出 sprite sheet)找現成的,或照「草稿→算圖→看→改」做新的。使用時機:練功房的 Boss 戰、作答答對、XP、寶箱、升級卡要加特效或打擊感;任何像素風網頁或小遊戲要特效;「打擊感不夠」「特效看起來像貼紙」「做一個金幣閃光/冰霜爆發」「匯出 sprite sheet 給 Godot/Unity/Phaser」;要畫新的像素角色、怪物、圖示時也用(畫法規則在本檔)。主動更新時機:在練功房或其他專案實際接上某個特效、或撞到新陷阱時,補進 references/kungfu-room.md 或 references/quality.md。

sprite-stack

用切片堆疊(sprite stacking)做「看起來是 3D、其實只有平面像素圖」的像素物件與場景:物件用程式寫成體素模型、自動切成一層一層、每層往上抬 1px 疊起來,可以旋轉、可以一片一片蓋起來、可以長成一整座會動的村莊,全程只用 Canvas 2D,不用 3D 引擎也不用圖檔。使用時機:要做可旋轉或有體積感的像素物件、像素小場景或小鎮、「自己蓋起來」的開場動畫、給短影音或 Reel 錄的像素場景片、練功房或品牌素材想從平面像素升級成有立體感時;提到 sprite stacking、切片堆疊、體素、voxel、pixel stack、stack farm、「像素 3D」「會轉的像素建築」,或手上有四視圖(上、側、前、後)要雕成可旋轉物件、要 16 方向 sprite sheet、要給 Godot/Unity/Phaser 用時。平面像素角色與特效用 pixel-fx;整支片換畫風用 style-pack。主動更新時機:實際做出新物件或場景、撞到新的畫面問題、或接進 Remotion/練功房時,補進 references/。

Related Skills