بنقرة واحدة
daily-news
每日资讯日报生成器。三阶段工作流:获取元数据、生成摘要、输出日报。 触发场景:每日新闻、资讯日报、信息监控、新闻聚合、daily news、生成日报。 也用于添加新信源(自动分析网页并生成 method 文件)。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
每日资讯日报生成器。三阶段工作流:获取元数据、生成摘要、输出日报。 触发场景:每日新闻、资讯日报、信息监控、新闻聚合、daily news、生成日报。 也用于添加新信源(自动分析网页并生成 method 文件)。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
所有联网操作必须通过此 skill 处理,包括:搜索、网页抓取、登录后操作、动态页面交互等。 触发场景:用户要求搜索信息、查看网页内容、访问需要登录的网站、操作网页界面、抓取社交媒体内容(小红书、微博、推特等)、读取动态渲染页面、以及任何需要真实浏览器环境的网络任务。
Use when creating new skills, editing existing skills, or verifying skills work before deployment
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.
Automate creating a GitHub repository and deploying a web project to Vercel. Use when the user asks to deploy a website/app to production, publish a project, or set up GitHub + Vercel deployment.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Generate bilingual GitHub release documentation (README.md + README.zh.md) from repo metadata and user input, and guide release prep with git add/commit/push. Use when the user asks to write or polish README files, create bilingual docs, prepare a GitHub release, or mentions release assistant/README generation.
| name | daily-news |
| description | 每日资讯日报生成器。三阶段工作流:获取元数据、生成摘要、输出日报。 触发场景:每日新闻、资讯日报、信息监控、新闻聚合、daily news、生成日报。 也用于添加新信源(自动分析网页并生成 method 文件)。 |
三阶段工作流:获取元数据 → 生成摘要 → 输出日报
首次运行询问工作目录路径(如 ~/daily-news),后续记住。
<workspace>/
├── profile.yaml # 用户画像(关于我、关注什么)
├── settings.yaml # 日报设置(语言、格式偏好)
├── methods/ # 信源获取方法
├── data/news.db # SQLite 数据库
└── output/YYYY-MM-DD.md # 日报输出
初始化:
mkdir -p <workspace>/methods <workspace>/data <workspace>/output
cp references/examples/settings.example.yaml <workspace>/settings.yaml
cp references/examples/profile.example.yaml <workspace>/profile.yaml
python3 scripts/db.py init --db <workspace>/data/news.db
初始化完成后:
~/.claude/CLAUDE.md,追加一行:
- daily-news skill 的项目目录在:<workspace>
这样后续新会话无需再询问目录位置。在执行抓取前,询问用户日期范围,从源头减少非必要工作量。
请选择抓取时间范围:
1. 今天(默认) → published_at >= 今天
2. 昨天 → published_at >= 昨天
3. 最近3天 → published_at >= 3天前
4. 最近7天 → published_at >= 7天前
5. 从上次抓取至今(增量) → published_at >= last_fetched_date
6. 自定义日期范围 → 输入开始日期
每个信源独立追踪抓取日期:
# methods/twitter-karpathy.yaml
source_id: twitter-karpathy
...
# 自动维护的元数据
last_fetched_date: "2026-01-27" # 上次抓取日期
last_fetched_count: 5 # 上次抓取数量
total_items_fetched: 127 # 累计总数
数据库记录:
source_status 表:快速查询上次抓取日期source_sync_log 表:详细同步日志# 1. 获取上次抓取日期
python3 scripts/db.py source-status --db <db> --source <source_id>
# 2. 执行增量抓取
# 在 method 执行时传入 since 参数
# 3. 记录同步日志
python3 scripts/db.py add-items-incremental \
--db <db> \
--source <source_id> \
--items '<json>' \
--since "2026-01-27"
遍历 <workspace>/methods/ 目录,执行每个 method 文件。
对每个 method,执行前检查:
# 1. 读取 method 文件中的 last_fetched_date
python3 -c "
import yaml
with open('methods/<source>.yaml') as f:
config = yaml.safe_load(f)
print(config.get('last_fetched_date', 'never'))
"
# 2. 或查询数据库
python3 scripts/db.py source-status --db <db> --source <source_id>
情况 A:method 有上次日期,且用户选择"增量"
# 只抓取 last_fetched_date 之后的内容
# 在 method 执行时传入 since 参数
情况 B:method 首次抓取,或用户选择"今天/最近N天"
# 使用用户指定的日期范围
第一层:抓取时过滤(阶段 1)
# 在 method 执行时,只返回 published_at > since 的内容
第二层:入库前检查(阶段 1.5)
# 批量检查 URL 是否已存在
python3 scripts/db.py check-existing \
--db <db> \
--urls '["url1", "url2", ...]'
# 返回已存在的 URL 列表
第三层:数据库 UNIQUE 约束(最终保护)
-- items 表的 url 字段有 UNIQUE 约束
INSERT INTO items ... -- 重复 URL 会触发 IntegrityError
python3 scripts/db.py add-items-incremental \
--db <db> \
--source <source_id> \
--items '<json>' \
--since "2026-01-27"
此命令会:
source_sync_log 表source_status 表的 last_fetched_date执行前先检查是否有信源需要 Browser MCP(extends: browser-smart 或 detail_method: browser):
如果有,执行以下检查流程:
# 检查 ~/.claude.json 中是否有 browsermcp 配置
grep -q '"browsermcp"' ~/.claude.json && echo "configured" || echo "not configured"
如果未配置,自动添加:
# 读取现有配置,在 mcpServers 中添加 browsermcp
# 使用 Python 或 jq 修改 JSON
python3 -c "
import json
config_path = '$HOME/.claude.json'
with open(config_path, 'r') as f:
config = json.load(f)
if 'mcpServers' not in config:
config['mcpServers'] = {}
if 'browsermcp' not in config['mcpServers']:
config['mcpServers']['browsermcp'] = {
'command': 'npx',
'args': ['@browsermcp/mcp@latest'],
'type': 'stdio'
}
with open(config_path, 'w') as f:
json.dump(config, f, indent=2)
print('Browser MCP 配置已添加,请重启 Claude Code 生效')
else:
print('Browser MCP 已配置')
"
调用 mcp__browsermcp__browser_snapshot 测试连接
判断结果:
Page URL: → 已连接,继续执行No connection to browser extension → 未连接mcp__browsermcp__browser_snapshot is not a function 或类似错误 → MCP 未加载MCP 未加载(刚添加配置):
Browser MCP 配置已添加。请:
1. 重启 Claude Code(Ctrl+C 退出后重新运行)
2. 重启后再次运行日报生成
MCP 已加载但未连接:
Browser MCP 未连接到浏览器。请:
1. 安装 Chrome 扩展:https://chromewebstore.google.com/detail/bjfgambnhccakkhmkepdoekmckoijdlc
2. 在 Chrome 中点击扩展图标,点击 "Connect" 按钮
3. 然后重新运行
或者跳过这些信源,只处理 RSS/WebFetch 信源?
用户可选择跳过或等待连接后继续。
必须使用 mcp__browsermcp__*,因为它复用用户浏览器的登录态,可访问需要登录的内容。其他浏览器工具(playwright/chrome-devtools)会启动独立实例,无法使用已登录的账号。
读取 method 文件的元数据,根据 extends 字段决定执行方式:
有 extends(引用通用方法):
# extends: rss(最快,有 RSS 源时首选)
python3 references/methods/rss.py --url "<source_url>"
# extends: webfetch-smart(快,适用大多数网站)
# 读取 references/methods/webfetch-smart.md 按指引操作
# extends: browser-smart(Browser MCP,JS渲染/需登录)
# 读取 references/methods/browser-smart.md 按指引操作
# 注意:需要用户先点击 Browser MCP 扩展连接
无 extends(完整定制):
*.py: 直接执行 python3 <file>*.md: 读取内容,按指引操作浏览器python3 scripts/db.py add-items \
--db <workspace>/data/news.db \
--source <source_id> \
--items '<JSON>'
python3 scripts/db.py list-pending --db <workspace>/data/news.db
对每条内容,根据 method 文件的 detail_method 字段获取正文:
| detail_method | 获取方式 |
|---|---|
fetch | WebFetch 工具(快) |
browser | Browser MCP(慢,需手动连接) |
| 未指定 | 默认 fetch |
按 references/prompts/summary.md 生成摘要,更新数据库:
python3 scripts/db.py update-summary \
--db <workspace>/data/news.db \
--id <item_id> \
--data '<摘要JSON>'
python3 scripts/db.py list-today --db <workspace>/data/news.db
读取 <workspace>/profile.yaml,按 references/prompts/report.md 生成日报。
输出到 <workspace>/output/YYYY-MM-DD.md。
画像用于评估内容相关度,自然语言描述,没有固定格式。
初始化时已创建空白 profile.yaml,询问用户是否需要调整:
根据回答更新 <workspace>/profile.yaml。
用户说"更新画像"时:
about: |
(关于我:身份、工作)
focus: |
(当前关注:最近在意的话题)
low_priority: |
(不太关心:降低优先级的内容)
按优先级依次尝试:
检查 RSS
/feed、/rss、/atom.xml 等常见路径<link rel="alternate" type="application/rss+xml">extends: rss测试 WebFetch
extends: webfetch-smart使用浏览器
extends: browser-smart创建 method 文件,详见 references/schemas/method.md
| 资料 | 路径 | 加载时机 |
|---|---|---|
| Method 规范 | references/schemas/method.md | 添加信源时 |
| 摘要提示词 | references/prompts/summary.md | 阶段 2 |
| 日报提示词 | references/prompts/report.md | 阶段 3 |
| 通用方法 | references/methods/ | 阶段 1(被 extends 引用) |
| 日报设置示例 | references/examples/settings.example.yaml | 初始化 |
| 画像格式参考 | references/examples/profile.example.yaml | 初始化时 |
| 网站模板 | references/website-template/ | 创建网站时 |
| Method 元数据示例 | references/examples/method-with-metadata.example.yaml | 增量抓取配置参考 |
# 批量检查 URL 是否已存在
python3 scripts/db.py check-existing --db <db> --urls '["url1", "url2"]'
# 增量添加条目(自动记录日志)
python3 scripts/db.py add-items-incremental \
--db <db> --source <id> --items '<json>' --since "2026-01-27"
# 查看信源同步状态
python3 scripts/db.py source-status --db <db> --source <id>
# 查看同步日志
python3 scripts/db.py sync-log --db <db> --source <id> --limit 10
# 升级到 V2(添加增量抓取支持)
sqlite3 <db> < scripts/migrate_v2.sql
pip install pyyaml feedparser requests beautifulsoup4
浏览器方式(browser-smart)使用 Browser MCP,需安装 Chrome 扩展。
日报生成后,可自动部署到网站。
使用内置网站模板:
# 复制模板到工作目录
cp -r references/website-template <workspace>/website
cd <workspace>/website
python3 build.py
<workspace>/
├── output/ # 日报 Markdown 输出
└── website/ # 网站项目
├── build.py # 构建脚本(来自模板)
├── dist/ # 生成的静态网站
└── README.md # 部署指南
references/website-template/build.py - 将 Markdown 转换为终端风格 HTMLREADME.md - 部署指南选择"创建网站"时自动执行:
复制模板:
cp -r references/website-template <workspace>/website
cd <workspace>/website
python3 build.py
初始化 Git:
git init
git add -A
git commit -m "Initial commit"
gh repo create daily-news-web --public --source=. --push
配置 Cloudflare Pages:
python3 build.pydist阶段 3 完成后,检查是否存在 website 目录:
询问用户是否需要创建网站:
日报已生成:output/2026-01-28.md
是否需要部署到网站?
1. 是,创建网站(Cloudflare Pages)
2. 否,仅保存 Markdown
询问用户如何更新:
日报已生成:output/2026-01-28.md
网站更新选项:
1. 立即构建并推送(自动部署到 Cloudflare)
2. 仅构建,稍后手动推送
3. 不更新网站
选择"立即构建并推送"时执行:
cd <workspace>/website
python3 build.py
git add -A
git commit -m "Add daily report for $(date +%Y-%m-%d)"
git push origin main
Cloudflare Pages 检测到 main 分支推送后自动重新部署。
如果用户选择稍后手动推送:
# 随时手动执行
cd <workspace>/website
python3 build.py # 重新构建网站
git add -A
git commit -m "Add report for YYYY-MM-DD"
git push origin main # 触发 Cloudflare 部署
首次创建网站时需配置:
python3 build.pydist详细配置见 <workspace>/website/README.md
如需修改网站样式,编辑 <workspace>/website/build.py 中的 CSS 变量。
原始模板保留在 references/website-template/ 供参考。