[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6G074K36K1ZK3MSDBDF8CSR":3,"skill-same:01M6G074K36K1ZK3MSDBDF8CSR":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":56,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M6G074K36K1ZK3MSDBDF8CSR","youtube-audit",null,"Analyze a YouTube channel with evidence-first metadata, transcripts, performance fields, portfolio shape, and repeated content-quality patterns","GeorgeQLe\u002Fagentic-skills","GeorgeQLe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21134126?v=4","01M6D2JP418S0VGJGF8M93EC3H","George Le","01M6D2JPBAKYD82TA5FS6HKQ3D",1,"MIT","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Fpacks\u002Fyoutube-ops\u002Fcodex\u002Fyoutube-audit\u002Farchive\u002Fv0.2\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"youtube audit","audit","youtube","portfolio","transcripts","URL","with","content-quality","patterns","shape","evidence","performance","channel","v0","quality","analyze","first","metadata","content","research","2026-11-10 10:12:30",false,"---\nname: youtube-audit\ndescription: Analyze a YouTube channel with evidence-first metadata, transcripts, performance fields, portfolio shape, and repeated content-quality patterns\ntype: research\nversion: v0.2\nargument-hint: \"\u003Cchannel URL or handle> [--count N]\"\n---\n\n# YouTube Audit — Evidence-First Channel Analysis\n\nInvoke as `$youtube-audit`.\n\n## Report-First Approval Gate\n\nDefault to report-only: present findings, evidence coverage, assumptions, recommended artifact path, and proposed file changes in a pre-approval alignment page plus a concise conversation summary for user approval before creating or updating canonical research, spec, or task files.\n\nDo not write or overwrite synthesized deliverables until the user explicitly approves, unless the user invoked an explicit write\u002Fupdate\u002Ffix mode or clearly asked to write files upfront. Raw evidence capture may be persisted before analysis when reproducibility requires it; report those raw paths separately and still gate synthesized research\u002Freport writes.\n\nWhen stopping for approval, build and attempt to open the alignment preview page first, then ask the user to review it and approve, question, or request adjustments. Do not include `Recommended next skill`, `Recommended next command`, or downstream routing language. The approval request itself is the next action. Only emit next-skill routing after the approved artifact has been written or updated.\n\nFetch full video metadata and transcripts from a YouTube channel, persist raw evidence, then analyze both performance shape and content quality. The output identifies repeated strengths, repeated weaknesses, portfolio concentration, content roles, archetypes, and cleanup candidates with evidence cited from specific videos.\n\n## Prerequisites\n\nTwo CLI tools are required. Neither needs API keys.\n\n- **yt-dlp**: Lists channel videos as JSON. Install: `brew install yt-dlp` or `pip install yt-dlp`.\n- **youtube-transcript-api**: Fetches transcripts via Python. If the active Python is externally managed, such as Homebrew Python on macOS under PEP 668, install this package in a project-local virtual environment instead of the system Python.\n\nCheck `yt-dlp` before proceeding. The transcript dependency should be handled through a project-local `.venv` when it is missing.\n\n## Workflow\n\n### 1. Parse Arguments\n\n- `$ARGUMENTS` must contain a YouTube channel URL or handle (e.g. `@handle`).\n- Optional `--count N` sets how many recent videos to fetch (default 20, max 50).\n- If no channel is provided, ask the user for one and stop.\n- Normalize handles to channel video URLs when needed: `@handle` -> `https:\u002F\u002Fwww.youtube.com\u002F@handle\u002Fvideos`.\n- Validate that `yt-dlp` is available first:\n\n```bash\ncommand -v yt-dlp\n```\n\n- Select the Python interpreter for transcript fetching. Prefer a workspace-local virtual environment when present; if one is not present, create it before checking the transcript import:\n\n```bash\nif [ ! -x .venv\u002Fbin\u002Fpython ]; then\n  python3 -m venv .venv\nfi\nTRANSCRIPT_PYTHON=.venv\u002Fbin\u002Fpython\n\"$TRANSCRIPT_PYTHON\" -c \"from youtube_transcript_api import YouTubeTranscriptApi; print('ok')\"\n```\n\n- If the import check fails, install the missing package into the project-local virtual environment, then rerun the import check:\n\n```bash\n.venv\u002Fbin\u002Fpython -m pip install youtube-transcript-api\n\"$TRANSCRIPT_PYTHON\" -c \"from youtube_transcript_api import YouTubeTranscriptApi; print('ok')\"\n```\n\n- Store the selected interpreter path and use it for every transcript-fetching command in this audit.\n- If package installation fails because network access is unavailable or denied, stop and report the exact safe install commands below:\n\n```bash\npython3 -m venv .venv\n.venv\u002Fbin\u002Fpython -m pip install youtube-transcript-api\n```\n\nDo not recommend installing `youtube-transcript-api` into Homebrew\u002Fsystem Python with `python3 -m pip install ...`, and do not recommend `--break-system-packages`. The local-venv path avoids PEP 668 `externally-managed-environment` failures on Homebrew Python.\n\n### 2. Archive Previous Audit\n\nIf `research\u002Fyoutube\u002Fyoutube-audit-*.md` or legacy `research\u002Fyoutube-audit-*.md` already exists for the same channel (check the `> Channel:` header in existing files):\n\n1. Copy the existing file to `docs\u002Fhistory\u002Farchive\u002FYYYY-MM-DD\u002FHHMMSS\u002Fresearch\u002Fyoutube-audit-*.md`.\n2. Preserve the archived snapshot exactly.\n3. Then proceed to overwrite the canonical path.\n\nNew files do not need archive snapshots.\n\n### 3. Fetch Video List\n\nCreate:\n\n```text\nresearch\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002F\n```\n\nRun full metadata export, not flat playlist metadata:\n\n```bash\nyt-dlp --dump-json --playlist-end N \"CHANNEL_URL\u002Fvideos\"\n```\n\nPersist the raw newline-delimited response exactly to:\n\n```text\nresearch\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002Fvideos-YYYY-MM-DD.jsonl\n```\n\nParse each JSON object for at least:\n\n| Field | Notes |\n| --- | --- |\n| `id`, `webpage_url`, `title`, `description` | Identity and audit links |\n| `channel`, `channel_id`, `uploader`, `uploader_id` | Channel identity |\n| `upload_date`, `timestamp` | Used for recency and views\u002Fday |\n| `duration` | Used for views\u002Fminute |\n| `view_count`, `like_count`, `comment_count` | Performance |\n| `tags`, `categories`, `chapters` | Positioning and packaging signals |\n| `thumbnail`, `thumbnails` | Packaging review signal |\n\nBuild a video table sorted by upload date (newest first). Report total videos found.\n\n### 4. Fetch Transcripts\n\nUse the same Python interpreter that passed the import check. If `.venv\u002Fbin\u002Fpython` exists and passed the import check, run transcript fetching with `.venv\u002Fbin\u002Fpython`; otherwise use the Python executable that passed the import check. Fetch transcripts sequentially and persist raw transcript JSON:\n\n```python\nfrom youtube_transcript_api import YouTubeTranscriptApi\nfrom pathlib import Path\nimport json, sys, time\n\nvideo_ids = json.loads(sys.argv[1])\nout_dir = Path(sys.argv[2])\nout_dir.mkdir(parents=True, exist_ok=True)\nresults = {}\nerrors = []\n\nfor vid in video_ids:\n    try:\n        transcript = YouTubeTranscriptApi.get_transcript(vid)\n        (out_dir \u002F f\"{vid}.json\").write_text(json.dumps(transcript, ensure_ascii=False, indent=2))\n        results[vid] = \" \".join(entry[\"text\"] for entry in transcript)\n    except Exception as e:\n        errors.append({\"id\": vid, \"reason\": str(e)})\n    time.sleep(1.5)\n\nsummary = {\"transcripts\": results, \"errors\": errors}\n(out_dir \u002F \"transcripts-summary.json\").write_text(json.dumps(summary, ensure_ascii=False, indent=2))\njson.dump(summary, sys.stdout)\n```\n\n- Fetch sequentially with 1.5s delay to avoid rate limiting.\n- Skip videos without transcripts and log the reason.\n- If more than 80% lack transcripts, warn the user and ask whether to proceed.\n- Do not fabricate transcript text; transcript gaps are evidence quality limits.\n\n### 5. Prepare Analysis Context\n\nBuild structured records per video:\n\n| Field | Computation |\n| --- | --- |\n| Title, date, URL, duration, views, likes, comments | Direct from metadata |\n| Age in days | From upload date to current date |\n| Views\u002Fday | `view_count \u002F max(age_days, 1)` |\n| Views\u002Fminute | `view_count \u002F max(duration_minutes, 1)` |\n| Like rate | `like_count \u002F view_count` when both exist |\n| Transcript coverage | `yes`, `no`, or `partial` |\n| Archetype | Format pattern such as founder update, interview, tutorial, analysis, vlog, launch, reaction, teardown |\n| Content role | Strategic role such as acquisition, trust-building, proof, education, launch support, community retention, cleanup candidate |\n\nIf total transcript text exceeds 80,000 words, truncate each transcript to preserve:\n- First 500 words (hook and intro)\n- Last 300 words (outro and CTA)\n- Trim the middle proportionally across all videos to fit the budget\n\n### 6. Analyze Content\n\nAnalyze performance and content in one pass.\n\n### Performance And Portfolio Fields\n\nInclude:\n\n- Total videos analyzed, transcript coverage, total views, median views, top video, bottom video.\n- Views\u002Fday and views\u002Fminute leaders.\n- Top-video concentration: top 1, top 3, and top 5 share of analyzed views.\n- Portfolio distribution by archetype and content role.\n- Packaging signals from titles, thumbnails, tags, descriptions, and chapters.\n- Cleanup candidates: videos with poor fit, weak performance relative to channel median, stale positioning, or inconsistent audience promise. Mark as `keep`, `refresh`, `unlist\u002Fprivate candidate`, or `needs human review`; do not recommend deletion as an automated action.\n\n### Content Quality Patterns\n\nSplit into positive patterns (double down) and critical patterns (fix).\n\n**Every finding must cite evidence from 2+ videos to qualify as a pattern.** Single-video observations are not patterns — discard them.\n\nAnalyze across these dimensions:\n\n| Dimension | What to look for |\n| --- | --- |\n| Positioning | Who is this channel for? Is it consistent? Does the creator own a niche? |\n| Hooks | First 30 seconds — do they create curiosity, state a problem, or waste time? |\n| Interview style | If applicable — question quality, follow-ups, guest chemistry, interruptions |\n| Credibility | Does the creator demonstrate expertise? Name-drop experiences? Show receipts? |\n| Topic selection | Are topics timely, evergreen, niche, or scattered? Do they match the audience? |\n| Pacing | Does the content drag or rush? Are there dead zones? |\n| Editing signals | Verbal cues for cuts, chapters, graphics. Does the script feel edited or rambling? |\n| Startup rigor | If startup\u002Fbusiness content — are frameworks used? Is advice actionable or generic? |\n| Audience trust | Does the creator build trust or erode it? Sponsorship handling, honesty, consistency |\n| Portfolio fit | Does each video serve a clear role in the channel strategy? |\n| Packaging | Do title, thumbnail, topic, and opening promise align? |\n\n### 7. Write Report\n\nSave to `research\u002Fyoutube\u002Fyoutube-audit-\u003Cslug>-YYYY-MM-DD.md`:\n\n```markdown\n# YouTube Audit — [Channel Name]\n\n> Channel: [URL]\n> Videos analyzed: N\n> Transcripts available: N of M\n> Date: YYYY-MM-DD\n> Raw metadata: research\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002Fvideos-YYYY-MM-DD.jsonl\n> Raw transcripts: research\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002Ftranscripts\u002F\n\n## Videos Analyzed\n\n| # | Title | Date | Views | Likes | Views\u002Fday | Views\u002Fmin | Duration | Archetype | Role | Transcript |\n|---|-------|------|-------|-------|-----------|-----------|----------|-----------|------|------------|\n| 1 | [Title](URL) | YYYY-MM-DD | N | N | N | N | Xm | [type] | [role] | Yes\u002FNo |\n| ... | | | | | |\n\n## Performance Snapshot\n\n- **Total views analyzed**: N\n- **Median views**: N\n- **Top 1 concentration**: N%\n- **Top 3 concentration**: N%\n- **Views\u002Fday leader**: [video]\n- **Views\u002Fminute leader**: [video]\n\n## Portfolio Shape\n\n| Archetype | Videos | View share | Notes |\n|---|---:|---:|---|\n| ... | | | |\n\n| Content role | Videos | View share | Notes |\n|---|---:|---:|---|\n| ... | | | |\n\n## Positive Patterns (Double Down)\n\n### [Pattern Title]\n- **Frequency**: Found in N of M videos\n- **Evidence**: [Video 1 title] — \"[quote or description]\"; [Video 2 title] — \"[quote or description]\"\n- **Recommendation**: [What to keep doing or amplify]\n\n### ...\n\n## Critical Patterns (Fix)\n\n### [Pattern Title]\n- **Severity**: High \u002F Medium \u002F Low\n- **Frequency**: Found in N of M videos\n- **Evidence**: [Video 1 title] — \"[quote or description]\"; [Video 2 title] — \"[quote or description]\"\n- **Impact**: [Why this hurts the channel]\n- **Recommendation**: [Specific fix]\n\n### ...\n\n## Cleanup Candidates\n\n| Video | Recommendation | Evidence | Human check |\n|---|---|---|---|\n| [Title](URL) | Keep \u002F Refresh \u002F Unlist-private candidate \u002F Needs human review | [performance + fit evidence] | [what to inspect before action] |\n\n## Summary\n\n### Top 3 Strengths\n1. [Strength] — [one-line why]\n2. [Strength] — [one-line why]\n3. [Strength] — [one-line why]\n\n### Top 3 Weaknesses\n1. [Weakness] — [one-line why]\n2. [Weakness] — [one-line why]\n3. [Weakness] — [one-line why]\n\n### Strategic Recommendation\n[2-3 sentences: the single most impactful change the channel should make, grounded in the patterns found]\n```\n\nCreate the `research\u002Fyoutube\u002F` and `research\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002F` directories if they do not exist.\n\n### 8. Summarize In Thread\n\nAfter saving the report, output: top 3 strengths, top 3 weaknesses, performance\u002Fportfolio headline, strategic recommendation, report path, and raw data paths.\n\n## Constraints\n\n- **Pattern-only reporting**: Every finding must have evidence from 2+ videos. No single-video observations.\n- **Sequential fetching**: Do not parallelize transcript fetches — use 1.5s delay to avoid IP rate limiting.\n- **No API keys**: Both tools work unauthenticated against public data. Do not ask the user for API keys.\n- **Smart truncation**: When truncating, always preserve hooks (first 500 words) and outros (last 300 words).\n- **Honest coverage**: If transcripts are sparse, say so. Do not fabricate transcript content or hallucinate quotes.\n- **Raw evidence first**: Always persist raw `yt-dlp` JSONL and transcript JSON before writing analysis.\n- **No automated destructive content advice**: Cleanup candidates are review recommendations, not instructions to delete content.\n- **Stay in analysis mode**: Do not propose video ideas, scripts, or content calendars. The job is to audit what exists.\n\n## Approved Artifact Handoff\n\nAfter an approved synthesized write, explicit write\u002Fupdate mode, or any direct artifact mutation:\n\n- List every created or updated synthesized artifact path in the final response.\n- State the verification performed, such as readback, schema\u002Fcheck command, or why no executable verification applies for a Markdown-only strategy artifact.\n- Check and report the relevant git status for intended artifacts when the project is a git repository. If intended artifacts are modified or untracked, make the next action shipping, committing, or an explicit dirty-artifact handoff before recommending downstream strategy work.\n- Do not imply the research workflow is complete while approved artifacts remain untracked or uncommitted unless the user explicitly asked not to ship.\n- If stopping for approval before writing, the approval request remains the next action; do not include downstream routing.\n\n## Intent-Aware Routing\n\nBefore applying the default next-step routing, classify the user's immediate intent and route to the missing action that best serves that intent:\n\n- Strategy refresh: recommend the missing or stale positioning, programming, portfolio, metrics, or product-media artifact.\n- Recording prep: recommend the missing series spec, script, build proof, walkthrough guide, or validation artifact needed before recording.\n- Upload prep: recommend packaging, title\u002Fthumbnail, description, chapters, or final metadata work before broader strategy work.\n- Performance review: recommend metrics, cadence, portfolio, peer benchmark, or owner-analytics export work before new content planning.\n- Owner analytics or private\u002Fmanual platform evidence: route to an explicit manual\u002Fguide handoff instead of inventing unavailable metrics.\n- Dirty intended artifacts: route to shipping\u002Fcommit\u002Fhandoff first, not another creator strategy skill.\n\nUse the default next-skill sequence only when no stronger user intent, missing artifact, manual blocker, or dirty-artifact handoff applies.\n\n## Alignment Page\n\nWhen this skill produces durable deliverables (research, specs, plans, reports, prototypes, or any document output), build a full-depth HTML alignment page following `ALIGNMENT-PAGE.md` in this skill's directory. Output: `alignment\u002Fyoutube-audit-{topic}.html`.\n\n## Default Shipping Contract\n\nFollow the shared shipping contract convention in CLAUDE.md.\n","# YouTube Audit — Evidence-First Channel Analysis\n\nInvoke as `$youtube-audit`.\n\n## Report-First Approval Gate\n\nDefault to report-only: present findings, evidence coverage, assumptions, recommended artifact path, and proposed file changes in a pre-approval alignment page plus a concise conversation summary for user approval before creating or updating canonical research, spec, or task files.\n\nDo not write or overwrite synthesized deliverables until the user explicitly approves, unless the user invoked an explicit write\u002Fupdate\u002Ffix mode or clearly asked to write files upfront. Raw evidence capture may be persisted before analysis when reproducibility requires it; report those raw paths separately and still gate synthesized research\u002Freport writes.\n\nWhen stopping for approval, build and attempt to open the alignment preview page first, then ask the user to review it and approve, question, or request adjustments. Do not include `Recommended next skill`, `Recommended next command`, or downstream routing language. The approval request itself is the next action. Only emit next-skill routing after the approved artifact has been written or updated.\n\nFetch full video metadata and transcripts from a YouTube channel, persist raw evidence, then analyze both performance shape and content quality. The output identifies repeated strengths, repeated weaknesses, portfolio concentration, content roles, archetypes, and cleanup candidates with evidence cited from specific videos.\n\n## Prerequisites\n\nTwo CLI tools are required. Neither needs API keys.\n\n- **yt-dlp**: Lists channel videos as JSON. Install: `brew install yt-dlp` or `pip install yt-dlp`.\n- **youtube-transcript-api**: Fetches transcripts via Python. If the active Python is externally managed, such as Homebrew Python on macOS under PEP 668, install this package in a project-local virtual environment instead of the system Python.\n\nCheck `yt-dlp` before proceeding. The transcript dependency should be handled through a project-local `.venv` when it is missing.\n\n## Workflow\n\n### 1. Parse Arguments\n\n- `$ARGUMENTS` must contain a YouTube channel URL or handle (e.g. `@handle`).\n- Optional `--count N` sets how many recent videos to fetch (default 20, max 50).\n- If no channel is provided, ask the user for one and stop.\n- Normalize handles to channel video URLs when needed: `@handle` -> `https:\u002F\u002Fwww.youtube.com\u002F@handle\u002Fvideos`.\n- Validate that `yt-dlp` is available first:\n\n```bash\ncommand -v yt-dlp\n```\n\n- Select the Python interpreter for transcript fetching. Prefer a workspace-local virtual environment when present; if one is not present, create it before checking the transcript import:\n\n```bash\nif [ ! -x .venv\u002Fbin\u002Fpython ]; then\n  python3 -m venv .venv\nfi\nTRANSCRIPT_PYTHON=.venv\u002Fbin\u002Fpython\n\"$TRANSCRIPT_PYTHON\" -c \"from youtube_transcript_api import YouTubeTranscriptApi; print('ok')\"\n```\n\n- If the import check fails, install the missing package into the project-local virtual environment, then rerun the import check:\n\n```bash\n.venv\u002Fbin\u002Fpython -m pip install youtube-transcript-api\n\"$TRANSCRIPT_PYTHON\" -c \"from youtube_transcript_api import YouTubeTranscriptApi; print('ok')\"\n```\n\n- Store the selected interpreter path and use it for every transcript-fetching command in this audit.\n- If package installation fails because network access is unavailable or denied, stop and report the exact safe install commands below:\n\n```bash\npython3 -m venv .venv\n.venv\u002Fbin\u002Fpython -m pip install youtube-transcript-api\n```\n\nDo not recommend installing `youtube-transcript-api` into Homebrew\u002Fsystem Python with `python3 -m pip install ...`, and do not recommend `--break-system-packages`. The local-venv path avoids PEP 668 `externally-managed-environment` failures on Homebrew Python.\n\n### 2. Archive Previous Audit\n\nIf `research\u002Fyoutube\u002Fyoutube-audit-*.md` or legacy `research\u002Fyoutube-audit-*.md` already exists for the same channel (check the `> Channel:` header in existing files):\n\n1. Copy the existing file to `docs\u002Fhistory\u002Farchive\u002FYYYY-MM-DD\u002FHHMMSS\u002Fresearch\u002Fyoutube-audit-*.md`.\n2. Preserve the archived snapshot exactly.\n3. Then proceed to overwrite the canonical path.\n\nNew files do not need archive snapshots.\n\n### 3. Fetch Video List\n\nCreate:\n\n```text\nresearch\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002F\n```\n\nRun full metadata export, not flat playlist metadata:\n\n```bash\nyt-dlp --dump-json --playlist-end N \"CHANNEL_URL\u002Fvideos\"\n```\n\nPersist the raw newline-delimited response exactly to:\n\n```text\nresearch\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002Fvideos-YYYY-MM-DD.jsonl\n```\n\nParse each JSON object for at least:\n\n| Field | Notes |\n| --- | --- |\n| `id`, `webpage_url`, `title`, `description` | Identity and audit links |\n| `channel`, `channel_id`, `uploader`, `uploader_id` | Channel identity |\n| `upload_date`, `timestamp` | Used for recency and views\u002Fday |\n| `duration` | Used for views\u002Fminute |\n| `view_count`, `like_count`, `comment_count` | Performance |\n| `tags`, `categories`, `chapters` | Positioning and packaging signals |\n| `thumbnail`, `thumbnails` | Packaging review signal |\n\nBuild a video table sorted by upload date (newest first). Report total videos found.\n\n### 4. Fetch Transcripts\n\nUse the same Python interpreter that passed the import check. If `.venv\u002Fbin\u002Fpython` exists and passed the import check, run transcript fetching with `.venv\u002Fbin\u002Fpython`; otherwise use the Python executable that passed the import check. Fetch transcripts sequentially and persist raw transcript JSON:\n\n```python\nfrom youtube_transcript_api import YouTubeTranscriptApi\nfrom pathlib import Path\nimport json, sys, time\n\nvideo_ids = json.loads(sys.argv[1])\nout_dir = Path(sys.argv[2])\nout_dir.mkdir(parents=True, exist_ok=True)\nresults = {}\nerrors = []\n\nfor vid in video_ids:\n    try:\n        transcript = YouTubeTranscriptApi.get_transcript(vid)\n        (out_dir \u002F f\"{vid}.json\").write_text(json.dumps(transcript, ensure_ascii=False, indent=2))\n        results[vid] = \" \".join(entry[\"text\"] for entry in transcript)\n    except Exception as e:\n        errors.append({\"id\": vid, \"reason\": str(e)})\n    time.sleep(1.5)\n\nsummary = {\"transcripts\": results, \"errors\": errors}\n(out_dir \u002F \"transcripts-summary.json\").write_text(json.dumps(summary, ensure_ascii=False, indent=2))\njson.dump(summary, sys.stdout)\n```\n\n- Fetch sequentially with 1.5s delay to avoid rate limiting.\n- Skip videos without transcripts and log the reason.\n- If more than 80% lack transcripts, warn the user and ask whether to proceed.\n- Do not fabricate transcript text; transcript gaps are evidence quality limits.\n\n### 5. Prepare Analysis Context\n\nBuild structured records per video:\n\n| Field | Computation |\n| --- | --- |\n| Title, date, URL, duration, views, likes, comments | Direct from metadata |\n| Age in days | From upload date to current date |\n| Views\u002Fday | `view_count \u002F max(age_days, 1)` |\n| Views\u002Fminute | `view_count \u002F max(duration_minutes, 1)` |\n| Like rate | `like_count \u002F view_count` when both exist |\n| Transcript coverage | `yes`, `no`, or `partial` |\n| Archetype | Format pattern such as founder update, interview, tutorial, analysis, vlog, launch, reaction, teardown |\n| Content role | Strategic role such as acquisition, trust-building, proof, education, launch support, community retention, cleanup candidate |\n\nIf total transcript text exceeds 80,000 words, truncate each transcript to preserve:\n- First 500 words (hook and intro)\n- Last 300 words (outro and CTA)\n- Trim the middle proportionally across all videos to fit the budget\n\n### 6. Analyze Content\n\nAnalyze performance and content in one pass.\n\n### Performance And Portfolio Fields\n\nInclude:\n\n- Total videos analyzed, transcript coverage, total views, median views, top video, bottom video.\n- Views\u002Fday and views\u002Fminute leaders.\n- Top-video concentration: top 1, top 3, and top 5 share of analyzed views.\n- Portfolio distribution by archetype and content role.\n- Packaging signals from titles, thumbnails, tags, descriptions, and chapters.\n- Cleanup candidates: videos with poor fit, weak performance relative to channel median, stale positioning, or inconsistent audience promise. Mark as `keep`, `refresh`, `unlist\u002Fprivate candidate`, or `needs human review`; do not recommend deletion as an automated action.\n\n### Content Quality Patterns\n\nSplit into positive patterns (double down) and critical patterns (fix).\n\n**Every finding must cite evidence from 2+ videos to qualify as a pattern.** Single-video observations are not patterns — discard them.\n\nAnalyze across these dimensions:\n\n| Dimension | What to look for |\n| --- | --- |\n| Positioning | Who is this channel for? Is it consistent? Does the creator own a niche? |\n| Hooks | First 30 seconds — do they create curiosity, state a problem, or waste time? |\n| Interview style | If applicable — question quality, follow-ups, guest chemistry, interruptions |\n| Credibility | Does the creator demonstrate expertise? Name-drop experiences? Show receipts? |\n| Topic selection | Are topics timely, evergreen, niche, or scattered? Do they match the audience? |\n| Pacing | Does the content drag or rush? Are there dead zones? |\n| Editing signals | Verbal cues for cuts, chapters, graphics. Does the script feel edited or rambling? |\n| Startup rigor | If startup\u002Fbusiness content — are frameworks used? Is advice actionable or generic? |\n| Audience trust | Does the creator build trust or erode it? Sponsorship handling, honesty, consistency |\n| Portfolio fit | Does each video serve a clear role in the channel strategy? |\n| Packaging | Do title, thumbnail, topic, and opening promise align? |\n\n### 7. Write Report\n\nSave to `research\u002Fyoutube\u002Fyoutube-audit-\u003Cslug>-YYYY-MM-DD.md`:\n\n```markdown\n# YouTube Audit — [Channel Name]\n\n> Channel: [URL]\n> Videos analyzed: N\n> Transcripts available: N of M\n> Date: YYYY-MM-DD\n> Raw metadata: research\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002Fvideos-YYYY-MM-DD.jsonl\n> Raw transcripts: research\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002Ftranscripts\u002F\n\n## Videos Analyzed\n\n| # | Title | Date | Views | Likes | Views\u002Fday | Views\u002Fmin | Duration | Archetype | Role | Transcript |\n|---|-------|------|-------|-------|-----------|-----------|----------|-----------|------|------------|\n| 1 | [Title](URL) | YYYY-MM-DD | N | N | N | N | Xm | [type] | [role] | Yes\u002FNo |\n| ... | | | | | |\n\n## Performance Snapshot\n\n- **Total views analyzed**: N\n- **Median views**: N\n- **Top 1 concentration**: N%\n- **Top 3 concentration**: N%\n- **Views\u002Fday leader**: [video]\n- **Views\u002Fminute leader**: [video]\n\n## Portfolio Shape\n\n| Archetype | Videos | View share | Notes |\n|---|---:|---:|---|\n| ... | | | |\n\n| Content role | Videos | View share | Notes |\n|---|---:|---:|---|\n| ... | | | |\n\n## Positive Patterns (Double Down)\n\n### [Pattern Title]\n- **Frequency**: Found in N of M videos\n- **Evidence**: [Video 1 title] — \"[quote or description]\"; [Video 2 title] — \"[quote or description]\"\n- **Recommendation**: [What to keep doing or amplify]\n\n### ...\n\n## Critical Patterns (Fix)\n\n### [Pattern Title]\n- **Severity**: High \u002F Medium \u002F Low\n- **Frequency**: Found in N of M videos\n- **Evidence**: [Video 1 title] — \"[quote or description]\"; [Video 2 title] — \"[quote or description]\"\n- **Impact**: [Why this hurts the channel]\n- **Recommendation**: [Specific fix]\n\n### ...\n\n## Cleanup Candidates\n\n| Video | Recommendation | Evidence | Human check |\n|---|---|---|---|\n| [Title](URL) | Keep \u002F Refresh \u002F Unlist-private candidate \u002F Needs human review | [performance + fit evidence] | [what to inspect before action] |\n\n## Summary\n\n### Top 3 Strengths\n1. [Strength] — [one-line why]\n2. [Strength] — [one-line why]\n3. [Strength] — [one-line why]\n\n### Top 3 Weaknesses\n1. [Weakness] — [one-line why]\n2. [Weakness] — [one-line why]\n3. [Weakness] — [one-line why]\n\n### Strategic Recommendation\n[2-3 sentences: the single most impactful change the channel should make, grounded in the patterns found]\n```\n\nCreate the `research\u002Fyoutube\u002F` and `research\u002Fyoutube\u002Fdata\u002F\u003Cslug>\u002F` directories if they do not exist.\n\n### 8. Summarize In Thread\n\nAfter saving the report, output: top 3 strengths, top 3 weaknesses, performance\u002Fportfolio headline, strategic recommendation, report path, and raw data paths.\n\n## Constraints\n\n- **Pattern-only reporting**: Every finding must have evidence from 2+ videos. No single-video observations.\n- **Sequential fetching**: Do not parallelize transcript fetches — use 1.5s delay to avoid IP rate limiting.\n- **No API keys**: Both tools work unauthenticated against public data. Do not ask the user for API keys.\n- **Smart truncation**: When truncating, always preserve hooks (first 500 words) and outros (last 300 words).\n- **Honest coverage**: If transcripts are sparse, say so. Do not fabricate transcript content or hallucinate quotes.\n- **Raw evidence first**: Always persist raw `yt-dlp` JSONL and transcript JSON before writing analysis.\n- **No automated destructive content advice**: Cleanup candidates are review recommendations, not instructions to delete content.\n- **Stay in analysis mode**: Do not propose video ideas, scripts, or content calendars. The job is to audit what exists.\n\n## Approved Artifact Handoff\n\nAfter an approved synthesized write, explicit write\u002Fupdate mode, or any direct artifact mutation:\n\n- List every created or updated synthesized artifact path in the final response.\n- State the verification performed, such as readback, schema\u002Fcheck command, or why no executable verification applies for a Markdown-only strategy artifact.\n- Check and report the relevant git status for intended artifacts when the project is a git repository. If intended artifacts are modified or untracked, make the next action shipping, committing, or an explicit dirty-artifact handoff before recommending downstream strategy work.\n- Do not imply the research workflow is complete while approved artifacts remain untracked or uncommitted unless the user explicitly asked not to ship.\n- If stopping for approval before writing, the approval request remains the next action; do not include downstream routing.\n\n## Intent-Aware Routing\n\nBefore applying the default next-step routing, classify the user's immediate intent and route to the missing action that best serves that intent:\n\n- Strategy refresh: recommend the missing or stale positioning, programming, portfolio, metrics, or product-media artifact.\n- Recording prep: recommend the missing series spec, script, build proof, walkthrough guide, or validation artifact needed before recording.\n- Upload prep: recommend packaging, title\u002Fthumbnail, description, chapters, or final metadata work before broader strategy work.\n- Performance review: recommend metrics, cadence, portfolio, peer benchmark, or owner-analytics export work before new content planning.\n- Owner analytics or private\u002Fmanual platform evidence: route to an explicit manual\u002Fguide handoff instead of inventing unavailable metrics.\n- Dirty intended artifacts: route to shipping\u002Fcommit\u002Fhandoff first, not another creator strategy skill.\n\nUse the default next-skill sequence only when no stronger user intent, missing artifact, manual blocker, or dirty-artifact handoff applies.\n\n## Alignment Page\n\nWhen this skill produces durable deliverables (research, specs, plans, reports, prototypes, or any document output), build a full-depth HTML alignment page following `ALIGNMENT-PAGE.md` in this skill's directory. Output: `alignment\u002Fyoutube-audit-{topic}.html`.\n\n## Default Shipping Contract\n\nFollow the shared shipping contract convention in CLAUDE.md.\n",{"name":5,"type":43,"version":49,"description":7,"argument-hint":50},"v0.2","\u003Cchannel URL or handle> [--count N]","master","96e2912af886dd1606b1b97df707715aef062b02","packs\u002Fyoutube-ops\u002Fcodex\u002Fyoutube-audit\u002Farchive\u002Fv0.2",0,"https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills","https:\u002F\u002Fagentic-skills-blush.vercel.app","https:\u002F\u002Fgithub.com\u002FGeorgeQLe","georgeqle.com","George Le is a futurist and serial tech entrepreneur who wants to work toward a world where humanity is free from robotic tasks.","2026-11-10 04:07:24",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add GeorgeQLe\u002Fagentic-skills --skill youtube-audit",{"tool":67,"command":68},"bunx","bunx skills add GeorgeQLe\u002Fagentic-skills --skill youtube-audit",{"tool":70,"command":71},"pnpm","pnpm dlx skills add GeorgeQLe\u002Fagentic-skills --skill youtube-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Fpacks\u002Fyoutube-ops\u002Fcodex\u002Fyoutube-audit\u002Farchive\u002Fv0.2\u002FSKILL.md",true,[],[76,88,98,110,123,134],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":44},"01M6G0NJES15RJKZE6YZ0TSYGF","source-checkout-allowed","Valid source-checkout-only fixture.","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Ftests\u002Ffixtures\u002Fskill-install-routing\u002Fvalid\u002Fsource-checkout-allowed\u002FSKILL.md",[],[83,84,85,86,37,87],"source checkout allowed","checkout","fixture","only","valid",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":44},"01M6G0NFZ3R1MNB1E3DVTM0WB7","deck-install-valid","Valid deck install fixture.","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Ftests\u002Ffixtures\u002Fskill-install-routing\u002Fvalid\u002Fdeck-install\u002FSKILL.md",[],[95,96,97,87,85,37],"deck install valid","deck","install",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":44},"01M6G0ND3QZQC4MDZ9NVB97PT2","codex-pack-guard-valid","Valid Codex Pack Availability Guard fixture.","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Ftests\u002Ffixtures\u002Fskill-install-routing\u002Fvalid\u002Fcodex-pack-guard\u002FSKILL.md",[],[105,106,107,87,108,109,85,37],"codex pack guard valid","pack","guard","codex","availability",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":119,"publishedAt":44},"01M6G0NA9YB3NKGZKD3S96JMNB","codex-missing-skill-valid","Valid Codex missing skill fallback fixture.","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Ftests\u002Ffixtures\u002Fskill-install-routing\u002Fvalid\u002Fcodex-missing-skill-fallback\u002FSKILL.md",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[120,121,87,108,37,122,85],"codex missing skill valid","missing","fallback",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":130,"publishedAt":44},"01M6G0N7PC0EKFD40ZWQAXSAQ9","codex-base-skill-fallback-valid","Valid Codex base skill fallback fixture.","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Ftests\u002Ffixtures\u002Fskill-install-routing\u002Fvalid\u002Fcodex-base-skill-fallback\u002FSKILL.md",[129],{"categoryNo":117,"categoryName":118,"taxonomyType":21,"taxonomyTypeDesc":22},[87,108,122,131,132,133,37,85],"base skill","codex base skill fallback valid","base",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":44},"01M6G0N4VRR2YKZQ6N3Y6S2BQA","claude-pack-guard-valid","Valid Claude Pack Availability Guard fixture.","https:\u002F\u002Fgithub.com\u002FGeorgeQLe\u002Fagentic-skills\u002Fblob\u002Fmaster\u002Ftests\u002Ffixtures\u002Fskill-install-routing\u002Fvalid\u002Fclaude-pack-guard\u002FSKILL.md",[],[87,107,106,141,109,37,85],"claude pack guard valid"]