Communitygithub.com

investment-chart-video

Create viral 9:16 TikTok/Reels/Shorts investment timeline videos using HyperFrames with real monthly Yahoo Finance data, historical event pins, CEO lead avatar, dynamic Y-axis scaling, TikTok safe zones, and synthesized rhythmic audio.

What is investment-chart-video?

investment-chart-video is a Claude Code agent skill that create viral 9:16 TikTok/Reels/Shorts investment timeline videos using HyperFrames with real monthly Yahoo Finance data, historical event pins, CEO lead avatar, dynamic Y-axis scaling, TikTok safe zones, and synthesized rhythmic audio.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hungorharry/investment-chart-video-skill/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Investment 10-Year Viral Chart Video

Build high-retention, repeatable 9:16 vertical finance storytelling videos (e.g., "If you invested $1,000 in [TICKER] 10 years ago...") rendered deterministically to MP4 via HyperFrames.

Core Rules (Learned from Production)

  1. No Spoilers in the Hook: Never reveal the final dollar amount in the opening hook or sub-hook. Use curiosity hooks like WHAT EVENTS CHANGED EVERYTHING?.
  2. Real Monthly Data Only: Fetch exact monthly split-adjusted prices up to the current month using scripts/fetch_monthly_prices.py (Yahoo Finance API). Never invent or smooth out real market crashes.
  3. Research Latest Catalysts: Always search the web for the latest major price-moving events (including recent scandals, earnings, splits, or macro shocks) before finalizing the events array.
  4. Zero-Flicker & Zero-Jitter Chart Rendering:
    • Pre-mount all SVG milestone groups (<g id="ms-0">...) and circular image pins (<g id="pin-0">...) in static HTML. Update only transform and opacity per frame—never rewrite innerHTML containing <image> elements.
    • Plot exact whole-month vertices (0..floor(currIdx)) plus one interpolated tip (currIdx, currPrice). Never re-sample intermediate points with Math.ceil(currIdx * k) or shake the chart container, which causes line jitter.
  5. Visual Polish & Readability:
    • TikTok 9:16 Safe Zone: Keep all main content inside top: 185px, right: 150px (clear of right action buttons), bottom: 235px (clear of captions).
    • Full Event Thumbnails: Use object-fit: contain; padding: 4px; background: #ffffff; on .event-thumb so products/hardware are never cropped.
    • Large Markers: Use r="25" (50px) for circular milestone photo pins on the line and r="34" (68px) for the leading CEO/founder avatar dot.
    • All 4 Y-Axis Labels: Always render all 4 horizontal gridline price labels (100%, 67%, 33%, $0).
    • Subtle Motion Background: Drift the background grid slowly and float faint grayscale company logos (opacity: 0.055) via GSAP timeline.
    • No Middle Dots: Never use • anywhere in copy; use | or —.
    • No Footer Clutter: Do not place small disclaimer/safe-zone notes at the bottom of the frame.

Modes

  1. Mode 1 — Single Asset (templates/compositions/race.html): Deep-dive into one stock/coin (NVDA, AAPL, BTC-USD) with a CEO intro, dynamic Y-axis, milestone photo pins, and Market Cap tracking.
  2. Mode 2 — 2-Company Versus (templates/compositions/versus.html): Head-to-head race between two assets (e.g., FPT.VN vs VNM.VN, AAPL vs MSFT, BTC-USD vs NVDA). Both start at the same initial capital (e.g., 100M VND for .VN tickers, $1,000 for US/Crypto) and race on a shared dynamic Y-axis with lead-change card highlighting.
  3. Mode 3 — Top 10 Bar Chart Race (templates/compositions/race10.html): Fast-paced 20s Bar Chart Race comparing 15 contenders (Top 10 visible) with real company logos, Market Cap, smooth Gaussian-interpolated Y-axis rank swaps (getSmoothedRank + getSmoothedMult), warm 115 BPM audio (--duration 20, no high-pitched arps/ticks), and an End Winner Spotlight (17.1s → 20.0s) that blurs the race board (blur(8px)) and pops up a centered Champion modal dynamically populated from the actual #1–#3 finishers.

Workflow

  1. Fetch Real Monthly Prices:
    • Single asset:
      python scripts/fetch_monthly_prices.py --ticker NVDA --start 2016-01-01 --out monthly.json
      
    • Multi-company comparison / Top 10 Bar Chart Race (including Vietnam stocks with .VN suffix):
      python scripts/fetch_monthly_prices.py --tickers XOM,CVX,COP,EOG,SLB,OXY,MPC,VLO,PSX,HAL,DVN,BKR,FANG,KMI,WMB --start 2016-01-01 --out race15_monthly.json
      
  2. Research Events & Download Real Assets:
    • Search for 6–7 key historical catalysts (including the latest current-month news) and download authentic images (CEO portrait, hardware/product photos, crisis/crash visuals, company SVG logo) into assets/.
  3. Generate Clean Audio (BGM + SFX):
    python scripts/generate_audio.py --duration 30 --out-dir assets/
    
  4. Scaffold & Customize HyperFrames Project:
    • Start from templates/index.html and templates/race.html.
    • Embed the monthly [YYYY-MM, price] array and events list.
    • Align <audio> data-start timestamps for sfx_pop.mp3 and sfx_crash.mp3 with each milestone's exact arrival time (t = start + (ev.idx / TOTAL_MONTHS) * duration).
  5. Verify & Render MP4:
    npx hyperframes check --json
    npx hyperframes snapshot --at 0.5,12.0,28.5 --json
    npx hyperframes render --output out.mp4 --json
    

Related Skills