Every step returns a file or data an agent can inspect. Go in order: each step catches in seconds what the next takes minutes to show.
0. Project shape
Section titled “0. Project shape”src/theme.ts tokens: size, fps, colors, fonts, beat gridsrc/film.ts export async function buildFilm(): Promise<Composition>src/render.ts frames | grid (render and preview: `framefields render|preview film`)assets/ every input file: on your bucket, or in Git LFS fonts/ .ttf .otf footage/ .mp4 .mov .webm audio/ .mp3 .wav images/ .png .jpg .webp luts/ .cube models/ .glb .gltf .obj .fbx lottie/ .json .lottie captions/ .srt (plain text, no LFS needed)output/ renders (gitignored, never committed).gitattributes LFS rules for assets/Also commit the lockfile and pin packageManager. Keep film.ts free of side effects: it builds the film and renders nothing. That way the same repo renders on a render worker unchanged.
render.ts is in Getting started. Keeping buildFilm() separate means tests, preview and export all build the same film. Reference assets from the module URL (path.resolve(HERE, "../assets/…")) so the preview can load them too.
Assets and Git LFS
Section titled “Assets and Git LFS”Source media goes in assets/, outside git, so the repo stays small and clones stay fast. Renders go in output/ and are never committed.
On a bucket. When framefields.json has a storage remote, pin media with npx framefields assets add <path> (it uploads, records the sha256 and gitignores the file) and commit framefields.json. In a fresh checkout, npx framefields assets pull restores them; framefields render pulls what’s missing itself, and framefields preview streams them from the bucket without downloading. npx framefields assets status lists each as ok, missing or changed. Keys come from the environment (FRAMEFIELDS_STORAGE_<REMOTE>_*); never print or commit them. Setup: Assets and storage.
In Git LFS, as below, when the repo uses it.
Set up once per repo
Section titled “Set up once per repo”git lfs install # once per machinegit lfs track "assets/fonts/**" "assets/footage/**" "assets/audio/**" \ "assets/images/**" "assets/luts/**" "assets/models/**" "assets/lottie/**"echo "output/" >> .gitignoregit add .gitattributes .gitignoregit commit -m "Track assets with Git LFS"git lfs track writes the rules to .gitattributes (assets/footage/** filter=lfs diff=lfs merge=lfs -text, and so on). Commit that file before adding any media. Ignore output/, never *.mp4 — that would also hide your footage.
Push assets
Section titled “Push assets”Add and push as usual; Git uploads the LFS objects with the push.
git add assets/footage/interview.mp4git lfs ls-files # the new file must be listed — otherwise it is not in LFSgit commit -m "Add interview footage"git pushIf a file was committed before its rule existed, it went into normal Git. Fix it with git rm --cached <file>, git add <file> and commit again.
Pull assets
Section titled “Pull assets”A clone with LFS installed downloads assets automatically. Anywhere else — a fresh container, a CI runner, an agent sandbox, or a clone made with GIT_LFS_SKIP_SMUDGE=1 — fetch them before rendering:
git lfs installgit lfs pull # all assets for the current commitgit lfs pull --include="assets/fonts/**,assets/footage/intro.mp4" # or just what this render needsCheck nothing is still a pointer: in git lfs ls-files, * means the file is downloaded and - means it is still a pointer.
In GitHub Actions, check out with lfs: true (actions/checkout) so the runner has the real files.
1. Check without the GPU
Section titled “1. Check without the GPU”npx tsc --noEmit -p .const film = await buildFilm();for (const d of film.lint()) console.log(`${d.severity} ${d.code}: ${d.message}${d.layerId ? ` [${d.layerId}]` : ""}`);Fix every error and warning before rendering. Codes and fixes: Lint & QA codes.
2. Look at key frames
Section titled “2. Look at key frames”npm run frames -- 0 30 60 89Open each PNG in output/ and compare it to what was asked. A black frame usually means a font that isn’t registered, a layer off canvas, opacity stuck at 0, or an asset that is still a Git LFS pointer (git lfs pull) or a pinned asset not pulled yet (npx framefields assets pull).
3. Look at motion
Section titled “3. Look at motion”npm run grid -- 0 6 12 18 24 30 36 42One image of the whole move: easing hitches, text that re-wraps, wrong z-order, missing cuts. Not for vision layers (they need frames in order).
4. Show a person
Section titled “4. Show a person”npm run preview # framefields preview film; run in the background; prints the URL- Give the person the URL, or open it in your own browser pane.
- Read the command’s output: page errors and lifecycle lines show up there.
- When they say they left notes, read
.framefields/preview-notes/notes.jsonand open each open note’snote-<id>.jpgbefore editing. Each note has the frame, the spot (x,yas fractions) and the text. - Rerun the preview after changes; the open tab reloads at the same moment. Mark notes
"done": truewhen addressed.
5. Ship with QA
Section titled “5. Ship with QA”import { formatQaReport } from "framefields";
const result = await film.renderVideo({ outputPath: "output/film.mp4", quality: "high", qa: { targetLufs: -14 } });console.log(formatQaReport(result.qa!));process.exit(result.qa!.passed ? 0 : 1);qa.passed is false on any error or warning: dropped, black or frozen frames, clipping, loudness off target, plus every lint finding. Treat it as the gate.
6. Render in the cloud
Section titled “6. Render in the cloud”To render on framefields GPUs instead of locally, commit and push (LFS assets included), then render a named render from framefields.json:
npx framefields render film --cloud --plan # GPUs, time and estimated cost; show this to the user firstnpx framefields render film --cloud # render and downloadAdd a named render per cut (teaser, vertical edit) instead of flags in render.ts, and run npx framefields check <name> before pushing. Long films with "workers": "auto" split across several GPUs. Go through the project checklist first. When a render fails, read its code and fix the project; the API retries infrastructure errors itself. Details: Cloud rendering. To run the worker on your own GPUs, see Render on a server.
A runner without a GPU renders on the CPU: on Linux once Mesa lavapipe is installed (apt-get install -y libvulkan1 mesa-vulkan-drivers), on Windows through the built-in WARP. That is enough for frames and short exports; run long films on a GPU runner or with cloud rendering (npx framefields render film --cloud, with FRAMEFIELDS_API_KEY as a CI secret). On any runner you can also gate on types and lint() without rendering:
import { CompositorProgramSchema } from "framefields";import { buildFilm } from "../src/film.js";
const film = await buildFilm();const bad = film.lint().filter((d) => d.severity !== "info");const schema = CompositorProgramSchema.safeParse(film.toSpec());if (bad.length || !schema.success) { for (const d of bad) console.error(`${d.code}: ${d.message}`); process.exit(1);}process.exit(0);Habits that keep agents fast
Section titled “Habits that keep agents fast”- Change one scene at a time and re-render only its frames.
- Keep all magic numbers in
theme.ts; a tweak is then one line. - Name layers with
id— lint, QA and chart children report by id. - Put asset paths through
import.meta.urlso the preview loads them too.