Skip to content

AlexAnsart/demo-studio / skills/demo-setup

demo-setup

Verified

One-time setup that analyzes the current project and configures it to use the film-demo / narrate / sync-narration / produce-video skills — detects the dev server and framework, asks only when necessary, generates demo.config.json and .env entries, vendors the recording engine and project helpers, and scaffolds a first demo from reference patterns. Use when the user asks to set up, configure, or install demo-studio / video-recording skills for this project, or before running produce-video for the first time in a new codebase.

templates/auth.mjs

View on GitHub
/**
 * Generic login helpers — reads selectors from demo.config.json and credentials
 * from env vars named in auth.credentialsEnv. Copy to demos/_lib/ during setup.
 */
import { readFileSync, existsSync } from 'fs'
import { join } from 'path'
import { pause } from '../_engine/motion.mjs'

function loadAuthConfig() {
  const path = join(process.cwd(), 'demo.config.json')
  if (!existsSync(path)) return { loginRequired: false }
  const cfg = JSON.parse(readFileSync(path, 'utf8'))
  return cfg.auth ?? { loginRequired: false }
}

export async function waitForAppReady(page, { timeout = 30000 } = {}) {
  await page.waitForLoadState('domcontentloaded', { timeout }).catch(() => {})
  await page.getByText(/loading|authenticating/i).first().waitFor({ state: 'hidden', timeout: 15000 }).catch(() => {})
  await pause(400)
}

export async function login(page, { baseUrl, email, password } = {}) {
  const auth = loadAuthConfig()
  if (!auth.loginRequired) return

  const credEnv = auth.credentialsEnv ?? {}
  const user = email ?? process.env[credEnv.email ?? 'DEMO_USER_EMAIL']
  const pass = password ?? process.env[credEnv.password ?? 'DEMO_USER_PASSWORD']
  if (!user || !pass) throw new Error('Demo login credentials missing — set env vars from demo.config.json auth.credentialsEnv')

  const loginUrl = `${baseUrl}${auth.loginPath ?? '/login'}`
  await page.goto(loginUrl, { waitUntil: 'commit' })
  await page.locator(auth.emailSelector ?? '#email').fill(user)
  await page.locator(auth.passwordSelector ?? '#password').fill(pass)
  await page.locator(auth.submitSelector ?? 'button[type=submit]').click()
  await waitForAppReady(page)
}

/** Off-camera session for authenticated recordings (storageState). */
export async function buildDemoSession(browser, { baseUrl, email, password } = {}) {
  const context = await browser.newContext()
  const page = await context.newPage()
  await login(page, { baseUrl, email, password })
  const state = await context.storageState()
  await context.close()
  return state
}
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: 472kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall