Communitygithub.com

delorenj/skills

Manim CE 動畫:3Blue1Brown 風格的數學/演算法影片製作管道。

skills 是什麼?

此技能提供了一套完整的 Manim 社群版 (Manim Community Edition) 動畫製作流程,專門用來產生 3Blue1Brown 風格的解說影片、演算法視覺化、方程式推導、架構圖以及數據故事。它適用於需要動畫解說、數學動畫、概念視覺化或技術講解的任何場景,支援概念解說、方程式推導、演算法視覺化、數據故事、架構圖、論文解說以及3D視覺化等多種模式。運作方式從撰寫敘事腳本(plan.md)開始,接著編寫可獨立渲染的場景類別(script.py),然後透過 Manim 指令進行低/高品質渲染、使用 ffmpeg 合成最終影片,並可選擇加入語音旁白。其創意標準強調「每個畫面都在教學」,要求先展示幾何直覺再呈現公式,並嚴格規範動畫節奏、色彩搭配與字體使用 (強制使用等寬字體),以確保視覺上清晰且美觀的輸出。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/delorenj/skills/tree/HEAD/manim-video

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Manim 影片製作流程

使用時機

當使用者要求:動畫解說、數學動畫、概念視覺化、演算法逐步解說、技術講解、3Blue1Brown 風格影片,或任何包含幾何/數學內容的程式化動畫時,使用此技能。可製作 3Blue1Brown 風格的解說影片、演算法視覺化、方程式推導、架構圖,以及使用 Manim 社群版(Community Edition) 的數據故事。

創意標準

這是教育電影。每個畫面都在教學。每個動畫都在揭示結構。

在撰寫任何程式碼之前,先闡述敘事弧線。這個動畫要糾正什麼誤解?「啊哈時刻」在哪裡?什麼樣的視覺故事能將觀眾從困惑帶向理解?使用者的提示只是起點——要以教學抱負來詮釋它。

先有幾何,再有代數。 先展示形狀,再展示方程式。視覺記憶比符號記憶編碼更快。當觀眾在公式之前看到幾何模式時,這個方程式會讓人感覺是應得的。

首次渲染的品質不容妥協。 輸出必須在視覺上清晰且美學上協調,無需修改回合。如果某些東西看起來雜亂、時間控制不佳,或像是「AI 生成的投影片」,那就是錯的。

不透明分層引導注意力。 永遠不要讓所有元素都以全亮度顯示。主要元素設為 1.0,上下文元素設為 0.4,結構元素(軸、網格)設為 0.15。大腦會分層處理視覺顯著性。

喘息空間。 每個動畫之後都需要 self.wait()。觀眾需要時間來吸收剛出現的內容。永遠不要從一個動畫匆忙跳到下一個。關鍵揭示後的 2 秒暫停絕不會浪費。

凝聚的視覺語言。 所有場景共用一個調色盤、一致的字體大小、匹配的動畫速度。一個技術上正確但每個場景都使用隨機不同顏色的影片,在美學上是失敗的。

先決條件

執行 scripts/setup.sh 來驗證所有依賴項。需要:Python 3.10+、Manim 社群版 v0.20+ (pip install manim)、LaTeX(Linux 上為 texlive-full,macOS 上為 mactex),以及 ffmpeg。參考文件針對 Manim CE v0.20.1 進行過測試。

模式

模式輸入輸出參考文件
概念解說主題/概念包含幾何直覺的動畫解說references/scene-planning.md
方程式推導數學表達式逐步動畫證明references/equations.md
演算法視覺化演算法描述包含資料結構的逐步執行references/graphs-and-data.md
數據故事數據/指標動畫圖表、比較、計數器references/graphs-and-data.md
架構圖系統描述組件逐步建立並顯示連接references/mobjects.md
論文解說研究論文關鍵發現與方法動畫化references/scene-planning.md
3D 視覺化3D 概念旋轉曲面、參數曲線、空間幾何references/camera-and-3d.md

技術棧

每個專案一個 Python 腳本。無需瀏覽器、無需 Node.js、無需 GPU。

層級工具用途
核心Manim 社群版場景渲染、動畫引擎
數學LaTeX (texlive/MiKTeX)透過 MathTex 渲染方程式
影片 I/Offmpeg場景拼接、格式轉換、音訊混合
TTSElevenLabs / Qwen3-TTS (可選)旁白配音

流程

規劃 --> 編碼 --> 渲染 --> 拼接 --> 音訊 (可選) --> 審查
  1. 規劃 — 撰寫 plan.md,包含敘事弧線、場景列表、視覺元素、調色盤、旁白腳本
  2. 編碼 — 撰寫 script.py,每個場景一個類別,每個都可獨立渲染
  3. 渲染 — 草稿用 manim -ql script.py Scene1 Scene2 ...,正式版用 -qh
  4. 拼接 — 使用 ffmpeg concat 將場景片段拼接成 final.mp4
  5. 音訊 (可選) — 透過 ffmpeg 加入旁白和/或背景音樂。詳見 references/rendering.md
  6. 審查 — 渲染預覽靜止畫面,根據規劃驗證,進行調整

專案結構

project-name/
  plan.md                # 敘事弧線、場景分解
  script.py              # 所有場景在一個檔案中
  concat.txt             # ffmpeg 場景列表
  final.mp4              # 拼接後的輸出
  media/                 # 由 Manim 自動產生
    videos/script/480p15/

創意方向

調色盤

調色盤背景主要次要強調色使用案例
經典 3B1B#1C1C1C#58C4DD (藍色)#83C167 (綠色)#FFFF00 (黃色)一般數學/計算機科學
溫暖學術#2D2B55#FF6B6B#FFD93D#6BCB77親和力
霓虹科技#0A0A0A#00F5FF#FF00FF#39FF14系統、架構
單色調#1A1A2E#EAEAEA#888888#FFFFFF極簡

動畫速度

情境run_time之後的 self.wait()
標題/介紹出現1.5秒1.0秒
關鍵方程式揭示2.0秒2.0秒
變形/型態轉換1.5秒1.5秒
輔助標籤0.8秒0.5秒
FadeOut 清理0.5秒0.3秒
「啊哈時刻」揭示2.5秒3.0秒

字體大小規範

角色字體大小用法
標題48場景標題、開場文字
標題236場景中的章節標題
正文30說明文字
標籤24註釋、軸標籤
字幕20副標題、細則

字型

所有文字使用等寬字型。 Manim 的 Pango 渲染器在處理比例字型時,在任何大小下都會產生斷裂的字距調整。完整建議請參閱 references/visual-design.md。

MONO = "Menlo"  # 在檔案頂部定義一次

Text("傅立葉級數", font_size=48, font=MONO, weight=BOLD)  # 標題
Text("n=1: sin(x)", font_size=20, font=MONO)                  # 標籤
MathTex(r"\nabla L")                                            # 數學(使用 LaTeX)

為確保可讀性,最小 font_size=18。

場景間的變化

永遠不要對所有場景使用相同的設定。對於每個場景:

  • 不同的主導色(從調色盤中選取)
  • 不同的佈局——不要總是將所有東西置中
  • 不同的動畫進場方式——在 Write、FadeIn、GrowFromCenter、Create 之間變化
  • 不同的視覺重量——有些場景密集,有些稀疏

工作流程

步驟 1:規劃 (plan.md)

在編寫任何程式碼之前,先撰寫 plan.md。完整模板請參閱 references/scene-planning.md。

步驟 2:編碼 (script.py)

每個場景一個類別。每個場景都可獨立渲染。

from manim import *

BG = "#1C1C1C"
PRIMARY = "#58C4DD"
SECONDARY = "#83C167"
ACCENT = "#FFFF00"
MONO = "Menlo"

class Scene1_Introduction(Scene):
    def construct(self):
        self.camera.background_color = BG
        title = Text("為什麼這有效?", font_size=48, color=PRIMARY, weight=BOLD, font=MONO)
        self.add_subcaption("為什麼這有效?", duration=2)
        self.play(Write(title), run_time=1.5)
        self.wait(1.0)
        self.play(FadeOut(title), run_time=0.5)

關鍵模式:

  • 每個動畫加上字幕:self.add_subcaption("文字", duration=N) 或在 self.play() 中使用 subcaption="文字"
  • 共用顏色常數放在檔案頂部,以確保跨場景一致性
  • 每個場景都設定 self.camera.background_color
  • 清理退出——在場景結束時 FadeOut 所有 mobject:self.play(FadeOut(Group(*self.mobjects)))

步驟 3:渲染

manim -ql script.py Scene1_Introduction Scene2_CoreConcept  # 草稿
manim -qh script.py Scene1_Introduction Scene2_CoreConcept  # 正式版

步驟 4:拼接

cat > concat.txt << 'EOF'
file 'media/videos/script/480p15/Scene1_Introduction.mp4'
file 'media/videos/script/480p15/Scene2_CoreConcept.mp4'
EOF
ffmpeg -y -f concat -safe 0 -i concat.txt -c copy final.mp4

步驟 5:審查

manim -ql --format=png -s script.py Scene2_CoreConcept  # 預覽靜止畫面

關鍵實作注意事項

LaTeX 使用原始字串

# 錯誤:MathTex("\frac{1}{2}")
# 正確:
MathTex(r"\frac{1}{2}")

邊緣文字的 buff >= 0.5

label.to_edge(DOWN, buff=0.5)  # 永遠不要小於 0.5

在取代文字前進行 FadeOut

self.play(ReplacementTransform(note1, note2))  # 不要在頂部 Write(note2)

永遠不要動畫尚未加入的 Mobject

self.play(Create(circle))  # 必須先加入
self.play(circle.animate.set_color(RED))  # 然後才能動畫

效能目標

品質解析度FPS速度
-ql (草稿)854x48015每個場景 5-15 秒
-qm (中等)1280x72030每個場景 15-60 秒
-qh (正式版)1920x108060每個場景 30-120 秒

始終使用 -ql 進行迭代。僅在最終輸出時使用 -qh 渲染。

參考文件

檔案內容
references/animations.md核心動畫、速率函數、組合、.animate 語法、時間模式
references/mobjects.md文字、形狀、VGroup/Group、定位、樣式、自訂 mobject
references/visual-design.md12 項設計原則、不透明分層、佈局模板、調色盤
references/equations.mdManim 中的 LaTeX、TransformMatchingTex、推導模式
references/graphs-and-data.md軸、繪圖、長條圖、動畫數據、演算法視覺化
references/camera-and-3d.mdMovingCameraScene、ThreeDScene、3D 曲面、攝影機控制
references/scene-planning.md敘事弧線、佈局模板、場景轉換、規劃模板
references/rendering.mdCLi 參考、品質預設、ffmpeg、旁白工作流程、GIF 匯出
references/troubleshooting.mdLaTeX 錯誤、動畫錯誤、常見錯誤、除錯
references/animation-design-thinking.md何時使用動畫 vs 顯示靜態、分解、節奏、旁白同步
references/updaters-and-trackers.mdValueTracker、add_updater、always_redraw、基於時間的 updater、模式
references/paper-explainer.md將研究論文轉換為動畫——工作流程、模板、領域模式
references/decorations.mdSurroundingRectangle、Brace、箭頭、DashedLine、Angle、註釋生命週期
references/production-quality.md編碼前、渲染前、渲染後檢查清單、空間佈局、顏色、節奏

創意發散(僅在使用者要求實驗性/創意性/獨特輸出時使用)

如果使用者要求創意性、實驗性或非傳統的解說方法,請在設計動畫之前選擇一個策略並進行推理。

  • SCAMPER — 當使用者想要對標準解說進行新的詮釋時
  • 假設反轉 — 當使用者想要挑戰某個主題的典型教學方式時

SCAMPER 轉換

採用標準的數學/技術視覺化並對其進行轉換:

  • 替代:取代標準的視覺隱喻(數線 → 蜿蜒路徑,矩陣 → 城市網格)
  • 結合:合併兩種解說方法(代數 + 幾何同時進行)
  • 反向:逆向推導——從結果開始,解構到公理
  • 修改:誇大某個參數以顯示其重要性(10 倍的學習率,1000 倍的樣本數)
  • 消除:移除所有標記——僅透過動畫和空間關係來解釋

假設反轉

  1. 列出這個主題的「標準」視覺化方式(從左到右、2D、離散步驟、正式標記)
  2. 選擇最根本的假設
  3. 反轉它(從右到左推導、將 2D 概念嵌入 3D、以連續變形取代離散步驟、零標記)
  4. 探索這個反轉揭示了哪些標準方法所隱藏的面向

Individual skills in this repo

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

delorenj/skills

Plan and generate terminal ASCII animations/screensaver-style output (FPS, refresh rules, loop policy, low-flicker guidance), with a static poster frame and an optional local demo script.

delorenj/skills

ASCII video: convert video/audio to colored ASCII MP4/GIF.

delorenj/skills

Plan, build and quality-check a premium short commercial for a real business (roofing, property, ecommerce, B2B software) using AI-generated footage, code-built motion (HTML/GSAP), selective Three.js and an independent-critic "Gauntlet" loop. Use when asked to make a launch-style / SaaS-style video, business ad, explainer, sample reel or pitch video, or to review and improve one. Encodes motion principles distilled from 28 professional launch films, a quality bar, audio rules and a business-offer playbook.

delorenj/skills

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

delorenj/skills

Generate professional voiceovers using ElevenLabs AI. Use when the user needs to create voiceovers for videos, audio narration, or text-to-speech content. Supports multiple voices with character presets (narrator, salesperson, expert) for natural delivery. Includes single scene regeneration for fine-tuning.

delorenj/skills

HyperFrames CLI dev loop — `npx hyperframes` for scaffolding (init), validation (lint, inspect), preview, render, and environment troubleshooting (doctor, browser, info, upgrade). Use when running any of these commands or troubleshooting the HyperFrames build/render environment. For asset preprocessing commands (`tts`, `transcribe`, `remove-background`), invoke the `hyperframes-media` skill instead.

delorenj/skills

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

delorenj/skills

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

delorenj/skills

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For dev-loop CLI commands (init, lint, inspect, preview, render) see the hyperframes-cli skill; for asset preprocessing commands (tts, transcribe, remove-background) see the hyperframes-media skill.

delorenj/skills

Join a Google Meet or Zoom call as a video meeting agent via PikaStreaming. Trigger: user drops a Google Meet or Zoom link, or asks to join a meeting.

delorenj/skills

Translate an existing Remotion (React-based) video composition into a HyperFrames HTML composition. Use ONLY when the user explicitly asks to port, convert, migrate, translate, or rewrite a Remotion composition as HyperFrames (e.g. "port my Remotion project to HyperFrames"). Do NOT use when (a) authoring a NEW HyperFrames composition (even if A/B-testing a Remotion video); (b) Remotion is mentioned in passing; (c) Remotion code is shared as reference, not for translation; (d) the user wants "the same video as my Remotion one" without explicitly asking to migrate the source — treat as a fresh HyperFrames build. When in doubt, default to the `hyperframes` skill. Detects unsupported patterns (useState, useEffect side effects, async calculateMetadata, third-party React component libraries, `@remotion/lambda`) and recommends the runtime interop escape hatch instead of a lossy translation.

delorenj/skills

Generate speech using the self-hosted voxxy (vox) TTS service at https://vox.delo.sh. Use when the user asks to speak, say, narrate, synthesize speech, clone a voice, create a voice, add or register a voice, pipe TTS, or control voice qualities by description (e.g. "a young woman with a cheerful voice"). Handles HTTP API usage, voice profile management, description-based voice design, cloning, MCP registration, and integration patterns for new platforms.

delorenj/skills

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

delorenj/skills

YouTube transcripts to summaries, threads, blogs.

相關技能