agentleFS
CHB-learnerCHB-learner/scholarflow-claude-skills/skills/daily-papers-fetch/SKILL.md

daily-papers-fetch

Skill4 starsChanged 6 months agoMITView on GitHub

论文抓取(3 步流水线的第 1 步)。根据 Claude 生成的多样化关键词,执行多源检索、 规范化、去重、排序和基础富化,输出 candidates/source_diagnostics/dedup_stats 供后续 skill 使用。

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. huangkiki/dailypaper-skills★ 1.3k25% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

Files
SKILL.md

开始前: 先说一声 "开始抓取论文 🐕" 并告知今天日期。如果是多天模式,告知抓取范围。

论文抓取 (Multi-source Fetch + Dedup + Enrich)

你是 用户的论文抓取系统(3 步流水线的第 1 步)。抓取最新论文 → 打分筛选 → 富化信息 → 保存到临时文件。

Step 0: 读取共享配置

先读取 ../_shared/user-config.json,如果 ../_shared/user-config.local.json 存在,再用它覆盖默认值。

显式生成并在后续统一使用这些变量:

  • VAULT_PATH
  • DAILY_PAPERS_PATH
  • KEYWORDS
  • NEGATIVE_KEYWORDS
  • DOMAIN_BOOST_KEYWORDS
  • ARXIV_CATEGORIES
  • MIN_SCORE
  • TOP_N

其中:

  • DAILY_PAPERS_PATH = {VAULT_PATH}/{daily_papers_folder}
  • DAILY_RUN_DIR = {DAILY_PAPERS_PATH}/{YYYY-MM-DD},例如 Dailypaper/2026-05-20
  • 所有关键词、分类、阈值都以共享配置为准

后续统一以共享配置和上面的变量为准。

路径契约(必须)

每日抓取只能写入:

{DAILY_PAPERS_PATH}/{YYYY-MM-DD}/_meta/

执行前必须设置:

DATE_DIR="$(date +%F)"
DAILY_RUN_DIR="{DAILY_PAPERS_PATH}/$DATE_DIR"
META_DIR="$DAILY_RUN_DIR/_meta"

禁止创建或写入:

  • {DAILY_PAPERS_PATH}/{月份}/{DD}/_meta
  • {DAILY_PAPERS_PATH}/{月份}/{MMDD}/_meta
  • 任何 5月/0520、5月/520 这类目录

如果旧式月份目录已经存在,不要继续写入。若同一天目标目录不存在,先迁移旧目录到 {DAILY_PAPERS_PATH}/{YYYY-MM-DD}/;若目标目录已存在,只使用目标目录。

解析天数

从用户输入中解析 --days N 参数。匹配规则:

  • "过去一周"、"最近7天"、"一周的论文" → --days 7
  • "过去3天"、"最近三天"、"抓3天" → --days 3
  • "过去两周" → --days 14
  • 无特殊指定 / "跑一下论文抓取" → 不加 --days(默认当天)

将解析出的天数存为变量 DAYS_ARG,在后续脚本调用中使用。

配置来源

  • 默认配置在 ../_shared/user-config.json
  • 个人覆盖配置放在 ../_shared/user-config.local.json
  • 如果两者都存在,以 local 为准

工作流程

Phase 1: 多源抓取 + 规范化 + 去重(纯 Python 脚本)

用 multi_source_fetch.py 一步完成免费核心源抓取、统一 Paper schema、强 ID 去重、标题相似度去重、排序和诊断。零 token 消耗。

DATE_DIR="$(date +%F)"
DAILY_RUN_DIR="{DAILY_PAPERS_PATH}/$DATE_DIR"
META_DIR="$DAILY_RUN_DIR/_meta"
mkdir -p "$META_DIR"
python3 ~/.claude/skills/daily-papers/multi_source_fetch.py \
  --topic "每日论文" \
  --queries-json '["{Claude生成的英文检索词1}", "{Claude生成的英文检索词2}"]' \
  --since-year {年份下限} \
  --max-results 100 \
  --sources auto \
  --output "$META_DIR/candidates.json"

脚本自动完成:

  • 查询 arXiv、Semantic Scholar、OpenAlex、Crossref、OpenReview、PubMed、Europe PMC、bioRxiv、medRxiv
  • 将来源字段统一为 Paper schema
  • 按 DOI / arXiv ID / OpenReview ID / PMID / PMCID 合并
  • 无强 ID 时按规范化标题、年份接近、作者重叠合并
  • 输出 rank_score 排序后的候选

输出文件:

  • $META_DIR/candidates.json
  • $META_DIR/source_diagnostics.json
  • $META_DIR/dedup_stats.json
  • $META_DIR/plan.json

检查输出:确认 $META_DIR/candidates.json 存在且包含有效 JSON 数组。如果为空数组或文件不存在,检查 source_diagnostics.json 诊断问题。

Phase 2: 批量富化(enrich_papers.py 脚本)

用 enrich_papers.py 脚本一次性富化所有论文。脚本使用 asyncio + curl 子进程并发请求,纯 regex 解析 HTML,无需 WebFetch。

将候选文件复制/传入富化脚本:

python3 ~/.claude/skills/daily-papers/enrich_papers.py \
  "$META_DIR/candidates.json" \
  "$META_DIR/enriched.json"

注意:使用文件路径参数(而非 stdout 重定向),避免 sandbox 环境下 stdout/stderr 混淆。

脚本自动完成以下工作(Semaphore(10) 限制并发,单篇超时 30 秒):

  • 并行抓取 HTML 页面 + PDF 页面
  • 从 HTML 提取:figure_url、authors、affiliations、section_headers、captions、has_real_world、method_names、method_summary
  • 从 PDF 提取:affiliations(通过 pdftotext | extract_affiliations.py)
  • 如果 HTML authors 为空,fallback 到 abs 页面 <meta> 标签提取 authors/affiliations
  • 合并优先级(脚本内部处理):
    • figure_url: HTML curl
    • affiliations: PDF > HTML > abs fallback > Phase 1 data
    • authors: HTML > abs fallback > Phase 1 data
    • 其他字段: HTML regex 提取

输出格式:与输入相同的 JSON 数组,每篇论文增加以下字段:

  • figure_url (string): 首图 URL
  • affiliations (string): 机构列表,逗号分隔
  • authors (string): 作者列表(可能被更完整的来源覆盖)
  • section_headers (array): 章节标题
  • captions (array): 图表标题
  • has_real_world (bool): 是否包含真实实验
  • method_names (array): 方法名列表
  • method_summary (string): 方法描述(300-500 字)

输出

完成后检查 $META_DIR/enriched.json 存在且包含有效 JSON 数组。告知用户:

  • 抓取了多少篇论文
  • 富化成功多少篇
  • 提示运行下一步:跑一下论文点评

注意事项

  • Phase 1 使用 multi_source_fetch.py 脚本,不启动 Task Agent,零 token 消耗
  • Phase 2 使用 enrich_papers.py 脚本,同样不启动 Task Agent
  • 如果脚本执行失败,检查 stderr 输出诊断问题
  • 如果某个来源抓取失败,脚本会在 source_diagnostics.json 记录错误并继续处理其他来源
  • 如果总论文数不足 20 篇,有多少处理多少
  • 不做 git 操作,不生成推荐文件,只输出 _meta JSON

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.