pre-render-gate
Skill8 starsChanged 8 days agoMITView on GitHub
Catch overlay, caption and timing defects in a video plan before rendering, so a draft costs one render instead of five. Checks a resolved plan (text overlays, counters, stamps, captions placement) for collisions, text wider than the safe area, off-screen or out-of-zone text, duplicated on-screen text and impossible label timings, and prints each problem with the overlay number and the exact change. Use this when an animated video, cartoon, motion-graphics piece, explainer, Short, Reel or title sequence is about to be rendered and the plan already exists — especially when the same video has already been rendered more than once to fix plan-level mistakes, when renders take minutes each, or when the user asks how to stop the render-and-review loop. Not a video analyzer and not a renderer: it reads a JSON plan, not pixels.
In this repository4 other files it gives its agents.
- animation-quality-reviewSkill
- gbro-collage-brollSkill
- lemo-opuscarSkill
- youtube-long-videoSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
After adding this gate, the plan check found the surviving defects in under a second and the next render was the last.
- Distinctive: line 89
At most one re-render: After the second render, ship unless a fact is wrong or text is unreadable.
- Distinctive: line 92
If the same defect appears in two videos, fix the plan template or the renderer — not the video.
- Distinctive: line 111
Read the constants from the renderer's own components once, and update them in the same change when the layout moves.
- Distinctive: line 112
Keep the gate silent on videos that already shipped well.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pre-render gate
Rendering is the expensive step. Almost every "render, look, fix, render again" cycle comes from a defect that was already visible in the plan: two counters counting at the same moment, a stamp wider than the frame, a label that outlives its number, the same line of text on screen twice, a pill 40 px off-screen. Those are milliseconds of JSON checking, not ten minutes of 4K encoding.
This skill turns that check into a gate. It ships scripts/check_overlays.py, needs only Python 3, and prints
messages an agent can act on directly: which overlay, which frames, what to set.
When to run it
- Before the first render, once the plan's timings are resolved (real voice/word timings, not placeholder ones).
- Again after any plan edit — a changed word timing can turn a clear band into a collision.
- Before a re-render, never after: if the gate is clean and the render still looks wrong, the defect is in the renderer or a visual judgment, and re-rendering the same plan cannot fix it.
Proven result (case study, 2026-11-09)
A 98-second history Short was rendered five times in 55 minutes and never uploaded. Every render chased a plan defect:
| Render | What the frame review found | Was it in the plan? |
| 1 | two counters counting simultaneously | yes — two counter overlays overlapped in the top band |
| 2 | label outlived its counter | yes — labelAt past the counter's end |
| 3 | stamp clipped at the frame edge | yes — text 145 px wider than the safe width |
| 4 | duplicate stamp wording | yes — two overlays with identical text |
| 5 | the previous 4 fixes | — |
After adding this gate, the plan check found the surviving defects in under a second and the next render was the last. The gate is calibrated to be silent on plans that shipped well: run it on your own finished videos first.
Use
python3 -I scripts/check_overlays.py plan.json
python3 -I scripts/check_overlays.py plan.json --config zones.json # your own types / geometryExit code 0 = clean, 1 = errors (WARN lines never fail). The plan is your renderer's resolved plan, in frames:
{
"width": 1080, "height": 1920,
"safe": {"margin": 40, "top": 220, "bottom": 1500},
"overlays": [
{"type": "counter", "from": 100, "dur": 60, "label": "LEFT EAST", "value": 3, "y": 250, "size": 132},
{"type": "stamp", "from": 300, "until": 380, "text": "AN ISLAND IN THE EAST", "y": 980, "size": 47}
]
}Rules applied:
- one band at a time among
counter,year,ribbon,hud(defaulttoplist) — anything overlapping by more than the 8-frame dissolve is an error; lower-zone stacking (a stamp under a pill) is a warning for the full-size look; - text fits the safe width (
width - 2 * margin) with the maximum size or character count printed; - text stays in the safe vertical zone;
- no text twice at once;
labelAtlies inside its counter.
Wire it into the render command
A gate nobody runs is a comment. Make the render script refuse:
python3 -I scripts/check_overlays.py public/<id>/timeline.json || {
echo "pre-render gate FAILED — nothing rendered."
echo "Fix the ERROR lines in your plan, rebuild the timeline, run the gate again."
exit 1
}
node render.mjs <id>The rebuild must come before the gate (timings change), and the gate before the encoder.
Review rules that go with it
- A contact sheet is for motion: is something changing every second, are there blank or black frames, do transitions jump? It is the wrong tool for text — a 540×960 thumbnail cannot show whether a stamp is clipped.
- Text and edges are checked at full size: render the specific frames at 1× and look at crops, or ask a separate image checker with the context ("is this stamp fully inside the frame at this word?").
- At most one re-render. After the second render, ship unless a fact is wrong or text is unreadable.
- Never stop a running render for a cosmetic fix. Let it finish, review it, fold every fix into the one allowed re-render.
- If the same defect appears in two videos, fix the plan template or the renderer — not the video.
Make the geometry yours
scripts/check_overlays.py --config takes a JSON file that overrides, per overlay type:
{
"zones": {"counter": {"y": 250, "h": 240}, "stamp": {"y": 760, "h": null}},
"widths": {"stamp": {"per": 0.68, "pad": 94}, "pill": {"per": 0.62, "pad": "=size"}},
"top": ["counter", "year", "ribbon", "hud"]
}zones.<type>.yis the layout default;his the height below it (null=size + 48).widths.<type>modelswidth = chars * per * size + pad;padmay be"=size"or"=0.1size". Measure one render of the type and fitper— it is the only number worth tuning.- Types not listed there are not width-checked (their
zonesentry still participates in band collisions).
Read the constants from the renderer's own components once, and update them in the same change when the layout moves. Keep the gate silent on videos that already shipped well; a gate that cries wolf gets skipped.
Not this skill
- Judging whether the animation is good, or measuring a rendered video: a frame-by-frame video analysis skill.
- Writing the script or the shot list: the project's own content skill.
- Rendering: the gate says "go", it does not encode.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

