code-film

code-film is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 138 tokens per session (1,736 once invoked), scanned A, original, MIT.

A code-based process for making short animated films with three.js, a JavaScript 3D graphics library, and generated audio, then exporting them as MP4 video files.

In plain words
What is it for?
Use it for short films, animated clips, title sequences, looping videos, product stories, or motion pieces made entirely with code.
Why use it?
It provides a defined way to turn characters, scenes, timing, and sound into a finished stylized video without relying on ordinary filmed footage.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Good fit Use it for short films, animated clips, title sequences, looping videos, product stories, or motion pieces made entirely with code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/code-film
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add majiayu000/spellbook --skill code-film
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-film

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/code-film/github.svg)](https://agentmods.dev/skills/majiayu000/spellbook/code-film)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/code-film"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/code-film/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-film

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/code-film"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/code-film.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,736 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00138 $0.01736
Opus 5.5 $0.00055 $0.00694
Sonnet 5.5 $0.00028 $0.00347
Haiku 4.5 $0.00014 $0.00174

Measured 1mo ago against content hash 1e30b6a9d5a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-film scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 9 executable files (assets/characters/clawd.js, assets/characters/sprout.js, assets/vendor/three.min.js, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/code-film/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Film

用一个 HTML 文件生成整部短片:画面和声音都是时间 t 的纯函数,离线逐帧渲染成 MP4,不用任何外部素材。

核心是一个有魅力的角色演一个看得懂的故事,渲染只是保证质量不掉。优先级:角色 > 表演 > 故事逻辑 > 世界 > 渲染。

这套做法适合风格化角色、微缩玩具感、动态图形、把抽象概念做成实物的片子。真人、写实表情和实拍质感做不好,遇到时直接告诉用户,并建议用拍摄、Blender 或 AI 视频模型。

下面命令里的 <skill-dir> 是本 skill 的安装目录:Claude Code 通常是 ~/.claude/skills/code-film,Codex 通常是 ~/.agents/skills/code-film。

工作流

按顺序走。每一步都有一个用户能看的东西,这样方向错了能尽早发现。

1. 先把用户定下的东西列出来

角色、品牌、题材、风格、时长,用户提到的都算定了。用户说“更有趣”“脱离原来的”,指的通常是内容,不是换主角。想改用户定下的东西时,先单独问,不要写进方案里默认通过。

2. 角色定稿

默认主角是 Clawd。 用户没指定角色时就用它,直接进入第 3 步,不换、不重新设计,也不用为了避开品牌问题而替换。它的标准图在 assets/characters/clawd-sheets/。

只有用户明确要新角色时,才读 references/character.md,单独把角色做到位,出造型图、表情表和走路测试,发给用户确认。新角色确认前不写故事、不搭场景,因为后续工作都建立在它上面,返工最贵。

3. 设计故事,先给方案再动手

读 references/story.md,用一张时间表给出方案:标题、片长、角色、每场发生什么、保留和去掉的东西。检查因果:每个道具和角色为什么在这里、观众凭什么看懂。

用户确认后才开工。

4. 做 15 到 20 秒样片,用最终画质

选最难的两段,直接按成片标准做。不做灰模。 用户拿上一部的质量当基准,灰模看起来就是退步,而且模板已经带好了全部画质能力,灰模省不了多少事。

cp <skill-dir>/assets/film-template.html <folder>/<film>.html

用 scripts/use_character.py 放入定稿角色,再改模板里 WORLD、PERFORMANCE、SHOTS、SOUND 这几节,渲染和后期不用动。模板本身就是一部能渲染的 7 秒小片,默认主角是 Clawd。做世界时读 references/craft.md。

如果片子有真实概念(代码、数学、科学),先把它跑通再搭景。上一部的报错、堆栈、修复结果都是真实程序的输出,这比编造的更有趣,也更可信。

5. 每轮抽帧检查

uv run --with playwright --python 3.12 python -I <skill-dir>/scripts/stills.py <film.html> <outdir> 1.5,4.2,7.6,12 8

然后用 Read 看 <outdir>/sheet0.jpg。一张图 12 格。逐格问:观众看得懂吗?角色完整吗?脸露出来了吗?主角和背景分得开吗?列出问题,一次修一批,再看。

6. 给用户看样片,再做全片

样片确认后才扩展。全片沿用样片的世界和时间轴,新场景放在同一文件里,用 T1、T2 这样的分段常量切换。

循环片要让最后一帧的所有状态等于第一帧:物体位置、地面颜色、镜头、文字朝向都要对上,用 check.py --loop 量。

7. 渲染、核对、交付

uv run --with playwright --python 3.12 python -I <skill-dir>/scripts/render.py <film.html> <film.mp4>
uv run --with playwright --python 3.12 python -I <skill-dir>/scripts/check.py <film.html> <film.mp4> --loop --level 全片:0-20

长片放后台跑,1080p 60 fps 每帧 16 次采样约 0.17 到 0.25 秒一帧(M2 Max),50 秒的片子约 9 分钟。

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 95 lines · 138 tokens per session scan A 1e30b6a9d5a4

Subscribe to this mod's changes

code-film is a skill published in the GitHub repository majiayu000/spellbook (303 stars, last pushed 4d ago), licensed MIT. It adds 138 tokens to every session and 1,736 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-02.

Related

code-film compared with skills from other repositories

code-film next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-filmmajiayu000/spellbookSkill3034d agoMITA138Claude Code, Codex
cao-session-managementawslabs/cli-agent-orchestratorSkill1.9kyesterdayApache-2.0B83Claude Code
workflowzhinkgit/embeddedskillsSkill829yesterdayMITA65Claude Code
agent-deckasheshgoplani/agent-deckSkill1.4kyesterdayMITA63Claude Code, Codex
fast-resumeangristan/fast-resumeSkill198yesterdayMITA50Claude Code, Codex
pneuma-sessionpandazki/pneuma-skillsSkill1624d agoMITA127Claude Code, Codex
lov-organize-storagelovstudio/skillsSkill72todayMITA58Claude Code