Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
docs: clarify declaration vs override attributes (PR #603 review)
James22bcd7a18bae
diff --git a/packages/cli/src/docs/compositions.md b/packages/cli/src/docs/compositions.mdindex 5af91e5c1e..5cd4cb9a28 100644--- a/packages/cli/src/docs/compositions.md+++ b/packages/cli/src/docs/compositions.md@@ -26,7 +26,12 @@ Use `npx hyperframes compositions` to see all compositions in a project.## Variables-Declare variables on the composition's `<html>` root, then read them inside any composition script with `window.__hyperframes.getVariables()`. Override per-instance via `data-variable-values` on the host element, or at render time via `npx hyperframes render --variables '{...}'`.+Two attributes work together:++- **`data-composition-variables`** on the `<html>` root *declares* the variables (id, type, label, default).+- **`data-variable-values`** on a sub-comp host element *overrides* values for that one instance.++Inside any composition script, `window.__hyperframes.getVariables()` returns the merged result of declarations + overrides. CLI `npx hyperframes render --variables '{...}'` provides a top-level override that layers the same way.```html<!-- compositions/card.html -->diff --git a/skills/hyperframes-cli/SKILL.md b/skills/hyperframes-cli/SKILL.mdindex 6e0749897a..399a35790d 100644--- a/skills/hyperframes-cli/SKILL.md+++ b/skills/hyperframes-cli/SKILL.md@@ -118,7 +118,7 @@ npx hyperframes render --docker # byte-identical**Quality guidance:** `draft` while iterating, `standard` for review, `high` for final delivery.-**Parametrized renders:** declare variables on `<html data-composition-variables='[...]'>` and read them inside the composition with `window.__hyperframes.getVariables()`. Override at render time with `--variables '{"title":"Q4 Report"}'`. Missing keys fall through to declared defaults, so the same composition runs unchanged in dev preview and in production renders. See the `hyperframes` skill for the full pattern.+**Parametrized renders:** the composition declares its variables on the `<html>` root with `data-composition-variables` (id/type/label/default per entry) and reads them in any script via `window.__hyperframes.getVariables()`. The CLI `--variables '{"title":"Q4 Report"}'` overrides those declared defaults for one render — missing keys fall through, so the same composition runs unchanged in dev preview and in production. (Sub-comp hosts can also override per-instance via `data-variable-values` — see the `hyperframes` skill.)## Transcription