Communitygithub.com

josueh04/product-video-skills

Regras de animação que impedem quedas, piscadas ou tremulações nos workers de renderização paralela do HyperFrames, além de um linter estático (lint_motion.py) que encontra violações no template de um vídeo antes de custar uma renderização.

O que é product-video-skills?

Esta skill fornece regras de animação e um linter estático para garantir que as animações GSAP em composições HyperFrames sejam seguras para renderização paralela. O HyperFrames renderiza vídeos buscando frames em três workers simultâneos, e cada frame precisa ser uma função pura do tempo — sem dependências de estado anterior, relógio ou aleatoriedade, caso contrário elementos podem desaparecer, piscar ou tremer. O linter (lint_motion.py) verifica violações como chaves ausentes em fromTo, uso de immediateRender, animações em display/visibility, repetições infinitas, e uso de clock ou timers, imprimindo relatórios detalhados com sugestões de correção. Suporta ambientes HyperFrames (versão 0.8.x ou superior) e pode ser executado manualmente ou integrado ao qa.py para falhar relatórios de renderização. O fluxo de trabalho recomendado é executar o linter após cada edição na linha do tempo e antes de cada renderização, complementando com snapshots para depuração visual de bugs suspeitos.

Funciona com✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/josueh04/product-video-skills/tree/HEAD/skills/seek-safe-motion

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Movimento seguro para seek

O HyperFrames não reproduz a linha do tempo. Ele a busca: para cada frame, o renderizador define a linha do tempo para o tempo daquele frame e captura a página. Com HyperFrames 0.8.x, isso é feito com três workers em paralelo, cada um pegando cada terceiro frame, e cada passo de seek recua 1 ms e depois avança para estabilizar. Então, cada frame deve ser uma função pura do seu tempo. Qualquer coisa que dependa do que foi renderizado antes, do relógio ou do acaso renderiza de forma diferente em cada worker, e o resultado é um elemento que falta em cada terceiro frame.

Esse bug é invisível na prévia do Studio (que reproduz em ordem) e em snapshots individuais. Na produção de onde essas skills vêm, foi o único defeito que chegou ao revisor: o título de abertura "tremendo e piscando" durante os primeiros sete segundos.

Lint primeiro

PVS_HOME="$(cd "$(cd "${CLAUDE_SKILL_DIR}" && pwd -P)/../.." && pwd)"
"$PVS_HOME/bin/pvs-py" "$PVS_HOME/skills/seek-safe-motion/scripts/lint_motion.py" <video_dir>/video

Ele lê index.html, src/*.tpl e os *.js ao lado deles (apenas scripts inline), imprime file:line: severity RULE: why mais a correção, e sai com código 1 em qualquer erro (--strict faz avisos falharem também, --json para ferramentas). Execute-o após cada edição na linha do tempo e antes de cada renderização. Ele é estático: não consegue ver variáveis computadas em tempo de execução (conta-as como "não verificáveis") ou duas tweens sobrepostas no tempo. Essas ficam com você, com a reprodução abaixo. qa.py (render-qa) também o executa e falha o relatório em um erro.

As regras e por que cada uma existe

  1. Cada chave em um fromVars de um fromTo também aparece em seus toVars (SS001, erro). Quando o frame de um worker cai exatamente no início de uma tween, o passo de 1 ms para trás reverte a tween para antes de começar, e uma chave que só existe em fromVars nunca é escrita novamente. A tween do título era fromTo(sel, {yPercent: 110, opacity: 1}, {yPercent: 0}): opacity: 1 vivia apenas em fromVars, então um worker manteve o título com opacidade 0 pelo resto da tween. Escreva {yPercent: 110, opacity: 1} para {yPercent: 0, opacity: 1}, ou um tl.set() seguido por um tl.to(). O mesmo vale para startAt dentro de um to() (SS002).
  2. immediateRender: false em cada fromTo após o tempo 0 (SS003, aviso). Caso contrário, a tween escreve seus valores iniciais quando a linha do tempo é construída, sobrescrevendo o que tweens anteriores definiram, e um seek para o meio da linha do tempo começa do estado errado.
  3. Prefira fromTo a from (SS004, aviso). Um from() termina no que quer que o elemento estivesse no momento da construção; assim que tweens anteriores tocam no elemento, os workers discordam sobre isso.
  4. Nunca anime display ou visibility (SS005, erro). Eles não podem ser interpolados; eles mudam abruptamente em um ponto arbitrário da tween. Altere-os com um tl.set() de duração zero em um tempo explícito, e desvaneça com opacity ou autoAlpha.
  5. Sem relógio, sem acaso, sem timers (SS006, erro): sem Date, performance.now(), Math.random(), setTimeout, setInterval ou requestAnimationFrame para nada visível. Uma variação de digitação ou uma forma de onda usa um gerador com semente; um timer de chamada exibido na tela é calculado a partir de tl.time() dentro do onUpdate da linha do tempo.
  6. Uma linha do tempo pausada, registrada, nunca reproduzida (SS007, SS011, SS012). Crie-a com gsap.timeline({ paused: true }), construa-a completamente (dentro de document.fonts.ready quando posições dependerem de métricas de texto), e só então atribua window.__timelines["<id da composição>"] = tl. Registrar uma linha do tempo vazia antes da construção terminar renderiza um vídeo em branco; tl.play() luta contra os seeks do renderizador.
  7. Rolagens são fromTo com início e fim explícitos para que cada worker calcule o mesmo deslocamento, limitado ao conteúdo real para que nenhum corte de linha ou ícone pare em uma borda.
  8. Nunca duas tweens na mesma propriedade do mesmo elemento ao mesmo tempo. Uma reinicialização de cursor que caiu dentro do próximo movimento deixou o ponteiro no lugar errado após um seek. Não verificado pelo lint: verifique a tabela de temporização da construção.
  9. Anime transformações, não layout (SS009, aviso): x, y, scale, clip-path em vez de left, top, width, margin. Tweens de layout recalculam fluxo a cada frame e hyperframes check as sinaliza como gsap_non_transform_motion. Uma pequena mudança de largura em um controle de produto real (uma barra lateral expandindo) pode ser aceita quando reproduz o produto.
  10. Nunca tween um elemento .clip (SS010, erro). O HyperFrames gerencia a visibilidade de um clip através de data-start e data-duration; anime um wrapper dentro dele.
  11. Repetições finitas (SS008, aviso). repeat: -1 só é permitido sob uma raiz data-duration finita; calcule uma contagem com Math.max(0, Math.floor(span / period) - 1).
  12. Defina todo estado inicial explicitamente no tempo 0. Um helper que faz gsap.set(sel, vars) também deve fazer tl.set(sel, vars, 0), para que buscar de volta para 0 restaure o primeiro frame em vez de manter o último estado que um worker renderizou.

Reproduza um bug suspeito antes de renderizar

O lint encontra padrões; um snapshot prova pixels. Para uma tween suspeita começando em t0:

npx --yes hyperframes@<pinned> snapshot . --at <t0 + 0.3> --no-end --describe false -o a
npx --yes hyperframes@<pinned> snapshot . --at <t0>,<t0 + 0.3> --no-end --describe false -o b

O frame em t0 + 0.3 deve ser idêntico em a e b. Se diferir, buscar através do início da tween mudou o estado. Para reproduzir exatamente um worker, tire snapshots dos frames 0, 3, 6, ... nessa ordem até logo após a tween. Faça bisseção dividindo o intervalo de tempo pela metade até que reste uma tween. Após renderizar, scan_render.py (render-qa) reporta o mesmo bug como uma execução WORKER PATTERN: frames discrepantes que compartilham um índice de frame mod 3.

Referências

  • references/patterns.md: código antes e depois para cada regra, os helpers que mantêm um template seguro (lineIn, init, digitação, rolagens, cliques de cursor) e o que o lint pode e não pode ver. Leia ao escrever um novo helper ou corrigir um achado do lint.

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

josueh04/product-video-skills

Extract, once per product, everything every video of it reuses and write it to kit/ and product.yaml (design tokens, font subsets as woff2, icon subsets as SVG from the product's own icon packages, logos in light, dark and app-tile variants from the repo, a fictional cast proposed once for veto and then frozen, the canonical-names map, pronunciations, banned terms and the read-only tool list). Use it when a product is set up or its kit is missing or incomplete, when a video needs an icon, font or logo that is not in kit/ yet, when someone asks for demo names, fake customers, phone numbers or emails, when a brand word is mispronounced or an old product name shows up, and when checking that demo data is fictional.

josueh04/product-video-skills

Interview the user about a product, then create products/<slug>/ with its own git history, a filled product.yaml and linked skills, fetch its sources and build its kit. Run only when the user types /product-new.

josueh04/product-video-skills

Back every sentence of a video's narration (audio/lines.tsv) and every screen it shows with a citation into the pinned source code (role/path:line@sha) or a docs URL, mark what is visible in the UI versus backend-only, flag restricted or unreleased features, and cut or rewrite anything unbacked; writes the video's TRUTH.md and checks it with truth_check.py. Use it whenever a script or narration is drafted or edited, before voice is generated, before a build, when someone asks "can we say this?", "is this true?", "does the product really do X?", when a reviewer asks for a feature or a claim the product may not support, and when a source document (pitch deck, PRD, marketing page) makes claims the video wants to repeat.

josueh04/product-video-skills

Check a rendered product video before anyone else sees it: worker-pattern flicker, black frames, loudness and true peak, clipping, clicks at clip edges, overlapping narration, speech to text against the script, banned terms and legacy names, camera zoom, contact sheets, frame strips at transitions and parity against the approved version; then write qa/REPORT.json, the only thing deliver.py accepts. Use it after every HyperFrames render, whenever someone asks "is the render clean", "QA this", "check the video", "check the audio", "why does it flicker", "there is a click", "compare v3 with v2", "did the approved part change", or before showing, sending, uploading or delivering any MP4, even when the request does not say QA. Also use it to triage a defect a reviewer reported in a render.

josueh04/product-video-skills

Write a product video's narration and turn it into voice clips with word timings, pronunciation fixes, sound effects and even loudness. The script becomes a table of moments and then audio/lines.tsv (one clip per sentence, with role and speed columns); tts.py voices it with ElevenLabs or the free macOS say voice, maps brand respellings back to the on-screen spelling, normalizes every clip and writes audio/timings.json for the composer; make_sfx.py builds typing tracks from real keystrokes and places recorded click and pop sounds. Use it whenever a video needs a script, narration, voice-over, lines.tsv, timings.json, TTS, a new take, a voice or casting choice, a pronunciation fix ("it says the name wrong"), a changed sentence, a tone note ("too hype", "sounds cut off"), audio levels, a click at the end of a clip, typing or click sounds, or when the build stage asks for the voice. Also use it for silent loops, which still need a moment table and SFX.

josueh04/product-video-skills

Pin a product's source code (read-only exports in sources/ plus sources.lock), confirm that the pinned commit is what runs in production, and map every screen of a video brief to its route, components, i18n strings and state, written to the video's SOURCES.md. Use it whenever a video needs to know where a screen lives in the code, when sources/ is missing or stale, before ui-spec-from-code or product-truth start on a video, after the product's frontend changed ("what changed", "which videos are affected", "refresh the sources", "is this checkout current", "which commit is in prod"), and when there is no code and you need an inventory of the no-code references (recordings, recovered captures, docs) a screen can be rebuilt from.

josueh04/product-video-skills

Compose a narrated product demo in HyperFrames: the stage (the product UI rebuilt at its real viewport and scaled to 1080p, camera, rack focus with veil, chapter titles, cursor and clicks, typing, streaming text, pop-ups, toasts, scrolls, end screen and lockup) and the build.py that anchors every beat to a word of the narration. Use it whenever you write or edit a video's video/build.py, src/template.tpl or src/app.css, place a beat on a word, add a chapter, a click, a pop-up or a push-in, frame a screen, build the end screen or lockup, snapshot setup beats, or render a draft or delivery MP4 of a product video in this workbench. Also use it when someone says "the cursor is off", "too zoomed in", "too fast", "it feels chaotic", "the title flashes", "sync the UI to the voice", or asks for a walkthrough, demo or pitch video of a UI.

josueh04/product-video-skills

Gather pixel references for UI that the code cannot show, or to check a rebuild against the real thing, using frames and timed OCR text from screen recordings, captures recovered from past Claude Code session transcripts, a local instance of the app built like production, and web research for third-party apps, plus side-by-side parity images and contact sheets. Use it whenever someone hands over a screen recording (.mov or .mp4) of the product, when a screen has no usable source code (a stale checkout, another company's UI such as a sign-in page, calendar or CRM, runtime output from a backend not in the repos), when asked "what does it really look like", "match the recording", "how long does that animation take in the app", "compare our render to the real app", or when screenshots from an earlier session might already exist. Never uses the reviewer's personal browser.

josueh04/product-video-skills

Turn a product's real frontend code into 1:1 rebuild specs for a video, one read-only subagent per screen, each returning static HTML, CSS with every variable resolved to its literal value and cited (role/path:line@sha), every state, transitions with exact durations and easings, icons from the code's own icon sets, and the exact i18n strings; plus resolve_tokens.py to write the product's design tokens to kit/tokens.css. Use it whenever a screen of the product has to appear in a video, when writing or fixing video/src/app.css or the template markup, when someone asks for exact sizes, colors, fonts, paddings, animations or icons of a screen, when a rebuilt screen "looks off" next to the real app, and when the design tokens or theme of a product need extracting. Framework adapters cover Angular with PrimeNG (proven), React, Vue, Tailwind and plain HTML (unproven).

josueh04/product-video-skills

Say where this session stands in the Product Video Skills workbench (setup state, which product and video the current folder belongs to, the stage of every video) and the exact next command to type. Also answers "how do I..." questions about the workbench from its docs.

josueh04/product-video-skills

Coordinate the build of one or more signed videos of the current product with subagents (source recon, product truth, UI specs, voice, one builder per video), re-run QA itself, then deliver. A light coordinator that never builds itself. Run only when the user types /video-build.

josueh04/product-video-skills

Start a new video of the current product - create videos/<video>/, write BRIEF.md, the feature coverage matrix (COVERAGE.md) and the claims sheet (CLAIMS.md), propose chapters, then stop for the reviewer's sign-off. Never builds. Run only when the user types /video-new.

josueh04/product-video-skills

Turn a batch of reviewer feedback on the product's videos into one table per video, fix every video that got notes in parallel (one subagent each) while keeping approved parts, re-run QA and parity, bump versions and deliver. Run only when the user types /video-review.

josueh04/product-video-skills

Check this machine and install the pinned video toolchain of the Product Video Skills workbench (HyperFrames CLI, its rendering Chrome and its agent skills from the same release, the Python environment, the speech model for QA), then run the self-check. Safe to run again. `/video-setup check` only reports.

Habilidades Relacionadas