diff --git a/skills/claude-design-hyperframes/SKILL.md b/skills/claude-design-hyperframes/SKILL.md index 3ec47654c..35e45f1bf 100644 --- a/skills/claude-design-hyperframes/SKILL.md +++ b/skills/claude-design-hyperframes/SKILL.md @@ -1,677 +1,445 @@ --- name: claude-design-hyperframes -description: Claude Design entry point for HyperFrames. Produce renderable HyperFrames videos in Claude Design with a working in-pane preview. Use for any request to create a video, animation, launch teaser, editorial explainer, product tour, social reel, or motion deliverable. +description: Use when running inside Claude Design specifically. Produces a valid, brand-accurate HyperFrames video draft using pre-valid skeletons. For Claude Code / Cursor / Codex, use the `hyperframes` skill instead. --- -# Claude Design + HyperFrames +# Claude Design + HyperFrames (Template-First) -For this project, your medium is **HyperFrames compositions**: plain HTML + CSS + a paused GSAP timeline. A separate CLI (`npx hyperframes render index.html`) turns the HTML into an MP4. You are authoring the HTML files — the user runs the CLI locally. You do NOT need a CLI environment to produce these files. +Your medium is **HyperFrames compositions**: plain HTML + CSS + a paused GSAP timeline. The CLI (`npx hyperframes render index.html`) turns the HTML into an MP4. You author the HTML -- the user renders locally. -**HyperFrames replaces your default video-artifact workflow for this project.** When the user asks for a video, animation, launch teaser, editorial explainer, product tour, social reel, or any motion deliverable: - -- Do **NOT** call `copy_starter_component` with `kind: "animations.jsx"`. The animations.jsx starter is the wrong format here — HyperFrames uses plain HTML + GSAP, not React Sprites. -- Do **NOT** invoke the built-in "Animated video" skill. HyperFrames replaces it for this project. -- Do **NOT** use React, Babel, or ` - -``` - -**Scene-count invariant — `scenes.length === transitions.length + 1`:** HyperShader enforces this at init. Pick one anchor scene BEFORE the first transition, and one anchor AFTER each transition. A video with three act-boundary transitions needs exactly four anchor scenes. Scenes between anchors (non-bracketing, runtime-managed) carry `style="visibility:hidden;"` instead of `style="opacity:0;"` — they're not HyperShader-managed so nothing animates their opacity back to 1. - -The simplest working pattern: list only the scene just before AND just after each shader cut. Do NOT list every scene in Act II just because they "span" a transition — that violates the invariant. If you genuinely need MORE listed anchors than real shader transitions (rare — e.g., tracking an additional fade beat that's not a visible shader bridge), insert `{ shader: "flash-through-white", duration: 0.01 }` as an invisible no-op bridge to satisfy the invariant. This is a workaround; the cleaner fix is almost always to drop the extra anchor. - -**Transition timing (critical — the scene boundary must fall INSIDE the transition window):** - -Scene windows are half-open (`[start, start+duration)`). At time `B` (the boundary), the runtime has already flipped the outgoing scene to `visibility:hidden`. If `transition.time === B`, `html2canvas` captures a blank outgoing texture → shader transitions from blank → incoming → visible blink. - -Rule: `transition.time < B` AND `transition.time + duration > B`. Simplest — center it: `transition.time = B - duration/2`. Example: scene-1 ends at 6, duration 0.5 → `time: 5.75`. - -**Scene visibility: HANDS OFF.** HyperShader owns scene `opacity` end-to-end. Do NOT add `tl.set(#scene-N, {autoAlpha: …}, …)` on scene containers. If you do, you create the same visibility race that produces the blink. - -### Sub-compositions — default NO for videos ≤ 3 minutes - -Default to a single `index.html` with scenes tiled inline. 30-second to 2-minute compositions fit cleanly in one file (~1500–2000 lines). Single file = single HyperShader instance = no canvas conflicts = everything works. - -Split into sub-compositions ONLY when one of these is true: - -- Video length > 3 minutes AND you need organizational structure. -- You're extracting a REUSABLE sub-comp that appears in multiple places (chart block, logo outro). -- A single scene is so complex it deserves its own file (full UI recreation, heavy data-vis). - -If you do split, **HyperShader lives at the ROOT `index.html` ONLY** — never inside a sub-composition. HyperShader hardcodes `#gl-canvas` as its canvas ID (see the canvas creation path in `packages/shader-transitions/src/hyper-shader.ts`); multiple HyperShader instances can't share one canvas. When a sub-comp's HyperShader fails silently on canvas conflict, its fallback code calls `document.querySelectorAll(".scene")` document-wide and sets every scene's opacity to 0 — corrupting visibility across the whole document. Symptom: only scene-1 of each act shows, scenes 2+ never appear. - -#### Sub-composition file shape - -Every sub-comp file in `compositions/` is wrapped in a `