用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ccwq/infocard-pub --skill infocard-source-routing-decision-tree命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Use before infocard .docs authoring to select a registered theme from content-aware candidates. Owns the only content-to-theme association, capability filtering, bounded reproducible variation, and theme-decision.json.
Use when one URL or a complete user brief should become one published infocard through the .docs promotion workflow.
Light-batch publish 2–3 cards in parallel without worktree.
| name | infocard-source-routing-decision-tree |
| description | Route non-X infocard sources before subagent dispatch. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| metadata | {"hermes":{"tags":["infocard","source-routing","decision-tree","youtube","video","web-article","paper"],"related_skills":["infocard-publish-sop","infocard-mobile-verifier"]}} |
Use this skill before any Research A subagent dispatch or publish-bundle.json write, whenever the user provides a source URL that is NOT https://x.com/i/status/....
All infocard work stays in the current main checkout. This routing skill performs source classification only; it never creates, enters, removes, or recommends a Git worktree or clone. Authoring remains under .docs/<run-id>/<slug>/, and any promotion or publication is owned by infocard-publish-sop and its Publisher flow.
The protocol's default entry path assumes an X post: status URL → author + timestamp + body extractable in one fetch. Non-X sources break that assumption in three places:
t=952s timestamp was associated with an AutoResearch card earlier in the session.expected_public_identity field in the v3 bundle normally names an X account. For YouTube it must name the channel.Source URL provided
│
├─ x.com/i/status/<id> → existing X source flow, no change
│
├─ github.com/<owner>/<repo> → existing source-fallback-github.md flow
│
├─ youtu.be / youtube.com → YouTube video flow (this file)
│ 1. Extract metadata from ytInitialPlayerResponse
│ 2. Topic-detect BEFORE author delegation
│ 3. Reject "looks related to last card" without
│ explicit title / description evidence
│
├─ arxiv.org/abs/<id> → Paper flow (TODO: future contribution)
│
├─ news.ycombinator.com/item?id → HN discussion flow (TODO: future contribution)
│
└─ other web URL → Generic web article flow
(blog post, podcast transcript, etc.)
# 1. Fetch the watch page with a normal desktop User-Agent
curl -sL "https://www.youtube.com/watch?v=$VIDEO_ID" \
-A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
# 2. Extract title, duration, publish date from the embedded JSON blob
python3 -c "
import sys, re, json
h = sys.stdin.read()
m = re.search(r'var ytInitialPlayerResponse = (\{.+?\});', h)
d = json.loads(m.group(1))
micro = d.get('microformat',{}).get('playerMicroformatRenderer',{})
print('title:', micro.get('title',{}).get('simpleText',''))
print('lengthSeconds:', micro.get('lengthSeconds',''))
print('publishDate:', micro.get('publishDate',''))
print('description:', (micro.get('description',{}).get('simpleText','') or '')[:2000])
"
# 3a. Find the caption base URL (it is signed and time-limited)
python3 -c "
import sys, re, json
h = sys.stdin.read()
m = re.search(r'var ytInitialPlayerResponse = (\{.+?\});', h)
d = json.loads(m.group(1))
for tr in d.get('captions',{}).get('playerCaptionsTracklistRenderer',{}).get('captionTracks',[]):
print(tr.get('languageCode'), tr.get('baseUrl','')[:300])
"
# 3b. Fetch the captions
curl -sL "<caption-baseUrl>&fmt=srv3&lang=zh-Hans" -A "Mozilla/5.0"
Pitfall: caption URLs include a signed signature= parameter and an expire timestamp. After a few minutes the URL returns 404. If caption fetch 404, do not retry the same URL — re-fetch the watch page and extract a fresh caption URL.
Symptom: User supplied https://m.youtube.com/watch?v=8RedSkw1UjE&t=952s (a 20-min Graph Engineering video by 大飞说科技 / 最佳拍档). I read the URL and associated the t=952s timestamp with an AutoResearch card from earlier in the session, dispatched Research A + worktree + bundle, and only discovered the actual title 「什么是图工程」several minutes into the run.
Hard rule: Before any research delegation, verify the current main checkout, then fetch the source and report the title + description + topic in one line. Worktrees and temporary clones are prohibited. If the title disagrees with the assumed topic, stop and re-discuss with the user — do not let momentum push you into an off-topic run.
Concrete check that fits in a single turn:
curl -sL "$URL" -A "Mozilla/5.0" | python3 -c "
import sys, re
h = sys.stdin.read()
m = re.search(r'<meta property=\"og:title\" content=\"([^\"]+)\"', h) or \
re.search(r'<meta name=\"title\" content=\"([^\"]+)\"', h) or \
re.search(r'<title>([^<]+)</title>', h)
print('TITLE:', m.group(1) if m else 'NONE')
m = re.search(r'<meta property=\"og:description\" content=\"([^\"]+)\"', h)
print('OG_DESC:', m.group(1)[:300] if m else 'NONE')
"
If TITLE: NONE, the URL did not fetch successfully — fix the fetch before continuing. If the title is empty / generic ("YouTube"), the request was routed to a different domain.
{
"identity": {
"slug": "graph-engineering",
"title": "图工程(Graph Engineering):AI 智能体架构从 Loop 到 Graph 的范式迁移",
"expected_public_identity": "Graph Engineering (视频解读)"
},
"requirements": {
"source_type": "youtube-video",
"source_url": "https://m.youtube.com/watch?v=8RedSkw1UjE&t=952s",
"channel": "大飞说科技 / 最佳拍档",
"publish_date": "2026-08-02",
"duration_seconds": 1211,
"key_timestamps": {"952s": "视频后段 · Graph 拓扑 / 验证器"}
}
}
The meta.yaml source field should be youtube-video (not x-post). Card section 01 should be re-labelled VIDEO IDENTITY instead of PROJECT IDENTITY, with 频道 / 时长 / 发布日 / 关键时间戳 as the four headline cards.
After metadata extraction, refuse to publish when the source is:
Do not auto-publish. Report the access boundary in one line and ask the user to provide an alternative source. Do not pad with L3 community speculation.
Same pre-flight gate applies:
# Fetch the article
curl -sL "$URL" -A "Mozilla/5.0" > /tmp/source.html
# Extract: title, author byline (look for <meta name="author">),
# published date (look for <meta property="article:published_time">),
# description (og:description)
python3 -c "
import re
h = open('/tmp/source.html').read()
for prop in ['og:title', 'twitter:title', 'title']:
m = re.search(rf'<meta (?:property|name)=\"{prop}\" content=\"([^\"]+)\"', h)
if m: print(f'{prop}:', m.group(1)); break
for prop in ['og:description', 'twitter:description', 'description']:
m = re.search(rf'<meta (?:property|name)=\"{prop}\" content=\"([^\"]+)\"', h)
if m: print(f'{prop}:', m.group(1)[:300]); break
m = re.search(r'<meta name=\"author\" content=\"([^\"]+)\"', h)
if m: print('author:', m.group(1))
m = re.search(r'<meta property=\"article:published_time\" content=\"([^\"]+)\"', h)
if m: print('published:', m.group(1))
"
For arXiv papers: prefer https://arxiv.org/abs/<id> (HTML, easier to parse) over the PDF. og:title is usually the full title, <meta name="citation_author" content="..."> repeats for each author.
references/non-x-source-extraction-recipes.md — concrete curl + python snippets for YouTube, arXiv, podcast transcripts, and paywall-aware news sites