Skip to content

Commit 67ffafb

Browse files
docs(contributing): refresh the catalog contribution guide (#2954)
The guide still described a 52-block registry, told contributors to run the deprecated `validate` command, and listed gaps that have since shipped. - Correct the counts: 113 blocks, 25 components - `validate` -> `check` in the quick version - Document the `demo.html` requirement for components (CI fails without it) - Document `params` (drives the Studio customization panel) and the other optional registry-item fields - Add the monospace caption floor and `fitTextFontSize()` to the quality bar - Add a motion-review checklist: rules paired with a self-check question - Replace the manual preview-MP4 step with what catalog-previews CI does - Rewrite "What's Needed Right Now" by the job a shot does in a video, and drop the gaps that have shipped (karaoke, lower thirds, maps, news ticker)
1 parent 411ada0 commit 67ffafb

1 file changed

Lines changed: 90 additions & 15 deletions

File tree

docs/contributing/catalog.mdx

Lines changed: 90 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ title: Contributing to the Catalog
33
description: How to add blocks and components to the HyperFrames registry.
44
---
55

6-
Your agent already knows how to build video components. It writes HTML. HyperFrames renders it. The registry is the collection of everything that's been built — 52 blocks and counting.
6+
Your agent already knows how to build video components. It writes HTML. HyperFrames renders it. The registry is the collection of everything that's been built — 113 blocks and 25 components.
77

88
This guide shows you how to add to it.
99

1010
<Info>
11-
**Quick version** — Fork the repo. Write one HTML file with a paused GSAP timeline. Add `registry-item.json`. Run `hyperframes lint` + `validate`. Publish with `npx hyperframes publish`. Open a PR.
11+
**Quick version** — Fork the repo. Write one HTML file with a paused GSAP timeline. Add `registry-item.json`. Run `hyperframes lint` + `hyperframes check`. Publish with `npx hyperframes publish`. Open a PR.
1212
</Info>
1313

1414
## Why Contribute?
@@ -53,12 +53,23 @@ The `/hyperframes-registry` skill scaffolds the structure, validates, renders a
5353

5454
### Structure
5555

56+
A block is two files. A component is three, because it also ships the demo the catalog renders it inside.
57+
5658
```
5759
registry/blocks/my-block/
5860
my-block.html ← the composition
5961
registry-item.json ← metadata
62+
63+
registry/components/my-effect/
64+
my-effect.html ← the snippet
65+
demo.html ← the composition the catalog previews it in
66+
registry-item.json ← metadata
6067
```
6168

69+
<Warning>
70+
`demo.html` is required for components. Preview generation skips any component without one, which fails the catalog CI job for your item.
71+
</Warning>
72+
6273
### registry-item.json
6374

6475
```json
@@ -71,6 +82,9 @@ registry/blocks/my-block/
7182
"tags": ["category", "subcategory"],
7283
"dimensions": { "width": 1920, "height": 1080 },
7384
"duration": 5,
85+
"params": [
86+
{ "key": "--accent", "label": "Accent", "type": "color", "default": "#ff4d4d" }
87+
],
7488
"files": [
7589
{
7690
"path": "my-block.html",
@@ -81,6 +95,36 @@ registry/blocks/my-block/
8195
}
8296
```
8397

98+
#### Expose your block's knobs with `params`
99+
100+
Declare `params` and Studio opens a live customization panel the moment someone adds your block. Each entry maps a label to a CSS variable your composition reads, so a user can restyle it without editing HTML.
101+
102+
```json
103+
"params": [
104+
{ "key": "--bg-color", "label": "Background", "type": "color", "default": "#faf9f6" },
105+
{ "key": "--headline", "label": "Headline", "type": "text", "default": "Ship it" },
106+
{ "key": "--speed", "label": "Speed", "type": "number", "default": "1", "min": 0.5, "max": 2, "step": 0.1 }
107+
]
108+
```
109+
110+
Types are `color`, `text`, `number`, and `select` (which takes an `options` array).
111+
112+
<Tip>
113+
If your block has any brand surface — a color, a headline, a logo slot — expose it as a param. A block nobody can restyle gets forked instead of reused.
114+
</Tip>
115+
116+
#### Other optional fields
117+
118+
| Field | What it does |
119+
|-------|--------------|
120+
| `author` / `authorUrl` | Credits you on the catalog page |
121+
| `relatedSkill` | Links the catalog page to the skill that authors this kind of block |
122+
| `registryDependencies` | Other registry items installed alongside yours |
123+
| `license` | SPDX identifier, if yours differs from the repo's |
124+
| `sourcePrompt` | The prompt that produced the block, for people remixing it |
125+
| `minCliVersion` | Guards against installing into a CLI too old to run it |
126+
| `deprecated` | Marks the item superseded, with the migration note as the value |
127+
84128
## The Rules
85129

86130
Five things that must be true for every registry item:
@@ -107,24 +151,39 @@ Five things that must be true for every registry item:
107151
Break any of these and renders won't be reproducible. The renderer captures every frame by seeking the timeline — if your animation depends on real time or random state, it breaks.
108152
</Warning>
109153

154+
Prefix every element ID with a 2-3 letter abbreviation of your item's name (`hz-cg-0`, `vc-canvas`). Unprefixed IDs collide when your block is used as a sub-composition.
155+
110156
## Quality Bar
111157

112158
Not everything belongs in the registry. The bar is production quality.
113159

114160
| Type | Minimum standard |
115161
|------|-----------------|
116-
| Captions | 96px+ font, text-stroke/shadow, overflow prevention |
162+
| Captions | 96px+ font (64-72px for monospace), text-stroke or shadow, `window.__hyperframes.fitTextFontSize()` on every group |
117163
| VFX | Solves a problem that takes 4+ hours from scratch |
118164
| Transitions | Smoother than CSS — if opacity 0→1 works, it's not a transition |
119165
| Blocks | Would a professional use this in a client project? |
120166

167+
### Motion review
168+
169+
Passing `check` isn't the same as the motion being good. Watch your rendered preview once at full speed and answer these:
170+
171+
| Rule | Ask yourself |
172+
|------|-------------|
173+
| Key information holds still before the block ends | Does the headline or number sit motionless for at least a second after it lands, or is it still drifting at the cut? |
174+
| Speed comes from acceleration, not constant velocity | Is anything moving at a constant rate? Linear motion reads as a slide deck. |
175+
| Default one notch slower than feels right | Was there anything you couldn't read on the first watch? |
176+
| One hero per block | Count what's animating in the first second. More than one and the eye has nowhere to land. |
177+
| Light effects aren't sprayed | Count the glints and sweeps. More than one, or any that spills past a rounded corner, is a cut. |
178+
121179
### Common rejection reasons
122180

123181
1. **"Looks like a demo"** — a spinning cube is not a component
124182
2. **"Text unreadable"** — font too small, no contrast treatment
125183
3. **"Non-deterministic"**`Math.random()` or `Date.now()`
126184
4. **"Timeline not found"** — ID mismatch between HTML and JS
127185
5. **"Breaks as sub-composition"** — element IDs collide (prefix everything)
186+
6. **"Nothing to tune"** — a branded block with no `params`
128187

129188
## Workflow
130189

@@ -136,13 +195,13 @@ Not everything belongs in the registry. The bar is production quality.
136195
```
137196
</Step>
138197
<Step title="Write your block">
139-
Create the HTML composition and `registry-item.json`. Use the templates above.
198+
Create the HTML composition and `registry-item.json`. Use the templates above. For a component, add `demo.html` too.
140199
</Step>
141200
<Step title="Validate">
142201
```bash
143202
hyperframes lint
144203
hyperframes check
145-
npx oxfmt your-block.html
204+
npx oxfmt registry/blocks/your-block/*.html
146205
```
147206
</Step>
148207
<Step title="Update registry">
@@ -161,26 +220,42 @@ Not everything belongs in the registry. The bar is production quality.
161220
```bash
162221
npx hyperframes publish
163222
```
164-
Open a PR with your [hyperframes.dev](https://hyperframes.dev) preview link.
223+
Open a PR with your [hyperframes.dev](https://hyperframes.dev) preview link. Commit your item directory, `registry/registry.json`, and the generated `docs/catalog/` page.
165224
</Step>
166225
</Steps>
167226

168-
**External contributors:** attach the preview MP4 to your PR. A maintainer handles the catalog image.
227+
CI renders the catalog PNG and MP4 for every block or component your PR touches, so there's nothing to attach by hand. A maintainer publishes the final catalog image before merge.
228+
229+
### What to write in the PR body
230+
231+
The one-line `description` tells a reader what your block looks like. It doesn't tell them when to reach for it, which is what decides whether it gets used. Three lines in the PR body:
232+
233+
- **When to use it** — name the moment, e.g. "second beat of a product promo, right after the hero card lands"
234+
- **Duration range** — your block has a fixed `duration`; say what range still reads correctly
235+
- **Known pitfalls** — a font that must be loaded, a background it needs contrast against, a length past which it stops working
169236

170237
**HeyGen internal:** run `scripts/upload-docs-images.sh` to push catalog PNGs.
171238

172239
## What's Needed Right Now
173240

174-
These are gaps in the registry. If you're looking for something to build, start here.
241+
The catalog is lopsided. It has 29 transitions and 33 code blocks, and almost nothing for the moments that carry a video's shape. These gaps are sorted by the job the shot does, not by the technique it uses.
242+
243+
| Job in the video | Blocks today | Gap |
244+
|------------------|--------------|-----|
245+
| Opening / hero reveal | 2 | The most-used moment in any promo has two options |
246+
| Outro / end card | 1 | Every video needs one |
247+
| Beat-driven cuts | 0 | Speed ramps, freeze frames, cut-on-the-beat — nothing, despite a whole music-to-video workflow |
248+
| Interaction demo | 0 | Command palette summon, type-and-filter, cursor performance, theme switch — nothing, despite HyperFrames capturing real product pages |
249+
| Data readout | 1 generic | Odometer digit roll, gauge sweep, before-and-after slider scrub |
250+
| Captions | 0 blocks | 15 caption components exist, but no ready-to-drop caption block |
251+
252+
Four specific holes that survived the last round:
175253

176254
| Category | Gap | Difficulty |
177255
|----------|-----|-----------|
178-
| Captions | Karaoke with clip-path sweep (CapCut style) | Medium |
179256
| Captions | RTL language layouts (Arabic, Hebrew) | Medium |
180-
| Lower thirds | 10 variations for podcasts/interviews | Easy |
181-
| Lower thirds | News ticker / scrolling text bar | Easy |
182-
| Maps | Animated route maps, region highlights, location pins | Medium |
183-
| VFX | Product turntable with HDRI | Hard |
184-
| VFX | Particle system with physics (collisions, gravity) | Hard |
185-
| Transitions | Morphing shape transitions | Hard |
186257
| Data viz | Sankey / flow diagrams | Medium |
258+
| VFX | Particle system with physics (collisions, gravity) | Hard |
259+
| VFX | Product turntable with HDRI | Hard |
260+
261+
Pick one, and your first contribution fills a hole instead of being the 30th transition.

0 commit comments

Comments
 (0)