Auto Shorts Repurposer
Published by sudhakar4103 in p1
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/p1Install 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-repurposerSkill 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.
bashmust be available because the workflow calls shell scripts directly.python3must be installed and available onPATH.yt-dlpmust be installed and available onPATH.ffmpegmust be installed and available onPATH.whispermust be installed and available onPATH.- The working directory must be writable so the skill can create
./workand./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.shfor one-command installation and verification. - See
references/requirements.mdfor 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.runprocess.spawn- External uploads unless the user explicitly asks for them
Workflow
- Create
./workand./output. - Normalize the source to
./work/input.mp4.- If the source is a URL, run
bash scripts/download.sh "<URL>" "./work". scripts/download.shmust useyt-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.
- If the source is a URL, run
- Transcribe the video.
- Run
bash scripts/transcribe.sh "./work/input.mp4" "./work/transcript". scripts/transcribe.shmust usewhisper input.mp4 --output_format json.
- Run
- 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.txtfor the LLM selection step. - Only fall back to the raw JSON when the compact transcript is missing or invalid.
- Run
- Use the internal prompt below to select exactly 4 non-overlapping viral segments.
- Save the result as
./work/segments.json. - Generate the clips.
- Run
python scripts/clip_generator.py "./work/input.mp4" "./work/segments.json" "./output". scripts/clip_generator.pycuts the clips withffmpeg -i input.mp4 -ss START -to END -c copy clipX.mp4.
- Run
- 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, orbashis 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.mp4output/clip2.mp4output/clip3.mp4output/clip4.mp4- Final response format:
clipX.mp4, title, caption, full file path for all 4 clips
Failure Rules
- If
yt-dlp,whisper, orffmpegis 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

