remotion-composition-builder
실제 작업을 수행합니다. 다른 모든 것을 읽고 TSX를 작성합니다.
트리거
remotion-orchestrator계획의 4단계(Wave 4)- 사용자가 브랜드와 스토리보드가 이미 알려진 상태에서 "{주제}에 대한 컴포지션 빌드"를 요청할 때
입력
동일한 작업의 이전 스킬 출력물에서 모두 가져옵니다:
BrandConfig(src/brands/{slug}.ts에서) — 런타임 및 동작: voice, voiceover, motion, audience, channel, forbiddenWords{slug}.design.md(src/brands/loadDesign.ts에서loadDesign(slug)로 로드) — 시각적 토큰: 색상, 타이포그래피, 간격, 구성 요소, 레이아웃, elevation- 스토리보드 JSON (
remotion-screen-storyteller에서) - 레이아웃 명세 (
remotion-designer에서) — 이름으로 design.md 토큰 참조 - 모션 블록 (
BrandConfig의 일부) - 채널 명세 / 종횡비 (
remotion-marketing-strategist에서)
BrandConfig와 design.md 간의 전체 소유권 경계는 src/brands/CONTRACT.md를 참조하세요.
방법
- 컴포지션 찾기 —
src/compositions/{Name}.tsx가 존재하는가?- 예 → 그 자리에서 패치 (기존 API 유지).
- 아니요 →
Explainer.tsx를 템플릿으로 사용하여 새 파일 생성.
- 임포트 연결 — 런타임용
import { brands } from '../brands', 시각적 토큰용import { loadDesign, colour, spacing, componentRecipe, typography } from '../design', 모션 헬퍼용../motion. - 스키마 정의 — 스토리보드 형태와 일치하는 입력 props에 대한
z.object. - 장면 구성 — 스토리보드 장면당 하나의
<Sequence>. 각 장면 구성 요소는cfg = brands[props.brand](motion/voice/voiceover용) 및tokens = loadDesign(props.brand)(색상/타이포그래피/간격/구성 요소 레시피용)를 읽고 조합합니다. hex를 인라인으로 사용하는 대신componentRecipe(tokens, 'cta-primary')를 사용하여 완전히 해석된 CSS 준비 객체를 얻습니다. - 오디오 — 경로가 설정된 경우 장면당
<Audio src={staticFile(scene.voiceoverAudioPath)} />연결. - Root에 등록 —
src/Root.tsx에<Composition id="{Name}" ... />추가 또는 업데이트.durationInFrames = sum(scene.durationSec) * fps. - 파일 위생 — 컴포지션 파일 500줄 이하. 그 이상 커지면 장면을
src/compositions/{Name}/scenes/*.tsx로 추출. - 타입 검사 —
npx tsc --noEmit실행. 오류 시 수정 후 한 번 재시도.
출력
수정된 파일:
src/compositions/{Name}.tsx(또는 장면 하위 파일)src/Root.tsx(등록 항목)
remotion-orchestrator에 상태 보고:
{ "composition": "Explainer", "filesChanged": [...], "tscPassed": true, "ready": true }
경계
- 브랜드 값(hex 코드, 글꼴 이름, 간격 리터럴)을 절대 인라인으로 사용하지 말 것 — 항상
tokens(시각적) 또는cfg(런타임)에서 읽어야 함. 각 항목의 소유권은CONTRACT.md참조. durationInFrames를 스토리보드 장면 길이 × fps를 합산하지 않고 설정하지 말 것.- 존재하지 않는 에셋 경로에 대해
staticFile()을 호출하지 말 것 — 빌드 시 명확하게 실패하고, 렌더링 시 조용히 넘어가지 않도록. - 진입 모션을 위해
signatureEntry()를 우회하지 말 것 — 모션 언어의 일관성 유지. BrandConfig.ts와{slug}.design.md간에 토큰을 중복하지 말 것. 값이.design.md에 있으면.ts에서 다시 선언하지 않아야 함.
재사용
src/compositions/Explainer.tsx— 표준 템플릿src/motion/index.ts—signatureEntry,brandFadeIn,staggerStartsrc/colour/index.ts—readableOn,brandGradient,contrastsrc/design/index.ts—loadDesign,colour,spacing,typography,componentRecipe,resolveTokensrc/brands/loadDesign.ts—{slug}.design.md용 타입 로더src/brands/CONTRACT.md—BrandConfig↔design.md소유권 경계
다음으로 넘김
실제 렌더링을 위해 remotion-render-pipeline으로 전달.