Auto Shorts Repurposer

Published by sudhakar4103 in p1

Review recommended1 installs

What this skill does

Generate exactly 4 finished short-form clips from a YouTube URL or a local Linux/WSL media path using yt-dlp, Whisper, an LLM segment-selection step, and ffmpeg. Use when the user wants local Shorts, Reels, TikTok clips, or highlight MP4s, not a planning document.

Add Auto Shorts Repurposer to your agent

Review the source and files first. When you are ready, copy the prompt instruction or use the CLI command supported by your environment.

Install with a prompt

Paste this into a compatible coding agent:

add this skill "auto-shorts-repurposer" from https://github.com/sudhakar4103/p1

Install with the CLI

Run this command in a controlled environment after reviewing the repository:

npx skills add https://github.com/sudhakar4103/p1 --skill auto-shorts-repurposer

Skill instructions

Auto Shorts Repurposer

Use this skill when the user says things like:

  • "Make viral clips from this YouTube video"
  • "Create 4 shorts from this file: /home/me/video.mp4"

Goal: produce 4 local MP4 clips plus titles and captions. Do not return a plan-only answer when the media and tools are available.

Prerequisites

  • Run this skill inside WSL, not Windows PowerShell.
  • bash must be available because the workflow calls shell scripts directly.
  • python3 must be installed and available on PATH.
  • yt-dlp must be installed and available on PATH.
  • ffmpeg must be installed and available on PATH.
  • whisper must be installed and available on PATH.
  • The working directory must be writable so the skill can create ./work and ./output.
  • Input must be either a YouTube URL or a valid Linux/WSL file path such as /home/user/video.mp4.

Environment Setup

Install the required packages in WSL before using this skill:

sudo apt update
sudo apt install -y ffmpeg python3 python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install yt-dlp openai-whisper

Preferred setup:

  • Run bash scripts/install.sh for one-command installation and verification.
  • See references/requirements.md for the dependency checklist.

Verify the required binaries before running:

yt-dlp --version
ffmpeg -version
whisper --help
python3 --version

Inputs

  • One source only: a YouTube URL or a local Linux/WSL file path.
  • Optional: audience, platform, language, niche, banned topics.

Allowed tools

  • Local CLI only: yt-dlp, whisper, ffmpeg
  • Normal file reads and writes inside the working directory
  • LLM reasoning only for segment selection and metadata generation

Forbidden tools

  • system.run
  • process.spawn
  • External uploads unless the user explicitly asks for them

Workflow

  1. Create ./work and ./output.
  2. Normalize the source to ./work/input.mp4.
    • If the source is a URL, run bash scripts/download.sh "<URL>" "./work".
    • scripts/download.sh must use yt-dlp -o input.mp4 <URL>.
    • If the source is a local Linux/WSL path, use the same script. It copies the file to ./work/input.mp4.
  3. Transcribe the video.
    • Run bash scripts/transcribe.sh "./work/input.mp4" "./work/transcript".
    • scripts/transcribe.sh must use whisper input.mp4 --output_format json.
  4. Compress the transcript before the LLM step.
    • Run python3 scripts/prepare_transcript.py "./work/transcript/input.json" "./work/transcript_compact.txt".
    • Use ./work/transcript_compact.txt for the LLM selection step.
    • Only fall back to the raw JSON when the compact transcript is missing or invalid.
  5. Use the internal prompt below to select exactly 4 non-overlapping viral segments.
  6. Save the result as ./work/segments.json.
  7. Generate the clips.
    • Run python scripts/clip_generator.py "./work/input.mp4" "./work/segments.json" "./output".
    • scripts/clip_generator.py cuts the clips with ffmpeg -i input.mp4 -ss START -to END -c copy clipX.mp4.
  8. Final response must include 4 clip file paths, titles, and captions.

Execution Rules

  • Execute the steps directly when prerequisites are satisfied.
  • Stop immediately and report the missing dependency if yt-dlp, ffmpeg, whisper, python3, or bash is unavailable.
  • Treat this as a local-only workflow. Do not upload the source, transcript, or clips unless the user explicitly asks.
  • Preserve deterministic behavior: one input, one transcript JSON, one segments.json, and exactly 4 output clips.
  • Keep token usage low by sending the compact transcript to the LLM instead of the full Whisper JSON.
  • If the estimated prompt would still be too large, trim low-signal transcript blocks first and preserve the strongest timestamped passages.

Viral Selection Prompt

From this compact transcript with timestamps, select the 4 most viral-worthy segments.
Criteria:
- strong hook in first 3 seconds
- emotional intensity OR surprising insight
- self-contained meaning
- length between 20-45 seconds

Return JSON:
[
  { "start": "00:10", "end": "00:35", "title": "...", "caption": "..." }
]

Rules:

  • Return exactly 4 objects.
  • Return JSON only.
  • Do not overlap segments.
  • Keep timestamps aligned to the transcript.
  • Prefer clips that make sense without extra setup.

Output Contract

  • output/clip1.mp4
  • output/clip2.mp4
  • output/clip3.mp4
  • output/clip4.mp4
  • Final response format: clipX.mp4, title, caption, full file path for all 4 clips

Failure Rules

  • If yt-dlp, whisper, or ffmpeg is missing, stop and report the missing binary.
  • If the transcript is empty or unusable, stop and say why.
  • Do not publish, upload, or request credentials.

Files included

  • SKILL.md
  • references/troubleshooting.md
  • references/webhooks.md
  • references/requirements.md
  • references/endpoints.md
  • _meta.json
  • references/ux.md
  • references/overview.md
  • scripts/prepare_transcript.py
  • scripts/transcribe.sh
  • references/auth.md
  • scripts/install.sh
  • scripts/clip_generator.py
  • references/safety.md
  • scripts/download.sh

More skills

Auto Shorts Repurposer: Install, Source and Security