Communitygithub.com

yazzang-homelab/motion-studio

撰寫一份六段式 XML 狀態規格,用於單一形體的 UI 變形影片(輸入、方向、結構、建置、注意事項、起始):狀態落在重拍上、游標驅動變化、無縫循環、需通過審核。適用於「UI 變形」、「狀態列表」。

motion-studio 是什麼?

這個技能是為 Claude Code 等 AI 代理設計的,用於撰寫「UI 變形循環影片」的完整規格。它強制要求使用六段式 XML 模板(輸入、方向、結構、建置、注意事項、起始),定義一個永不剪切的單一 UI 元素,在不同狀態之間改變大小、圓角和顏色。每個變化都由真實的游標點擊驅動,且最後一幀必須等同於第一幀以達成無縫循環。 使用流程包含五個步驟:先收集使用者輸入(產品資訊、8-12 個狀態、真實資料、品牌顏色、節奏),接著將規格填入 `docs/spec.xml`,然後透過 CLI 工具將狀態精確對齊到節拍網格。狀態列表必須展示給使用者批准,之後才能開始編寫實際的 `film.js` 程式碼。 技能支援 `motion-director` 子代理來草擬規格,並提供 `statelist.mjs` 等腳本來自動化生成時間表。它還內建了嚴格的審查循環,檢查循環接縫是否完美(P0 級別問題)、游標是否在每個重拍上正確點擊,以及所有碰撞和內容切換是否正確。 最終輸出是一個可在多種格式(9x16、1x1、16x9)中渲染的完整 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 個狀態,按故事順序標誌、CTA、電子郵件欄位、載入器、勾選、卡片、圖表、指令面板每個重拍一個狀態
每個狀態的真實資料詢問標籤、數字、來自產品的名稱;不能使用佔位符
品牌顏色、字體、一個強調色從擷取內容或 studio.json 取得一個強調色
音軌合成 minimal 風格,120 BPM提供的音軌必須允許此用途,並從一個重拍開始
格式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 "<產品> 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 並調整:這是一個可運作的 16 秒、8 個狀態、120 BPM 的循環,可在每種格式中渲染。用已批准的列表和真實資料替換 STATES(以 1080 px 為單位的尺寸、填充標記)、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'.

相關技能