一键导入
gmail-scholar-daily
自动处理 Google Scholar Alerts 邮件,基于 MEMORY.md 过滤论文,生成 Markdown 日报。使用场景:用户说'生成scholar日报'、'处理scholar邮件'、'今天的scholar日报',或使用/gmail-scholar-daily命令。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
自动处理 Google Scholar Alerts 邮件,基于 MEMORY.md 过滤论文,生成 Markdown 日报。使用场景:用户说'生成scholar日报'、'处理scholar邮件'、'今天的scholar日报',或使用/gmail-scholar-daily命令。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.
Find and remove AI slop — the generic, machine-default visual and copy tics of vibe-coded products — from a web project. Use when the user asks to "kill AI slop", "de-slop", "remove the AI look", "make this not look AI-generated", or clean up a landing page / UI / docs that feels templated. Detects and fixes: indigo→violet gradients, gradient-clip headline text, warm amber/stone "cozy" palettes, the default semantic palette (info-blue / tip-amber / success-green / error-red), one-hue status boxes, atmospheric/ambient gradients, serif-italic emphasis on one word, serif where sans belongs, decorative strikes and highlights, highlighted keywords in copy, AI copywriting voice ("not just X — it's Y"), emoji everywhere, glowing status dots, rounded colored-left-border callouts, pastel rounded-square icon tiles, glassmorphism and over-rounding, oversized drop shadows, corners that don't nest, badge & pill spam, AI-drawn SVG icons, icons in a tint of themselves, kickers over every heading, full-sentence display headl
Read, search, and manage Gmail emails and Google contacts. Use when the user asks to check email, find emails, search messages, look up contacts, or find someone's email/phone. Supports multiple accounts.
使用 Camoufox 执行 Google Scholar 学术检索,支持关键词搜索、年份筛选、结果批量获取。当用户需要进行学术文献检索、查询论文、搜索学术资料时使用。
| name | gmail-scholar-daily |
| description | 自动处理 Google Scholar Alerts 邮件,基于 MEMORY.md 过滤论文,生成 Markdown 日报。使用场景:用户说'生成scholar日报'、'处理scholar邮件'、'今天的scholar日报',或使用/gmail-scholar-daily命令。 |
| allowed-tools | Read, Write, Bash, Skill, Task, AskUserQuestion |
作为主智能体(指挥官),协调 Gmail 访问、邮件解析、语义过滤和报告生成。
| 组件 | 类型 | 角色 | 文件位置 |
|---|---|---|---|
gmail-skill | Skill | Gmail 访问工具 | .claude/skills/gmail-skill/SKILL.md |
scholar-email-processor | Subagent | 邮件过滤专家 | .claude/agents/scholar-email-processor.md |
email_formatter.py | Script | 邮件解析工具 | .claude/skills/gmail-scholar-daily/scripts/email_formatter.py |
wechat_push | Skill | 企业微信推送 | .claude/skills/wechat_push/SKILL.md |
# 生成今天的日报
/gmail-scholar-daily
# 生成指定日期的日报
/gmail-scholar-daily 2026-02-03
| 组件 | 职责 | 读取文件 |
|---|---|---|
| 主流程 | 编排任务、汇总结果、生成日报、调用企业微信推送 | 仅读取子代理返回的 JSON 结果 |
| Subagent | 读取论文数据、读取研究兴趣、语义过滤 | papers_*.json + MEMORY.md |
| wechat_push skill | 推送日报到企业微信(支持 Markdown 文件内容或文件附件) | 通过 Skill tool 调用,独立处理推送逻辑 |
关键原则:
MEMORY.md - 避免冗余和上下文浪费MEMORY.md - 每个过滤任务独立完成# 强制规则:所有 Gmail API 调用必须通过代理(如 Clash Premium)
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890
# 优先方案:使用 --date-range 参数(推荐)
# 该参数自动将日期转换为 Unix 时间戳,避免 PST 时区问题
# 注意:限定只搜索 Inbox 中的邮件
target_date="2026-02-04"
result=$(python3 .claude/skills/gmail-skill/scripts/gmail_skill.py search \
"in:inbox from:scholaralerts-noreply@google.com" \
--date-range "$target_date" \
--account wzjlxy@gmail.com)
# 降级方案:如果当天无邮件,查询最新 6 封
if [ "$(echo $result | jq '.total')" -eq 0 ]; then
result=$(python3 .claude/skills/gmail-skill/scripts/gmail_skill.py search \
"from:scholaralerts-noreply@google.com" \
--max-results 6 \
--account wzjlxy@gmail.com)
fi
关键说明:
www.googleapis.com,必须设置 https_proxy 和 http_proxy--account 参数指定 Gmail 账户,避免认证错误# 使用 --output 参数直接保存到 temps 目录
temps_dir="$CLAUDE_PROJECT_DIR/outputs/temps"
# 强制规则:每个 gmail_skill.py 调用都必须包含代理设置和 --account 参数
Bash(command=f"export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 && python3 .claude/skills/gmail-skill/scripts/gmail_skill.py read {id1} --account wzjlxy@gmail.com --output {temps_dir}/email_{id1}.json")
Bash(command=f"export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 && python3 .claude/skills/gmail-skill/scripts/gmail_skill.py read {id2} --account wzjlxy@gmail.com --output {temps_dir}/email_{id2}.json")
# ... 所有邮件(在同一消息中并行调用)
# 并行调用 email_formatter.py
# 注意:email_formatter.py 位于 scholar-daily/scripts/ 目录,不是 gmail-skill/scripts/
Bash(command=f"python3 .claude/skills/gmail-scholar-daily/scripts/email_formatter.py {temps_dir}/email_{id1}.json --output {temps_dir}/papers_{id1}.md --json-output {temps_dir}/papers_{id1}.json")
Bash(command=f"python3 .claude/skills/gmail-scholar-daily/scripts/email_formatter.py {temps_dir}/email_{id2}.json --output {temps_dir}/papers_{id2}.md --json-output {temps_dir}/papers_{id2}.json")
# ... 所有邮件(在同一消息中并行调用)
输出文件:
papers_{id}.md - Markdown 格式(人工查看用)papers_{id}.json - JSON 格式(过滤阶段用)# 关键:并行启动 subagent
Task(
subagent_type="scholar-email-processor",
description=f"过滤邮件: {email1_subject}",
prompt=f"""请过滤以下邮件中的相关论文:
邮件 ID: {email_id}
主题: {subject}
已解析论文文件: {temps_dir}/papers_{email_id}.json
任务:
1. 读取 {temps_dir}/papers_{email_id}.json 获取论文列表
2. 读取 $CLAUDE_PROJECT_DIR/MEMORY.md 了解研究兴趣
3. 对每篇论文进行语义过滤,判断相关度
4. 返回 JSON 格式结果
论文已解析完成,无需调用 email_formatter.py。
"""
)
# 邮件2、3、4、5... 同样在同一条消息中并行调用
重要提示:
gmail read 或 email_formatter.py此步骤只需处理Step 4子代理返回的 JSON 结果
# 等待所有 subagent 完成,收集结果
total_emails = len(results)
total_papers = sum(r["total_papers"] for r in results)
relevant_papers = []
for r in results:
relevant_papers.extend(r["relevant_papers"])
# 按相关度排序(星级从高到低)
def star_to_number(star_str):
return star_str.count('★')
relevant_papers.sort(key=lambda x: star_to_number(x.get("relevance_score", "★☆☆☆☆")), reverse=True)
基于 Step 5 汇总的结果生成日报
日报包含三个章节:
完整模板见 REFERENCE.md。
保存路径:
$CLAUDE_PROJECT_DIR/outputs/scholar-reports/scholar-report-YYYY-MM-DD.md(如冲突自动添加 _1, _2 后缀)wechat_push skill)# 跨平台文件保存:先保存本地,再推送到企业微信
from pathlib import Path
def get_unique_path(filepath: Path) -> Path:
"""如果文件已存在,添加后缀避免覆盖"""
if not filepath.exists():
return filepath
counter = 1
while True:
new_path = filepath.with_stem(f"{filepath.stem}_{counter}")
if not new_path.exists():
return new_path
counter += 1
# 1. 保存到本地(自动创建目录,处理文件名冲突)
report_dir = Path("$CLAUDE_PROJECT_DIR") / "outputs" / "scholar-reports"
report_dir.mkdir(parents=True, exist_ok=True)
local_path = report_dir / f"scholar-report-{date}.md"
unique_local_path = get_unique_path(local_path)
# 写入日报内容到 unique_local_path
# 2. 推送到企业微信(使用 Skill tool 调用 wechat_push skill)
# 优先使用 send-markdown-file,直接读取日报内容并按 Markdown 推送
wechat_push_result = Skill(
skill="wechat_push",
args=f"send-markdown-file {unique_local_path}"
)
# 如果 Markdown 推送失败,可降级为发送文件附件
# wechat_push skill 会返回推送结果或错误信息,在此记录警告即可
错误处理:如果企业微信推送失败,仅记录警告,不影响日报生成完成状态。本地文件始终保存成功。
# 批量删除(使用逗号分隔多个 ID)
# 强制规则:必须包含代理设置、--account 参数
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890
python3 .claude/skills/gmail-skill/scripts/gmail_skill.py trash "id1,id2,id3,id4" --account wzjlxy@gmail.com
错误处理:删除失败仅记录警告,不影响日报生成完成状态。
# 清理 temps 目录下的所有内容
rm -rf ${temps_dir}/*
✅ Scholar Alerts 日报生成完成
📊 统计:
- 处理邮件: X 封
- 总论文数: Y 篇
- 相关论文: Z 篇
📁 日报路径:
- 本地: outputs/scholar-reports/scholar-report-YYYY-MM-DD[_n].md
- 企业微信: 推送成功(Markdown 内容已发送)
上传失败时:
📁 日报路径:
- 本地: outputs/scholar-reports/scholar-report-YYYY-MM-DD[_n].md
- 企业微信: 推送失败 - {错误原因}
如果有 5 星论文,可以简要列出标题:
⭐ 今日高光论文:
- [论文标题1] (★★★★★)
- [论文标题2] (★★★★★)
不要输出:完整的论文列表、所有论文的详细摘要。
| 错误类型 | 处理方式 |
|---|---|
| 无邮件 | 提示"未找到 {date} 的 scholaralerts 邮件" |
| Subagent 失败 | 记录错误,继续处理其他邮件 |
| 无相关论文 | 提示"今日无相关论文",生成空日报(仅统计摘要) |
| 删除邮件失败 | 记录警告,不影响日报生成 |
Gmail search → 邮件 ID 列表
↓
并行读取 → outputs/temps/email_{id}.json
↓
并行解析 → outputs/temps/papers_{id}.md + papers_{id}.json
↓
并行过滤 → Subagent 读取 .json, 返回过滤结果
↓
汇总生成日报 → outputs/scholar-reports/scholar-report-YYYY-MM-DD.md
↓
推送日报到企业微信 (wechat_push skill)
↓
删除已处理邮件(移到垃圾箱)
↓
清理 temps 目录
| 文档 | 内容 |
|---|---|
| REFERENCE.md | 日报模板、输出格式详细说明 |
| CONFIG.md | 常量定义、配置说明 |
| gmail-skill | Gmail 访问能力 |
| scholar-email-processor | Subagent 详细说明 |