# Youtube To Vault

> Analyze a YouTube video (or playlist) and save it as a clean, AI-retrievable note in the user's Obsidian second brain. Use when the user shares a YouTube URL and wants it captured, summarized, or "added to my vault/second brain/notes". Fetches the transcript for free via uvx yt-dlp (no install), distills it, and writes a note following the vault conventions.

- **Type:** Skill
- **Install:** `agentstack add skill-ridwanahmed06-claude-skills-youtube-to-vault`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ridwanahmed06](https://agentstack.voostack.com/s/ridwanahmed06)
- **Installs:** 0
- **Category:** [Productivity](https://agentstack.voostack.com/c/productivity)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ridwanahmed06](https://github.com/ridwanahmed06)
- **Source:** https://github.com/ridwanahmed06/claude-skills/tree/master/skills/youtube-to-vault

## Install

```sh
agentstack add skill-ridwanahmed06-claude-skills-youtube-to-vault
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# YouTube → Second Brain

Turn a YouTube video into a distilled, linked note in the Obsidian vault.

## Vault location
`$env:OBSIDIAN_VAULT` — notes go in `03-Resources\`.
Follow `CONVENTIONS.md` and the `_templates\video.md` template in that vault.

## Single video

1. **Get the transcript** (free, no install — `uvx` runs yt-dlp on demand):
   ```powershell
   $tmp = "$env:OBSIDIAN_VAULT\.tmp"
   New-Item -ItemType Directory -Force -Path $tmp | Out-Null
   uvx yt-dlp --skip-download --write-auto-subs --write-subs --sub-langs en `
     --sub-format vtt --convert-subs vtt -o "$tmp\%(id)s.%(ext)s" ""
   ```
   Also grab metadata for title/creator:
   ```powershell
   uvx yt-dlp --skip-download --print "%(title)s|%(uploader)s|%(id)s" ""
   ```
   If no subtitles exist, **fall back to local Whisper transcription** (next section) —
   do NOT give up.

### Fallback: local Whisper (for videos with no captions)

The user has an RTX 5060 (8 GB). Transcribe the audio locally — free, no API. Uses
`whisper-ctranslate2` (a faster-whisper CLI) run on demand via `uvx`, GPU if available:

```powershell
$tmp = "$env:OBSIDIAN_VAULT\.tmp"
New-Item -ItemType Directory -Force -Path $tmp | Out-Null
# 1) grab audio only (small + fast)
uvx yt-dlp -x --audio-format mp3 -o "$tmp\%(id)s.%(ext)s" ""
# 2) transcribe -> writes .vtt next to the audio
uvx whisper-ctranslate2 "$tmp\.mp3" --model small --language en `
  --output_format vtt --output_dir $tmp --device auto --compute_type auto
```

- `--model small` is the sweet spot for speed/accuracy on 8 GB; bump to `medium` for
  hard audio, drop to `base` for speed. `--device auto` uses CUDA when present, else CPU.
- First run downloads the model weights once (cached).
- Then continue from step 2 below (read & distill the `.vtt`) exactly as normal.
- Flag to the user that Whisper output is a machine transcription — names/jargon may be off.

2. **Read & distill** the `.vtt` file. Strip timestamps/markup. Produce:
   - a 1-paragraph **Summary**
   - 5–10 **Key takeaways**, each prefixed with the `[mm:ss]` it came from
   - any **code/steps**, in a code block
   Keep it tight — distill, don't dump the raw transcript.

3. **Write the note** to `03-Resources\.md` (slug = kebab-case title) using the
   `video.md` template. Fill frontmatter: `title`, `type: video`, `tags`, `source` = the
   exact URL, `creator` = channel, `created` = today. Add a **Questions this answers** line.
   Add `[[wikilinks]]` to any related existing notes (search the vault first).

4. **Flag** that auto-transcribed code can be wrong — tell the user to verify snippets.

5. Delete the `.tmp` subtitle files when done.

## Batch (a playlist / course) — use a parallel agent team

When given a playlist, list its videos first:
```powershell
uvx yt-dlp --flat-playlist --print "%(url)s" ""
```
Then dispatch **parallel agents**, following the user's Agent Team Standard:
- **Goal:** one well-formed, cross-linked note per video.
- **Workers (Sonnet 4.6** — good transcript distillation at reasonable cost; **Haiku 4.5**
  for very short clips): each worker OWNS exactly one file `03-Resources\.md`.
  **Zero file overlap** — partition by video.
- **Lead (Opus 4.8** — synthesis): dedupe topics, add cross-`[[links]]` between the new
  notes and existing vault notes, update `index.md`.

## Notes & gotchas
- Needs a video with captions/auto-captions. Some have none.
- First `uvx yt-dlp` run downloads yt-dlp into a cache (one-time, a few seconds).
- Never save the raw transcript as the note — always distill.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ridwanahmed06](https://github.com/ridwanahmed06)
- **Source:** [ridwanahmed06/claude-skills](https://github.com/ridwanahmed06/claude-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ridwanahmed06-claude-skills-youtube-to-vault
- Seller: https://agentstack.voostack.com/s/ridwanahmed06
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
