Skip to content

Pipeline brain: Claude feature-detection + media pipeline (animated graphics, ElevenLabs script, Suno music)#1

Merged
ralyodio merged 3 commits into
masterfrom
feat/pipeline-claude-media
Jun 28, 2026
Merged

Pipeline brain: Claude feature-detection + media pipeline (animated graphics, ElevenLabs script, Suno music)#1
ralyodio merged 3 commits into
masterfrom
feat/pipeline-claude-media

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

Ports the qaaas QA feature-detection flow into makedemo and extends it for marketing demo videos. This is the pipeline brain half of the makedemo upgrade — it pairs with the web-upload UI being built in parallel on feat/web-app (same job / emit(type, data) contract, so it's a drop-in).

Crawl the site → Claude picks demo-worthy features → screen-record each (Playwright) → Claude writes one cohesive voiceover script + a surreal/metal suno.com music prompt → synthesize VO (ElevenLabs) → assemble motion graphics + recorded clips + user-uploaded clips + a ducked Suno trackdemo.mp4.

Stages (src/pipeline/)

  • discover: crawl.js (same-origin BFS, optional login) + feature-detect.js (Claude claude-opus-4-8, adaptive thinking, zod structured output)
  • record: feature-recorder.js (Playwright recordVideo per feature)
  • script: script-writer.js (cohesive VO script + paste-ready suno.com surreal/metal prompt)
  • voiceover: voiceover.js (ElevenLabs; reuses existing src/audio/generator.js)
  • assemble: timeline.js + graphics.js (ffmpeg motion cards + lower-thirds; optional Remotion) + music.js (loop + sidechain-duck Suno song under VO) + assembly.js

Orchestrated by runPipeline(job, emit) in src/pipeline/index.js. Full architecture + web integration contract in docs/PIPELINE.md.

The 4 product decisions

  • Web upload UI → drop-in for the parallel feat/web-app shell (job.clips / job.song carry uploads).
  • Claudeclaude-opus-4-8 + adaptive thinking + structured outputs; heuristic fallback with no key.
  • Suno upload + generate prompt → emits a paste-ready surreal/metal suno.com prompt; uploaded clip looped + ducked under VO.
  • Full motion graphics → ffmpeg backend (animated mandelbrot cards + kinetic type + lower-thirds) default; opt-in Remotion (MKDEMO_REMOTION=1).

Tests

  • pnpm run test:pipeline13 passing (timeline math, ducking filter, URL globs).
  • All 14 pipeline modules import clean; zodOutputFormat(schema)json_schema with @anthropic-ai/sdk@0.106 + zod@4.
  • Graceful degradation: no Anthropic key → heuristics; no ElevenLabs → timed silent VO; no song → VO-only; no Remotion → ffmpeg cards.

Not yet (see docs/PIPELINE.md)

  • E2E run needs API keys + npx playwright install chromium + ffmpeg (structured, not run here).
  • Remotion composition scaffolded behind the flag; ffmpeg backend is default + functional.
  • Recorder uses a light step-interpreter; a Claude action-loop (à la qaaas browser-agent) is the next upgrade.

🤖 Generated with Claude Code

ralyodio and others added 2 commits June 27, 2026 17:10
… brain

Port the qaaas QA feature-detection flow into makedemo and extend it for
marketing demo videos: crawl the whole site, let Claude pick the demo-worthy
features (structured output), screen-record each feature, let Claude write one
cohesive voiceover script + a surreal/metal suno.com music prompt, synthesize
the voiceover (ElevenLabs), and assemble motion graphics + recorded clips +
user-uploaded clips + a ducked Suno background track into the final MP4.

Designed as a drop-in for the parallel web-upload shell (feat/web-app): same
job + emit(type, data) contract, exported runPipeline(job, emit).

- src/pipeline/{crawl,feature-detect}: same-origin BFS crawl + Claude feature
  detection (claude-opus-4-8, adaptive thinking, zod structured output), with a
  heuristic fallback when no ANTHROPIC_API_KEY.
- src/pipeline/feature-recorder: Playwright recordVideo per feature.
- src/pipeline/script-writer: cohesive VO script + suno.com surreal/metal prompt.
- src/pipeline/voiceover: ElevenLabs TTS (reuses existing audio generator).
- src/pipeline/{timeline,graphics,music,assembly}: timeline math, ffmpeg motion
  graphics (animated cards + lower-thirds; optional Remotion backend), suno song
  looped + sidechain-ducked under the voiceover, final ffmpeg assembly.
- 13 unit tests for the pure pieces (timeline, ducking filter, URL globs).
- docs/PIPELINE.md documents the architecture + web integration contract.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ks, drawtext escaping

Adds 17 tests (13 -> 30 total):
- schemas: zod validation of feature/feature-detection/demo-script shapes
- detectFeatures heuristic path (no ANTHROPIC_API_KEY): maxFeatures, skips
  login/privacy, de-dupes paths, required shape
- writeScript heuristic path: intro/outro bookends, every feature once, every
  uploaded clip placed with a valid index, non-empty surreal/metal suno prompt
- escapeDrawtext: colon/percent/backslash/apostrophe/null handling

Exports escapeDrawtext from graphics.js for testing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ages/core)

PR #2 already merged this pipeline into master under packages/core/src/pipeline.
Resolved the conflicts so PR #1 adds NO duplicate code:
- dropped the root src/pipeline copy (canonical lives in @makedemo/core)
- took master's test/pipeline (they import packages/core) and root package.json
- kept only the unique bits: scripts/run-pipeline.js (a standalone local runner,
  now importing @makedemo/core) + the `pipeline` npm script + .env.example
  (ANTHROPIC_API_KEY / MKDEMO_REMOTION).

30 pipeline tests pass; runner resolves runPipeline from packages/core.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ralyodio

Copy link
Copy Markdown
Contributor Author

Rebased/merged onto master and resolved conflicts by de-duplicating: the pipeline brain itself already merged via #2 (now lives in packages/core/src/pipeline/ and is live on makedemo.app behind MKDEMO_PIPELINE_BRAIN).

To avoid a duplicate root copy, this PR now reduces to the non-redundant bits only:

  • scripts/run-pipeline.js — a standalone local runner for the brain (imports @makedemo/core), plus the pipeline npm script
  • .env.exampleANTHROPIC_API_KEY / MKDEMO_REMOTION entries

Net diff vs master is 3 files; no duplicated pipeline/tests. pnpm run test:pipeline → 30 passing. Mergeable/clean.

(If you'd rather not keep a separate local runner, this PR can simply be closed — #2 already carries everything.)

@ralyodio ralyodio merged commit 6953e88 into master Jun 28, 2026
2 checks passed
@ralyodio ralyodio deleted the feat/pipeline-claude-media branch June 28, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant