konradre/video-production-skills / skills/video-refs-continuity
video-refs-continuity
VerifiedContinuity through consistency for generated video: builds the DERIVED reference set and start image every shot needs, keeps the continuity ledger between shots, and runs the refs gate in code before any generation call. Use when a shot must match the shot before it (room, cast, seats, wardrobe, held props, door swing, a named state), when a character, product or room reference is built or cut from a keeper, when a plate or start image is generated, or when seeds keep drifting between shots. Triggers — "continuity", "refs gate", "reference set", "start image", "continuity ledger", "backfill from accepted", "the door is on the wrong wall", "not the same guy", "the same shape in all videos". Not for the cost line, the GO and the submit itself — use video-gen-cost-gate. Not for the prompt's wording — use video-prompt-dialects. Not for upscale, film look, grain or the delivery encode — use video-finish.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 31.6 KB |
| references/ASSET-HYGIENE.md | markdown | 6.1 KB |
| references/CONTINUITY-AXES.md | markdown | 6.3 KB |
| references/REFERENCE-CONTRACT.md | markdown | 19.0 KB |
| references/REPAIR-LADDER.md | markdown | 6.0 KB |
| references/SCENE-PROXY.md | markdown | 24.5 KB |
| references/ZOOM-OUT-CHAIN.md | markdown | 4.1 KB |
| references/refs-required.example.json | config | 3.1 KB |
| scripts/air_pieces.pyexecutable | script | 3.9 KB |
| scripts/cast_stress.pyexecutable | script | 17.8 KB |
| scripts/comfy_preflight.py | script | 22.3 KB |
| scripts/comfy_ready.pyexecutable | script | 2.7 KB |
| scripts/comfy_up.shexecutable | script | 2.6 KB |
| scripts/knit_letters.pyexecutable | script | 7.3 KB |
| scripts/plate_pieces.pyexecutable | script | 4.9 KB |
| scripts/ref_dag.pyexecutable | script | 5.2 KB |
| scripts/refs_gate.pyexecutable | script | 41.1 KB |
| scripts/scene_blockout.py | script | 6.4 KB |
| scripts/scene_proxy.py | script | 16.6 KB |
| scripts/split_sheet.pyexecutable | script | 1.4 KB |
| scripts/sprinkle_pieces.pyexecutable | script | 2.8 KB |
scripts/ref_dag.py
View on GitHub#!/usr/bin/env python3
"""ref_dag.py — the ORDER a reference set is built in: a still is generated only after every still it is built FROM.
Portraits and locations have nothing upstream; a prop is built with its owner in the frame (a hand, a wrist, a pocket) so
it comes after the owner's portrait; an anchor frame composes accepted references, so it comes after all of them. Build
out of order and the prop is generated against a face nobody has accepted yet, then re-rolled when the face changes.
Pattern: ReCA (`videorlm/framework/pipeline.py`: one image DAG for portrait / location / prop / anchor, then validate →
repair → re-validate — video-refs-continuity SKILL.md § 3 carries the repair by reason).
refs.json: [{"name": "MOM", "kind": "portrait"}, {"name": "KITCHEN", "kind": "location"},
{"name": "APRON", "kind": "prop", "owner": "MOM"},
{"name": "S01-START", "kind": "anchor", "refs": ["MOM", "KITCHEN", "APRON"]}, …] (+ optional "depends_on": [...])
kinds: portrait · location · look · prop · anchor.
ref_dag.py --refs <refs.json> [--accepted A,B,…] # the waves; with --accepted, what may be built NEXT
ref_dag.py --selftest
Exit 1 on an unknown name, a cycle, a prop with no owner or an anchor with no refs; 0 otherwise.
"""
import argparse, json, sys, tempfile, os
ROOTS = {'portrait', 'location', 'look'}
def deps_of(r):
return list(dict.fromkeys(([r['owner']] if r.get('owner') else []) + list(r.get('refs', [])) + list(r.get('depends_on', []))))
def plan(refs):
names = {r['name']: r for r in refs}; errs, warns = [], []
for r in refs:
k = r.get('kind')
if k == 'prop' and not r.get('owner'): errs.append(f"{r['name']}: a prop with no owner — name whose hand, pocket or table it is built with")
if k == 'anchor' and not r.get('refs'): errs.append(f"{r['name']}: an anchor with no refs — an anchor composes accepted references")
if k in ROOTS and deps_of(r): warns.append(f"{r['name']}: a {k} built from {deps_of(r)} — a {k} is normally a root")
for d in deps_of(r):
if d not in names: errs.append(f"{r['name']}: depends on {d}, which is not in the set")
if errs: return None, errs, warns
left, done, waves = dict(names), set(), []
while left:
wave = sorted(n for n, r in left.items() if all(d in done for d in deps_of(r)))
if not wave: return None, [f"a cycle among {sorted(left)}"], warns
waves.append(wave); done |= set(wave); [left.pop(n) for n in wave]
return waves, [], warns
def main(argv=None):
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument('--refs'); ap.add_argument('--accepted', default=''); ap.add_argument('--selftest', action='store_true')
a = ap.parse_args(argv)
if a.selftest: return selftest()
if not a.refs: ap.error('--refs, or --selftest')
refs = json.load(open(a.refs)); waves, errs, warns = plan(refs)
for w in warns: print('WARN', w)
if errs:
for e in errs: print('FAIL', e)
return 1
kind = {r['name']: r.get('kind') for r in refs}
for i, w in enumerate(waves, 1): print(f"wave {i}: " + ', '.join(f'{n} ({kind[n]})' for n in w))
acc = {x for x in a.accepted.split(',') if x}
if acc:
by = {r['name']: r for r in refs}
nxt = [n for w in waves for n in w if n not in acc and all(d in acc for d in deps_of(by[n]))]
wait = [n for w in waves for n in w if n not in acc and n not in nxt]
print(f"NEXT (every upstream accepted): {', '.join(nxt) or 'nothing — the set is complete'}"
+ (f" · waiting: {', '.join(f'{n} on ' + ','.join(d for d in deps_of(by[n]) if d not in acc) for n in wait)}" if wait else ''))
return 0
def selftest():
good = [{'name': 'MOM', 'kind': 'portrait'}, {'name': 'KITCHEN', 'kind': 'location'}, {'name': 'APRON', 'kind': 'prop', 'owner': 'MOM'},
{'name': 'S01', 'kind': 'anchor', 'refs': ['MOM', 'KITCHEN', 'APRON']}]
w, e, _ = plan(good)
chk = [('portraits and locations first, the prop after its owner, the anchor last', w == [['KITCHEN', 'MOM'], ['APRON'], ['S01']] and not e),
('a prop with no owner fails', bool(plan([{'name': 'CUP', 'kind': 'prop'}])[1])),
('an anchor with no refs fails', bool(plan([{'name': 'A', 'kind': 'anchor'}])[1])),
('an unknown dependency fails', bool(plan([{'name': 'CUP', 'kind': 'prop', 'owner': 'DAD'}])[1])),
('a cycle fails', bool(plan([{'name': 'X', 'kind': 'prop', 'owner': 'Y'}, {'name': 'Y', 'kind': 'prop', 'owner': 'X'}])[1]))]
with tempfile.TemporaryDirectory() as r:
p = os.path.join(r, 'refs.json'); json.dump(good, open(p, 'w'))
import io, contextlib
buf = io.StringIO()
with contextlib.redirect_stdout(buf): main(['--refs', p, '--accepted', 'MOM,KITCHEN'])
chk.append(('with MOM and KITCHEN accepted, the next buildable is APRON alone', 'NEXT (every upstream accepted): APRON ·' in buf.getvalue()))
for name, ok in chk: print(f"{'ok ' if ok else 'FAIL'} {name}")
ok = all(v for _, v in chk); print(f"SELFTEST {'PASS' if ok else 'FAIL'} ({sum(v for _, v in chk)}/{len(chk)})"); return 0 if ok else 1
if __name__ == '__main__':
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |