Communitygithub.com

risingjerry/motion-skill

用代码做 4K 动效短片,全程不用 AI 生图或生视频:产品发布片、App 宣传片、logo 动画、实物产品 3D 镜头、讲解/演示动效、接真人实拍的剪影转场。包括:先出带编号的分镜、HTML 逐帧渲染、浏览器里的 3D、Blender 单灯棚拍、逐帧检查(文字压物体、接缝、穿模、转速)、配乐对齐落点和音效混音。用户说“做个动效/动画/宣传片/发布视频/产品视频/logo 动画/App 演示动画/讲解动画/开场动画/motion graphics/product video/promo/launch video/explainer animation”,或要改这类片子时使用,即使没提“动效”两个字。

motion-skill 是什么?

motion-skill is a Claude Code agent skill that 用代码做 4K 动效短片,全程不用 AI 生图或生视频:产品发布片、App 宣传片、logo 动画、实物产品 3D 镜头、讲解/演示动效、接真人实拍的剪影转场。包括:先出带编号的分镜、HTML 逐帧渲染、浏览器里的 3D、Blender 单灯棚拍、逐帧检查(文字压物体、接缝、穿模、转速)、配乐对齐落点和音效混音。用户说“做个动效/动画/宣传片/发布视频/产品视频/logo 动画/App 演示动画/讲解动画/开场动画/motion graphics/product video/promo/launch video/explainer animation”,或要改这类片子时使用,即使没提“动效”两个字。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/risingjerry/motion-skill/tree/HEAD

在你喜欢的 AI 中提问

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

文档

Code-Driven Motion Graphics Shorts (motion)

The video is written in code: every frame is computed from the time variable t, so "make this section slower" is just changing one number and re-rendering — no need to reshoot. No AI image or video generation models are used; everything on screen comes from real assets or code.

Choose Your Production Tier

All three tiers follow the same workflow, but each progressively mimics real-life shooting and takes longer. Pick the one that fits your video; you can mix tiers.

TierWhat You SeeBest ForStarting Point
1. 2D MotionReal logos, real screenshots, shapes morphingApp, software, brand introstemplates/2d.html
2. Browser 3DInterface cards in 3D space, camera fly-throughs; silhouette-to-live footageMulti-screen UI showcases, videos with live footagetemplates/3d.html, scripts/silhouette.py
3. Blender StudioPhysical product model, one light, realistic materialsPhysical products like headphones, phones, cupsscripts/blender/studio.py

Detailed explanation: references/layers.md.

Workflow (in order, no skipping)

  1. Clarify requirements; gather real assets. What is the product? Who is the audience? How long? Which platform? What should viewers do at the end? Always use genuine materials: Official logo files, real device screenshots (first remove notifications, avatars, phone numbers), brand colors and fonts. Do not use app store promo images as UI; do not draw logos from memory. For physical products, ask for multiple photos from different angles — preferably photos the user took themselves — to later compare with the model.
  2. Define the ending. The ending should only show the icon and wordmark (or cut to live footage). No "Download Now" or "Open XX" slogans, and no "concept piece" disclaimers (include those in the description instead).
  3. Produce a numbered storyboard; get client approval. 5–10 shots, each describing: time range, visuals, action, how it transitions to the next shot, and on-screen text. Write shots.json, run node scripts/render.mjs board shots.json board.png to generate a visual board. Do not proceed to final production until approved — changes are cheapest here. Format in references/storyboard.md.
  4. Build the page. Copy the template and templates/motion-kit.js into the assets folder. All beats are defined in the BEATS array at the top of the page; to change pacing, edit only this array. Page conventions in references/html-engine.md.
  5. Frame-by-frame self-review before sharing. Use render.mjs still to extract key moments (3–4 frames per transition, not just the resting state), then scripts/sheet.py to compile them into an image and review yourself. Then run the checking scripts:
    • render.mjs probe + scripts/layout_check.py probe: text must be at least 40 px from the subject (4K); subject near the center.
    • 3D: scripts/blender/motion_check.py (clipping, max 6° rotation per frame, no sudden speed changes), scripts/seam_check.py (seam gap ≤ 1 px). Full checklist in references/checklist.md.
  6. Export only 4K. node scripts/render.mjs video page.html film-name-4K.mp4 --scale 2 (1920x1080 page → 3840x2160). Only one 4K render or Blender render at a time per computer. Extract frames for review from the 4K final: python3 scripts/sheet.py video ....
  7. Add sound only after picture is locked. Any picture change shifts all beats. Both music and sound effects are required; the music's strongest beat must align with the key visual moment; overall -14 LUFS, true peak max -1 dBTP; video stream copied without re-encoding. See references/sound.md.
  8. Revisions. Back up before each round, re-check frames after changes, explain changes in plain language. Save as new version; do not overwrite or delete the client's files. Be honest about what was checked: stills are not playback, viewing images is not listening to the mix.

Rules for Good-Looking Videos

Full explanation in references/transitions.md and references/blender-3d.md. These are must-remembers:

  • Each shot emerges from the previous one. No fades, no cross dissolves. The same object morphs, flips, unfolds, or retracts — the viewer's eyes never have to search for a new focal point.
  • Action stays in the center. Imagine a crosshair at the center of the frame; the main subject is always near it.
  • The frame is always moving. Even stationary shots have a very slow push-in or drift.
  • One motion follows one curve. Push in all the way; don't push then pull. Rotate in one direction; don't rotate partway then reverse. Start fast, end slow; give the slowdown ample time.
  • Text should be concise, fade in from blurry to clear — no bouncing, no sudden enlargement. Text must not overlap the subject.
  • 3D uses only one light with a black background. This is the main reason it looks like a studio shot.
  • 3D must be physically plausible: lid closes seamlessly; objects do not clip through each other; two objects swap positions via 3D orbit, not straight-line intersection; rotation speed is smooth, no jumps.
  • Compare the model with real product photos — if proportions, corner radii, or port positions are wrong, fix the model.
  • Silhouette transition starts from an extreme close-up, then pulls back before a hard cut to live footage. See references/silhouette.md.
  • Audio and video shift together globally; no speed or pitch changes.

Rules to Follow

  • Branding: Only work on brands that the client owns or has permission to use. Other brands are for practice only — do not impersonate official accounts, run ads, or mimic their real campaigns.
  • Assets: Use only assets, fonts, music, and models that the client created or has a license for; confirm the license covers this usage.
  • Claims: Every number and claim in the video must be truthful and sourced; do not fabricate data or reviews.
  • Privacy: Remove personal information from screenshots and live footage; obtain consent from people appearing on camera.
  • Paid services (voiceover, AI music, etc.) will use the client's credits — use them only when requested.

Script Overview

ScriptPurpose
scripts/render.mjsHTML page → stills / 4K mp4 / position records (probe) / storyboard (board)
scripts/sheet.pyExtract frames at time intervals from stills or final video → a single time-stamped check image (extracted from original resolution)
scripts/layout_check.pyCheck text-to-subject distance and subject centering
scripts/seam_check.pySeam misalignment (in pixels) between two parts as seen from the actual camera angle
scripts/blender/studio.pySingle-light studio scene + EEVEE/Cycles rendering; accepts GLB/glTF/USDZ/OBJ/FBX; --demo includes a sample model
scripts/blender/motion_check.pyPer-frame clipping, angular velocity, and sudden speed changes
scripts/silhouette.pyPerson masking (macOS Vision, optional) → smooth vector silhouette, can pull back from close-up
scripts/audio/synth.pyCode-synthesized sound effects and backing track (royalty-free)
scripts/audio/mix.pyAlign music to key moments, place sound effects on beats, sidechain ducking, loudness normalization, final mix into video
scripts/encode.pyPNG frame sequence → mp4
scripts/doctor.pyCheck dependencies — what's missing and how to install it

Which File to Read When

You are…Read
Choosing a tier or estimating effortreferences/layers.md
Writing a storyboardreferences/storyboard.md
Writing an HTML page and renderingreferences/html-engine.md
Designing transitions between shotsreferences/transitions.md
Making 3D for a physical productreferences/blender-3d.md
Making silhouettes and cutting to live footagereferences/silhouette.md
Adding music and sound effectsreferences/sound.md
Final self-check before deliveryreferences/checklist.md
Something looks wrongreferences/pitfalls.md

Environment

Node.js 20+, Python 3.9+ (numpy, Pillow, opencv-python-headless), ffmpeg, Google Chrome or Chromium. Tier 3 requires Blender (free); automatic silhouette masking requires macOS 14+; other systems can use external tools to generate masks. Before starting, run python3 scripts/doctor.py and inform the client about any missing dependencies and how to install them. If the skill directory contains a .venv, run Python scripts with .venv/bin/python (Windows: .venv\Scripts\python); on Windows, replace python3 with python.

相关技能