计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
shorts-creation【效率与协作】Transforms long YouTube/Google Drive videos into multiple captioned vertical shorts through a multi-step workflow
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
This skill executes a multi-task sequential workflow:
┌─────────────────────┐
│ 1. Download Video │ ← Input: YouTube URL or Drive URL
└──────────┬──────────┘
↓
┌─────────────────────┐
│ 2. Transcribe Audio │ ← Tool: OpenAI Whisper
└──────────┬──────────┘
↓
┌─────────────────────┐
│ 3. Recommend Clips │ ← Tool: Gemini AI
└──────────┬──────────┘
↓
┌─────────────────────┐
│ 4. Configure Subs │ ← User confirms settings
└──────────┬──────────┘
↓
┌─────────────────────┐
│ 5. Generate Shorts │ ← FFmpeg + subtitle burn-in
└──────────┬──────────┘
↓
┌─────────────────────┐
│ 6. Upload to Drive │ ← Tool: Google Drive MCP
└─────────────────────┘
From YouTube URL:
Create shorts from this YouTube video: https://youtube.com/watch?v=abc123
Target: 3-5 shorts, 30-45 seconds each
From Google Drive:
Make shorts from this Drive video: https://drive.google.com/file/d/FILE_ID
Focus on tutorial segments
Add yellow subtitles
With Specific Preferences:
Create shorts from: https://youtube.com/watch?v=xyz789
Number of shorts: 5
Duration: 15-30 seconds
Subtitle style: Bold white text with black outline
Position: Bottom center
Objective: Retrieve source video for processing
From YouTube:
yt-dlp -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" \
-o "source_video.%(ext)s" \
"https://youtube.com/watch?v=VIDEO_ID"
From Google Drive:
Tool: google-drive
Method: download_file
Parameters: {
"file_id": "extracted_from_url",
"destination": "source_video.mp4"
}
Output: Downloaded source video file
Objective: Generate accurate transcript with timestamps
Using OpenAI Whisper:
Extract audio from video:
ffmpeg -i source_video.mp4 -vn -acodec pcm_s16le -ar 16000 \
-ac 1 audio.wav
Transcribe with Whisper (if available via MCP or local):
# Example using OpenAI Whisper API
import openai
with open("audio.wav", "rb") as audio_file:
transcript = openai.Audio.transcribe(
model="whisper-1",
file=audio_file,
response_format="verbose_json",
timestamp_granularity="word"
)
Parse transcript into timestamped segments:
{
"segments": [
{
"start": 0.0,
"end": 3.5,
"text": "Welcome to this tutorial on React hooks"
},
{
"start": 3.5,
"end": 8.2,
"text": "Today we're going to learn about useState"
}
]
}
Generate SRT subtitle file:
1
00:00:00,000 --> 00:00:03,500
Welcome to this tutorial on React hooks
2
00:00:03,500 --> 00:00:08,200
Today we're going to learn about useState
Fallback (if Whisper unavailable):
Output: Full transcript with timestamps (SRT format)
Objective: Identify most viral-worthy segments using AI analysis
Using Gemini AI:
Prepare analysis prompt for Gemini:
You are a viral content expert analyzing video transcripts to identify
the most engaging segments for social media shorts.
Video Title: [title]
Duration: [duration]
Platform: YouTube Shorts, Instagram Reels, TikTok
Full Transcript:
[Insert timestamped transcript]
Task: Identify the 5-7 best segments for short-form content. For each segment:
1. Start and end timestamps
2. Duration (15-60 seconds)
3. Hook quality (why it's engaging)
4. Viral potential (high/medium)
5. Recommended title
6. Target platform focus
Prioritize segments with:
- Strong opening hooks
- Self-contained complete thoughts
- Actionable tips or surprising facts
- Emotional or funny moments
- Clear value proposition
Send to Gemini via Google AI MCP:
Tool: google-ai (Gemini)
Method: generate_content
Parameters: {
"model": "gemini-pro",
"prompt": [analysis_prompt],
"temperature": 0.7
}
Parse Gemini's recommendations:
{
"recommendations": [
{
"segment_id": 1,
"start": "00:00:45",
"end": "00:01:15",
"duration": 30,
"hook": "Starts with common mistake everyone makes",
"viral_potential": "high",
"title": "Stop Making This React Mistake",
"platform": "TikTok (problem-solution format)",
"transcript": "Here's a mistake I see beginners make..."
},
// ... more segments
]
}
Present recommendations to user:
**AI-Recommended Segments:**
🔥 Segment 1: "Stop Making This React Mistake" (30s)
Time: 0:45 - 1:15
Hook: Opens with common mistake
Viral Potential: HIGH
Best for: TikTok, YouTube Shorts
⭐ Segment 2: "useState in 30 Seconds" (28s)
Time: 3:10 - 3:38
Hook: Quick, actionable tutorial
Viral Potential: HIGH
Best for: All platforms
[... more segments ...]
**Which segments would you like to create?**
Select: [All] [1,2,4] [Custom]
Allow user to:
Output: Approved list of segments with timestamps and metadata
Objective: Configure subtitle appearance with user preferences
Present Configuration Options:
**Subtitle Configuration**
Please confirm or customize subtitle settings:
1. Font Family:
[ ] Arial (Default)
[ ] Helvetica
[ ] Impact (Bold, attention-grabbing)
[ ] Montserrat (Modern, clean)
[Custom font name]
2. Font Size:
[ ] Small (32px) - Subtle
[ ] Medium (48px) - Default
[ ] Large (64px) - High visibility
[ ] Extra Large (80px) - Maximum impact
3. Font Color:
[ ] White (Default)
[ ] Yellow (High visibility)
[ ] Cyan/Light Blue
[Custom hex color: #FFFFFF]
4. Text Outline/Stroke:
[ ] Black outline (3px) - Default
[ ] No outline
[ ] Custom color/thickness
5. Background:
[ ] None (transparent) - Default
[ ] Semi-transparent black box
[ ] Subtle shadow
6. Position:
[ ] Bottom Center (Default)
[ ] Top Center
[ ] Middle Center
[ ] Custom (y-offset)
7. Animation:
[ ] None - Static
[ ] Fade in per word (TikTok style)
[ ] Karaoke style (word highlight)
Default Settings:
Font: Arial Bold
Size: 48px
Color: White (#FFFFFF)
Outline: Black 3px
Background: None
Position: Bottom center (y=100px from bottom)
Animation: None (static)
Save Configuration:
{
"subtitle_config": {
"font": "Arial-Bold",
"size": 48,
"color": "#FFFFFF",
"outline_color": "#000000",
"outline_width": 3,
"background": "none",
"position": "bottom_center",
"y_offset": 100,
"animation": "none"
}
}
Output: Finalized subtitle configuration for video generation
Objective: Create 9:16 vertical videos with burned-in subtitles
For Each Approved Segment:
Extract segment from source video:
ffmpeg -ss 00:00:45 -i source_video.mp4 -t 30 -c copy segment_raw.mp4
Convert to vertical 9:16 format:
# Smart crop to vertical (center-focused)
ffmpeg -i segment_raw.mp4 \
-vf "scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920" \
-c:a copy segment_vertical.mp4
Extract segment subtitle from full transcript:
1
00:00:00,000 --> 00:00:03,500
Here's a mistake I see beginners make
2
00:00:03,500 --> 00:00:07,200
They forget to include the dependency array
Burn in subtitles with configured style:
ffmpeg -i segment_vertical.mp4 -vf "subtitles=segment.srt:force_style='\
FontName=Arial-Bold,\
FontSize=48,\
PrimaryColour=&HFFFFFF&,\
OutlineColour=&H000000&,\
Outline=3,\
Alignment=2,\
MarginV=100'" \
-c:a copy segment_with_subs.mp4
Alternative (drawtext for word-by-word):
# For animated karaoke-style subtitles
ffmpeg -i segment_vertical.mp4 -vf "drawtext=textfile=words.txt:\
fontfile=/path/to/Arial-Bold.ttf:fontsize=48:fontcolor=white:\
borderw=3:bordercolor=black:x=(w-text_w)/2:y=h-100:\
enable='between(t,START_TIME,END_TIME)'" \
segment_with_subs.mp4
Add fade in/out:
ffmpeg -i segment_with_subs.mp4 \
-vf "fade=t=in:st=0:d=0.5,fade=t=out:st=29.5:d=0.5" \
-c:a copy segment_final.mp4
Optimize for mobile:
ffmpeg -i segment_final.mp4 \
-c:v libx264 -preset medium -crf 23 \
-vf "scale=1080:1920" \
-c:a aac -b:a 128k \
-movflags +faststart \
short_01_final.mp4
Apply naming convention:
[source_title]_short_[01-99]_9x16.mp4
Example: react_tutorial_short_01_9x16.mp4
Repeat for all approved segments
Output: Multiple vertical short videos with burned-in subtitles
Objective: Save files locally and upload to cloud storage
Local Export:
Create output directory structure:
output/
├── shorts/
│ ├── react_tutorial_short_01_9x16.mp4
│ ├── react_tutorial_short_02_9x16.mp4
│ └── ...
├── metadata/
│ └── shorts_metadata.json
└── subtitles/
├── short_01.srt
└── ...
Generate metadata file:
{
"source_video": "Complete React Tutorial",
"source_url": "https://youtube.com/watch?v=abc123",
"created_date": "2026-01-07",
"shorts_generated": 5,
"shorts": [
{
"filename": "react_tutorial_short_01_9x16.mp4",
"duration": 30,
"original_timestamp": "00:00:45 - 00:01:15",
"title": "Stop Making This React Mistake",
"description": "Common useState mistake and how to fix it",
"hashtags": ["#react", "#coding", "#programming", "#webdev"],
"platform_recommendations": ["TikTok", "YouTube Shorts"]
}
]
}
Upload to Google Drive:
Use upload-to-drive skill to batch upload:
Tool: google-drive (via upload-to-drive skill)
Upload all shorts to:
Video Projects/Shorts/React Tutorial/
Files:
- All MP4 files → Finals/
- Metadata JSON → Finals/
- SRT files → Subtitles/
Generate shareable links for each short
Create summary document in Drive:
**Shorts Creation Summary**
Source: Complete React Tutorial
Created: 2026-01-07
Total Shorts: 5
**Files:**
1. react_tutorial_short_01_9x16.mp4
Link: https://drive.google.com/file/d/...
Title: Stop Making This React Mistake
Duration: 30s
[... continue for all shorts ...]
**Recommended Hashtags:**
#react #coding #webdev #programming #tutorial
**Platform-Specific Notes:**
- YouTube Shorts: Upload as-is, max 60s
- TikTok: Shorts 1, 4, 5 have strong hooks
- Instagram Reels: All shorts suitable
Output: All shorts saved locally and uploaded to Google Drive with shareable links
User Request:
Create shorts from https://youtube.com/watch?v=xyz789 Focus on beginner-friendly segments Use yellow subtitles with black background
Agent Execution:
✓ Task 1: Downloading Video
Source: "React Hooks Complete Guide" (22:15)
Resolution: 1920x1080
Downloaded: react_hooks_guide.mp4 (145 MB)
✓ Task 2: Transcribing Audio
Using: OpenAI Whisper
Processing audio... [Progress: 100%]
Generated: full_transcript.srt (485 lines)
Duration: 22:15
✓ Task 3: AI Segment Analysis (Gemini)
Analyzing transcript for viral segments...
Gemini Recommendations:
🔥 Segment 1: "useState Explained in 30 Seconds" (28s)
Time: 02:15 - 02:43
Hook: "Here's what most tutorials don't tell you about useState"
Viral Score: 9/10
Reason: Quick, actionable, addresses common confusion
⭐ Segment 2: "Fix This Common Hook Mistake" (32s)
Time: 07:45 - 08:17
Hook: "This mistake crashes your app"
Viral Score: 10/10
Reason: Problem-solution format, relatable error
⭐ Segment 3: "useEffect Dependency Array Trick" (25s)
Time: 12:30 - 12:55
Hook: "One simple trick saves hours of debugging"
Viral Score: 8/10
Reason: Specific tip, time-saving
✓ Segment 4: "Custom Hooks in 40 Seconds" (38s)
Time: 16:20 - 16:58
Hook: "Custom hooks are easier than you think"
Viral Score: 7/10
Reason: Beginner-friendly, empowering
✓ Segment 5: "React Hook Rules Explained" (35s)
Time: 19:10 - 19:45
Hook: "Break these rules and React breaks"
Viral Score: 8/10
Reason: Clear rules, consequences shown
Recommended: Create Segments 1, 2, 3, 5 (4 shorts total)
User confirms: "Create all 5"
✓ Task 4: Subtitle Configuration
Applying custom settings:
- Font: Arial Bold
- Size: 52px (larger for readability)
- Color: Yellow (#FFFF00)
- Background: Semi-transparent black box
- Outline: None (background provides contrast)
- Position: Bottom center, 120px from bottom
✓ Task 5: Generating Shorts
Creating 5 vertical shorts with subtitles...
[1/5] "useState Explained in 30 Seconds"
✓ Extracted segment (02:15 - 02:43)
✓ Converted to 9:16 (1080x1920)
✓ Burned in yellow subtitles
✓ Added fade transitions
✓ Optimized: react_hooks_short_01_9x16.mp4 (12.3 MB)
[2/5] "Fix This Common Hook Mistake"
✓ Extracted segment (07:45 - 08:17)
✓ Converted to 9:16 (1080x1920)
✓ Burned in yellow subtitles
✓ Added fade transitions
✓ Optimized: react_hooks_short_02_9x16.mp4 (13.8 MB)
[3/5] "useEffect Dependency Array Trick"
✓ Extracted segment (12:30 - 12:55)
✓ Converted to 9:16 (1080x1920)
✓ Burned in yellow subtitles
✓ Added fade transitions
✓ Optimized: react_hooks_short_03_9x16.mp4 (10.5 MB)
[4/5] "Custom Hooks in 40 Seconds"
✓ Extracted segment (16:20 - 16:58)
✓ Converted to 9:16 (1080x1920)
✓ Burned in yellow subtitles
✓ Added fade transitions
✓ Optimized: react_hooks_short_04_9x16.mp4 (16.2 MB)
[5/5] "React Hook Rules Explained"
✓ Extracted segment (19:10 - 19:45)
✓ Converted to 9:16 (1080x1920)
✓ Burned in yellow subtitles
✓ Added fade transitions
✓ Optimized: react_hooks_short_05_9x16.mp4 (14.7 MB)
All shorts generated successfully!
Total: 5 videos, 67.5 MB
✓ Task 6: Uploading to Google Drive
Uploading to: Video Projects/Shorts/React Hooks Guide/
[Upload Progress]
✓ react_hooks_short_01_9x16.mp4
✓ react_hooks_short_02_9x16.mp4
✓ react_hooks_short_03_9x16.mp4
✓ react_hooks_short_04_9x16.mp4
✓ react_hooks_short_05_9x16.mp4
✓ shorts_metadata.json
All files uploaded successfully!
🎉 Shorts Creation Complete!
📁 Google Drive Links:
📊 Summary:
🎯 Publishing Recommendations:
#️⃣ Suggested Hashtags: #react #reacthooks #javascript #webdev #coding #programming #tutorial #learntocode