Skip to content

notpritam/forge

Repository files navigation

Forge

A self-improving AI video production pipeline. Topics go in, finished videos come out. The system learns from every review and gets smarter over time.

Forge is a markdown-first, CLI-driven system built to produce short-form educational videos at scale. It pairs Claude Code with 5 specialized renderers (Manim, Remotion, Motion Canvas, Three.js, Lottie), a rules engine that accumulates production knowledge, and a React dashboard for monitoring.

How It Works

Topic → Research → Script → Scenes → Render → Audio → Post-Production → Review → Archive
         │                    │                   │                          │
         │                    │                   │                          ▼
         │                    │                   │                    Rules Engine
         │                    │                   │                    (learns from
         │                    ▼                   ▼                     feedback)
         │              Renderer Selection   ElevenLabs TTS              │
         ▼              (auto or manual)     + Music + SFX              │
   Deep research                                                        │
   from web sources                                                     ▼
                                                               Next video is better

Every video lives in its own folder with a status.md tracking its pipeline stage. The system is stage-gated — nothing advances until the previous stage validates. After review, feedback is parsed into permanent rules that apply to all future videos.

The Pipeline

Stage What Happens Output
INBOX Topic arrives (manual or from ideas file) brief.md
RESEARCH Deep-dive research from multiple sources research/ folder with findings
SCRIPT Outline → Draft → Final (all rules loaded) script/final.md
SCENES Script converted to renderer-specific code .py, .tsx, or .ts scene files
RENDER Scenes compiled into video renders/full/{slug}.mp4
AUDIO Voiceover (ElevenLabs), music, SFX mixing audio/ folder
POST-PRODUCTION Captions, trimming, platform cuts renders/cuts/
REVIEW Human watches, gives feedback review/feedback.md

After review, feedback is extracted into permanent rules via /extract-rules. The system never makes the same mistake twice.

The Rules Engine

The brain of Forge. Three tiers:

  • HARD rules (129 viral content rules) — never violated. Sourced from 35+ research papers and creator analyses.
  • SOFT rules — preferred patterns, can be overridden with justification.
  • Guidelines — per-renderer learned preferences that accumulate over time.

Rules cover:

  • Hook mechanics (must land in 1.7s, triple-channel delivery)
  • Retention patterns (visual change every 2-3s, open loops, pacing curves)
  • Platform algorithm signals (DM sends > saves > comments > likes on IG)
  • Educational structure (one concept, Veritasium method, second-person narration)
  • Audio mixing (voice at 120-130 wpm, music 18-20dB below)
  • Technical specs per platform (resolution, duration sweet spots, safe zones)

Every script and scene is validated against all rules before output. Violations are flagged.

Renderers

Renderer Best For Format
Manim Math, algorithms, data viz, 3Blue1Brown-style Python .py
Remotion Motion graphics, text-heavy, branded, editorial React .tsx
Motion Canvas Pixel-perfect animations, precision tweening TypeScript .ts
Three.js 3D visualizations, WebGL, spatial data React Three Fiber .tsx
Lottie Micro-animations, icons, lightweight embeds JSON

Renderer selection is automatic based on content type, or manually overridden via /select-renderer.

Dashboard

A React + Hono dashboard for real-time pipeline visibility.

  • Frontend: http://localhost:4729 — Vite + React 19 + Tailwind
  • Backend: http://localhost:4730 — Hono API reading project markdown files

Pages:

  • Dashboard — Active projects with pipeline stage indicators
  • Inbox — Pending topics awaiting production
  • Output — Rendered videos with playback
  • Rules — Browse and search the full rules engine

Start with: start-forge (global script)

Project Structure

forge/
├── inbox/                       # Topics land here
├── projects/                    # One folder per video
│   └── {slug}/
│       ├── brief.md             # Topic + research summary
│       ├── research/            # Deep research output
│       ├── script/              # outline → draft → final
│       ├── scenes/              # Renderer-specific source
│       ├── audio/               # TTS + music + SFX
│       ├── renders/             # Output (full/ + cuts/)
│       ├── review/              # Feedback + changelog
│       └── status.md            # Pipeline stage tracker
├── rules/                       # The brain (learned rules)
│   ├── viral.md                 # 129 HARD viral rules
│   ├── content.md               # Script/pacing rules
│   ├── visual.md                # Visual style rules
│   ├── rendering.md             # Technical output settings
│   ├── mistakes.md              # Anti-patterns
│   ├── per-renderer/            # Renderer-specific rules
│   └── log.md                   # Rule addition history
├── renderers/                   # Renderer configs + styles
│   ├── manim/
│   ├── remotion/
│   ├── motion-canvas/
│   ├── threejs/
│   └── lottie/
├── templates/                   # New project templates
├── dashboard/                   # React + Hono monitoring UI
│   ├── client/                  # Vite + React frontend
│   └── server/                  # Hono API backend
├── scripts/                     # Validation + pipeline scripts
├── media/                       # Shared media assets
├── output/                      # Final exports
└── archive/                     # Completed projects

Workflow Commands

These are Claude Code slash commands that drive the pipeline:

/forge-status              Show active projects and pipeline state
/new-video {topic}         Create project, kick off research
/research {slug}           Deep-dive research
/write-script {slug}       Generate script (loads all rules)
/build-scenes {slug}       Convert script to renderer scenes
/render {slug}             Compile scenes to video
/add-audio {slug}          Generate voiceover + mix
/post-produce {slug}       Captions, trim, platform cuts
/review-video {slug}       Record feedback
/extract-rules             Parse feedback into permanent rules
/check-rules {slug}        Validate against all rules
/archive {slug}            Move to archive

Standard loop: forge-status → new-video → research → write-script → build-scenes → render → add-audio → post-produce → review-video → extract-rules → archive

Git Workflow

main                    ← Rules, templates, renderers, tooling
  └── video/{slug}      ← Video production branch (WIP allowed)

Each video is produced on its own branch. Merged to main after archiving.

The Learning Loop

This is what makes Forge different from a one-shot video generator:

┌─────────────────────────────────────────────────┐
│                                                  │
│   Make Video → Review → Extract Rules            │
│        ↑                      │                  │
│        │                      ▼                  │
│        └──── Next video loads all rules ─────────┘
│                                                  │
└─────────────────────────────────────────────────┘
  1. You produce a video and watch the result
  2. You provide feedback: "the hook was too slow", "transitions felt jarring", "text was too small"
  3. /extract-rules parses feedback into concrete rules with unique IDs
  4. Those rules are permanently written to the rules engine
  5. Every future video loads those rules during script and scene generation
  6. The system never repeats the same mistake

After 10 videos, Forge knows your style. After 50, it's an extension of your creative instincts.

Skills (21 installed)

Forge uses Claude Code skills for domain-specific knowledge:

Category Skills
Renderers remotion-best-practices, remotion, remotion-render, manim-video, manim, manim-video-teacher, motion-canvas, threejs-animation, threejs-shaders, threejs-fundamentals, lottie-animator
Motion Design video-motion-graphics, motion-designer, css-animations
Audio elevenlabs, zai-tts
Post-Production ffmpeg, video-editing
Content video (marketing), ai-video-generation
Integration remotion-to-hyperframes (HeyGen avatar export)

Setup

Prerequisites:

  • Node.js 20+
  • Python 3.11+ (for Manim)
  • Claude Code with skills installed
  • FFmpeg (for post-production)
  • ElevenLabs API key (for voiceover)
# Clone
git clone git@github.com:notpritam/forge.git
cd forge

# Install dashboard dependencies
cd dashboard/client && npm install && cd ../..
cd dashboard/server && npm install && cd ../..

# Install Manim (for math/algorithm videos)
pip install manim

# Install Remotion (for motion graphics)
cd renderers/remotion && npm install && cd ../..

# Start the dashboard
start-forge

Extending Forge

Add a New Renderer

  1. Create renderers/{name}/config.md with: when to use, defaults, CLI command
  2. Create rules/per-renderer/{name}.md for learned preferences
  3. Add a scene template in templates/project/scenes/{name}/
  4. Add renderer-specific skills to .agents/skills/

Add New Rules

Run /extract-rules after any review, or manually add to the appropriate rules file:

- [ID-NNN] Rule statement. Evidence or reasoning.

Rules need: unique ID, clear statement, and ideally a source.

Add a New Skill

Drop skill files in .agents/skills/{category}/. They're auto-discovered by Claude Code.

Design Principles

  1. The system gets smarter with every video — feedback becomes permanent rules
  2. Rules over intuition — load and follow rules, don't generate from scratch
  3. One concept per video — clarity beats comprehensiveness
  4. Stage-gated pipeline — no shortcuts, each stage validates before the next
  5. Human directs, AI executes — you choose topics, approve scripts, review output
  6. Git-trackable, human-readable — everything is markdown, nothing is opaque
  7. Renderer-agnostic — the pipeline works regardless of which renderer produces the frames

License

MIT

About

Self-improving AI video production system — stage-gated pipeline with 5 renderers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors