Skip to content

Commit 22f0e6a

Browse files
authored
feat(skills): design.md integration, shared video references, Claude Design gaps (heygen-com#549)
## What Major skill infrastructure update: design.md support, shared video-composition references, and creative direction patterns extracted from website-to-hyperframes into the base hyperframes skill. ## Changes ### design.md Integration (lightweight) - Step 0a reads any format design.md (YAML, prose, tables) — no format mandate - Brand colors/fonts are strict; video layout adapts per video-composition.md - Font warning gate: warns user if design.md names fonts without local .woff2 files - Design picker generates spec-compliant design.md with YAML frontmatter + prose - Picker generates contextual options from user's prompt (3-4 architectures, 5-6 palettes, 3 type pairings) ### Shared Video References (extracted from website-to-hyperframes) - `video-composition.md` — density, scale, color presence, frame composition rules. Light canvas guidance (don't override user palette). **Always read.** - `beat-direction.md` — per-beat planning (concept → mood → choreography verbs → transition), rhythm templates by video type - `techniques.md` — 11 visual techniques with code patterns (SVG drawing, Canvas 2D, kinetic type, Lottie, etc.) - `narration.md` — pacing, tone, script structure, number pronunciation, hooks - `motion-principles.md` — gained image motion treatment + load-bearing GSAP rules ### Claude Design Transfer Brief (6 gaps applied) 1. Discovery step for exploratory requests (audience, platform, priority, variations) 2. Anti-scope-creep: "build what was asked, every element earns its place" 3. Read-source discipline: "read actual files, don't guess" 4. Rhythm planning: declare scene rhythm before implementing 5. Variations as first-class output for exploratory requests 6. Two-phase verification: fast checks block, slow checks parallel ### Prompt Expansion Updated - Uses beat-direction format (concept → mood → verbs → depth layers) - Rhythm declaration before scene breakdown - References video-composition.md and beat-direction.md ### Key Design Decision **design.md = brand truth, not video layout spec.** Background color is strict from design.md (don't switch light to dark). Video-composition rules teach how to make any palette work cinematically. ## Files Changed (16) **New shared references:** - `skills/hyperframes/references/video-composition.md` - `skills/hyperframes/references/beat-direction.md` - `skills/hyperframes/references/techniques.md` - `skills/hyperframes/references/narration.md` **Updated:** - `skills/hyperframes/SKILL.md` — discovery, anti-scope-creep, rhythm, variations, two-phase verify, new references - `skills/hyperframes/references/prompt-expansion.md` — beat-direction format - `skills/hyperframes/references/motion-principles.md` — image treatment + GSAP rules - `skills/hyperframes/references/design-picker.md` — contextual generation - `skills/hyperframes/visual-styles.md` — YAML token blocks per preset - `skills/hyperframes/house-style.md` — design.md precedence - `skills/hyperframes/templates/design-picker.html` — spec-compliant output - `skills/website-to-hyperframes/references/*` — now reference shared files ## Test plan - [x] Design picker generates and serves correctly - [x] Picker output is spec-compliant design.md - [x] Composition built from picker design.md renders in Studio - [x] Before/after eval: 4 topics × 2 versions showing skill guidance impact - [x] Light canvas compositions respect user palette (don't switch to dark) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 4d05b47 commit 22f0e6a

15 files changed

Lines changed: 2384 additions & 318 deletions

skills/hyperframes/SKILL.md

Lines changed: 80 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,58 @@ HTML is the source of truth for video. A composition is an HTML file with `data-
99

1010
## Approach
1111

12+
### Discovery (exploratory requests only)
13+
14+
For open-ended requests ("make me a product launch video", "create something for our brand") where the user hasn't committed to a direction, understand intent before picking colors:
15+
16+
- **Audience** — who watches this? Developers? Executives? General consumers?
17+
- **Platform** — where does it play? Social (15s), website hero, product demo, internal?
18+
- **Priority** — what matters most? Motion quality? Content accuracy? Brand fidelity? Speed?
19+
- **Variations** — does the user want options, or a single best shot?
20+
21+
For specific requests ("add a title card", "fix the timing on scene 3"), skip discovery.
22+
23+
For exploratory requests, consider offering 2-3 variations that differ meaningfully — not just color swaps, but different pacing, energy levels, or structural approaches. One safe/expected, one ambitious. Don't mandate this — it's a tool available when appropriate.
24+
25+
### Step 1: Design system
26+
27+
If `design.md` or `DESIGN.md` exists in the project, read it first (check both casings — they're different files on Linux). It's the source of truth for brand colors, fonts, and constraints. Use its exact values — don't invent colors or substitute fonts. Any format works (YAML frontmatter, prose, tables — just extract the values).
28+
29+
If it names fonts you can't find locally (no `fonts/` directory with `.woff2` files, not a built-in font), warn the user before writing HTML: "design.md specifies [font name] but no font files found. Please add .woff2 files to `fonts/` or I'll fall back to [closest built-in alternative]."
30+
31+
If no `design.md` exists, offer the user a choice:
32+
33+
1. **User named a style or mood?** → Read [visual-styles.md](./visual-styles.md) for the 8 named presets. Pick the closest match.
34+
2. **Want to browse options visually?** → Run the design picker: read [references/design-picker.md](references/design-picker.md) for the full workflow. This serves a visual picker page. The user configures mood, palette, typography, and motion in the browser, then copies the generated design.md and pastes it back into the conversation.
35+
3. **Want to skip and go fast?** → Ask: mood, light or dark, any brand colors/fonts? Then pick a palette from [house-style.md](./house-style.md).
36+
37+
**design.md defines the brand. It does not define video composition rules.** Those come from [references/video-composition.md](references/video-composition.md) and [house-style.md](./house-style.md). Use brand colors at video-appropriate scale — not at web-UI opacity.
38+
39+
### Step 2: Prompt expansion
40+
41+
Always run on every composition (except single-scene pieces and trivial edits). This step grounds the user's intent against `design.md` and `house-style.md` and produces a consistent intermediate that every downstream agent reads the same way.
42+
43+
Read [references/prompt-expansion.md](references/prompt-expansion.md) for the full process and output format.
44+
45+
### Step 3: Plan
46+
1247
Before writing HTML, think at a high level:
1348

1449
1. **What** — what should the viewer experience? Identify the narrative arc, key moments, and emotional beats.
1550
2. **Structure** — how many compositions, which are sub-compositions vs inline, what tracks carry what (video, audio, overlays, captions).
16-
3. **Timing** — which clips drive the duration, where do transitions land, what's the pacing.
17-
4. **Layout** — build the end-state first. See "Layout Before Animation" below.
18-
5. **Animate** — then add motion using the rules below.
51+
3. **Rhythm** — declare your scene rhythm before implementing. Which scenes are quick hits, which are holds, where do shaders land, where does energy peak. Name the pattern: fast-fast-SLOW-fast-SHADER-hold. Read [references/beat-direction.md](references/beat-direction.md) for rhythm templates.
52+
4. **Timing** — which clips drive the duration, where do transitions land, what's the pacing.
53+
5. **Layout** — build the end-state first. See "Layout Before Animation" below.
54+
6. **Animate** — then add motion using the rules below.
1955

20-
For small edits (fix a color, adjust timing, add one element), skip straight to the rules.
56+
**Build what was asked.** A request for "a title card" is not a request for "a title card + 3 supporting scenes + ambient music + captions." Every scene, every element, every tween should earn its place. If additional scenes or elements would genuinely improve the piece, propose them — don't add them.
2157

22-
### Visual Identity Gate
58+
For small edits (fix a color, adjust timing, add one element), skip straight to the rules.
2359

2460
<HARD-GATE>
25-
Before writing ANY composition HTML, you MUST have a visual identity defined. Do NOT write compositions with default or generic colors.
26-
27-
Check in this order:
28-
29-
1. **DESIGN.md exists in the project?** → Read it. Use its exact colors, fonts, motion rules, and "What NOT to Do" constraints.
30-
2. **visual-style.md exists?** → Read it. Apply its `style_prompt_full` and structured fields. (Note: `visual-style.md` is a project-specific file. `visual-styles.md` is the style library with 8 named presets — different files.)
31-
3. **User named a style** (e.g., "Swiss Pulse", "dark and techy", "luxury brand")? → Read [visual-styles.md](./visual-styles.md) for the 8 named presets. Generate a minimal DESIGN.md with: `## Style Prompt` (one paragraph), `## Colors` (3-5 hex values with roles), `## Typography` (1-2 font families), `## What NOT to Do` (3-5 anti-patterns).
32-
4. **None of the above?** → Ask 3 questions before writing any HTML:
33-
- What's the mood? (explosive / cinematic / fluid / technical / chaotic / warm)
34-
- Light or dark canvas?
35-
- Any specific brand colors, fonts, or visual references?
36-
Then generate a minimal DESIGN.md from the answers.
37-
38-
Every composition must trace its palette and typography back to a DESIGN.md, visual-style.md, or explicit user direction. If you're reaching for `#333`, `#3b82f6`, or `Roboto` — you skipped this step.
61+
Before writing ANY composition HTML — verify you have a visual identity from Step 1. If you're reaching for `#333`, `#3b82f6`, or `Roboto`, you skipped it.
3962
</HARD-GATE>
4063

41-
For motion defaults, sizing, entrance patterns, and easing — follow [house-style.md](./house-style.md). The house style handles HOW things move. The DESIGN.md handles WHAT things look like.
42-
4364
## Layout Before Animation
4465

4566
Position every element where it should be at its **most visible moment** — the frame where it's fully entered, correctly placed, and not yet exiting. Write this as static HTML+CSS first. No GSAP yet.
@@ -50,7 +71,7 @@ Position every element where it should be at its **most visible moment** — the
5071

5172
1. **Identify the hero frame** for each scene — the moment when the most elements are simultaneously visible. This is the layout you build.
5273
2. **Write static CSS** for that frame. The `.scene-content` container MUST fill the full scene using `width: 100%; height: 100%; padding: Npx;` with `display: flex; flex-direction: column; gap: Npx; box-sizing: border-box`. Use padding to push content inward — NEVER `position: absolute; top: Npx` on a content container. Absolute-positioned content containers overflow when content is taller than the remaining space. Reserve `position: absolute` for decoratives only.
53-
3. **Add entrances with `gsap.from()`** — animate FROM offscreen/invisible TO the CSS position. The CSS position is the ground truth; the tween describes the journey to get there.
74+
3. **Add entrances with `gsap.from()`** — animate FROM offscreen/invisible TO the CSS position. The CSS position is the ground truth; the tween describes the journey to get there. (In sub-compositions loaded via `data-composition-src`, prefer `gsap.fromTo()` — see load-bearing GSAP rules in [references/motion-principles.md](references/motion-principles.md).)
5475
4. **Add exits with `gsap.to()`** — animate TO offscreen/invisible FROM the CSS position.
5576

5677
### Example
@@ -259,27 +280,34 @@ tl.from("#s2-heading", { x: -40, opacity: 0, duration: 0.6, ease: "expo.out" },
259280
- 60px+ headlines, 20px+ body, 16px+ data labels for rendered video
260281
- `font-variant-numeric: tabular-nums` on number columns
261282

262-
When no `visual-style.md` or animation direction is provided, follow [house-style.md](./house-style.md) for aesthetic defaults.
283+
If no `design.md` exists, follow [house-style.md](./house-style.md) for aesthetic defaults.
263284

264285
## Typography and Assets
265286

266-
- **Fonts:** Just write the `font-family` you want in CSS — the compiler embeds supported fonts automatically. If a font isn't supported, the compiler warns.
287+
- **Built-in fonts:** Write the `font-family` you want in CSS — the compiler embeds supported fonts automatically.
288+
- **Custom fonts:** If design.md names a font that isn't built-in, the user must provide `.woff2` files in a `fonts/` directory. If missing, warn before writing HTML. When files exist, add `@font-face` declarations pointing to the local files.
267289
- Add `crossorigin="anonymous"` to external media
268290
- For dynamic text overflow, use `window.__hyperframes.fitTextFontSize(text, { maxWidth, fontFamily, fontWeight })`
269291
- All files live at the project root alongside `index.html`; sub-compositions use `../`
270292

271293
## Editing Existing Compositions
272294

273-
- Read the full composition first — match existing fonts, colors, animation patterns
295+
- **Read actual files, don't guess.** When editing, extending, or creating companion compositions, read the existing source. Don't reconstruct hex codes from memory. Don't guess GSAP easing patterns. The composition IS the spec — extract exact values from it.
296+
- Match existing fonts, colors, animation patterns from what you read
274297
- Only change what was requested
275298
- Preserve timing of unrelated clips
276299

277300
## Output Checklist
278301

302+
**Fast (run immediately, block on results):**
303+
279304
- [ ] `npx hyperframes lint` and `npx hyperframes validate` both pass
305+
- [ ] Design adherence verified if design.md exists
306+
307+
**Slow (run in parallel while presenting the preview to the user):**
308+
280309
- [ ] `npx hyperframes inspect` passes, or every reported overflow is intentionally marked
281310
- [ ] Contrast warnings addressed (see Quality Checks below)
282-
- [ ] Layout issues addressed (see Quality Checks below)
283311
- [ ] Animation choreography verified (see Quality Checks below)
284312

285313
## Quality Checks
@@ -317,6 +345,24 @@ If warnings appear:
317345

318346
Use `--no-contrast` to skip if iterating rapidly and you'll check later.
319347

348+
### Design Adherence
349+
350+
If a `design.md` exists, verify the composition follows it after authoring. Read the HTML and check:
351+
352+
1. **Colors** — every hex value in the composition appears in design.md's palette section (however the user labeled it: Colors, Palette, Theme, etc.). Flag any invented colors.
353+
2. **Typography** — font families and weights match design.md's type spec. No substitutions.
354+
3. **Corners** — border-radius values match the declared corner style, if specified.
355+
4. **Spacing** — padding and gap values fall within the declared density range, if specified.
356+
5. **Depth** — shadow usage matches the declared depth level, if specified (flat = none, subtle = light, layered = glows).
357+
6. **Avoidance rules** — if design.md has a section listing things to avoid (commonly "What NOT to Do", "Don'ts", "Anti-patterns", or "Do's and Don'ts"), verify none are present.
358+
359+
Report violations as a checklist. Fix each one before serving.
360+
361+
If no `design.md` exists (house-style-only path), verify:
362+
363+
1. **Palette consistency** — the same bg, fg, and accent colors are used across all scenes. No per-scene color invention.
364+
2. **No lazy defaults** — check the composition against house-style.md's "Lazy Defaults to Question" list. If any appear, they must be a deliberate choice for the content, not a default.
365+
320366
### Animation Map
321367

322368
After authoring animations, run the animation map to verify choreography:
@@ -348,10 +394,15 @@ Skip on small edits (fixing a color, adjusting one duration). Run on new composi
348394
- **[references/tts.md](references/tts.md)** — Text-to-speech with Kokoro-82M. Voice selection, speed tuning, TTS+captions workflow. Read when generating narration or voiceover.
349395
- **[references/audio-reactive.md](references/audio-reactive.md)** — Audio-reactive animation: map frequency bands and amplitude to GSAP properties. Read when visuals should respond to music, voice, or sound.
350396
- **[references/css-patterns.md](references/css-patterns.md)** — CSS+GSAP marker highlighting: highlight, circle, burst, scribble, sketchout. Deterministic, fully seekable. Read when adding visual emphasis to text.
397+
- **[references/video-composition.md](references/video-composition.md)** — Video-medium rules: density, color presence, scale, frame composition, design.md as brand not layout. **Always read** — these override web instincts.
398+
- **[references/beat-direction.md](references/beat-direction.md)** — Beat planning: concept, mood, choreography verbs, rhythm templates, transition decisions, depth layers. **Always read for multi-scene compositions.**
351399
- **[references/typography.md](references/typography.md)** — Typography: font pairing, OpenType features, dark-background adjustments, font discovery script. **Always read** — every composition has text.
352-
- **[references/motion-principles.md](references/motion-principles.md)** — Motion design principles: easing as emotion, timing as weight, choreography as hierarchy, scene pacing, ambient motion, anti-patterns. Read when choreographing GSAP animations.
353-
- **[visual-styles.md](visual-styles.md)** — 8 named visual styles (Swiss Pulse, Velvet Standard, Deconstructed, Maximalist Type, Data Drift, Soft Signal, Folk Frequency, Shadow Cut) with hex palettes, GSAP easing signatures, and shader pairings. Read when user names a style or when generating DESIGN.md.
354-
- **[house-style.md](house-style.md)** — Default motion, sizing, and color palettes when no style is specified.
400+
- **[references/motion-principles.md](references/motion-principles.md)** — Motion design principles, image motion treatment, load-bearing GSAP rules. **Always read** — every composition has motion.
401+
- **[references/techniques.md](references/techniques.md)** — 11 visual techniques with code patterns: SVG drawing, Canvas 2D, CSS 3D, kinetic type, Lottie, video compositing, typing effect, variable fonts, MotionPath, velocity transitions, audio-reactive. Read when planning techniques per beat.
402+
- **[references/narration.md](references/narration.md)** — Pacing, tone, script structure, number pronunciation, opening line patterns. Read when the composition includes voiceover or TTS.
403+
- **[references/design-picker.md](references/design-picker.md)** — Create a design.md via visual picker. Read when no design.md exists and the user wants to create one.
404+
- **[visual-styles.md](visual-styles.md)** — 8 named visual styles with hex palettes, GSAP easing signatures, and shader pairings. Read when user names a style or when generating design.md.
405+
- **[house-style.md](house-style.md)** — Default motion, sizing, and color palettes when no design.md is specified.
355406
- **[patterns.md](patterns.md)** — PiP, title cards, slide show patterns.
356407
- **[data-in-motion.md](data-in-motion.md)** — Data, stats, and infographic patterns.
357408
- **[references/transcript-guide.md](references/transcript-guide.md)** — Transcription commands, whisper models, external APIs, troubleshooting.

skills/hyperframes/house-style.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# House Style
22

3-
Creative direction for compositions when no `visual-style.md` is provided. These are starting points — override anything that doesn't serve the content.
3+
Creative direction for compositions when no `design.md` is provided. These are starting points — override anything that doesn't serve the content. When a `design.md` exists, its brand values take precedence; house-style fills gaps.
44

55
## Before Writing HTML
66

@@ -44,6 +44,8 @@ Ideas (mix and match, 2-5 per scene):
4444

4545
All decoratives should have slow ambient GSAP animation — breathing, drift, pulse. Static decoratives feel dead.
4646

47+
**Decorative count vs motion count.** The "2-5 per scene" count refers to decorative _elements_. If a project's `design.md` says "single ambient motion per scene", it means one looping motion applied to these decoratives (a shared breath/drift/pulse) — not one element total. A scene with 4 decoratives sharing one breathing motion is correct; a scene with 1 decorative is under-dressed.
48+
4749
## Motion
4850

4951
See [references/motion-principles.md](references/motion-principles.md) for full rules. Quick: 0.3–0.6s, vary eases, combine transforms on entrances, overlap entries.

0 commit comments

Comments
 (0)