remotion-brand-codify
Turns research output into typed code that every composition reads.
Triggers
- After
remotion-brand-researchwrites a dossier under.research/. - User pastes brand colours, fonts, and tone notes and says "codify the {brand} brand".
Inputs
.research/brand-{slug}-{date}.json(preferred) or the markdown dossier- Existing
Synthex/packages/brand-config/src/brands/{slug}.tsif present (for diff)
Method
- Validate the dossier covers every required field of
BrandConfig(seeSynthex/packages/brand-config/src/types.ts). Missing fields = block; askremotion-brand-researchto fill. - Apply the boundary contract — colour hexes / typography scale / spacing / components / layout go to
.design.md; voice / voiceover / motion / audience / channel / forbiddenWords / logo paths / signature go to.ts. SeePi-Dev-Ops/remotion-studio/src/brands/CONTRACT.md. - For each colour, run through
remotion-colour-familyif the palette has fewer than 5 colours or fails WCAG-AA ontext on primary. The colour-family skill emits a YAML block ready to drop into the.design.mdcolors:section. - For motion, run through
remotion-motion-languageifmotionblock is empty. - For fonts, validate licensing: only OFL / Apache / MIT families pass. Block on Adobe Fonts (server-side rendering disallowed) and paid Google Fonts.
- Emit
Synthex/packages/brand-config/src/brands/{slug}.tscontaining runtime fields only (per CONTRACT.md). UseSynthex/packages/brand-config/src/brands/ra.tsas the canonical example. Runnpm run buildfromSynthex/packages/brand-config/afterwards to regeneratedist/. - Emit
Synthex/packages/brand-config/src/brands/{slug}.design.mdcontaining visual tokens only in spec-conformant@google/design.mdformat. Use any existing*.design.md(e.g.ra.design.md) as the canonical example. - Lint the design.md — run
npx --prefix Pi-Dev-Ops/remotion-studio design.md lint Synthex/packages/brand-config/src/brands/{slug}.design.md. Block on errors. Warnings are advisory — fix unreferenced-token warnings only when the unused token has no semantic intent. - Mirror to the runtime location —
cp Synthex/packages/brand-config/src/brands/{slug}.design.md Pi-Dev-Ops/packages/brand-config/src/brands/{slug}.design.md. The runtime loader (loadDesign(slug)) reads from the Pi-Dev-Ops local copy via the workspace-link in remotion-studio. - Update
Synthex/packages/brand-config/src/brands/index.tsif the slug is new (also extendBrandSlugunion intypes.ts). - Regenerate the human-readable 9-section projection at
Pi-Dev-Ops/remotion-studio/src/brands/{slug}.mdreading from BOTH.tsand.design.md. Sections 2 (Color Palette), 3 (Typography), 4 (Components), 5 (Layout) pull from.design.md; sections 1, 6, 7, 8, 9 pull from.ts+ supporting prose.
Output
Three edited files per brand:
Synthex/packages/brand-config/src/brands/{slug}.ts— typedBrandConfig(runtime + behaviour, source of truth per RA-1985).Synthex/packages/brand-config/src/brands/{slug}.design.md— visual tokens (source of truth, spec-conformant@google/design.md).Pi-Dev-Ops/remotion-studio/src/brands/{slug}.md— 9-section human-readable projection (regenerated from BOTH; never hand-edit).
Plus the runtime mirror at Pi-Dev-Ops/packages/brand-config/src/brands/{slug}.design.md (a cp of #2 — kept in sync until the brand-config consolidation removes the local copy).
The 9-section .md projection is a projection of the .ts + .design.md, not a parallel source. Regenerate it whenever either source changes; never hand-edit. Section order is fixed:
- Visual Theme & Atmosphere (from
.tsvoice + audience prose) - Color Palette & Roles (table mirroring
.design.mdcolors:, plus dark variant row if defined) - Typography Rules (from
.design.mdtypography:+ family/weight fromBrandTypographyfor licence trace) - Component Stylings (from
.design.mdcomponents:) - Layout Principles (from
.design.mdspacing.outer-margin-*+BrandLogo.safeAreaPx) - Depth & Elevation (from
.design.mdElevation prose) - Do's and Don'ts (concatenate
.tsdoNot+voice.forbiddenWords+.design.mdDo's/Don'ts section) - Responsive Behavior (aspect ratios from
.ts, type scale per ratio from.design.md) - Agent Prompt Guide (one literal example invoking
{colors.*}andmotion.signaturetokens)
Plus a PR (or local diff) summarising:
- Source dossier path
- Fields filled vs left to founder review
- Lint status (
design.md linterrors / warnings, font licence, contrast) - All three files emitted (
.ts+.design.md+.mdprojection) — block on missing artifact
Boundaries
- Always set PR
auto-merge:false— brand voice nuance must be reviewed by a human. - Never overwrite an existing file silently; produce a side-by-side diff.
- Never invent fonts or colours — values come from the research dossier or default to neutral fallbacks with
// TODO: founder reviewcomments. - Never duplicate a token across
.tsand.design.md. Ifcolour.primarylives in.design.md, the.tsmust not redeclare it. The CONTRACT.md is the arbiter. - Never edit the
.mdprojection by hand — regenerate from sources.
Reused
src/brands/CONTRACT.md— token ownership boundarysrc/brands/ra.design.md— canonical.design.mdexampleSynthex/packages/brand-config/src/brands/ra.ts— canonical.tsexamplesrc/design-systems/_library/— 140 vendored DESIGN.md files for visual-school anchoring (cite at most one)
Reused utilities
Synthex/packages/brand-config/src/types.ts— schema source of truth (per RA-1985)remotion-studio/src/colour/index.ts—contrast()for WCAG checksremotion-studio/src/design-systems/_library/— 138 vendored reference DESIGN.md files (open-design, Apache-2.0). Cite at most one as a visual-school anchor in the.mdprojection; never copy verbatim- Reference projection:
remotion-studio/src/brands/ra.mdis the canonical example to mirror