Communitygithub.com

yazzang-homelab/motion-studio

编写一个六部分的 XML 状态规范,用于一个单一形状的 UI 动画影片(输入、方向、结构、构建、注意事项、开始):状态落于节奏重拍上,光标驱动变化,无缝循环,并有审批关卡。适用于“UI 变形”和“状态列表”场景。

motion-studio 是什么?

该技能指导开发者通过一个结构化的六部分 XML 模板来制作复杂的 UI 变形动画。它基于一个基本原则:单个形状在整个动画过程中永不剪切,而是通过大小、圆角和颜色的变化在按钮、加载器、播放器、图表和命令面板等不同 UI 状态之间转换。每个状态变化都由真实的光标点击触发,并且最终帧与第一帧完全相同,从而实现无缝循环。 该技能支持多种平台,包括 Cursor、Claude Code 和 Codex,并提供了一个包含输入收集、节拍网格状态编排、代码生成、质量审查和交付的完整工作流。其关键特性包括:在输入收集阶段从产品 URL 捕获真实 UI 数据;使用最低 120 BPM 的节拍网格精确计时;通过专门的脚本自动生成状态列表,并进行循环一致性检查;最后通过一个多轮审查流程确保所有轴评分达到 8 分以上、零 P0 问题,并验证循环无缝性。该技能特别适合需要为可交互原型、产品演示或微交互创建高度结构化、可循环的 UI 变形动画的开发者。

兼容平台✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/yazzang-homelab/motion-studio/tree/HEAD/skills/ui-morph-spec

在你喜欢的 AI 中提问

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

文档

UI 变形规范(课程步骤 06,级别 L3)

编写状态列表,而不是氛围。Opus 5.5 发布周收藏最多的提示词并非一行代码:@twoclipping 的 UI 变形循环和 @verbove 的 MakerMap 影片都使用了一个 XML 规范,其中包含需要询问的输入、一个方向、逐节拍的状态列表、构建规则和注意事项。它们背后的理念:一个永不剪切的单一形状。单个元素从一个状态到另一个状态改变大小、圆角和颜色(按钮、加载器、播放器、图表、命令面板),光标通过真实的点击引发每次变化,最后一帧等于第一帧,从而使影片循环。

请求参数(可能为空),仅显示一次:

鸣谢:六部分布局遵循 @twoclipping 的公开模板 (https://x.com/twoclipping/status/2103273003555402193;XML 在主帖中,而非课程所说的跟帖回复中) 和 @verbove 的 MakerMap 规范 (https://x.com/verbove/status/2103483957266268381)。本技能中的模板使用 motion-studio 自身的语言编写:assets/spec-template.xml。

1. 询问输入

在一轮 AskUserQuestion 中询问(子代理无法提问;由你提问):

输入默认值规则
产品 + URL必填捕获真实 UI,并在有 URL 时使用 /motion-studio:product-reel 阶段 3 进行复制
按故事顺序的 8 到 12 个状态logo, CTA, email field, loader, check, card, chart, command palette每个重拍一个状态
每个状态的真实数据询问来自产品的标签、数字、名称;无占位符
品牌颜色、字体、一个强调色来自捕获或 studio.json一个强调色
音轨以 120 BPM 合成 minimal 风格提供的音轨必须允许此用途,并从重拍开始
输出格式9x16, 1x1, 16x9相同时间线,重新构图
循环是最后一个状态变形回第一个状态

2. 填充规范

将模板复制到项目中,命名为 docs/spec.xml,并用答案填充每个 [...]。保留所有六个部分:<inputs>、<direction>、<structure>、<build>、<gotchas>、<start>。motion-director 子代理(motion-studio:motion-director)可以根据你的简要说明起草它;它只写入 docs/ 目录下。

3. 将状态置于节拍网格上

  1. 项目:如有必要,使用 --loop 进行脚手架搭建 (node "${CLAUDE_PLUGIN_ROOT}/skills/studio-init/scripts/init.mjs" <dir> --title "<Product> morph" --loop --duration <S> --install; 在仅技能安装中,使用 node "${CLAUDE_SKILL_DIR}/../studio-init/scripts/init.mjs" ... 并带上相同的标志,或调用 studio-init 技能)。

  2. 网格:node tools/score.mjs --style minimal --bpm 120 --dur <S>,或使用 node tools/beats.mjs audio/<track> 测量提供的音轨。

  3. 包含精确重拍时间、循环检查和警告的状态列表:

    node "${CLAUDE_SKILL_DIR}/scripts/statelist.mjs" --states "logo,CTA button,email field,loader,check,card,chart,palette" --out docs/statelist.md
    
    标志用途
    --states "a,b:2,c" 或 --file list.txt按顺序的状态;:2 表示一个状态保持两个小节
    --beats audio/beats.json测量的网格(文件存在时的默认值);--beats none 忽略它
    --bpm N,--beats-per-bar N覆盖网格
    --no-loop一个结束而不循环的影片
    --json一行 JSON,包含每个状态的开始、结束和内容时间

    当循环长度与 studio.json 中的 duration 不同、第一个状态不在 0 秒处(音轨中的弱起)、或某个状态持续时间少于 1 秒时,它会发出警告。在继续之前修复持续时间或修剪音轨。

  4. 填充 docs/statelist.md 的光标动作、数据和声音列,并将表格复制到 docs/shotlist.md 中。

4. 审核关卡

在节拍网格上显示状态列表,并在编写任何影片代码之前等待用户的确认(<start> 部分如此要求,课程也是如此)。被拒绝的列表会被重写,而不是绕过它进行编码。在 docs/shotlist.md 的 Status: 行记录决定。

5. 从已验证示例构建

将 assets/morph-loop.film.js 复制到 film/film.js 并改编它:它是一个以 120 BPM 运行、包含 8 个状态、持续 16 秒且可在每种格式中渲染的工作循环。用已批准的状态列表和真实数据替换 STATES(以 1080 像素单位表示的大小、填充令牌)、COPY 和 content 绘制器;保留机制:

机制API规则
状态时间grid.bar(i)从不使用秒数
容器大小、圆角、颜色通道、相机缩放loopTrack(t, keys, dur, spring)键在 [0, duration] 范围内;接缝处改变一次,作为第一个重拍处的键(此示例)或在 t = duration 处
内容移入和移出swapAlpha(t, start, nextStart)在变形开始后移入,在下一个开始前移出
光标loopTrack 作用于 x 和 y,cursor(g, x, y, { pressed })在重拍处点击当前元素
标签和列表高亮indicator(t, stops, { width })边缘使用不同的弹性参数
声音来自 grid.bar 和 grid.beat 的 cues按下时发出咔嗒声,变形时发出飒飒声
颗粒感和其他帧索引噪声grain(g, W, H, c.frame % LOOP_FRAMES, ...) 配合 LOOP_FRAMES = Math.round(dur * fps)批评比较 hash(0) 与 hash(duration, { wrap: false });由原始帧索引作为种子的噪声会使结尾与第 0 帧不同,从而导致循环检查失败

每个模式及其原理:references/morph-recipes.md。 设置 studio.json 中的 "loop": true 和 duration 为循环长度,然后运行 npm run lint。

6. 评论与交付

从 /motion-studio:motion-reel 运行评论循环(至少 3 轮,所有轴评分 >= 8,无未解决的 P0 问题;每轮先构建混合渲染和两个证据通过,请参阅其流水线运行手册)。 对于变形循环,还要检查 out/review/<fmt>/loop.png(仅限实时通过;video/ 通过没有循环面板)和“循环接缝”指标 (hash(0) 等于 hash(duration, { wrap: false }),连续性比率 <= 1.5;|end - first| 面板必须为黑色, 帧索引颗粒感除非其索引被包裹否则会破坏这一点),strip.png 中每次交换期间的标签,以及 contact.png 中每个重拍处的光标位置。接缝跳跃是 P0 问题。然后运行 npm run build。

变形影片规则

  • 一个容器,永不剪切。状态仅通过大小、圆角、填充和内容进行区分。
  • 光标引发每一次变化;没有状态会自行改变。
  • 每个节拍都有移动:按下、打字、计数器、线条绘制、高亮步骤。
  • 仅使用真实产品数据。弹性动画最多允许轻微的过冲;打字时不允许使用弹性。
  • 禁止:弹跳缓动、发光效果、UI 框架上的渐变、粒子爆发、空拍。
  • 切勿在任何被相机缩放的物体上使用 will-change(或任何光栅化技巧)。

下一步:/motion-studio:springs 调整手感;/motion-studio:ship-formats 进行每种格式的重新构图和交付。

Individual skills in this repo

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

yazzang-homelab/motion-studio

Make Claude watch its own frames: critique.mjs evidence, harsh 7-axis scores, timestamped P0/P1/P2 problems in docs/review_log.md, fix the 3 worst, re-check, pass the gate. Use for 'critique it', 'review the frames', 'is it good'.

yazzang-homelab/motion-studio

Plan long-form or overnight films: director's brief (PLAN FIRST or GO, budget, definition of done), ANIMATION_GUIDE + STORYBOARD, chapter subagents, gates, chunked render. Use for 'overnight film', 'music video', '2-minute film'.

yazzang-homelab/motion-studio

Make a launch video, app or product reel, explainer or motion ad from code, end to end: brand assets from a URL, beat-grid shot list, synced sound, critique loop, all formats. Default for new video requests; not footage edits.

yazzang-homelab/motion-studio

Brand-asset stage of a product film (motion-reel runs the whole film): capture real screenshots, logo, colors and fonts from a URL, never redraw UI; brand story beats; voice + mascot. Use to grab or fix a brand's assets.

yazzang-homelab/motion-studio

Turn a reference (a frame, a video or an image library) into docs/style_guide.md and a beat-grid shot list: measure cuts, palette and pace, take grammar not content, wait for OK. Use when the user supplies or names a look.

yazzang-homelab/motion-studio

Build, debug or speed up the seek(t) render engine: render contract, canvas vs page capture, workers/subframes/chunks, determinism fixes, Remotion or HyperFrames handoff. Use for 'render is slow', 'frames differ', 'use Remotion'.

yazzang-homelab/motion-studio

Ship every format from one timeline, then package it: layout() reframing (never crop), render all formats, per-format checks, deliver.mjs, a brand skill, a service offer. Use for 'export 9:16 and 16:9', 'deliver', 'make a skill'.

yazzang-homelab/motion-studio

The viral one-line 'showreel for a résumé' prompt: why it works (anatomy), the credited quote, and seeded variants that avoid look-alike reels; runs it as an engine test. Use for that prompt, its variations, or a showreel.

yazzang-homelab/motion-studio

Score a film to its beat grid: measure a track (beats.mjs) or synthesize one (score.mjs), cue SFX from the film, add voice, mix to -14 LUFS / -1 dBTP at exact length. Use for 'add music', 'sync to the beat', 'SFX', 'loudness'.

yazzang-homelab/motion-studio

Make motion feel physical with closed-form springs from lib/motion.js: presets, springFromFeel, track() for multi-target values, loopTrack loops, indicators, text swaps. Use for 'feels linear', 'add bounce', 'easing to springs'.

yazzang-homelab/motion-studio

Scaffold a motion-studio film project (seek(t) renderer, springs, beat grid, synthesized sound, critique tools), install it, set up the browser, run doctor. Use for 'set up the motion studio', 'new film project', 'init studio'.

相关技能