anything-to-skill
Convert any content source into a working agent skill.
The Pipeline (14 Steps)
- Collect source URL(s) from user
- Get metadata —
yt-dlp --dump-json (title, channel, date, duration)
- Download transcript —
yt-dlp --write-auto-sub --sub-lang en --sub-format vtt --skip-download
- Extract visual frames — 3-tier fallback (see Video Extraction below)
- Analyze transcript via subagent (methodology, tools, prompts, tips)
- Analyze frames via subagent or direct Read (tool UIs, settings, prompts on screen)
- Cross-reference transcript + frames (flag visual-only findings)
- Multi-source merge — if multiple sources: compare methodologies, flag differences, synthesize best of both
- Brainstorm skill design (clarifying questions, approach options)
- Write spec + review loop
- RED test — baseline without skill (what does the agent get wrong?)
- GREEN write — minimal skill addressing specific baseline gaps
- REFACTOR test — verify skill closes all gaps
- Cleanup — delete downloaded videos, temp frames, VTT files
3-Tier Video Extraction
Attempted in order. Move to the next tier only on failure.
Tier 1 — Video Download + ffmpeg (DEFAULT, most robust)
# Download at 720p max to limit file size (36-100MB typical)
yt-dlp -f "bestvideo[height<=720]+bestaudio/best[height<=720]" --merge-output-format mp4 -o "/tmp/video.mp4" "URL"
# Extract frames at 1 per 15 seconds, 1920px wide
ffmpeg -i /tmp/video.mp4 -vf "fps=1/15,scale=1920:-1" -q:v 2 /tmp/frames/frame-%03d.jpg
# ALWAYS delete video file after frame extraction
rm /tmp/video.mp4
- 100% reliable in testing. 88 frames from a 22min video in 28 seconds.
- Must delete video file immediately after frame extraction.
- Requires:
yt-dlp, ffmpeg
Tier 2 — Playwright Browser (FALLBACK)
node /tmp/yt-capture.mjs <videoId> <outputDir> <intervalSec> <startTime> <maxFrames>
- UNRELIABLE for YouTube. Player crashes after ~12-13 rapid seeks ("Something went wrong"). Both test videos failed identically at ~2:45.
- Useful for non-YouTube sources or when video download is blocked.
- Requires: Playwright + Chromium (
npx playwright install chromium)
- Script at
/tmp/yt-capture.mjs — write it fresh each time (~80 lines)
Tier 3 — Transcript Only (LAST RESORT)
yt-dlp --write-auto-sub --sub-lang en --skip-download --sub-format vtt -o "/tmp/transcript" "URL"
- Always works. ~100-300KB files.
- Misses ALL visual content — tool UIs, generated images, settings, website results.
- Auto-generated captions have no punctuation and phonetically misspell tool names.
Fallback Chain
Tier 1 → success? → extract frames → delete video → analyze
└── fail? → Tier 2 → success? → analyze frames
└── fail? → Tier 3 (transcript only, warn user of reduced quality)
Why Frame Analysis Is Not Optional
Transcript-only analysis misses ~30-40% of actionable detail. Proven categories of missed content:
| Category |
Example |
| Tool UI details |
Tool has 6+ models visible in dropdown — transcript only mentioned 3 |
| Post-gen features |
Upscale, Enhancer, Relight, Inpaint buttons visible — never mentioned verbally |
| Exact settings |
Model, Quality, Size values visible in sidebar — not spoken |
| URLs |
Actual URLs visible in browser bar — never spoken |
| Prompt text on screen |
Exact prompts in tool UI that were paraphrased in speech |
| Tool names |
Phonetic misspelling in auto-captions vs actual name visible in UI |
| Feature discovery |
Features shown in UI but barely explained verbally |
Multi-Source Handling
When converting multiple videos on the same topic:
- Analyze each independently via parallel subagents
- Create a comparison table (shared techniques vs. different approaches)
- Flag contradictions (different tools, different ordering, different philosophy)
- Synthesize the best of each into the skill — don't average, merge the strongest parts
- Note the source of each technique for attribution
Testing Protocol (TDD for Skills)
For technique/reference skills, use RED/GREEN/REFACTOR:
- RED — Run the target scenario WITHOUT the skill. Document what the agent gets wrong, misses, or doesn't know. This is the gap list.
- GREEN — Write the minimal skill that addresses those specific gaps. No speculation, no "nice to haves."
- REFACTOR — Run the same scenario WITH the skill. Verify every gap is closed. If new gaps appear, update and re-test.
Cleanup Requirements
The skill MUST clean up after itself:
- Tier 1: Delete video file immediately after frame extraction (
rm /tmp/video.mp4)
- Tier 2: Delete Playwright frame PNGs after analysis (
rm -rf /tmp/yt-frames-*)
- Tier 3: VTT files are small, safe to leave or delete
- All tiers: All temp files go in
/tmp/, never in the project directory
- Frame directories: Keep during analysis, delete when skill writing is complete
Known Issues & Workarounds
| Issue |
Detail |
Workaround |
| WebFetch can't parse YouTube |
JS-rendered pages return raw config |
Use yt-dlp for everything |
| WebSearch can't find video IDs |
site:youtube.com returns zero results |
Use yt-dlp --dump-json |
| yt-dlp deno warnings |
n challenge solving fails with TypeError |
Cosmetic — downloads still complete |
| Playwright YouTube crash |
Player errors after ~12-13 rapid seeks |
Fall back to Tier 1 (download + ffmpeg) |
| Auto-captions misspell names |
Phonetic approximations of tool/brand names |
Frame analysis catches the real names |
| Write tool rejection |
Permission prompt timeout in IDE |
Retry the Write — succeeds on second attempt |
Mode Selection
Before parsing, ask the user:
- Autonomous — generate skill without interruption, review after
- Guided — show extracted content, ask what to focus on, then generate
Discovery Mode
Triggers automatically when source lacks full process content. Infers probable workflow, tags steps as [demonstrated] or [inferred], assigns confidence scores. See references/extraction-strategies.md for detection criteria.
Deduplication
Scans installed skills before generating. Recommends: update existing, write new, neither, or both. See references/output-format.md for recommendation logic.
Self-Debugging
Each pipeline stage validates its output. 3 failures at any stage = stop and surface error. Every run produces diagnostic.md. See references/extraction-strategies.md for stage gates and red flags.
1---2name: anything-to-skill3description: Converts YouTube videos, websites, PDFs, and social media clips into executable SKILL.md files. Use when user shares a URL, file path, or content source and wants to turn the demonstrated workflow into a reusable agent skill. Supports autonomous and guided modes with visual frame analysis and multi-source synthesis. Do NOT use for video summarization, content repurposing, or code extraction.4---56# anything-to-skill78Convert any content source into a working agent skill.910## The Pipeline (14 Steps)11121. **Collect** source URL(s) from user132. **Get metadata** — `yt-dlp --dump-json` (title, channel, date, duration)143. **Download transcript** — `yt-dlp --write-auto-sub --sub-lang en --sub-format vtt --skip-download`154. **Extract visual frames** — 3-tier fallback (see Video Extraction below)165. **Analyze transcript** via subagent (methodology, tools, prompts, tips)176. **Analyze frames** via subagent or direct Read (tool UIs, settings, prompts on screen)187. **Cross-reference** transcript + frames (flag visual-only findings)198. **Multi-source merge** — if multiple sources: compare methodologies, flag differences, synthesize best of both209. **Brainstorm** skill design (clarifying questions, approach options)2110. **Write spec** + review loop2211. **RED test** — baseline without skill (what does the agent get wrong?)2312. **GREEN write** — minimal skill addressing specific baseline gaps2413. **REFACTOR test** — verify skill closes all gaps2514. **Cleanup** — delete downloaded videos, temp frames, VTT files2627## 3-Tier Video Extraction2829Attempted in order. Move to the next tier only on failure.3031### Tier 1 — Video Download + ffmpeg (DEFAULT, most robust)3233```bash34# Download at 720p max to limit file size (36-100MB typical)35yt-dlp -f "bestvideo[height<=720]+bestaudio/best[height<=720]" --merge-output-format mp4 -o "/tmp/video.mp4" "URL"3637# Extract frames at 1 per 15 seconds, 1920px wide38ffmpeg -i /tmp/video.mp4 -vf "fps=1/15,scale=1920:-1" -q:v 2 /tmp/frames/frame-%03d.jpg3940# ALWAYS delete video file after frame extraction41rm /tmp/video.mp442```4344- 100% reliable in testing. 88 frames from a 22min video in 28 seconds.45- Must delete video file immediately after frame extraction.46- Requires: `yt-dlp`, `ffmpeg`4748### Tier 2 — Playwright Browser (FALLBACK)4950```bash51node /tmp/yt-capture.mjs <videoId> <outputDir> <intervalSec> <startTime> <maxFrames>52```5354- **UNRELIABLE for YouTube.** Player crashes after ~12-13 rapid seeks ("Something went wrong"). Both test videos failed identically at ~2:45.55- Useful for non-YouTube sources or when video download is blocked.56- Requires: Playwright + Chromium (`npx playwright install chromium`)57- Script at `/tmp/yt-capture.mjs` — write it fresh each time (~80 lines)5859### Tier 3 — Transcript Only (LAST RESORT)6061```bash62yt-dlp --write-auto-sub --sub-lang en --skip-download --sub-format vtt -o "/tmp/transcript" "URL"63```6465- Always works. ~100-300KB files.66- **Misses ALL visual content** — tool UIs, generated images, settings, website results.67- Auto-generated captions have no punctuation and phonetically misspell tool names.6869### Fallback Chain7071```72Tier 1 → success? → extract frames → delete video → analyze73 └── fail? → Tier 2 → success? → analyze frames74 └── fail? → Tier 3 (transcript only, warn user of reduced quality)75```7677## Why Frame Analysis Is Not Optional7879Transcript-only analysis misses ~30-40% of actionable detail. Proven categories of missed content:8081| Category | Example |82|---|---|83| Tool UI details | Tool has 6+ models visible in dropdown — transcript only mentioned 3 |84| Post-gen features | Upscale, Enhancer, Relight, Inpaint buttons visible — never mentioned verbally |85| Exact settings | Model, Quality, Size values visible in sidebar — not spoken |86| URLs | Actual URLs visible in browser bar — never spoken |87| Prompt text on screen | Exact prompts in tool UI that were paraphrased in speech |88| Tool names | Phonetic misspelling in auto-captions vs actual name visible in UI |89| Feature discovery | Features shown in UI but barely explained verbally |9091## Multi-Source Handling9293When converting multiple videos on the same topic:94951. Analyze each independently via **parallel subagents**962. Create a **comparison table** (shared techniques vs. different approaches)973. **Flag contradictions** (different tools, different ordering, different philosophy)984. **Synthesize** the best of each into the skill — don't average, merge the strongest parts995. **Note the source** of each technique for attribution100101## Testing Protocol (TDD for Skills)102103For technique/reference skills, use RED/GREEN/REFACTOR:1041051. **RED** — Run the target scenario WITHOUT the skill. Document what the agent gets wrong, misses, or doesn't know. This is the gap list.1062. **GREEN** — Write the minimal skill that addresses those specific gaps. No speculation, no "nice to haves."1073. **REFACTOR** — Run the same scenario WITH the skill. Verify every gap is closed. If new gaps appear, update and re-test.108109## Cleanup Requirements110111The skill MUST clean up after itself:112113- **Tier 1:** Delete video file immediately after frame extraction (`rm /tmp/video.mp4`)114- **Tier 2:** Delete Playwright frame PNGs after analysis (`rm -rf /tmp/yt-frames-*`)115- **Tier 3:** VTT files are small, safe to leave or delete116- **All tiers:** All temp files go in `/tmp/`, never in the project directory117- **Frame directories:** Keep during analysis, delete when skill writing is complete118119## Known Issues & Workarounds120121| Issue | Detail | Workaround |122|---|---|---|123| WebFetch can't parse YouTube | JS-rendered pages return raw config | Use yt-dlp for everything |124| WebSearch can't find video IDs | `site:youtube.com` returns zero results | Use `yt-dlp --dump-json` |125| yt-dlp deno warnings | n challenge solving fails with TypeError | Cosmetic — downloads still complete |126| Playwright YouTube crash | Player errors after ~12-13 rapid seeks | Fall back to Tier 1 (download + ffmpeg) |127| Auto-captions misspell names | Phonetic approximations of tool/brand names | Frame analysis catches the real names |128| Write tool rejection | Permission prompt timeout in IDE | Retry the Write — succeeds on second attempt |129130## Mode Selection131132Before parsing, ask the user:133- **Autonomous** — generate skill without interruption, review after134- **Guided** — show extracted content, ask what to focus on, then generate135136## Discovery Mode137138Triggers automatically when source lacks full process content. Infers probable workflow, tags steps as `[demonstrated]` or `[inferred]`, assigns confidence scores. See `references/extraction-strategies.md` for detection criteria.139140## Deduplication141142Scans installed skills before generating. Recommends: update existing, write new, neither, or both. See `references/output-format.md` for recommendation logic.143144## Self-Debugging145146Each pipeline stage validates its output. 3 failures at any stage = stop and surface error. Every run produces `diagnostic.md`. See `references/extraction-strategies.md` for stage gates and red flags.