feat: Creative Studio — material (物料) production capability#2
Merged
Merged
Conversation
WHAT (additive): - Creative.sourceRef + tags (scene provenance + LLM creative tags) - CreativeBrief: a production brief (product/audience/angle/platforms/languages) - CreativeVariant: DCO matrix cell (platform×format×hook×language) with fitted copy + produced Creative link + platform-spec conformance status - IAB Dynamic Content Ads aligned (base + swappable slots); back-relations; FKs cascade; prisma validate/generate + tsc clean Ref: docs/growth/00-cuddler-first-redesign.md §6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…dation The core of the material (物料) capability. Per-platform/placement specs (TikTok in-feed, Meta Reels/Feed, Google App, Apple Search Ads) grounded in published 2025–26 guidance, in one editable place. validateCreative distinguishes fixable issues: needs_resize (dims/ratio) vs needs_transcode (duration/size/container) vs rejected (wrong kind); ASA → not_applicable (uses store product page). 11 vitest cases. Ref: docs/growth/03-creative-studio.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…back) fitText/fitCopy (word-boundary truncation within limits), validateCopy, generateCopy (LLM asked to respect char limits, deterministic fallback when no key, output always fitted so it never exceeds platform maximums). 12 vitest cases. Ref: docs/growth/03-creative-studio.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
buildVariantMatrix: brief → platform×format×hook×language cells (IAB DCO fan-out), deduped + capped with truncation reported. buildStoryboard: hook→ scene→end-card structure with cumulative timings; a Cuddler scene ref becomes the scene segment. 8 vitest cases. Ref: docs/growth/03-creative-studio.md · 01-5k-pilot-plan.md §P4 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
WHAT: - scene-import.ts: parseScenes + mapSceneToCreative (source=imported_scene, reviewStatus=pending) + tagScenes (LLM character/emotion/style/language with deterministic fallback) + fallbackTags - POST /api/ingest/scenes?org=: HMAC-authed, idempotent by (orgId, sourceRef), imports scenes as review-gated Creatives — must pass creatives/review before any platform push (IP/authorization gate) - 6 vitest cases; tsc + eslint clean Ref: docs/growth/00-cuddler-first-redesign.md §6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
WHAT: - POST /api/creatives/studio: brief → buildVariantMatrix → generate platform- fitted copy per variant → CreativeVariant rows (spec status); GET list/detail - /creatives/studio: brief form (product/audience/angle/hooks/platforms/langs) → variant matrix table with spec-status lights; sidebar entry - docs/growth/03-creative-studio.md — full pipeline spec - 138 vitest total; tsc + eslint + next build clean Ref: docs/growth/03-creative-studio.md · 00-cuddler-first-redesign.md §6 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The material (物料) production capability for the Cuddler growth OS. Turns a brief into a DCO variant matrix of platform-fitted ad creative, and imports Cuddler scenes as review-gated creatives. Stacked on #1.
Grounded in research: IAB Dynamic Content Ads schema (base creative + swappable slots), the open-source creative-automation pipeline pattern (brief → multi-format localized assets), and published 2025–26 platform specs (TikTok in-feed 9:16 1080×1920 5–60s ≤500MB; Meta Reels/Feed; Google App; Apple Search Ads).
Pipeline
Brief → variant matrix (platform × format × hook × language) → platform-fitted copy → spec validation → produce → review → pushModules (
src/lib/growth/, all pure + unit-tested)creative-specs.ts— per-platform spec registry +validateCreative(conforms / needs_resize / needs_transcode / rejected; ASA → uses store page)creative-copy.ts—generateCopyfitted to each platform's char limits (LLM + deterministic fallback; output never exceeds maximums)creative-brief.ts—buildVariantMatrixDCO fan-out (deduped, capped, truncation reported)storyboard.ts— hook → scene → end-card composition; a Cuddler scene ref becomes the scene segmentscene-import.ts— scene → review-gated Creative + LLM/fallback taggingSchema
Creative.sourceRef/tags;CreativeBrief;CreativeVariant(DCO matrix cell) + migration.Surfaces
POST/GET /api/creatives/studio·POST /api/ingest/scenes(HMAC, idempotent) ·/creatives/studioUI (brief → matrix with spec lights) + sidebar entry.Gates
Review-gated (imported scenes =
reviewStatus=pending— the IP/authorization gate); spec-safe (no push untilconforms); bounded matrix (cap 40, truncation reported).Verification
138 vitest ·
prisma validate/generate·tsc·eslint·next build— all green.Not included (needs external services)
Actual asset rendering (variants → Seedream/Seedance2 jobs), transcode/crop, and platform push of produced creatives.
🤖 Generated with Claude Code