codecast 动画解说视频制作
cast-motion
根据代码和时间线制作动画解说,发布为可播放、可拖动进度、可在特定时刻固定评论、可显示实时数字并可按需导出为 MP4 的 codecast 页面。当用户要求制作动态短片、动画解说、仪表板视频或团队交付内容视频,或将数据转化为短片时使用。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 49
- Forks
- 6
01 前言 Front Matter
- name
- cast-motion
- description
- Make an animated explainer from code and a timeline, published as a codecast page that plays, scrubs, takes comments pinned to moments, can show live numbers, and exports to MP4 on request. Use when asked for a motion piece, an animated explainer, a video of a dashboard or of what the team shipped, or to turn data into a short film.
- argument-hint
- [the question the piece answers, or the data to explain]
03 SKILL.md 正文
A motion page is a short film written as HTML: a composition whose every
beat, number and timing is code, published with cast publish so people
watch it in the browser, scrub to a moment and comment there. Because it is
code, a comment like "hold on the empty dock a beat longer" is a one-line
edit and a republish, not a re-edit of footage.
Start from the question and the reveal
Before anything visual, write down the one question a viewer walks in with and the reveal that answers it. "Why are the hill docks empty by 8:15?" is a question; "commuters ride downhill in the morning and nobody rides back up" is its reveal. Every beat exists to make that reveal land: set up what the viewer expects, show the evidence, turn, reveal, and leave them with what it means. A piece without a reveal is a slideshow of charts; find the surprising fact in the data first, and if there is none, say so instead of animating.
Storyboard before code
Write the beats as a list before writing markup: for each, what the viewer learns, what is on screen, and how long it holds. Explainers run 30 to 90 seconds; a beat that teaches nothing goes. Durations add up to the whole, and the reveal gets the most time. The hook lands at once: the question is on screen within the first second, and every beat shows its point as it opens rather than after a lead-in, while the reveal is earned later. Share the storyboard with the person when the direction is theirs to choose; otherwise build from it.
Numbers come from real data
Every number on screen comes from a query you ran, and the composition keeps
the source beside the value so a reader of the code can rerun it. Codecast's
own record is the usual source: cast feed, cast search "<topic>" after:7d,
cast task ls, git log --since, cast events ls, cast metrics ls, and a
dashboard's own queries. Never round a number into a better story or invent
one to fill a beat.
When the page has a live data source, bind the number instead of baking it:
<span data-cast-data="<data id>" data-cast-col="<column>" data-cast-row="-1" data-cast-format="int">1,204</span> shows the current value from
window.cast.data and follows revisions without a re-render, while the
authored text stays for renders and offline viewers. A script that needs the
value to build a tween (a count up, a bar height) reads it with
await window.castMotion?.value(id, col, row) before registering its
timeline, falling back to the authored number.
The composition contract
This is all the runtime needs; the hyperframes-core and
hyperframes-animation skills go deeper when they are installed.
- One directory, entry
index.html. Its root element carriesdata-composition-id,data-width,data-heightanddata-duration(seconds), sizedwidth:100%; height:100%, never hard pixels. - Each beat is an element with
data-startanddata-duration(a clip). The runtime shows a clip only inside its window, so never animate a clip'svisibilityordisplay; fade or move its children. - Exactly one GSAP timeline, created
{ paused: true }and registered last aswindow.__timelines["<composition id>"] = tl. The page's player owns play, pause and seek; never calltl.play(). - Every frame is a pure function of time: no
Date.now(), unseeded random, network fetches for visuals, hover state, or infinite repeats. - Load GSAP from
https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.jsand do not add the HyperFrames runtime yourself: the page gets the pinned one when it is served, and the renderer brings its own.
<div id="root" data-composition-id="main" data-width="1920" data-height="1080" data-duration="45">
<section id="beat-question" class="clip" data-start="0" data-duration="6">…</section>
<section id="beat-reveal" class="clip" data-start="30" data-duration="15">…</section>
</div>
<script>
const tl = gsap.timeline({ paused: true });
// tweens, positioned in seconds on the composition's clock
window.__timelines["main"] = tl;
</script>
Keep it steerable: name each beat's element after the beat, put beat starts and holds in named constants and the data in one block at the top of the script, so a comment about a moment maps to one obvious line.
Verify, then publish
Run npx hyperframes@0.8.142 check <dir> until it reports no findings, then
npx hyperframes@0.8.142 snapshot <dir> --at <the midpoint of each beat> and
look at every frame: text that overflows, a number that reads wrong, a beat
that is empty at its midpoint. Snapshot sends the frames to Gemini for a description whenever GEMINI_API_KEY is set; clear it for that command when the frames show private data. Then cast publish <dir>, open the page with
cast browser, scrub through the beats and screenshot the reveal before
sharing the link.
The page opens on a poster still rather than a blank first frame: the
moment the root names with data-poster="<seconds>", else the first beat
once its entrances have settled. Name one when a later frame sells the piece
better; the page's thumbnail is shot at the same moment. Play starts from
the top.
The page fits the film to the window under a transport: play and pause, a
scrubber with a tick at each beat, frame steps, keys (space, arrows, shift
arrows, comma and period for single frames, 0 to 9 to jump), and #t=12.5
links to a moment.
Steer by comments
Viewers comment on a moment: their comment carries the time it was pinned
at, and it shows as a marker on the scrubber. Read them with cast publish comments <slug>, change the beat each one names, republish the same
directory (the URL and its history stay), and resolve what you addressed. When
a comment asks for something the data does not support, answer it rather than
bend the piece.
MP4 only on request
Rendering is slow, so publish without it while the piece is being steered.
When someone asks for a file, cast publish <dir> --render renders with the
same HyperFrames release, stores the MP4 in the directory's cast-render/,
and the page offers a Download MP4 button. A later publish of a changed
directory warns that the MP4 is behind until it is rendered again. HyperFrames' own
output folders (renders/, snapshots/) never ride a publish.
Codecast-native pieces
- A week of the team's changes, in 60 to 90 seconds. The question is what actually moved this week. Pull merged work, closed tasks and the sessions behind them, pick the three to five changes that matter by their effect rather than their size, give each a beat with one real number, and end on what the week adds up to.
- A dashboard as an explainer. Take the dashboard's own queries, find the number that surprises (a spike, a gap, a reversal), and build the film toward it: the normal shape first, then the break, then its cause. Bind the headline numbers so the film stays current as the dashboard refreshes.
04 同仓库更多 Skills
名称与目录名不一致示例
something-else-entirely
一个 frontmatter 中的 name 与其目录名不一致的技能。
未知字段示例技能
unknown-field
携带一个既不属于规范六项字段、也不在 Claude Code 字段列表中的字段。
Remotion 视频创作最佳实践
remotion-best-practices
Remotion 的最佳实践——用 React 创作视频。
超长描述示例技能
overlength
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
无 Frontmatter 技能
no-frontmatter
暂无简介
代码库审计与改进规划
improve
以高级顾问的身份审视任意代码库,产出按优先级排序、自成体系的实施计划,供其他模型/智能体执行。对源代码严格只读——绝不亲自实现、修复或重构任何内容。当用户要求审计代码库、发现改进机会(缺陷、安全性、性能、测试覆盖率、技术债务、迁移、开发者体验 DX)、建议新功能或项目下一步方向(路线图、产品方向),或生成交接计划供其他智能体实施时使用。