Home / All Skills / Content & Media Creation / tapestry-sources
Content & Media Creation · michalparkola/tapestry-skills

tapestry-sources

Unified content extraction and action planning. Use when user says "learn-this <URL>", "learn this <URL>", "weave <URL>", "help me plan <URL>", "extract and plan <URL>", "make this actionable <URL>", or similar phrases indicating they want to extract content and create an action plan. Automatically detects content type (YouTube video, article, PDF) and processes accordingly.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandInstall DepsNetwork AccessWrite FileDual-pass Audit
Author michalparkolaGitHub michalparkola/tapestry-skills ↗Stars 543License MIT(仓库根 LICENSE 文件;GitHub API spdx=MIT)Commit 80e1dc56df
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

The site entry 'Tapestry Sources' has no directory by the same name at this pinned commit (the repository only contains 7 skills: learn-this / article-extractor / youtube-transcript / ship-learn-next / scrum-sage / session-log / unblock-action). Based on the description 'download source materials from articles, PDFs, and YouTube subtitles', this report maps to the content acquisition orchestrator learn-this, using article-extractor and youtube-transcript, which it actually invokes, as the evidentiary basis for the download implementation.

README.md
| [Learn This](#0-learn-this-) | One command to extract content from any URL and turn it into an action plan. |
See the two records in verification.second_pass for the mapping rationale (the directory named tapestry-sources is unlocatable; the mapping to learn-this is recorded as a discrepancy-level note). The description of learn-this verbatim covers the three sources: 'Automatically detects content type (YouTube video, article, PDF) and processes accordingly.'

Content acquisition is dispatched based on URL type: YouTube routes to yt-dlp, articles route to readability/trafilatura, and PDFs route to curl+pdftotext. Detection and dispatching are entirely written as directly executable inline bash.

learn-this/SKILL.md
elif [[ "$URL" =~ \.pdf$ ]] || curl -sI "$URL" | grep -iq "Content-Type: application/pdf"; then CONTENT_TYPE="pdf"
YouTube detection uses 'if [[ "$URL" =~ youtube\.com/watch || "$URL" =~ youtu\.be/ || "$URL" =~ youtube\.com/shorts ]]', defaulting to article for others; PDFs also trigger a HEAD request to check the Content-Type. SKILL.md embeds the complete 'Complete Tapestry Workflow Script' (#!/bin/bash, Usage: tapestry <URL>) for the agent to copy and execute directly.

The YouTube branch follows a fixed pattern of fetching automatic subtitles with yt-dlp and deduplicating/cleaning them into plain text via inline Python, naming the output file after the video title.

learn-this/SKILL.md
yt-dlp --write-auto-sub --skip-download --sub-langs en --output "temp_transcript" "$URL"
The inline script immediately following uses 'seen = set()' to filter lines matching WEBVTT/Kind/Language/'-->' line by line and decode HTML entities, outputting "${VIDEO_TITLE}.txt", followed by 'rm -f temp_transcript.en.vtt'. youtube-transcript/SKILL.md is an expanded version of the same workflow (including manual subtitles priority, Whisper fallback, deleting audio, etc.).

The article branch uses a three-tier fallback chain: reader (Mozilla Readability) → trafilatura → curl + inline HTMLParser, installing missing tools on the spot via npm/pip.

article-extractor/SKILL.md
### Option 1: reader (Recommended - Mozilla's Readability) ```bash command -v reader ```
Installation commands are in the same file: 'npm install -g @mozilla/readability-cli' and 'pip3 install trafilatura'; the fallback is 'curl -s "URL" | python3 -c "…class ArticleExtractor(HTMLParser)…"', skipping script/style/nav/header/footer/aside/form. The title is extracted respectively from the first markdown line, the title in trafilatura --json, or regex matching <title>.

The PDF branch is the simplest: downloads via curl -L and extracts text using pdftotext; if poppler is missing, it does not block—it keeps the PDF and prints the installation command.

learn-this/SKILL.md
echo "⚠️ pdftotext not found. PDF downloaded but not extracted." echo " Install with: brew install poppler"
Upon successful extraction, it asks whether to keep the original PDF ('echo "Keep original PDF? (y/n)"'), otherwise removing it; the artifact is ${PDF_FILENAME%.pdf}.txt.

All branches conclude with 'convert title to a safe filename + save to the current working directory': stripping / : ? " < > | and truncating to 80-100 characters before appending .txt.

learn-this/SKILL.md
FILENAME=$(echo "$ARTICLE_TITLE" | tr '/' '-' | tr ':' '-' | tr '?' '' | tr '"' '' | cut -c 1-80 | sed 's/ *$//')
The YouTube branch applies similar sanitization to VIDEO_TITLE; article-extractor/SKILL.md provides a more comprehensive tr chain and recommends '< 100 chars'.

Content acquisition is only the first half: after obtaining the txt, learn-this strictly ('Always create an action plan') calls ship-learn-next to generate a 5-rep action plan, delivering two artifacts: 'content file + plan file'.

learn-this/SKILL.md
**IMPORTANT**: Always create an action plan after extracting content.
Correspondingly, learn-this is positioned in the skills table as 'The unified workflow that orchestrates everything' (README); the 'download source materials' capability of this entry corresponds to Step 1-2 in SKILL.md.

2Core Capabilities

01Automatically detect content type (YouTube / article / PDF) by URL and dispatch to the corresponding extraction pipeline
02Download YouTube subtitles and clean/deduplicate them into readable plain text (transcript file named after the video title)
03Fallback transcription for videos without subtitles: reports audio file size and awaits user confirmation before downloading audio for Whisper transcription
04Extract main body text from arbitrary article pages (three-tier tool fallback chain, including a zero-dependency inline HTML parser fallback)
05Download PDF and extract text using pdftotext (optional retention of the original file)
06Filename sanitization: generate cross-platform safe, length-constrained .txt filenames from titles
07Automatic dependency installation when missing (across brew / apt / pip / npm paths)
08Hand off extracted results to downstream (ship-learn-next to generate a 5-rep action plan), establishing a single entry point for 'fetch source → build plan'

3External Dependencies

KindDependency / Endpoint
cliyt-dlp(字幕/元数据/音频下载)
clireader(@mozilla/readability-cli 或 reader-cli,文章提取首选)
clitrafilatura(Python 文章提取备选)
clicurl(PDF 下载与文章兜底抓取)
clipdftotext(poppler,PDF 取文)
cliwhisper(openai-whisper,仅在完全无字幕时使用)
clipython3(VTT 去重清洗与 HTML 兜底解析的内联脚本)
networkYouTube(经 yt-dlp 取字幕/元数据/音频)
network目标网页(用户给的任意 URL:HEAD 探测、curl 抓 HTML、reader/trafilatura 拉正文)
network包管理器源(Homebrew / apt / PyPI / npm registry)——依赖自动安装路径上的网络出口

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Executes local scripts or commands: yt-dlp --list-subs / --write-sub / --write-auto-sub --skip-download --sub-l
  • scripts/ 或 SKILL.md: Declares dynamic installation of external language package dependencies
  • 网络端点: Declares external network access: YouTube (yt-dlp: subtitles, metadata, audio when necessary; youtube.com / youtu.be / /shorts/)
  • 本地工作目录: File read/write and artifact output: Current working directory: <title>.txt (cleaned main text/transcript, final artifact)
Audit Notes: According to the unified tiering criteria: this skill (content ingestion path) does not read credentials or user accounts. Outbound network targets are predictable—YouTube public subtitles, user-provided URLs, and official package manager registries, fitting 'standard network access + local read/write'. However, it does execute download CLIs (yt-dlp/curl/reader/trafilatura), writes remote content to disk, and automatically installs missing dependencies via brew/apt/pip/npm on demand (including sudo), placing it above pure local execution (Blue) but below Orange—the criteria for Orange (credential/cookie access or third-party plugin mirrors) do not apply here (Whisper is an optional local model without mirrors/proxies). Key considerations include fetching arbitrary URLs, automatic dependency installations, and passing extracted content into downstream models.

5Second-Pass Verification

  • [unlocatable] 任务表 name_slug=tapestry-sources 对应的 skill 目录 — git ls-tree -r HEAD 列名:LICENSE、README.md、article-extractor/SKILL.md、install.sh、learn-this/SKILL.md、scrum-sage/SKILL.md、session-log/SKILL.md、ship-learn-next/SKILL.md、unblock-action/SKILL.md、youtube-transcript/SKILL.md——无 tapestry-sources 或任何 sources 命名的目录/SKILL.md;pool.json 侧该条目 path="{空}"、来源为 awesome-skills.com 的 repo 级摘要。按任务书规则记为 unlocatable,不硬造目录。
  • [discrepancy] 映射决定:以 learn-this 作为本条目主体 — 站点摘要『Download sources from articles, PDFs, and YouTube video transcripts』与 learn-this frontmatter description 的三源检测('Automatically detects content type (YouTube video, article, PDF)')逐项对应,仓库内没有第二个覆盖三源的入口(article-extractor 只做文章、youtube-transcript 只做视频)。故 skill.path 记为 learn-this,报告显式说明这是映射而非同名命中;如需严格一一对应,本条目应在站点侧标注为 repo 级条目。
  • [ok] 文章三级降级链真实存在 — article-extractor/SKILL.md '## Extraction Methods' 依次 Method 1 reader、Method 2 trafilatura、Method 3 兜底 curl + 内联 HTMLParser;'## Complete Workflow' 用 if command -v reader / elif command -v trafilatura / else 分支实现,与 learn-this Step 2 的 case 一致。
  • [ok] YouTube 三段策略与确认门 — youtube-transcript/SKILL.md 明列 Option 1 --write-sub、Option 2 --write-auto-sub、Option 3 Whisper('**ONLY use this if both manual and auto-generated subtitles are unavailable.**'),且 Whisper 前有体积展示+等待确认、安装前再次等待确认、转写后询问是否删除音频——确认门原文均在。
  • [ok] PDF 分支的 pdftotext 与降级 — learn-this Step 2 PDF 段:curl -L 下载 → if command -v pdftotext → pdftotext 取文并可选删 PDF;否则打印 'pdftotext not found' 与 brew/apt 安装提示并保留 PDF 作为产物。
  • [ok] 无凭证读取(重要:决定档位) — 对 learn-this/article-extractor/youtube-transcript/install.sh/README 扫描 .env|API_KEY|token|secret|cookie|login 无命中;yt-dlp 未使用 --cookies-from-browser,Whisper 为本地模型,无任何账号依赖。故 credential_reads 为空、档位落黄而非橙。
  • [ok] 文件名清洗与写盘范围 — 清洗链在 learn-this(article 行)与 article-extractor(tr '/' '-' / tr ':' '-' / cut -c 1-80|100)均存在;产物写当前目录,中间文件 rm;install.sh 只写 $HOME/.claude/skills(SOURCE 目录为脚本自身所在目录)。
  • [ok] 安装命令是否需要提权 — youtube-transcript/SKILL.md 的 Linux 路径为 'sudo apt update && sudo apt install -y yt-dlp'(需要 sudo);macOS/pip/npm 路径无需提权。已如实写入 scripts_executed 与 external_deps。

6Verdict & Scenarios

  • A single entry point covering three types of source materials: dedicated pipelines and fallback strategies for YouTube subtitles, web articles, and PDFs, triggered simply by 'learn-this <URL>'.
  • Pragmatic fallback chain design: each content type presets secondary and tertiary fallbacks when preferred tools are missing/unavailable (including zero-dependency inline HTMLParser), ensuring results even in bare environments.
  • Confirmation gates for heavy operations: checks file size and waits for user consent before Whisper installation and audio downloading, asks whether to delete audio after transcription, and asks whether to keep the original PDF.
  • Clean artifacts: single .txt files named after the title are saved to the current directory, with intermediate files removed immediately to avoid polluting the project workspace.
  • Portable plain text: the entire capability is self-contained in SKILL.md, allowing full directory portability across host environments without depending on external script directories or runtimes.
  • Best for: Suitable for: knowledge workers looking to turn articles, PDF papers, or technical videos they are consuming into readable text (and generate an action plan along the way) with a single command; developers willing to install tools like yt-dlp/trafilatura/poppler locally; users needing to port the same ingestion workflow across hosts like Claude Code (plain-text skill with zero runtime dependencies).
    Not for: Not suitable for: content requiring credentials or authenticated sessions (paywalls, private repositories, cookie-gated sites—the skill lacks login capabilities, and article-extractor explicitly notes 'Paywall or login required → Cannot extract'); environments where agents are disallowed from installing software or executing sudo; teams with strict requirements for content provenance and compliance (no source attribution, no copyright handling); and scenarios requiring highly precise subtitles (limited accuracy of Whisper base models and yt-dlp auto-generated subtitles) or batch/large-scale scraping.
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload tapestry-sources.tar.gz
    sha256: 1da7c419a2dedca5…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 80e1dc56df.