Communitygithub.com

Anhvu1107/all-agent-skill

總是於請求符合 Youtube 摘要器時使用:從 YouTube 影片提取逐字稿,並使用智慧分析框架產生全面且詳細的摘要。

all-agent-skill 是什麼?

此技能專為需要深入分析 YouTube 影片內容的開發者與研究者設計。它會自動驗證影片是否可存取,並使用 `youtube-transcript-api` Python 函式庫提取逐字稿。接著,技能會套用強化的 STAR + R-I-S-E 摘要框架,產出結構化、詳盡的 Markdown 文件,內容包含高階綜合摘要、逐節細部分析、關鍵概念與結論。此技能支援 Claude Code、Cursor 與 Codex 等 AI 代理平台,適合需要從教育、學術或資訊性影片中建立可參考文件,無需重看影片的使用者。完整工作流程包含五個步驟:驗證 URL、檢查影片與逐字稿可用性、提取逐字稿、產生摘要,以及格式化輸出,每個步驟皆附有進度指示,確保流程透明且可控。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Anhvu1107/all-agent-skill/tree/HEAD/.agent/skills/youtube-summarizer

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

youtube-summarizer

選擇性閱讀規則

從以下檔案開始:

  • references/senior-master-standard.md
  • references/usage-routing.md
  • references/quality-checklist.md

然後僅載入與使用者實際任務相符的繼承文件、指令稿、資源或範例。

目的

此技能從 YouTube 影片提取逐字稿,並使用 STAR + R-I-S-E 框架產生全面且詳盡的摘要。它會驗證影片的可存取性,使用 youtube-transcript-api Python 函式庫提取逐字稿,並產出詳細的文件,捕捉所有見解、論點和關鍵要點。

此技能專為需要對教育影片、講座、教學課程或資訊性內容進行徹底內容分析與建立參考文件的設計。

何時使用此技能

應在以下情況使用此技能:

  • 使用者提供 YouTube 影片網址並要求詳細摘要
  • 使用者需要記錄影片內容以供參考,無需重看
  • 使用者想從教育內容中提取見解、關鍵要點和論點
  • 使用者需要從 YouTube 影片中提取逐字稿進行分析
  • 使用者要求「摘要」、「總結」或「提取內容」來自 YouTube 影片
  • 使用者希望獲得優先考慮完整性的詳盡文件,而非簡潔性

步驟 0:探索與設定

在處理影片之前,驗證環境與依賴項:

# 檢查是否已安裝 youtube-transcript-api
python3 -c "import youtube_transcript_api" 2>/dev/null
if [ $? -ne 0 ]; then
    echo "⚠️  未安裝 youtube-transcript-api"
    # 提供安裝選項
fi

# 檢查 Python 是否可用
if ! command -v python3 &>/dev/null; then
    echo "❌ 需要 Python 3 但未安裝"
    exit 1
fi

若缺少依賴項,詢問使用者:

youtube-transcript-api 是必要的但尚未安裝。

您想現在安裝嗎?
- [ ] 是 - 使用 pip 安裝 (pip install youtube-transcript-api)
- [ ] 否 - 我會手動安裝

如果使用者選擇「是」:

pip install youtube-transcript-api

驗證安裝:

python3 -c "import youtube_transcript_api; print('✅ youtube-transcript-api 安裝成功')"

主要工作流程

進度追蹤指引

在整個工作流程中,請在每個步驟前顯示視覺化進度條,以隨時告知使用者。進度條格式如下:

echo "[████░░░░░░░░░░░░░░░░] 20% - 步驟 1/5:驗證網址"

格式規範:

  • 寬度為 20 個字元(使用 █ 表示已完成,░ 表示未完成)
  • 百分比增量:步驟 1=20%,步驟 2=40%,步驟 3=60%,步驟 4=80%,步驟 5=100%
  • 步驟計數器顯示目前/總數(例如「步驟 3/5」)
  • 目前階段的簡短描述

在步驟 1 之前顯示初始狀態框:

╔══════════════════════════════════════════════════════════════╗
║     📹  YOUTUBE 摘要器 - 處理影片                            ║
╠══════════════════════════════════════════════════════════════╣
║ → 步驟 1:驗證網址                    [進行中]               ║
║ ○ 步驟 2:檢查可用性                                        ║
║ ○ 步驟 3:提取逐字稿                                        ║
║ ○ 步驟 4:產生摘要                                          ║
║ ○ 步驟 5:格式化輸出                                        ║
╠══════════════════════════════════════════════════════════════╣
║ 進度:████░░░░░░░░░░░░░░░░░░░░░░░░  20%                     ║
╚══════════════════════════════════════════════════════════════╝

步驟 1:驗證 YouTube 網址

目標: 提取影片 ID 並驗證網址格式。

支援的網址格式:

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://m.youtube.com/watch?v=VIDEO_ID

操作:

# 使用正規表示式或網址解析提取影片 ID
URL="$USER_PROVIDED_URL"

# 模式 1:youtube.com/watch?v=VIDEO_ID
if echo "$URL" | grep -qE 'youtube\.com/watch\?v='; then
    VIDEO_ID=$(echo "$URL" | sed -E 's/.*[?&]v=([^&]+).*/\1/')
# 模式 2:youtu.be/VIDEO_ID  
elif echo "$URL" | grep -qE 'youtu\.be/'; then
    VIDEO_ID=$(echo "$URL" | sed -E 's/.*youtu\.be\/([^?]+).*/\1/')
else
    echo "❌ 無效的 YouTube 網址格式"
    exit 1
fi

echo "📹 已提取影片 ID:$VIDEO_ID"

如果網址無效:

❌ 無效的 YouTube 網址

請提供以下格式之一的有效 YouTube 網址:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID

範例:https://www.youtube.com/watch?v=dQw4w9WgXcQ

步驟 2:檢查影片與逐字稿可用性

進度:

echo "[████████░░░░░░░░░░░░] 40% - 步驟 2/5:檢查可用性"

目標: 驗證影片是否存在且逐字稿可存取。

操作:

from youtube_transcript_api import YouTubeTranscriptApi, TranscriptsDisabled, NoTranscriptFound
import sys

video_id = sys.argv[1]

try:
    # 取得可用的逐字稿清單
    transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
    
    print(f"✅ 影片可存取:{video_id}")
    print("📝 可用逐字稿:")
    
    for transcript in transcript_list:
        print(f"  - {transcript.language} ({transcript.language_code})")
        if transcript.is_generated:
            print("    [自動產生]")
    
except TranscriptsDisabled:
    print(f"❌ 影片 {video_id} 已禁用逐字稿")
    sys.exit(1)
    
except NoTranscriptFound:
    print(f"❌ 找不到影片 {video_id} 的逐字稿")
    sys.exit(1)
    
except Exception as e:
    print(f"❌ 存取影片時發生錯誤:{e}")
    sys.exit(1)

錯誤處理:

錯誤訊息動作
找不到影片"❌ 影片不存在或為私人"要求使用者驗證網址
逐字稿已禁用"❌ 此影片已禁用逐字稿"無法繼續
無可用逐字稿"❌ 找不到逐字稿(非自動產生或手動新增)"無法繼續
私人/受限影片"❌ 影片為私人或受限制"要求提供公開影片

步驟 3:提取逐字稿

進度:

echo "[████████████░░░░░░░░] 60% - 步驟 3/5:提取逐字稿"

目標: 以偏好的語言擷取逐字稿。

操作:

from youtube_transcript_api import YouTubeTranscriptApi

video_id = "VIDEO_ID"

try:
    # 嘗試先以使用者偏好的語言取得逐字稿
    # 若無則回退至英文
    transcript = YouTubeTranscriptApi.get_transcript(
        video_id, 
        languages=['pt', 'en']  # 偏好葡萄牙語,回退至英文
    )
    
    # 將逐字稿區段合併為完整文字
    full_text = " ".join([entry['text'] for entry in transcript])
    
    # 取得影片中繼資料
    from youtube_transcript_api import YouTubeTranscriptApi
    transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
    
    print("✅ 逐字稿提取成功")
    print(f"📊 逐字稿長度:{len(full_text)} 個字元")
    
    # 儲存至暫存檔以供處理
    with open(f"/tmp/transcript_{video_id}.txt", "w") as f:
        f.write(full_text)
    
except Exception as e:
    print(f"❌ 提取逐字稿時發生錯誤:{e}")
    exit(1)

逐字稿處理:

  • 將所有逐字稿區段合併為連貫文字
  • 保留標點符號與格式(若可用)
  • 移除重複或重疊的區段(若為自動產生的產物)
  • 儲存至暫存檔以供分析

步驟 4:產生全面摘要

進度:

echo "[████████████████░░░░] 80% - 步驟 4/5:產生摘要"

目標: 應用強化的 STAR + R-I-S-E 提示來建立詳細摘要。

套用的提示:

使用階段 2 的強化提示(STAR + R-I-S-E 框架),並將提取的逐字稿作為輸入。

操作:

  1. 載入完整逐字稿文字
  2. 套用全面摘要提示
  3. 使用 AI 模型 (Claude/GPT) 產生結構化摘要
  4. 確保輸出遵循定義的結構:
    • 含影片中繼資料的標頭
    • 高階綜合摘要
    • 詳細的逐節細部分析
    • 關鍵見解與結論
    • 概念與術語
    • 資源與參考資料

實作:

# 使用逐字稿檔案作為 AI 提示的輸入
TRANSCRIPT_FILE="/tmp/transcript_${VIDEO_ID}.txt"

# AI 代理將:
# 1. 讀取逐字稿
# 2. 套用 STAR + R-I-S-E 摘要框架
# 3. 產生全面的 Markdown 輸出
# 4. 使用標題、清單和重點標示進行結構化

Read "$TRANSCRIPT_FILE"  # 將逐字稿讀入上下文

然後套用完整的摘要提示(來自階段 2 的強化版本)。

步驟 5:格式化與呈現輸出

進度:

echo "[████████████████████] 100% - 步驟 5/5:格式化輸出"

目標: 以整潔、結構良好的 Markdown 提供摘要。

輸出結構:

# [影片標題]

**頻道:** [頻道名稱]  
**時長:** [時長]  
**網址:** [https://youtube.com/watch?v=VIDEO_ID]  
**發布日期:** [日期(若可用)]


## 📝 詳細摘要

### [主題 1]

[包含範例、資料、引述等的全面說明...]

#### [子主題 1.1]

[詳細細部分析...]

### [主題 2]

[繼續詳細分析...]


## 📚 概念與術語

- **[術語 1]:** [定義與背景]
- **[術語 2]:** [定義與背景]


## 📌 結論

[最終綜合摘要與重點]


### **範例 2:缺少依賴項**

**使用者輸入:**

claude> summarize this youtube video https://youtu.be/abc123


**技能回應:**

⚠️ 未安裝 youtube-transcript-api

此技能需要 Python 函式庫 'youtube-transcript-api'。

您想現在安裝嗎?

  • 是 - 使用 pip 安裝
  • 否 - 我會手動安裝

**使用者選擇「是」:**

```bash
$ pip install youtube-transcript-api
Successfully installed youtube-transcript-api-0.6.1

✅ 安裝完成!繼續處理影片摘要...

範例 4:無效網址

使用者輸入:

claude> summarize youtube video www.youtube.com/some-video

技能回應:

❌ 無效的 YouTube 網址格式

預期的格式範例:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID

請提供有效的 YouTube 影片網址。

📊 高階摘要

此影片全面介紹了人工智慧 (AI) 的基本概念,專為想要了解現代 AI 技術基礎與實際應用的初學者和專業人士設計。講師涵蓋了從基本定義到機器學習演算法的所有內容,使用實際範例與視覺化來促進理解。

[... 繼續詳細摘要 ...]


**儲存選項:**

您想儲存什麼? → 摘要 + 原始逐字稿

✅ 已儲存檔案:resumo-exemplo123-2026-02-01.md(包含原始逐字稿) [████████████████████] 100% - ✓ 處理完成!



歡迎來到這個機器學習基礎的全面教學。在今天的影片中,我們將探討驅動現代 AI 系統的核心概念...

版本: 1.2.0 最後更新: 2026-02-02 維護者: Eric Andrade

限制

  • 僅在任務明確符合上述範圍時使用此技能。
  • 請勿將輸出視為特定環境驗證、測試或專家審查的替代品。
  • 若缺少必要的輸入、權限、安全邊界或成功標準,請停止並要求釐清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches 007: Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Agentfolio: Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Animejs Animation: Advanced JavaScript animation library skill for creating complex, high-performance web animations.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astropy: Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astro: Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Emotional ARC Designer: One sentence - what this skill does and when to invoke it

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Fixing Motion Performance: Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches I18n Localization: Internationalization and localization patterns.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Interactive Portfolio: Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches JQ: Expert jq usage for JSON querying, filtering, transformation, and pipeline integration.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Landing Page Generator: Generates high-converting Next.js/React landing pages with Tailwind CSS.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches LEX: Centralized ''Truth Engine'' for cross-jurisdictional legal context (US, EU, CA) and contract scaffolding.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Magic Animator: AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Makepad Animation: CRITICAL: Use for Makepad animation system.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs APP Router Patterns: Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Anhvu1107/all-agent-skill

ALWAYS use this when the user mentions Nextjs Best Practices, asks to build, debug, review, document, automate, test, configure, migrate, or make decisions in this domain, or the task clearly depends on Nextjs Best Practices; scope: Next.js App Router principles. Apply the bundled workflow, references, scripts, Senior Master standard, and Codex strict review gate before final output.

Anhvu1107/all-agent-skill

description: ALWAYS use this when the work is specifically about modern Next.js or React architecture, data flow, rendering strategy, routing, or performance-sensitive frontend behavior.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs Supabase Auth: Expert integration of Supabase Auth with Next.js App Router

Anhvu1107/all-agent-skill

ALWAYS use this when the task involves reading, extracting, splitting, merging, rotating, creating, validating, OCR-ing, form-filling, or otherwise producing or modifying PDF files.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches React Nextjs Development: React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

相關技能