Communitygithub.com

mografy-film

用 Mografy(MIT 開源,npm 套件 mografy)讓 Claude Code 寫程式做動態圖像:畫面是時間的純函數,在本機播放器逐格預覽,匯出 MP4、WebM、Lottie、SVGA。強項是從截圖做操作教學短片(一步一支)、產品介面小動畫、紙劇場風格的概念解說、社群短影音模板,內建繁中直排與斷行。使用時機:「做操作教學動畫」「把這幾張截圖做成教學影片」「新手引導動畫」「產品示範片」「介面動畫」「紙劇場、紙偶、定格解說」「做一支 8 秒的介面動態」「要 Lottie 或 SVGA」、課程或練功房的功能教學片;資料夾裡有 mografy.json 時也用。主動更新時機:實際做完一支片、撞到新陷阱或版本更新時,補進 references/。

mografy-film 是什么?

mografy-film is a Claude Code agent skill that 用 Mografy(MIT 開源,npm 套件 mografy)讓 Claude Code 寫程式做動態圖像:畫面是時間的純函數,在本機播放器逐格預覽,匯出 MP4、WebM、Lottie、SVGA。強項是從截圖做操作教學短片(一步一支)、產品介面小動畫、紙劇場風格的概念解說、社群短影音模板,內建繁中直排與斷行。使用時機:「做操作教學動畫」「把這幾張截圖做成教學影片」「新手引導動畫」「產品示範片」「介面動畫」「紙劇場、紙偶、定格解說」「做一支 8 秒的介面動態」「要 Lottie 或 SVGA」、課程或練功房的功能教學片;資料夾裡有 mografy.json 時也用。主動更新時機:實際做完一支片、撞到新陷阱或版本更新時,補進 references/。.

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

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/。

相关技能