video-style-extractor
Skill9 starsChanged 3 months agoMITView on GitHub
Extract complete editing styles from video files for programmatic recreation. Analyzes visual design (colors, fonts, layout, mascot characters), editing patterns (cuts, transitions, timing), motion/animation, audio production, and storytelling structure using Gemini video analysis + scene-aware frame extraction + pixel-art mascot profiling + marketing psychology. Use when asked to "extract a style," "analyze videos," "reverse-engineer a video style," "pull mascot design," or any request to understand and document how a video was made for recreation purposes. Produces STYLE-GUIDE.md (cohort invariants) and optionally MASCOT-KIT/ (reference images + per-generator prompts) for driving AI image and image-to-video generators.
- Reads credentials
- Installs packages
In this repository15 other files it gives its agents.
- ai-voice-humanizerSkill
- blog-writerSkill
- brand-kitSkill
- brand-voice-extractorSkill
- watchSkill
- course-infographicsSkill
- extract-designSkill
- lesson-writerSkill
- mascot-processorSkill
- prompt-enhancerSkill
- remotion-video-builderSkill
- saas-studySkill
- skool-courseSkill
- startup-naming-scorerSkill
- ui-workflowSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
All local helpers live under scripts/ and are invoked as python -m scripts.<module> from the skill directory (cd "${CLAUDE_SKILL_DIR}").
- Distinctive: line 26
Create a working directory:
- Very specific: line 80
Use the Pass A prompt from references/gemini-prompts.md.
- Very specific: line 90
If the user supplies --force-mascot <hint-image>, skip detection and activate Mascot Track with the hint as seed.
- Distinctive: line 94
Only runs if pass C activated it.
- Very specific: line 103
M2. Bounding boxes: use the M2 prompt from references/mascot-prompts.md.
- Distinctive: line 132
M7. Pose clustering: use M7 prompt. Save pose_map JSON.
- Very specific: line 134
M8. Consistency check: use M8 prompt. If variants exist, write MASCOT-VARIANTS.md and proceed with the dominant variant only.
- Very specific: line 136
M9. Canonical frame selection: use M9 prompt. Copy selected file to MASCOT-KIT/canonical-reference.png.
- Very specific: line 144
M11. Constraints: use M11 prompt. Save as structured JSON into mascot-profile.json.
- Very specific: line 146
M12. Prompt distillation: use M12a and M12b prompts.
- Distinctive: line 156
every frame cited by Pass A as hex/typography evidence
- Very specific: line 174
If the run was a single video and you want the deeper per-video breakdown (timeline map, script template, Remotion token block), also …
- Very specific: line 199
Variants are flagged, not blended: If the mascot has design variants across videos, record them in MASCOT-VARIANTS.md and proceed with the …
- Distinctive: line 201
Cite every claim: Every hex, every font, every timing is traceable to a frame path.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Video Style Extractor
Extract the complete editing style from one or more videos, including pixel-art mascot profiles when present, and produce artifacts ready for AI image generators and image-to-video generators.
Prerequisites
- Gemini API key in the environment as
GEMINI_API_KEY. Set it withexport GEMINI_API_KEY="your-key"(add the line to your shell profile to make it stick). - google-genai Python SDK
- ffmpeg and yt-dlp on your PATH
- Python deps from
scripts/requirements.txt:pip install -r "${CLAUDE_SKILL_DIR}/scripts/requirements.txt"
All local helpers live under scripts/ and are invoked as python -m scripts.<module> from the skill directory (cd "${CLAUDE_SKILL_DIR}").
Workflow
Step 1: Acquire videos
Create a working directory:
mkdir -p <working-dir>/per-videoAccept either: a folder of .mp4/.mov files, or a list of URLs. yt-dlp covers YouTube and most public video hosts. For Instagram and TikTok, use whatever downloader you already have available (a scraping service such as Apify works if you have an account; otherwise download the files by hand and point the skill at the folder).
For each source video, create a slug folder:
mkdir -p <working-dir>/per-video/<slug>/{frames,mascot-raw}Step 2: Scene segmentation
For each video, detect cuts with PySceneDetect:
python -m scripts.scene_detect <video> <working-dir>/per-video/<slug>/scenes.jsonStep 3: Scene-aware frame sampling
python -m scripts.scene_aware_sample <video> \
<working-dir>/per-video/<slug>/scenes.json \
<working-dir>/per-video/<slug>/frames/Emits frames/frame_NNNN.jpg plus frames/manifest.json.
Step 3b: Contact sheets (optional, when the output feeds a recreation)
If the extraction is destined for a programmatic recreation (for example the remotion-video-builder skill), also tile each scene's frames into one contact sheet: a start-to-end grid collage. Text-only models cannot watch video, so a contact sheet encodes the motion arc as a single readable image and is the highest-leverage artifact for downstream agents.
# per scene, from the frames already sampled in Step 3
ffmpeg -pattern_type glob -i '<slug>/frames/scene03_*.jpg' \
-vf "scale=480:-1,tile=4x2" -frames:v 1 <slug>/frames/scene03-sheet.jpgPair each sheet with a per-scene recreation prompt from Gemini, describing what has to happen between the first and last cell.
Step 4: Audio metrics
python -m scripts.audio_metrics <video> <working-dir>/per-video/<slug>/audio-metrics.jsonStep 5: Gemini Pass A, cohort visual invariants
Upload frames only (not full videos). Budget: 1 keyframe per scene, capped at 20 per video, capped at 200 total. Downsample proportionally if the cohort exceeds the cap.
Use the Pass A prompt from references/gemini-prompts.md. Save to <working-dir>/cohort-analysis.md.
Step 6: Gemini Pass B, per-video transcript and cadence
For each video, upload the full video via Files API. Use the transcription prompt from references/gemini-prompts.md. Save to per-video/<slug>/gemini-transcript.md.
Step 7: Gemini Pass C, mascot detection
For each video, run the Pass C prompt from references/mascot-prompts.md. Save results. If >=1 video returns mascot_present: true, activate the Mascot Track (Step 8).
If the user supplies --force-mascot <hint-image>, skip detection and activate Mascot Track with the hint as seed.
Step 8: Mascot Track
Only runs if pass C activated it.
M1. Dense extraction: re-sample at 4fps within the mascot-containing ranges only:
# For each mascot-bearing video, for each flagged range:
ffmpeg -ss <start> -t <duration> -i <video> -vf "fps=4" -q:v 2 <slug>/mascot-raw/raw_%04d.jpgM2. Bounding boxes: use the M2 prompt from references/mascot-prompts.md. Drop frames with confidence < 0.6.
M3. Crop + bg-remove: for each kept frame:
# Pillow crop to bbox+10% (inline python or small helper)
python -m scripts.bg_remove <cropped>.png <slug>/mascot-raw/iso_NNNN.png <slug>/mascot-raw/iso_NNNN.meta.jsonM4. Native resolution
python -m scripts.native_resolution <slug>/mascot-raw/iso_0001.png <slug>/native-res.jsonM5. Palette quantization (pool all isolated mascot PNGs across the cohort):
python -m scripts.palette_quantize <slug>/mascot-raw/iso_*.png MASCOT-KIT/palette.jsonAlso emit palette.gpl and palette-swatch.png (use Pillow inline).
M6. Native fps (use the mascot bbox from M2):
python -m scripts.native_fps_detect <video> <slug>/native-fps.json <x> <y> <w> <h>M7. Pose clustering: use M7 prompt. Save pose_map JSON.
M8. Consistency check: use M8 prompt. If variants exist, write MASCOT-VARIANTS.md and proceed with the dominant variant only.
M9. Canonical frame selection: use M9 prompt. Copy selected file to MASCOT-KIT/canonical-reference.png.
M10. Sprite sheet
python -m scripts.sprite_sheet <pose_map.json> MASCOT-KIT/sprite-sheet.pngM11. Constraints: use M11 prompt. Save as structured JSON into mascot-profile.json.
M12. Prompt distillation: use M12a and M12b prompts. Save as MASCOT-KIT/STATIC-PROMPT.md and MASCOT-KIT/ANIMATED-PROMPT.md.
Write MASCOT-KIT/mascot-profile.json aggregating all mascot-track outputs per the schema in references/pipeline-design.md.
Write MASCOT-KIT/MASCOT-EVIDENCE.md, where every claim traces to a specific frame path.
Step 9: Frame verification (main thread)
Using the Read tool, inspect keyframes per video:
- frame at 10%, 25%, 50%, 75%, 90% of duration (scene-snapped)
- every frame cited by Pass A as hex/typography evidence
- 3 random mascot-containing frames per mascot-bearing video
Append YAML corrections to per-video/<slug>/corrections.md:
- claim_id: pass_A#palette#accent_1
original: "#FF6A3D"
corrected: "#FF5A33"
evidence_frame: frames/frame_0034.jpgStep 10: Synthesizer subagent
Dispatch a subagent with the prompt from references/synthesizer-subagent-prompt.md. It produces STYLE-GUIDE.md.
Step 11: Detailed single-video guide (optional)
If the run was a single video and you want the deeper per-video breakdown (timeline map, script template, Remotion token block), also produce STYLE-GUIDE-DETAILED.md using the template at references/detailed-guide-template.md.
Step 12: Run log
Throughout the workflow, call scripts.run_log at every major step to append status, cost, and warnings to <working-dir>/run-log.md. At the end, emit a summary block with:
- total Gemini cost (USD)
- mascot track activation
- low-confidence flags raised
- bg-removal method used per video
Output structure
See references/pipeline-design.md for the canonical structure and JSON schemas. Primary deliverables:
STYLE-GUIDE.md: cohort invariantsMASCOT-KIT/STATIC-PROMPT.md+ANIMATED-PROMPT.md: promptsMASCOT-KIT/canonical-reference.png+sprite-sheet.png+poses/: reference imagesMASCOT-KIT/palette.json+palette.gpl+palette-swatch.pngMASCOT-KIT/mascot-profile.json: canonical machine-readable profile
Key rules
- Always use
gemini-2.5-pro. Flash misses subtle details. - Visually verify keyframes with the Read tool. Gemini gets hex values wrong by 10 to 20% routinely.
- For cohort analysis, upload FRAMES ONLY, not full videos. Stay under the 200-frame budget.
- Variants are flagged, not blended. If the mascot has design variants across videos, record them in
MASCOT-VARIANTS.mdand proceed with the dominant variant. - Low-confidence fields must be flagged, not silently substituted. The prompt distillation (M12) uses qualitative fallbacks when confidence is "low".
- Cite every claim. Every hex, every font, every timing is traceable to a frame path.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

