Communitygithub.com

Seegin/vibe-masterpiece-skill

End-to-end procedural code-video engine, 7 battle-tested visual styles (Napoleon, Wellington, Saladin, Bismarck, Cao Cao POV, Han Wendi, Minimalist Knowledge), Canvas2D + Dual-Texture WebGL2 GLSL shaders, in-place HPSS audio beat sculpting, and CAMPPlus/Qwen3-TTS/Seed-VC voiceprint lock pipeline. Activate whenever the user asks to plan, design, voice, audio-sculpt, preview, or render deterministic code-driven animations, historical epics, POV dramas, or explainer videos.

What is vibe-masterpiece-skill?

vibe-masterpiece-skill is a Claude Code agent skill that end-to-end procedural code-video engine, 7 battle-tested visual styles (Napoleon, Wellington, Saladin, Bismarck, Cao Cao POV, Han Wendi, Minimalist Knowledge), Canvas2D + Dual-Texture WebGL2 GLSL shaders, in-place HPSS audio beat sculpting, and CAMPPlus/Qwen3-TTS/Seed-VC voiceprint lock pipeline. Activate whenever the user asks to plan, design, voice, audio-sculpt, preview, or render deterministic code-driven animations, historical epics, POV dramas, or explainer videos.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Seegin/vibe-masterpiece-skill/tree/HEAD

Ask in your favorite AI

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

Documentation

Vibe Masterpiece — Procedural Code-Video, WebGL2 Fine-Art & Voiceprint Skill

Turn an AI coding agent into a director, technical artist, audio DSP engineer, and voiceprint supervisor that produces cinema-grade 1080p / 2K deterministic videos (window.render(t)) without AI-video temporal warping or raster slop.


1. Style Router — Pick the Right Paradigm First

Before writing any code, select one unified visual paradigm and one locked palette for the entire film. Read 01_style_matrix_and_recipes.md for exact hex palettes, matTex channel tables, and composition rules:

Style IDArchetypeAspect & SpecEngineSignature Visual & Technical DNA
napoleonImperial Obsidian & Gold Rim (拿破仑风)9:16 (1080×1920 @ 30fps)Canvas2D Dual-BufferObsidian silhouettes (fillAndRim), headVeil backlight separation, lon/lat ink-wash conquest maps with 0.0b ballistic war-pieces, bowed-head push-in awakening, $C^\infty$ sabre slash transitions.
wellingtonCold-Iron & Scarlet Engraving (威灵顿风)9:16 (1080×1920 @ 30fps)Canvas2D + KinematicsAnalytical 2-bone equine IK (solveIK2D + Muybridge gallop/rear), concentric 12-spoke artillery recoil & parabolic shrapnel, triptych split panels, 3D hollow infantry squares, recurring physical anchor prop.
saladinSamarkand Illuminated Watercolor (萨拉丁风)16:9 2K (2560×1440, 1.5× SSAA)WebGL2 Dual-TextureCold-press rag-paper heightfield (wetness > 0.58 organic bleed vs wetness <= 0.35 micro-chiseled dry gouache), 12-tap dual-ring velvet glow, 24K hammered Damascus gold-leaf (Tazhib), Shamsa star transitions.
bismarckPrussian Oil-Gouache & 24K Foil (俾斯麦风)9:16 2K (1440×2560, 1.5× SSAA)WebGL2 Dual-TextureSculpted oil-gouache portraits, burnished Solingen steel & 24K gold-leaf glyphs, Krupp cannon supersonic shockwave refraction wipe + sabre wipe, museum oil-painting vs procedural side-by-side tribute, strict 315px bottom safe zone.
caocaoHan Lacquer, Hemp-Paper & Embodied POV (曹操第一人称连载风)9:16 2K (1440×2560, 1.5× SSAA)WebGL2 + Voiceprint Drama6-color Han mineral lacquer palette (zero blue-purple AI slop), 70% anatomical 1st-person POV hands (palm -> prop -> thumb occlusion) + 30% 3rd-person chiaroscuro (zero laser eyes), blink / sabre / ink semantic transitions, dual-role monologue/dialogue seals & bamboo choice UI.
han_wendiOriental Cinnabar & Bamboo-Slip Chronicle (汉文帝风)9:16 (1080×1920 @ 30fps)Canvas2D + Stroke FXSwinging 12-string 旒 crown beads, stroke-by-stroke brush calligraphy, shattering archaic penalty glyphs, slide-in primary-source bamboo slips, period-vessel data visualization (grain discs, coin strings, terracotta granaries).
minimalMinimalist Dark Knowledge & Data Curve (极简几何知识流)16:9 (1920×1080 @ 30fps)Canvas2D / SVGNear-black vignette (82–94% dark), single amber/cyan accent, 4-layer information density (conclusion headline + procedural geometry/particles + axis/counter callouts + bottom caption; active pixel ratio >= 3.5%).

2. Quick CLI Reference

All tools live under scripts/ and work out of the box with node (Playwright) + python3 (numpy, scipy, Pillow) + ffmpeg:

SKILL_DIR="/path/to/vibe-masterpiece-skill"

# 1. Scaffold a new project with pre-wired Canvas2D or WebGL2 engine
bash "$SKILL_DIR/scripts/new_project.sh" my_project "项目标题" --style bismarck

# 2. Extract 0.005-BPM beat grid, DROP/VACUUM bars, and 60Hz audio_env.js
python3 "$SKILL_DIR/scripts/audio/analyze_bgm.py" path/to/bgm.mp3 --project-dir my_project

# 3. Sculpt in-place low-point drumless muffle (ZERO section cutting!) or find loop bars
python3 "$SKILL_DIR/scripts/audio/sculpt_audio.py" hpss-pause \
  --input my_project/music/full_backup.wav --output my_project/music/full.wav \
  --t-low 79.51 --t-deep 81.55 --t-pickup 83.22 --t-drop 83.59

python3 "$SKILL_DIR/scripts/audio/sculpt_audio.py" correlate-bars \
  --input my_project/music/full.wav --bpm 117.725 --phase 0.002

# 4. Instant keyframe visual QA (3-5s; supports headless WebGL2 via SwiftShader)
cd my_project/video
node "$SKILL_DIR/scripts/render/render_par.mjs" index.html check/preview --preview 0.5,4.8,12.2,24.5

# 5. Parallel master MP4 render + 1.5x Lanczos BT.709 downsample + 30-tile sheet + QA gate
node "$SKILL_DIR/scripts/render/render_par.mjs" index.html out/final.mp4 \
  --duration 150.0 --audio music/full.wav --workers 8 --sheet check/final_sheet.png

For multi-act POV dialogue dramas (caocao paradigm), use the generalized voiceprint toolkit in scripts/voiceprint/:

  • purify_voice_corpus.py: 192-d CAMPPlus speaker cosine filter + pyin $f_0$ check + zero 3-gram overlap stem pairing.
  • train_qwen3_dual_lora.py: <6.5 GB VRAM Dual-Loss (talker + code_predictor) Hybrid LoRA SFT for Qwen3-TTS-12Hz-1.7B-Base.
  • npc_voiceprint_sts_pipeline.py: Cross-act NPC voiceprint lock + Qwen3-VoiceDesign -> Seed-VC STS extreme acting transfer + faster-whisper recall gate.

3. Standard 6-Stage Production Pipeline

Stage 1: Fact Verification & Acoustic Beat Mapping

  • Verify every date, troop count, institutional number, and primary-source quote (zero fabricated quotes).
  • Run analyze_bgm.py on the BGM; inspect music/beatmap.json and research/audio_overview.png for DROP downbeats, VACUUM cliffhangers, and active_sub_beats (3.5b eighth-note pickups).
  • If the dramatic arc needs longer breathing room, run sculpt_audio.py correlate-bars to extend at zero-crossings (similarity >= 0.98), then re-run analyze_bgm.py.

Stage 2: Beat-Locked PLAN.md & Anchor Object Design

  • Draft PLAN.md before coding scenes:
    • Cold Open (0s .. FirstDrop): Concrete visual/sensory hook in the first 2 seconds (前2秒强钩子), building into FirstDrop.
    • Act I–II: Rise, institutional pillars (progressive bar-by-bar sub-beats, never static holds >6s), borderless cartographic conquests (0.0b bar-downbeat slams), and multi-angle battlefields (never boxed inside strokeRect spreadsheet frames).
    • Act III (Low-Point -> Climax): In-place HPSS muffled push-in or POV choice vacuum -> pickup spark -> explosive drop return.
    • Finale: Recurring physical anchor object payoff (e.g., King's Shilling -> Waterloo Silver Medal) + dialectical legacy + solemn memorial.

Stage 3: 20–28s Style Sample (sample_v1.mp4) Gate

  • For a new protagonist or style, render a 20–28s sample spanning FirstDrop first, inspect keyframes via read_file, and align aesthetics with the user before scaling to 2–4 minutes.
  • For voiced multi-act dramas, export 3 short MP3 audition clips (01_opening_drop, 02_npc_climax_ducking, 03_outro_swell) and ear-audit via read_file before any 2K video render.

Stage 4: Modular Procedural Engineering

Stage 5: Mandatory Dual-Frame --preview Gate

Before full rendering, run --preview and visually inspect PNGs with read_file:

  1. Protagonist & Garments: Consistent crown/cockade insignia across all acts; headVeil separating head from bright skies; Chinese historical robes strictly 交领右衽 (y-collar, left lapel overlapping right).
  2. Directional Physics (hitT - 0.08s & hitT + 0.02s): Canvas2D +Y points down! Sample both pre-impact and impact frames on every strike, throw, falling shutter, or war-piece jump to confirm motion direction and zero label overlap.
  3. Safe Zone: On 9:16 vertical videos, keep y = 1605 .. 1920 (315px bottom zone) 100% clear of subtitles/stamps so platform UI never covers captions.

Stage 6: Parallel Master Render & Delivery QA

  • Run render_par.mjs with --sheet check/final_sheet.png (runs qa_video.py automatically).
  • Inspect check/final_sheet.png via read_file, verify zero low-density accidental blackouts, and generate UPLOAD.md with platform titles and a <300-character primary-source citation note.

4. Non-Negotiable Determinism & Anti-Slop Laws

  1. Pure Function of Time t: Expose window.render(t) (seconds) and set window.__ready = true after document.fonts.ready. Strictly zero Math.random() (use rng(seed)), requestAnimationFrame, setTimeout, Date.now(), or CSS transitions.
  2. WebGL2 Buffer Preservation: Always create WebGL2 contexts with preserveDrawingBuffer: true and finish frames with gl.flush(); gl.finish(); so headless multi-worker screenshots never capture blank buffers.
  3. Sharpness Separation in WebGL2: Foreground characters, faces, eyes, hands, horses, and armor MUST write wetness <= 0.35 in matTex.r (pin-sharp dry gouache micro-chisel); reserve wetness = 0.60..0.95 strictly for skies, mist, water, and ink washes.
  4. Zero Blue-Purple AI Slop: Never default to 225°–300° neon blue-purple gradients or mixed raster clipart. Lock one historical mineral/oil/engraving palette from frame 0 to the final frame.

Related Skills