hyperframes 0.5.0-alpha.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +7518 -5457
- package/dist/commands/contrast-audit.browser.js +2 -0
- package/dist/docs/compositions.md +35 -7
- package/dist/docs/rendering.md +4 -1
- package/dist/hyperframe-runtime.js +82 -32
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +82 -32
- package/dist/skills/gsap/SKILL.md +30 -1
- package/dist/skills/hyperframes/SKILL.md +165 -39
- package/dist/skills/hyperframes/house-style.md +3 -1
- package/dist/skills/hyperframes/patterns.md +73 -0
- package/dist/skills/hyperframes/references/beat-direction.md +102 -0
- package/dist/skills/hyperframes/references/design-picker.md +117 -0
- package/dist/skills/hyperframes/references/motion-principles.md +73 -0
- package/dist/skills/hyperframes/references/narration.md +92 -0
- package/dist/skills/hyperframes/references/prompt-expansion.md +68 -0
- package/dist/skills/hyperframes/references/techniques.md +387 -0
- package/dist/skills/hyperframes/references/transcript-guide.md +1 -45
- package/dist/skills/hyperframes/references/video-composition.md +62 -0
- package/dist/skills/hyperframes/scripts/contrast-report.mjs +10 -0
- package/dist/skills/hyperframes/templates/design-picker.html +1432 -0
- package/dist/skills/hyperframes/visual-styles.md +339 -107
- package/dist/skills/hyperframes-cli/SKILL.md +21 -27
- package/dist/studio/assets/hyperframes-player-CoI5h1xv.js +353 -0
- package/dist/studio/assets/index-BKjcNNNd.css +1 -0
- package/dist/studio/assets/index-CqiisJmo.js +93 -0
- package/dist/studio/index.html +2 -2
- package/dist/templates/_shared/AGENTS.md +7 -7
- package/dist/templates/_shared/CLAUDE.md +15 -7
- package/package.json +4 -2
- package/dist/skills/hyperframes/references/tts.md +0 -75
- package/dist/studio/assets/hyperframes-player-vibA20NC.js +0 -198
- package/dist/studio/assets/index-0Zt0t13W.css +0 -1
- package/dist/studio/assets/index-C9f5eif8.js +0 -105
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Design Picker
|
|
2
|
+
|
|
3
|
+
Two-phase visual picker: mood boards first (pick a complete direction), then fine-tune individual categories.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Read these before generating options — they define the rules your options must follow:
|
|
8
|
+
|
|
9
|
+
- [typography.md](typography.md)
|
|
10
|
+
- [../house-style.md](../house-style.md)
|
|
11
|
+
- [video-composition.md](video-composition.md)
|
|
12
|
+
- [../visual-styles.md](../visual-styles.md)
|
|
13
|
+
- [beat-direction.md](beat-direction.md)
|
|
14
|
+
|
|
15
|
+
## Building the picker
|
|
16
|
+
|
|
17
|
+
1. Generate options **deeply contextual to the user's prompt**. Every category — not just architectures — must reflect the specific product, brand, audience, and mood. Generic options that could appear on any picker are a failure.
|
|
18
|
+
|
|
19
|
+
**Mood boards** — as many as the creative space warrants (4-8). Every board must tell a different STORY about the brand, not just reshuffle the same elements. Ask: "what are the genuinely different ways to position this product?" A cat food brand might be: playful chaos, premium positioning, comfort/cozy, social-native, flavor showcase, humor-led, sensory/appetizing. Each is a different narrative, not a different font on the same layout.
|
|
20
|
+
|
|
21
|
+
**Architectures** — one per mood board minimum, each visually distinct. Use `{{prompt_headline}}` and `{{prompt_sub}}` tokens. If the user provided media assets, use them as background images (use `url(path)` without quotes — single quotes inside `style='...'` break the attribute).
|
|
22
|
+
|
|
23
|
+
**Palettes** (5-6) — named after the brand's world, not generic moods. The palette names and colors should feel like they belong to THIS specific product. Always mix dark + light + tinted. **Every palette must be visually distinct at swatch size.** If two palettes share the same background lightness AND a similar accent hue, cut one. Test: would a user see the difference in a 14px swatch chip? If not, they're duplicates.
|
|
24
|
+
|
|
25
|
+
**Type pairings** (5-6) — **RUN the font discovery script from typography.md BEFORE generating pairings.** This is not optional. Download Google Fonts metadata, run the script, and pick from its output. You will otherwise reach for the same 8 fonts every time (Bricolage Grotesque, Instrument Serif, Fraunces, Archivo Black, DM Serif Display, Space Grotesk, Fredoka) — that's your training data default, not a contextual choice. Match the brand's energy and audience. Cross-category per typography.md (never two sans-serifs).
|
|
26
|
+
|
|
27
|
+
2. `mkdir -p .hyperframes` then copy [../templates/design-picker.html](../templates/design-picker.html) to `.hyperframes/pick-design.html`.
|
|
28
|
+
3. Replace these placeholders using Python (don't hand-escape quotes in sed):
|
|
29
|
+
- `__ARCHITECTURES_JSON__` — array of architecture objects
|
|
30
|
+
- `__PALETTES_JSON__` — array of palette objects
|
|
31
|
+
- `__TYPEPAIRS_JSON__` — array of type pairing objects
|
|
32
|
+
- `__MOODBOARDS_JSON__` — array of mood board objects (see format below)
|
|
33
|
+
- `__PROMPT_JSON__` — object with prompt context (see format below)
|
|
34
|
+
|
|
35
|
+
### Architecture data format
|
|
36
|
+
|
|
37
|
+
Each architecture object must include a `preview_html` field — the HTML that renders in the preview panel. Use token placeholders that the template replaces at runtime: `{{bg}}`, `{{fg}}`, `{{ac}}`, `{{mt}}`, `{{hf}}`, `{{hw}}`, `{{bf}}`, `{{bw}}`, `{{cr}}` (corner radius), `{{pad}}`, `{{gap}}`, `{{shadow}}`, `{{g}}` (grid line color), `{{fg3}}`/`{{fg6}}`/`{{fg8}}`/`{{fg15}}` (fg at opacity), `{{ac3}}`/`{{ac5}}`/`{{ac25}}` (accent at opacity).
|
|
38
|
+
|
|
39
|
+
**Every token must be used.** Apply `{{cr}}` to all cards, buttons, and containers. Apply `{{shadow}}` to elevated elements (cards, buttons, code blocks). Apply `{{pad}}` and `{{gap}}` to control spacing. If a token isn't used in the preview_html, that option will have no visible effect.
|
|
40
|
+
|
|
41
|
+
**Density matters.** Each architecture preview must include 15+ distinct elements to give the user a real sense of the layout. Include: headline, subhead, body paragraph, label/overline, stat with number, secondary stat, quote/testimonial, attribution, card with title+body, second card (different treatment), code/command block, primary button, secondary button, list or tags, accent divider/rule, and a data element (table row, progress bar, or chart).
|
|
42
|
+
|
|
43
|
+
Optionally include `components` (component styling rules) and `dos` (do's and don'ts) as strings — these appear in the generated design.md.
|
|
44
|
+
|
|
45
|
+
**Layout constraint:** All preview HTML must use percentage widths or `max-width: 100%`. Use `flex-wrap: wrap` on all flex rows. Absolute-positioned decoratives must stay within a parent with `overflow: hidden`.
|
|
46
|
+
|
|
47
|
+
**Security:** Architecture `preview_html` must not contain `<script>` tags, event handlers (`onclick`, `onerror`, etc.), or `javascript:` URLs. It is injected via `innerHTML`.
|
|
48
|
+
|
|
49
|
+
**Image URLs:** When using background images in `preview_html`, use `url(path/to/image.jpg)` WITHOUT quotes around the path. Single quotes like `url('path.jpg')` break because `preview_html` is inside a `style='...'` attribute — the inner single quotes terminate the outer attribute.
|
|
50
|
+
|
|
51
|
+
**Palette variety:** Always include a mix of light, dark, and tinted backgrounds across the 6 palettes — even for calm/wellness prompts.
|
|
52
|
+
|
|
53
|
+
### Example architecture object
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"name": "Editorial Stack",
|
|
58
|
+
"description": "Vertical rhythm with large type, pull quotes, and data callouts",
|
|
59
|
+
"tag": "editorial / longform / narrative",
|
|
60
|
+
"mood": "Confident, unhurried, typographically driven",
|
|
61
|
+
"preview_html": "<div style='background:{{bg}};color:{{fg}};padding:{{pad}};min-height:100vh;font-family:\"{{bf}}\",sans-serif;font-weight:{{bw}};'><div style='max-width:100%;display:flex;flex-direction:column;gap:{{gap}};'><div style='font-size:10px;text-transform:uppercase;letter-spacing:0.12em;color:{{mt}};'>Overline Label</div><div style='font-family:\"{{hf}}\",serif;font-weight:{{hw}};font-size:48px;line-height:1.1;letter-spacing:-0.02em;'>The Headline Goes Here</div><div style='font-size:20px;color:{{mt}};max-width:70%;line-height:1.5;'>Subheading text that introduces the narrative arc of this composition with enough words to fill two lines.</div><div style='font-size:15px;line-height:1.7;color:{{fg}};max-width:65%;'>Body paragraph with real sentences. The quick brown fox jumps over the lazy dog. This gives a sense of text density and reading rhythm at the chosen type size.</div><div style='display:flex;gap:{{gap}};flex-wrap:wrap;'><div style='background:{{fg6}};border-radius:{{cr}};padding:{{pad}};flex:1;min-width:200px;box-shadow:{{shadow}};'><div style='font-size:36px;font-family:\"{{hf}}\",serif;font-weight:{{hw}};color:{{ac}};'>2.4M</div><div style='font-size:12px;color:{{mt}};margin-top:4px;'>Primary Stat</div></div><div style='background:{{fg6}};border-radius:{{cr}};padding:{{pad}};flex:1;min-width:200px;box-shadow:{{shadow}};'><div style='font-size:36px;font-family:\"{{hf}}\",serif;font-weight:{{hw}};color:{{fg}};'>87%</div><div style='font-size:12px;color:{{mt}};margin-top:4px;'>Secondary Stat</div></div></div><div style='border-left:3px solid {{ac}};padding:12px {{pad}};background:{{ac3}};border-radius:0 {{cr}} {{cr}} 0;'><div style='font-size:18px;font-style:italic;color:{{fg}};line-height:1.5;'>\"A pull quote that captures the key insight of the piece.\"</div><div style='font-size:12px;color:{{mt}};margin-top:8px;'>— Attribution Name</div></div><div style='background:{{fg3}};border-radius:{{cr}};padding:{{pad}};box-shadow:{{shadow}};'><div style='font-size:14px;font-weight:{{hw}};margin-bottom:8px;'>Card Title</div><div style='font-size:13px;color:{{mt}};line-height:1.5;'>Card body text with a different treatment than the main content area.</div></div><div style='background:{{ac5}};border:1px solid {{ac25}};border-radius:{{cr}};padding:{{pad}};box-shadow:{{shadow}};'><div style='font-size:14px;font-weight:{{hw}};color:{{ac}};margin-bottom:8px;'>Accent Card</div><div style='font-size:13px;color:{{fg}};line-height:1.5;'>Second card with a tinted accent treatment for variety.</div></div><div style='font-family:monospace;font-size:13px;background:{{fg8}};border-radius:{{cr}};padding:{{pad}};color:{{fg15}};box-shadow:{{shadow}};'>$ hyperframes render --output video.mp4</div><div style='display:flex;gap:12px;flex-wrap:wrap;'><button style='background:{{ac}};color:{{bg}};border:none;padding:10px 24px;border-radius:{{cr}};font-size:14px;font-weight:600;box-shadow:{{shadow}};cursor:pointer;'>Primary Action</button><button style='background:transparent;color:{{fg}};border:1px solid {{fg15}};padding:10px 24px;border-radius:{{cr}};font-size:14px;cursor:pointer;'>Secondary</button></div><div style='display:flex;gap:8px;flex-wrap:wrap;'><span style='background:{{fg6}};border-radius:100px;padding:4px 12px;font-size:11px;color:{{mt}};'>Tag One</span><span style='background:{{fg6}};border-radius:100px;padding:4px 12px;font-size:11px;color:{{mt}};'>Tag Two</span><span style='background:{{ac5}};border-radius:100px;padding:4px 12px;font-size:11px;color:{{ac}};'>Accent Tag</span></div><div style='height:1px;background:linear-gradient(to right,{{ac25}},{{fg6}},{{ac25}});'></div><div style='display:flex;justify-content:space-between;font-size:12px;color:{{mt}};border-bottom:1px solid {{g}};padding:8px 0;'><span>Data row label</span><span style='color:{{fg}};font-weight:600;'>1,234</span></div></div></div>"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Mood board data format
|
|
66
|
+
|
|
67
|
+
Each mood board pre-selects one option from each category. The user picks a mood board in Phase 1, then fine-tunes in Phase 2 with those selections pre-filled.
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"name": "Terminal Precision",
|
|
72
|
+
"description": "Code-forward, data-dense, CLI energy. Dark canvas, monospace body, sharp corners.",
|
|
73
|
+
"theme": "dark",
|
|
74
|
+
"arch_index": 0,
|
|
75
|
+
"palette_index": 0,
|
|
76
|
+
"type_index": 0,
|
|
77
|
+
"corners_index": 0,
|
|
78
|
+
"density_index": 0,
|
|
79
|
+
"depth_index": 1,
|
|
80
|
+
"easing_index": 0,
|
|
81
|
+
"corners": "0px",
|
|
82
|
+
"padding": "12px",
|
|
83
|
+
"gap": "8px",
|
|
84
|
+
"shadow": "0 2px 16px rgba(0,230,255,0.15)"
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Indices reference into the ARCHITECTURES, PALETTES, and TYPEPAIRS arrays. The template renders a mini preview of each mood board using its architecture's `preview_html` with the mood board's palette/type applied.
|
|
89
|
+
|
|
90
|
+
### Prompt context data format
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"title": "AI Coding Assistant",
|
|
95
|
+
"headline": "Your Code, Understood.",
|
|
96
|
+
"subline": "An AI coding assistant that reads your entire codebase.",
|
|
97
|
+
"section_desc": "Layout options for your product launch"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`title` appears in the Phase 1 header. `headline` and `subline` replace `{{prompt_headline}}` and `{{prompt_sub}}` in architecture preview_html so previews show real content.
|
|
102
|
+
|
|
103
|
+
### Content tokens in preview_html
|
|
104
|
+
|
|
105
|
+
In addition to the standard design tokens (`{{bg}}`, `{{fg}}`, `{{ac}}`, etc.), architecture `preview_html` can use:
|
|
106
|
+
|
|
107
|
+
- `{{prompt_headline}}` — the user's actual headline text
|
|
108
|
+
- `{{prompt_sub}}` — the user's actual subline text
|
|
109
|
+
|
|
110
|
+
This makes previews contextual — the user sees their own content styled, not generic placeholders.
|
|
111
|
+
|
|
112
|
+
## Serving and user selection
|
|
113
|
+
|
|
114
|
+
4. Serve the file: `cd <project-dir> && python3 -m http.server 8723 &` (use port 8723 or any unused port above 8000; if the curl check fails, try the next port). Verify: `curl -s -o /dev/null -w "%{http_code}" http://localhost:8723/.hyperframes/pick-design.html` — only share the link if it returns 200. Do NOT use `npx hyperframes preview` for the picker — it blocks. Only start the HTTP server from the main conversation thread. If you are running as a dispatched task or subagent, return the file path and let the caller serve it.
|
|
115
|
+
5. Once the user picks, tell them: "Copy the design.md from the picker and paste it here." The user pastes the markdown back into the conversation. Save it verbatim to `design.md` in the project root — it's already in spec format (YAML frontmatter + prose sections). After the user pastes, kill the background server: `kill %1` or `kill $(lsof -ti:8723)`. Then proceed with construction.
|
|
116
|
+
|
|
117
|
+
The picker outputs a [google-labs-code/design.md](https://github.com/google-labs-code/design.md) spec-compliant file: YAML frontmatter with `colors`, `typography`, `rounded`, and `spacing` tokens, followed by `## Overview`, `## Colors`, `## Typography`, `## Layout`, `## Elevation`, `## Components`, and `## Do's and Don'ts` prose sections.
|
|
@@ -67,3 +67,76 @@ You build for the web. Video frames are not pages.
|
|
|
67
67
|
- **Anchor to edges.** Pin content to left/top or right/bottom. Centered-and-floating is a web pattern.
|
|
68
68
|
- **Split frames.** Data panel on the left, content on the right. Top bar with metadata, full-width below. Zone-based layouts, not centered stacks.
|
|
69
69
|
- **Use structural elements.** Rules, dividers, border panels. They create paths for the eye and animate well (scaleX from 0).
|
|
70
|
+
|
|
71
|
+
## Image Motion Treatment
|
|
72
|
+
|
|
73
|
+
Never embed a raw flat image. Every image must have motion treatment:
|
|
74
|
+
|
|
75
|
+
- **Perspective tilt**: use `gsap.set(el, { transformPerspective: 1200, rotationY: -8 })` + `box-shadow` — creates depth. Do NOT use CSS `transform: perspective(...)` as GSAP will overwrite it.
|
|
76
|
+
- **Slow zoom (Ken Burns)**: GSAP `scale: 1` → `1.04` over beat duration — makes photos cinematic
|
|
77
|
+
- **Device frame**: Wrap in a laptop/phone shape using CSS `border-radius` and `box-shadow`
|
|
78
|
+
- **Floating UI**: Extract a key element and animate it at a different z-depth for parallax
|
|
79
|
+
- **Scroll reveal**: Clip the image to a viewport window and animate `y` position
|
|
80
|
+
|
|
81
|
+
## Load-Bearing GSAP Rules
|
|
82
|
+
|
|
83
|
+
Rules below came out of two independent website-to-hyperframes builds (2026-04-20) where compositions lint-clean and still ship broken — elements that never appear, ambient motion that doesn't scrub, entrance tweens that silently kill their target. The linter cannot catch these; the rules must be followed by the author.
|
|
84
|
+
|
|
85
|
+
- **No iframes for captured content.** Iframes do not seek deterministically with the timeline — the capture engine cannot scrub inside them, so they appear frozen (or blank) in the rendered output. If the source you're stylizing is a live web app, use the screenshots from `capture/` as stacked panels or layered images, not live embeds.
|
|
86
|
+
|
|
87
|
+
- **Never stack two transform tweens on the same element.** A common failure: a `y` entrance plus a `scale` Ken Burns on the same `<img>`. The second tween's `immediateRender: true` writes the element's initial state at construction time, overwriting whatever the first tween set — leaving the element invisible or offscreen with no lint warning. A secondary mechanism: `tl.from()` resets to its declared "from" state when the playhead is seeked past the timeline's end, so an element that looked correct in linear playback vanishes in the capture engine's non-linear seek. Fix one of two ways:
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<!-- BAD: two transforms on one element -->
|
|
91
|
+
<img class="hero" src="..." />
|
|
92
|
+
<script>
|
|
93
|
+
tl.from(".hero", { y: 50, opacity: 0, duration: 0.6 }, 0);
|
|
94
|
+
tl.to(".hero", { scale: 1.04, duration: beat }, 0); // kills the entrance
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<!-- GOOD option A: combine into one tween -->
|
|
98
|
+
<script>
|
|
99
|
+
tl.fromTo(
|
|
100
|
+
".hero",
|
|
101
|
+
{ y: 50, opacity: 0, scale: 1.0 },
|
|
102
|
+
{ y: 0, opacity: 1, scale: 1.04, duration: beat, ease: "none" },
|
|
103
|
+
0,
|
|
104
|
+
);
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<!-- GOOD option B: split across parent + child -->
|
|
108
|
+
<div class="hero-wrap"><img class="hero" src="..." /></div>
|
|
109
|
+
<script>
|
|
110
|
+
tl.from(".hero-wrap", { y: 50, opacity: 0, duration: 0.6 }, 0); // entrance on parent
|
|
111
|
+
tl.to(".hero", { scale: 1.04, duration: beat }, 0); // Ken Burns on child
|
|
112
|
+
</script>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- **Prefer `tl.fromTo()` over `tl.from()` inside `.clip` scenes.** `gsap.from()` sets `immediateRender: true` by default, which writes the "from" state at timeline construction — before the `.clip` scene's `data-start` is active. Elements can flash visible, start from the wrong position, or skip their entrance entirely when the scene is seeked non-linearly (which the capture engine does). Explicit `fromTo` makes the state at every timeline position deterministic:
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
// BRITTLE: immediateRender interacts badly with scene boundaries
|
|
119
|
+
tl.from(el, { opacity: 0, y: 50, duration: 0.6 }, t);
|
|
120
|
+
|
|
121
|
+
// DETERMINISTIC: state is defined at both ends, no immediateRender surprise
|
|
122
|
+
tl.fromTo(el, { opacity: 0, y: 50 }, { opacity: 1, y: 0, duration: 0.6 }, t);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- **Ambient pulses must attach to the seekable `tl`, never bare `gsap.to()`.** Auras, shimmers, gentle float loops, logo breathing — all of these must be added to the scene's timeline, not fired standalone. Standalone tweens run on wallclock time and do not scrub with the capture engine, so the effect is absent in the rendered video even though it looks correct in the studio preview:
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
// BAD: lives outside the timeline, never renders in capture
|
|
129
|
+
gsap.to(".aura", { scale: 1.08, yoyo: true, repeat: 5, duration: 1.2 });
|
|
130
|
+
|
|
131
|
+
// GOOD: seekable, deterministic, renders
|
|
132
|
+
tl.to(".aura", { scale: 1.08, yoyo: true, repeat: 5, duration: 1.2 }, 0);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- **Hard-kill every scene boundary, not just captions.** The caption hard-kill rule above generalizes: any element whose visibility changes at a beat boundary needs a deterministic `tl.set()` kill after its fade, because later tweens on the same element (or `immediateRender` from a sibling tween) can resurrect it. Apply to every element with an exit animation:
|
|
136
|
+
|
|
137
|
+
```js
|
|
138
|
+
tl.to(el, { opacity: 0, duration: 0.3 }, beatEnd);
|
|
139
|
+
tl.set(el, { opacity: 0, visibility: "hidden" }, beatEnd + 0.3); // deterministic kill
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
These are the exact rules with the exact code examples — don't summarize or shorten them. They exist because compositions that lint clean still ship broken without them.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Narration & Script
|
|
2
|
+
|
|
3
|
+
How to write narration scripts for video compositions. Read when the composition includes voiceover or TTS.
|
|
4
|
+
|
|
5
|
+
## Pacing
|
|
6
|
+
|
|
7
|
+
- **2.5 words per second** is natural speaking pace
|
|
8
|
+
- 15s = ~37 words. 30s = ~75 words. 60s = ~150 words
|
|
9
|
+
- Leave room for pauses. Silence between sentences is a feature, not dead air
|
|
10
|
+
- The script should feel SHORTER than the video — visual breathing room matters
|
|
11
|
+
|
|
12
|
+
## Tone
|
|
13
|
+
|
|
14
|
+
Write like a person, not a brochure:
|
|
15
|
+
|
|
16
|
+
- Use contractions: "it's", "you'll", "that's", "we've"
|
|
17
|
+
- Vary sentence length — short punchy phrases mixed with longer flowing ones
|
|
18
|
+
- Read it out loud. If it sounds robotic, rewrite it
|
|
19
|
+
- Avoid jargon unless the audience expects it
|
|
20
|
+
|
|
21
|
+
## Number Pronunciation
|
|
22
|
+
|
|
23
|
+
Write what you want the voice to say. TTS reads literally.
|
|
24
|
+
|
|
25
|
+
| In the product | Write in script as |
|
|
26
|
+
| -------------- | --------------------------------- |
|
|
27
|
+
| 135+ | more than one hundred thirty five |
|
|
28
|
+
| $1.9T | nearly two trillion dollars |
|
|
29
|
+
| 99.999% | ninety nine point nine percent |
|
|
30
|
+
| 200M+ | over two hundred million |
|
|
31
|
+
| 10x | ten times |
|
|
32
|
+
| API | A P I |
|
|
33
|
+
| stripe.com | stripe dot com |
|
|
34
|
+
|
|
35
|
+
The visual can show the exact figure while the voice rounds it.
|
|
36
|
+
|
|
37
|
+
## Structure
|
|
38
|
+
|
|
39
|
+
For product videos:
|
|
40
|
+
|
|
41
|
+
1. **Hook** — what's surprising or impressive about this product? A bold claim, a provocative question, a contrast, or a striking number. This is the opening line. **Vary the hook type** — don't default to a stat every time.
|
|
42
|
+
2. **Story** — what does the product do? Who uses it? Keep it concrete.
|
|
43
|
+
3. **Proof** — stats, customer names, social proof. Real numbers from the product.
|
|
44
|
+
4. **CTA** — what should the viewer do? "Start building at stripe dot com."
|
|
45
|
+
|
|
46
|
+
Not every video needs all four. A 15-second social ad might be Hook + Proof + CTA. A 60-second product tour uses all four with more Story.
|
|
47
|
+
|
|
48
|
+
## The Opening Line
|
|
49
|
+
|
|
50
|
+
The most important sentence in the video. It must create tension, curiosity, or surprise in the first 3 seconds.
|
|
51
|
+
|
|
52
|
+
Patterns that work:
|
|
53
|
+
|
|
54
|
+
- **A bold claim**: "The financial infrastructure that powers the internet economy."
|
|
55
|
+
- **A question that provokes**: "What if your database could think?"
|
|
56
|
+
- **A contrast**: "Your AI agent already knows how to make videos. It just needs the right format."
|
|
57
|
+
- **A number that shocks**: "Nearly two trillion dollars." (Use sparingly — not every video should open with a stat.)
|
|
58
|
+
|
|
59
|
+
If the opening is generic ("Welcome to Stripe" / "Introducing our product"), start over.
|
|
60
|
+
|
|
61
|
+
## Example
|
|
62
|
+
|
|
63
|
+
From a 62-second product launch video (team reference):
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Your AI agent already knows how to make videos.
|
|
67
|
+
It just needs the right format.
|
|
68
|
+
|
|
69
|
+
This is Hyperframes. An open source framework. HTML in, video out.
|
|
70
|
+
|
|
71
|
+
A div is a keyframe. Data attributes are your timeline.
|
|
72
|
+
CSS is your look. G-Sap is your animation engine.
|
|
73
|
+
|
|
74
|
+
Anything a browser can render can be a frame in your video.
|
|
75
|
+
|
|
76
|
+
CSS animations. G-Sap. Lottie. Shaders. Three.js.
|
|
77
|
+
|
|
78
|
+
Drop in music, sound effects, footage — it all composes together.
|
|
79
|
+
|
|
80
|
+
No new framework for the agent to learn.
|
|
81
|
+
Just HTML.
|
|
82
|
+
|
|
83
|
+
The agent writes it. The renderer captures every frame as MP4.
|
|
84
|
+
It's deterministic. Identical outputs, every time.
|
|
85
|
+
|
|
86
|
+
Give your agent the CLI. Tell it what to make.
|
|
87
|
+
Watch it build.
|
|
88
|
+
|
|
89
|
+
Hyperframes. Go make something.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Note: ~140 words for 62 seconds — that's 2.3 words/sec, leaving room for pauses and visual breathing.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Prompt Expansion
|
|
2
|
+
|
|
3
|
+
Run on every composition. Expansion is not about lengthening a short prompt — it's about grounding the user's intent against `design.md` and `house-style.md` and producing a consistent intermediate that every downstream agent reads the same way.
|
|
4
|
+
|
|
5
|
+
Runs AFTER design direction is established (Step 1). The expansion consumes design.md (if present) and produces output that cites its exact values.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Read before generating:
|
|
10
|
+
|
|
11
|
+
- `design.md` (if it exists) — extract brand colors, fonts, mood, and constraints. The expansion cites these exact values (hex codes, font names); it does not invent new ones.
|
|
12
|
+
- [beat-direction.md](beat-direction.md) — per-beat planning format (concept, mood, choreography verbs, transitions, depth layers, rhythm). The expansion outputs each scene using this format.
|
|
13
|
+
- [video-composition.md](video-composition.md) — video-medium rules for density, scale, and color presence. The expansion applies these automatically.
|
|
14
|
+
- [../house-style.md](../house-style.md) — its rules for Background Layer (2-5 decoratives), Color, Motion, Typography apply to every scene. The expansion writes output that conforms to them.
|
|
15
|
+
|
|
16
|
+
If `design.md` doesn't exist yet, run Step 1 (Design system) first. Expansion without a design context produces generic scene breakdowns that later agents ignore.
|
|
17
|
+
|
|
18
|
+
## Why always run it
|
|
19
|
+
|
|
20
|
+
**The expansion is never pass-through.** Every user prompt — no matter how detailed — is a _seed_. The expansion's job is to enrich it into a fully-realized per-scene production spec that the scene subagents can build from directly.
|
|
21
|
+
|
|
22
|
+
Even a detailed 7-scene brief lacks things only the expansion adds:
|
|
23
|
+
|
|
24
|
+
- **Atmosphere layers per scene** (required 2–5 from house-style: radial glows, ghost type, hairline rules, grain, thematic decoratives) — the user's prompt almost never lists these; expansion adds them.
|
|
25
|
+
- **Secondary motion for every decorative** — breath, drift, pulse, orbit. A decorative without ambient motion feels dead.
|
|
26
|
+
- **Micro-details that make a scene feel real** — registration marks, tick indicators, monospace coord labels, typographic accents, code snippets in the background, grid patterns. Things the user didn't think to request.
|
|
27
|
+
- **Transition choreography at the object level** — not "crossfade" but "X expands outward and becomes Y". Specific duration, ease, and morph source/target.
|
|
28
|
+
- **Pacing beats within each scene** — where tension builds, where a hold lets the viewer breathe, where the accent word lands.
|
|
29
|
+
- **Exact hex values, typography parameters, ease choices** from design.md — no vagueness left for the scene subagent to guess.
|
|
30
|
+
|
|
31
|
+
Expansion's job on a detailed prompt is not to summarize or pass through — it's to **take what the user wrote and make it richer**. The user's content stays; the atmosphere, ambient motion, and micro-details are added on top. That's what makes the difference between a scene that matches the brief and a scene that feels alive.
|
|
32
|
+
|
|
33
|
+
The quality gap between a single-pass composition and a multi-scene-pipeline composition comes from this step. Expansion front-loads the richness so every scene subagent builds from a rich brief, not a terse one.
|
|
34
|
+
|
|
35
|
+
**Do not skip. Do not pass through.** Single-scene compositions and trivial edits are the only exceptions.
|
|
36
|
+
|
|
37
|
+
## What to generate
|
|
38
|
+
|
|
39
|
+
Expand into a full production prompt with these sections:
|
|
40
|
+
|
|
41
|
+
1. **Title + style block** — cite design.md's exact hex values, font names, and mood. Do NOT invent a palette — quote what the design provides.
|
|
42
|
+
|
|
43
|
+
2. **Rhythm declaration** — name the scene rhythm before detailing any scene. Example: `hook-PUNCH-breathe-CTA` or `slow-build-BUILD-PEAK-breathe-CTA`. See [beat-direction.md](beat-direction.md) for rhythm templates by video type.
|
|
44
|
+
|
|
45
|
+
3. **Global rules** — parallax layers, micro-motion requirements, transition style, primary + accent transitions. Match energy to mood (calm → slow eases, high → snappy eases).
|
|
46
|
+
|
|
47
|
+
4. **Per-scene beats** — for each scene, use the beat-direction format:
|
|
48
|
+
- **Concept** — the big idea in 2-3 sentences. What visual WORLD? What metaphor? What should the viewer FEEL?
|
|
49
|
+
- **Mood direction** — cultural/design references, not hex codes. ("Bauhaus color studies", "cinematic title sequence", "editorial calm")
|
|
50
|
+
- **Depth layers** — BG (2-5 decoratives with ambient motion), MG (content), FG (accents, structural elements, micro-details). 8-10 total elements per scene per video-composition.md.
|
|
51
|
+
- **Animation choreography** — specific verbs per element. High: SLAMS, CRASHES. Medium: CASCADE, SLIDES. Low: floats, types on, counts up. Every element gets a verb. If you can't name the verb, the element is not yet designed.
|
|
52
|
+
- **Transition out** — shader or CSS, with specific type and parameters. Not "crossfade" but "blur crossfade, 0.4s, power2.inOut."
|
|
53
|
+
|
|
54
|
+
5. **Recurring motifs** — visual threads across scenes from the brand palette.
|
|
55
|
+
|
|
56
|
+
6. **Negative prompt** — what to avoid, informed by design.md's constraints if present.
|
|
57
|
+
|
|
58
|
+
## Output
|
|
59
|
+
|
|
60
|
+
Write the expanded prompt to `.hyperframes/expanded-prompt.md` in the project directory. Do NOT dump it into the chat — it will be hundreds of lines.
|
|
61
|
+
|
|
62
|
+
Tell the user:
|
|
63
|
+
|
|
64
|
+
> "I've expanded your prompt into a full production breakdown. Review it here: `.hyperframes/expanded-prompt.md`
|
|
65
|
+
>
|
|
66
|
+
> It has [N] scenes across [duration] seconds with specific visual elements, transitions, and pacing. Edit anything you want, then let me know when you're ready to proceed."
|
|
67
|
+
|
|
68
|
+
Only move to construction after the user approves or says to continue.
|