cto-legends · module overview · studio · MIT
legends-capcut: Agent-Native CapCut Desktop Compiler, Patcher & Critic
Agent-native editing for CapCut Desktop: compile a plain JSON timeline into a real CapCut project, read any project back into scenes, surgically patch one scene with ripple sync, render six-frame storyboards, and audit reveal-aware text readability over CLI or stdio MCP.
GitHub Repository (https://github.com/avalonreset/legends-capcut)
CapCut Desktop is where short-form video gets finished, yet it exposes zero public automation API. Unguided agents trying to edit CapCut projects break in predictable ways: they hand-write malformed draft_content.json files CapCut silently ignores, rewrite entire timelines to tweak one shot, forget the Timelines/ parity copy CapCut actually loads, leave orphan media in Resources/, and cannot see whether text on screen stayed readable long enough.
legends-capcut closes every gap with a deterministic bidirectional compiler and surgical patcher on the Python standard library. Feed in a plain JSON timeline spec with video, overlay, text, and audio tracks, transitions, in/out animations, source-window keyframes, beat markers, fades, ducking, and review burn-in, and it writes a complete, validated CapCut Desktop project. Run inspect in the opposite direction on any project, including hand-cut projects, to decode scenes S01, S02, and onward read-only.
Surgical patch-scene edits replace, trim, extend, shorten, rewrite statements, or punch individual scenes while rippling later clips and keeping untouched tracks byte-identical. Every patch validates in memory before writing a byte, copies replacement media only after validation succeeds, and refuses to mutate hand-cut or protected projects. Built-in six-frame perpetual storyboards, reveal-aware readability and overstay audits, local effect and keymap discovery, optional Windows playback watch, and a 21-tool stdio MCP server let agents assemble and critique a cut before a human opens CapCut for final taste and export.
Deterministic Execution Boundary
Why Unguided Agent CapCut Edits Break Real Timelines
Raw JSON edits drift out of sync with CapCut Desktop's Timelines/ mirror, corrupt source-window keyframe timing, overwrite hand-cut drafts, or leave unreadable split-second text flashes undetected.
- Bidirectional Compiler & Multi-Copy Atomic Parity: Compiles specs into complete CapCut projects and saves root draft_content.json, .bak, and Timelines/<id> mirrors together through atomic renames, then re-validates every track, reference, and source-window keyframe.
- Surgical Single-Scene Patching With Zero Orphan Media: Replaces clips and adjusts duration in a single call, ripples downstream segments cleanly, validates in memory before touching disk, and leaves untouched tracks byte-identical.
- Generated-Draft Safety Lock & Path Confinement: Writes strictly to projects carrying .legends_capcut_generated.json, refuses hand-cut and protected drafts with PermissionError, and blocks symlinks, directory junctions, and draft-escaping placeholders.
- Perpetual Storyboards & Reveal-Aware Readability Critic: Renders six-frame per-scene contact sheets with timecodes and motion deltas, measures when on-screen text finishes revealing, and flags late reveals and dead overstays automatically.
CLI Subcommands & Capability Surface
- Bidirectional Draft Compiler & Inspector: Compiles JSON specs with video, overlay, text, audio, transitions, animations, keyframes, beat markers, fades, ducking, and review burn-in into CapCut projects, or reads any project back into scenes S01..SN read-only.
- Surgical Single-Scene Patcher & Track Flags: Replaces media, changes duration in one call, trims, extends, rewrites statements, toggles scale punches, hides review burn-in, and mutes or hides tracks with ripple sync and in-memory pre-write validation.
- Perpetual Six-Frame Storyboards: Extracts six timestamped frames per scene with motion deltas, density class, and on-screen copy so an agent can audit an entire cut visually before opening CapCut.
- Reveal-Aware Readability & Overstay Critic: Measures when animated statements finish revealing, checks post-reveal reading absorption time, ignores review burn-in tracks, and catches late reveals and frozen overstays.
- Beat Sync, Local Effects & Active Keymap Discovery: Maps audio tempo, beats, downbeats, and sections, catalogs locally cached CapCut effects and transitions by name, and resolves your active CapCut shortcut preset read-only.
- 21-Tool Stdio MCP Server & Optional Windows GUI Eyes: Mirrors every CLI command one-to-one as capcut_* stdio MCP tools, plus optional Windows GUI launch, project open, playback filmstrip capture, and active keymap actions.
Raw Frontier LLM vs. legends-capcut Execution Matrix
- Draft Format & Timelines Parity: Standard AI Chat (Edits root draft_content.json alone while ignoring Timelines/<id> mirrors and .bak copies, causing CapCut to open stale timelines or reject the draft.) vs. With legends-capcut (Writes root draft, .bak, and Timelines copies atomically together and validates all 55 material buckets, references, and source-window keyframes before finishing.) · legends-capcut validate confirms zero errors and root_timeline_parity: true.
- Single-Scene Edits & Media Hygiene: Standard AI Chat (Rebuilds the whole timeline to swap one clip, desyncs downstream audio/text cues, or copies replacement files into Resources/ even when edits fail.) vs. With legends-capcut (Patches one scene with ripple sync, checks requested duration before copying media, validates in memory first, and keeps untouched tracks byte-identical.) · Refused patches write zero files and leave Resources/, draft_content.json, and draft_meta_info.json unchanged.
- Hand-Cut Project Safety: Standard AI Chat (Mutates existing human-edited CapCut projects directly or follows unsafe relative paths outside the draft directory.) vs. With legends-capcut (Refuses any project missing .legends_capcut_generated.json or matching protected names, and blocks symlinks, Windows junctions, and path escapes.) · PermissionError (exit code 2) enforced before any write target opens.
- Pacing & Readability Proof: Standard AI Chat (Ships timelines blind from JSON durations without noticing late text reveals or static frozen frames.) vs. With legends-capcut (Generates six-frame scene storyboards and reveal-aware readability audits measuring effective post-reveal read time.) · Structured JSON critic dossier plus per-scene PNG contact sheets.
Explicit Safety Boundaries & Exclusions
- Does not render or export final MP4 video files; CapCut Desktop remains the human finishing and export tool.
- Never modifies hand-cut CapCut projects or protected project names; writes are strictly gated to drafts carrying .legends_capcut_generated.json.
- Never contacts the network, automates CapCut cloud accounts, or downloads proprietary CapCut effects or templates.
- Optional gui commands target Windows with a local desktop bridge; core compiler, reader, validator, patcher, beat sync, storyboards, and readability run standalone cross-platform.
Operator FAQ
- Can legends-capcut corrupt or overwrite my hand-edited CapCut Desktop projects?
- No. inspect, validate, scan-effects, keymap, and doctor are strictly read-only. Every write command refuses any draft that does not carry a .legends_capcut_generated.json marker, refuses protected project names outright, validates mutations in memory before touching disk, and writes atomically.
- Does legends-capcut require Windows or a GUI bridge to compile and patch timelines?
- No. The core compiler, reader, validator, surgical scene patcher, beat sync, six-frame storyboards, readability critic, and stdio MCP server run cross-platform on Python 3.11+ with zero mandatory pip dependencies. Only the optional gui commands (launching CapCut and capturing live playback filmstrips) require Windows and a local desktop bridge.
- Why output an editable CapCut project instead of rendering a flat FFmpeg video?
- Flat programmatic renders force you back to code every time you want to nudge a cut, swap a transition, or polish color and audio. legends-capcut handles the tedious multi-track assembly, beat alignment, surgical patching, and pacing review while leaving you a native CapCut project you can refine and export directly.
- How does legends-capcut chain with the other cto-legends studio modules?
- Pull source footage and clips with legends-youtube or legends-obs, generate instrumental beds with legends-stable-audio-3, align active-word subtitles with legends-captions, assemble and review the editable project in legends-capcut, and ship the finished export as a frozen private draft via legends-youtube.
Work Directly With Benjamin (Async-First Advisory & 48-Hour Diagnostics)
Message Benjamin directly by text or voice note at /dm, or start at /home#home-offer: Step 1: Missing customers study ($256) (48-hour service-area Google Maps heatmap, competitor demand report, site teardown, and ranked fix checklist), Step 2: Tech & marketing game plan ($1,024) (full study plus software/vendor/agency cut list, custom AI workflow map, and 90-day execution plan), or Step 3: Fractional CTO retainer ($4,096/mo) (same-day direct line to Benjamin, study and game plan kept current, second opinion on every quote or hire, and on-demand live screen-shares under the one-page retainer agreement).
All cto-legends Packages (CLI Router + On-Demand Modules)
cto-legends · GitHub: Stop memorizing CLI flags and managing dozens of skill folders. Register one vendor-agnostic router skill with any AI coding agent, speak to your coding agent in plain english, and let it load curated open-source tools on demand with every change previewed first.
legends-empire · GitHub: Turn your local Markdown vault into source-cited AI agent memory: ships the Seven Provinces starter map (Work, Money, Craft, Home, People, Self, Ambition), instant local search, SHA-256 research intake, the Ontology Engine, and hash-locked transactions.
legends-hetzner · GitHub: Scan live European Hetzner Cloud CX43, CX33, CX23, and CAX stock, compare Fractional CTO x86 and ARM64 sizing, and enforce 10-check SHA-256 preflight plans before provisioning or sniping any server.
legends-coolify · GitHub: Audit your self-hosted Coolify v4 servers, Docker container states, deployment queues, Dockerfile/Compose environment variable keys, and database backup schedules over pinned read-only HTTPS with zero secret exposure.
legends-cloudflare · GitHub: Execute preview-first Cloudflare DNS updates and cutovers that preserve orange-cloud proxy states, guard multi-record hostnames, and verify every change via live API readback.
legends-astro · GitHub: Complete agency Astro v7 lifecycle: Day-1 greenfield starters, multi-framework and WordPress or Webflow migrations, two-pass asset localization, Day-2 article publishing with 301-safe renames, baseline manifest regression gating, and Visual Digital Twin diffing.
legends-gohighlevel · GitHub: Operate GoHighLevel sub-accounts, batch-clone V2 snapshots with headless PIT minting, X-ray and rebrand internal workflow steps, stage A2P 10DLC Trust Center profiles, and enforce 5-layer agency permissions and 4-store SaaS rebilling markups.
legends-stripe · GitHub: Audit Stripe .env price IDs, issue orphan-free B2B Hosted Invoices and scan overdue receivables, sync Test and Live price ladders behind SHA-256 plan locks, reconcile fixed-fee drag and net retained cash to the cent, and verify raw-body HMAC webhooks with zero dependencies.
legends-dataforseo · GitHub: Query a 53-route DataForSEO v3 catalog covering Google SERPs, AI Optimization LLM citations, Google AI Mode, Maps, Labs, Backlinks, and On-Page Lighthouse JSON with fail-closed decoy SERP defense, automatic Page-1 /goto domain unmasking, 5x search-operator cost guards, and SHA-256 local evidence banking.
legends-geogrid · GitHub: Map your entire Google Maps territory on a river-clipped radial hexagonal lattice up to 30 positions deep at wholesale DataForSEO rates: 39.5% fewer pins for equal blind-spot accuracy (52.3% fewer with river clipping), 30-layer topography, Winnability relief Campaigns, 3-pane Keyword Stuffing studio, Strategy Room avoid zones, and a 5-page vector-hex PDF.
legends-firecrawl · GitHub: Run the 15-route Firecrawl v2 catalog (lfc) and 114-provider Alexandria data catalog (lax) with fail-closed SERP verification, /goto platform resolution, local PDF/DOCX parsing, 43M research papers, and SHA-256 local evidence banking.
legends-grant · GitHub: Search federal, state, and foundation grants across 56 US jurisdictions, verify verbatim eligibility rules against your private company facts, and check proposal budgets to the cent.
legends-youtube · GitHub: Unified YouTube Data API v3, Analytics API v2, Studio packaging, and verified yt-dlp media archiving CLI: 2-unit channel inventory, 0-quota outlier and public readback radar, Perfect Video Score idea scoring, anonymous SHA-256 yt-dlp batch capture, GPU word-timed FFmpeg clips, lossless ETag metadata updates, SHA-256 private-draft uploads, and an 18-file Empire knowledge pack.
legends-obs · GitHub: Automate OBS Studio over its local WebSocket v5 server with scene and source filter topology audits, audio gain and track preflight, idle-only profile backups, window-aware scene switching, and FFprobe canary clip verification.
legends-capcut · GitHub: Agent-native editing for CapCut Desktop: compile a plain JSON timeline into a real CapCut project, read any project back into scenes, surgically patch one scene with ripple sync, render six-frame storyboards, and audit reveal-aware text readability over CLI or stdio MCP.
legends-captions · GitHub: Repair misheard technical terms, lock letter-by-letter acronym timing, render frame-accurate 9:16 and 16:9 ASS subtitles, and format injection-safe FFmpeg burn-in filtergraphs.
legends-stable-audio-3 · GitHub: Preview-first Stable Audio text-to-audio, audio-to-audio, and inpainting CLI studio with duration/seed/credit guardrails, SHA-256 WAV/MP3 stem banking, and active-cue loudness mastering.
legends-hyperyap · GitHub: Push-to-talk local GPU voice dictation for Windows, macOS, and Linux: transcribe speech offline with NVIDIA Parakeet and paste straight into your active editor or terminal.
legends-ambient-intelligence · GitHub: Offline voice-memo and field-recording transcription pipeline: archive USB voice recorders with SHA-256 deduplication, run local faster-whisper or Parakeet ASR, stitch 15-minute recorder rollovers, and distill structured legends-empire Markdown notes.
legends-temporal · GitHub: Replace fragile crontabs, sleep loops, and rate-limited chat-app schedulers with server-side Temporal schedules, one-shot start_delay timers, first-class cto-legends --module scheduling, live orphaned-queue and inventory drift audits, local/Docker/systemd cluster bootstrap blueprints, and single-screen event-history failure verdicts.
legends-jev · GitHub: Local Python OCR and visual verification for UI screenshots, exact original-image pixel_box coordinates, Street View storefront signage audits, and 120s-gated UI action advice.
legends-buzz · GitHub: Operate self-hosted Block Buzz Nostr relays, validate NIP-01/NIP-19 secp256k1 Bech32 and hex keys, route all 26 Buzz domains through token-compact CLI calls, diagnose NIP-29 and NIP-FI membership 403s, isolate reply threads, and lock relay publishing behind SHA-256 plan hashes.
legends-a2ui · GitHub: Offline-first A2UI v1.0, v0.9.1, v0.9, and v0.8 toolkit: strict schema and graph validation, deterministic legacy normalization, curated interactive surface composition, zero-coupling JSON-to-A2UI projection, zero-daemon file:// HTML previewing, and Precision Noir React, WebCore, and Lit renderer scaffolding.
legends-github · GitHub: GitHub repository audit, release readiness, DataForSEO 20-topic SEO discovery, non-destructive README scoring, and 1280x640 Open Graph social preview pixel-parity CLI for coding agents.