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/serve.mjs

View on GitHub
#!/usr/bin/env node
import { createReadStream } from 'node:fs';
import { stat } from 'node:fs/promises';
import { createServer } from 'node:http';
import { extname, join, normalize, resolve } from 'node:path';

/**
 * Serves the pinned build, because a demo must not be filmed against a dev
 * server, nor against a directory the rest of the repo rebuilds.
 *
 * This replaced the app's own dev server for one reason, learned twice in one
 * afternoon: a dev server's module graph belongs to whoever is editing the
 * source. Two full corpus runs died mid-flight because another session touched
 * the app's source and an install rewrote `node_modules` underneath the
 * bundler, and both times the symptom was scenes failing on a page that never
 * rendered, which looks exactly like a broken scene. A build cannot be
 * invalidated by a keystroke. It is also what anybody actually ships, so the
 * corpus is now of the production bundle rather than of a development one.
 *
 * Route resolution follows `nginx.conf` deliberately, so what is filmed
 * matches what is deployed: a real file wins, then a directory's own
 * `index.html` (which is what a prerendered page is), and only then the SPA
 * shell. Getting that order wrong would serve the shell over a prerendered
 * page and film a client-side render of something the deployment serves as
 * static HTML.
 */

const ROOT = resolve(process.argv[2] ?? 'demo/.build');
const PORT = Number(process.env.DEMO_PORT ?? process.argv[3] ?? 5499);

const TYPES = {
  '.html': 'text/html; charset=utf-8',
  '.js': 'text/javascript; charset=utf-8',
  '.mjs': 'text/javascript; charset=utf-8',
  '.css': 'text/css; charset=utf-8',
  '.json': 'application/json; charset=utf-8',
  '.svg': 'image/svg+xml',
  '.png': 'image/png',
  '.jpg': 'image/jpeg',
  '.jpeg': 'image/jpeg',
  '.webp': 'image/webp',
  '.ico': 'image/x-icon',
  '.woff': 'font/woff',
  '.woff2': 'font/woff2',
  '.ttf': 'font/ttf',
  '.map': 'application/json; charset=utf-8',
  '.txt': 'text/plain; charset=utf-8',
  '.webmanifest': 'application/manifest+json',
};

async function fileAt(path) {
  const found = await stat(path).catch(() => null);
  return found?.isFile() ? path : null;
}

/**
 * `..` is stripped before the path is joined, not after. A studio server is
 * only ever reachable from localhost, but a path traversal that reads outside
 * the build directory is not a thing to leave lying around because of who
 * happens to be calling today.
 */
function inside(pathname) {
  const clean = normalize(decodeURIComponent(pathname)).replace(
    /^(\.\.[/\\])+/,
    ''
  );
  const full = join(ROOT, clean);
  return full.startsWith(ROOT) ? full : ROOT;
}

async function resolveFile(pathname) {
  const full = inside(pathname);

  return (
    (await fileAt(full)) ??
    (await fileAt(join(full, 'index.html'))) ??
    (await fileAt(join(ROOT, 'index.html')))
  );
}

const server = createServer((request, response) => {
  const pathname = new URL(request.url ?? '/', 'http://localhost').pathname;

  void resolveFile(pathname).then((file) => {
    if (!file) {
      response.writeHead(404, { 'content-type': 'text/plain' });
      response.end('not found');
      return;
    }

    response.writeHead(200, {
      'content-type': TYPES[extname(file)] ?? 'application/octet-stream',
      // Hashed assets are immutable; the shell must never be, or a rebuilt
      // corpus films the previous build out of the browser's own cache.
      'cache-control': file.endsWith('index.html')
        ? 'no-store'
        : 'public, max-age=31536000, immutable',
    });

    createReadStream(file).pipe(response);
  });
});

server.listen(PORT, '127.0.0.1', () => {
  process.stdout.write(`demo studio serving ${ROOT} on ${PORT}\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