Docs/Skills and code/skill video-visual-production
.claude/skills/video-visual-production/scripts/build-many.js
What the file says about itself
Build several beats one after another (no agents) and print one verdict line per beat. Unchanged scenes come from the cache.
#!/usr/bin/env node
// Build several beats one after another (no agents) and print one verdict line per beat. Unchanged scenes come from the cache.
// node build-many.js --beats B2,B3,B4 [--topic the-fall-of-moser-baer]
// Run two copies with different beat lists to use both build slots. Each beat still queues for a slot inside build-beat.js.
const fs = require('fs');
const path = require('path');
const U = require('./lib/util');
const beats = U.arg('beats', '').split(',').filter(Boolean);
if (!beats.length) U.die('usage: build-many.js --beats B2,B3');
const topic = U.arg('topic', 'the-fall-of-moser-baer');
const vdir = path.join(U.ROOT, 'research', topic, 'video');
const rows = [];
for (const b of beats) {
const sheet = path.join(vdir, `beat-sheet-${b}.json`);
const t0 = Date.now();
const r = U.run(process.execPath, [path.join(__dirname, 'build-beat.js'), '--sheet', sheet], { stdio: ['ignore', 'pipe', 'pipe'] });
const secs = ((Date.now() - t0) / 1000).toFixed(0);
const statusFile = path.join(vdir, `STATUS-video-${b}.md`);
const st = fs.existsSync(statusFile) ? fs.readFileSync(statusFile, 'utf8') : '';
const verdict = (st.match(/\*\*Verdict: ([^*]+)\*\*/) || [])[1] || (r.status === 0 ? 'built' : 'BUILD FAILED before the check');
const fails = st.split('\n').filter((l) => l.includes('**FAIL**')).map((l) => l.split('|').slice(1, 3).map((x) => x.trim()).join(' ') + ': ' + (l.split('|')[4] || '').trim().slice(0, 140));
const line = `${b} ${verdict.startsWith('HARD GATES PASS') ? 'PASS' : 'FAIL'} ${secs}s ${fails.join(' || ')}`;
rows.push(line);
U.say(line);
}
U.say('\n' + rows.join('\n'));
Shown as it is in the repository at build time (2026-11-03); the home directory appears as <home>. If this page and the file differ, the file is right. Back to the catalogue.