Skip to content

datit309/supergraph / plugins/supergraph/skills/video-demo

video-demo

Flagged

Films a web app as narrated, zooming, cursor-driven demo videos with retina screenshots, either from a repo it builds and mocks or from a live URL as it is served. Use when the user asks for a demo video, product video, walkthrough, screencast, screen recording of an app or of a URL, hero or landing-page footage, app screenshots for a website, "show off this feature", "record a demo of <url>", or wants to add, re-film, re-narrate or fix a demo scene.

FileKindSize
LICENSEother1.0 KB
README.mdmarkdown1.6 KB
SKILL.mdskill md8.9 KB
engine/pin-build.mjsexecutablescript4.0 KB
engine/playwright.demo.tsscript4.8 KB
engine/run.mjsexecutablescript5.1 KB
engine/serve.mjsexecutablescript3.7 KB
engine/studio/actor.tsscript23.5 KB
engine/studio/config.tsscript13.4 KB
engine/studio/define.tsscript5.9 KB
engine/studio/overlay.tsscript12.0 KB
engine/studio/preview.tsscript7.0 KB
engine/studio/ready.tsscript3.6 KB
engine/studio/recorder.tsscript23.1 KB
engine/studio/run-id.tsscript1.8 KB
engine/studio/scene.tsscript6.0 KB
engine/studio/stage.tsscript5.4 KB
engine/studio/stitch.tsscript11.0 KB
engine/studio/voice.tsscript17.3 KB
examples/roadmap-search-poster.pngbinary187.3 KB
package-lock.jsonmanifest2.2 KB
package.jsonmanifest407 B
references/capture.mdmarkdown10.7 KB
references/config.mdmarkdown14.3 KB
references/mocking.mdmarkdown8.8 KB
references/narration.mdmarkdown8.1 KB
references/runs.mdmarkdown14.7 KB
references/scenes.mdmarkdown10.4 KB
references/troubleshooting.mdmarkdown20.3 KB
scripts/demoexecutablescript303 B
scripts/doctor.shexecutablescript4.6 KB
scripts/gaps.mjsexecutablescript5.7 KB
scripts/install-voice.shexecutablescript2.1 KB
scripts/install.shexecutablescript3.9 KB
scripts/probe-fps.mjsexecutablescript8.7 KB
scripts/say.shexecutablescript4.1 KB
scripts/scaffold.mjsexecutablescript11.4 KB
template/demo/demo.config.tsscript6.0 KB
template/demo/mock.tsscript4.1 KB
template/demo/scenes/smoke.scene.tsscript1.9 KB
template/demo/ui.tsscript1.1 KB

engine/pin-build.mjs

View on GitHub
#!/usr/bin/env node
import { spawn } from 'node:child_process';
import { cp, readFile, readdir, rm, stat } from 'node:fs/promises';
import { join, relative } from 'node:path';

import { APP_ROOT, PROJECT, SITE, demo } from './studio/config.ts';

/**
 * Builds the app fresh, then puts the result somewhere private.
 *
 * A build directory is one anybody in the repo may rebuild at any moment,
 * mid-run, with a different environment. That is exactly what happened once:
 * another session's build had no same-origin API base, so it baked the real
 * one in instead. Every request then went cross-origin, missed the studio's
 * stubs entirely, and the app did the correct thing with no session, which is
 * to show its own home page. Fifty-four scenes then failed looking for an app
 * that was sitting on its login screen, and nothing in that failure pointed
 * at a build.
 *
 * So the corpus is filmed from a copy nobody else writes to, and the check
 * afterwards is the other half: a build with the wrong API base looks perfect
 * until it runs, so `demo.build.forbid` is verified here, where the message
 * can say what is wrong, rather than later as a wall of missing locators.
 */

if (SITE) {
  process.stdout.write(`demo: filming ${SITE}, nothing to build\n`);
  process.exit(0);
}

/**
   * The pinned copy lives in the workspace, not beside the engine: the engine
   * is one shared clone and two projects filming at once would otherwise
   * overwrite each other's bundle.
   */
const PINNED = join(PROJECT, '.build');
const OUTPUT = join(APP_ROOT, demo.build.output);

function runBuild(command) {
  return new Promise((resolve, reject) => {
    const child = spawn(command, {
      shell: true,
      cwd: APP_ROOT,
      stdio: 'inherit',
    });
    child.on('error', reject);
    child.on('close', (code) =>
      code === 0 ? resolve() : reject(new Error(`build exited ${code}`))
    );
  });
}

async function jsFiles(dir) {
  const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
  const found = await Promise.all(
    entries.map((entry) => {
      const full = join(dir, entry.name);
      if (entry.isDirectory()) {
        return jsFiles(full);
      }
      return entry.name.endsWith('.js') ? [full] : [];
    })
  );
  return found.flat();
}

/** Kept per file, not joined into one blob, so a hit can name where it landed. */
async function readAssets() {
  const files = await jsFiles(PINNED);
  return Promise.all(
    files.map(async (file) => ({
      file,
      text: await readFile(file, 'utf8').catch(() => ''),
    }))
  );
}

process.stdout.write(`demo: building (${demo.build.command})\n`);
await runBuild(demo.build.command);

const built = await stat(join(OUTPUT, 'index.html')).catch(() => null);
if (!built) {
  process.stderr.write(
    `demo: build finished but ${OUTPUT} has no index.html.\n` +
      '      check build.output in demo/demo.config.ts.\n'
  );
  process.exit(1);
}

await rm(PINNED, { recursive: true, force: true });
await cp(OUTPUT, PINNED, { recursive: true });

const assets = await readAssets();

/**
 * A string or a pattern, because both are reasonable things to reach for and
 * the failure mode of guessing wrong is a throw inside the one script whose
 * whole job is a clear message about a misconfigured build.
 */
const hit = (rule, text) =>
  typeof rule === 'string' ? text.includes(rule) : rule.test(text);

for (const rule of demo.build.forbid ?? []) {
  const found = assets.find((asset) => hit(rule, asset.text));
  if (!found) {
    continue;
  }

  process.stderr.write(
    `demo: the pinned build matches a forbidden rule: ${String(rule)}\n` +
      `      found in: ${relative(PINNED, found.file)}\n` +
      '      This usually means the build ran without the same-origin API\n' +
      '      base, so every request would go cross-origin, miss the mocks,\n' +
      '      and leave the app on its login screen while scene after scene\n' +
      '      fails looking for content. Check build.command in\n' +
      '      demo/demo.config.ts.\n'
  );
  process.exit(1);
}

process.stdout.write(`demo: pinned ${OUTPUT} to ${PINNED}\n`);
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall