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

template/demo/mock.ts

View on GitHub
import type { Page, Route } from '@playwright/test';

import type { MockContext } from 'video-demo/define';

/**
 * Every request the app makes during a film, answered in this process.
 *
 * There is no API, no database and no third party behind a demo run — only
 * `page.route` handlers and whatever this file keeps in memory for the
 * length of a scene. See references/mocking.md for the two reasons this
 * matters (a corpus gets published; a demo has to be reproducible) and for
 * the route-ordering trap the comment below exists to prevent.
 *
 * Unlike `demo.config.ts`, this file is only ever evaluated by the test
 * runner, which is the whole reason the config reaches it through a dynamic
 * `import('./mock.ts')`. So it may import anything Playwright can load —
 * your app's packages, an e2e fixture, a workspace module with extensionless
 * specifiers — none of which plain Node's resolver would follow.
 */

type Row = { id: string };

/**
 * An in-memory table with the four operations a mocked write route needs.
 *
 * A stub that answers every write with `{}` and status 200 looks like it
 * mocks a write; it doesn't. The panel that just sent the request reads its
 * own state back a moment later, and if the write went nowhere, that read
 * hands back the old value — the viewer's own change appears to undo itself
 * on film. `createStore` exists so a route handler can actually mutate
 * something and have every later read agree with it.
 */
export function createStore<T extends Row>(seed: T[]) {
  const rows = new Map(seed.map((row) => [row.id, row]));
  let minted = rows.size;

  return {
    list(): T[] {
      return [...rows.values()];
    },
    one(id: string): T | undefined {
      return rows.get(id);
    },
    create(value: Omit<T, 'id'> & { id?: string }): T {
      const id = value.id ?? `row_${++minted}`;
      const row = { ...value, id } as T;
      rows.set(id, row);
      return row;
    },
    patch(id: string, changes: Partial<T>): T | undefined {
      const row = rows.get(id);
      if (!row) {
        return undefined;
      }
      const updated = { ...row, ...changes };
      rows.set(id, updated);
      return updated;
    },
    remove(id: string): boolean {
      return rows.delete(id);
    },
  };
}

export function json(route: Route, body: unknown, status = 200): Promise<void> {
  return route.fulfill({
    status,
    contentType: 'application/json',
    body: JSON.stringify(body),
  });
}

export async function mock(page: Page, ctx: MockContext): Promise<unknown> {
  // TODO: model each entity the app fetches with its own createStore, seeded
  // around ctx.reference (never `new Date()`) so there's history behind the
  // anchor and days still ahead of it:
  //
  // const things = createStore(createSeedThings(ctx.reference));

  /**
   * Registration order matters, and it is backwards from how you'd guess.
   * Playwright asks the *last-registered* handler first, so a broad pattern
   * has to go on before a narrow one, or the narrow one never gets a turn —
   * '**\/api/**' before '**\/api/v1/things**' before '**\/api/v1/things/**'.
   * Get it backwards and a later, broader registration silently shadows an
   * earlier, narrower one: a write answers with the old, unmutated state,
   * and the change the panel just showed optimistically reverts on film a
   * beat later, which reads exactly like a bug in the app.
   */
  await page.route('**/api/**', (route) => json(route, {}));

  await page.route('**/api/v1/auth/me**', (route) => {
    if (!ctx.signedIn) {
      return json(route, { message: 'No session' }, 401);
    }
    // TODO: return your own viewer shape.
    return json(route, { id: 'usr_demo' });
  });

  // TODO: one page.route per surface this app reads or writes, broadest
  // first, narrowest last:
  //
  // await page.route('**/api/v1/things**', (route) => {
  //   const request = route.request();
  //   if (request.method() === 'POST') {
  //     const made = things.create(request.postDataJSON());
  //     return json(route, { thing: made }, 201);
  //   }
  //   return json(route, { things: things.list() });
  // });

  return {};
}
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