每日 AI 资讯简报 (Daily AI News Digest)
Overview
一个经过真实生产验证的端到端工作流:用 agent-browser CLI 从中国科技媒体站点抓取当日最新 AI 头条,整理成白底黑字的 HTML 简报。该技能已经过实际运行检验,并规避了裸用浏览器自动化时常见的环境坑(Chromium 下载超时、链式命令偶发失败、自动化时区与推送机制等)。
When to use
- User asks for a daily / morning AI news digest ("每日AI资讯", "AI日报", "AI早报", "抓AI新闻").
- User wants AI news aggregated from AIbase and 量子位 (QbitAI).
- User wants to set up a recurring scheduled AI-news push.
权限与安全声明(平台审核参考)
本技能完全在本地运行,不收集、不上传任何用户隐私数据。其涉及系统资源的行为如下,已在脚本与提示词中明确约束:
- 启动本地浏览器:通过
agent-browserCLI 拉起本机已缓存的 Chrome(仅用于渲染新闻网页、读取正文),不会访问用户其他文件或网页。 - 网络下载(仅一次):
scripts/setup_browser.sh仅从 npmmirror 官方 CDN(cdn.npmmirror.com)下载指定版本的 Chrome-for-Testing 压缩包并缓存到用户目录;无硬编码密钥、无第三方数据外传。若机器已有可用 Chrome,可跳过此步、直接设置AGENT_BROWSER_EXECUTABLE_PATH。 - 读写工作区:仅在本技能所在工作目录生成
每日AI资讯_YYYY-MM-DD.html简报文件,不修改用户其他文件。 - 无外部 API Key / Token:不调用任何需要密钥的付费接口。
安全提示:脚本内唯一的下载源是 npmmirror 官方二进制镜像,请审核时据此确认无恶意网络行为。
Prerequisites (one-time per machine)
- Install the CLI:
npm install -g agent-browser. - Provide a Chromium binary. In restricted networks the built-in
agent-browser install(downloads from Google) often times out. Runscripts/setup_browser.shto fetch the same Chrome-for-Testing build from the npmmirror China CDN and cache it atC:/Users/Administrator/.agent-browser/chrome/. The script is idempotent. - During every run, export these two variables (the Rust binary wants a Windows-style path, not POSIX):
export AGENT_BROWSER_EXECUTABLE_PATH="C:/Users/Administrator/.agent-browser/chrome/chrome-win64/chrome.exe" export AGENT_BROWSER_ARGS="--no-sandbox"
Workflow
Step 1 — Fetch sources with agent-browser
agent-browser keeps a persistent background daemon: the first open starts it, later commands reuse it, close ends it. Run each major step as its own shell call — chained ; commands occasionally fail on the first open (see pitfalls).
export AGENT_BROWSER_EXECUTABLE_PATH="C:/Users/Administrator/.agent-browser/chrome/chrome-win64/chrome.exe"
export AGENT_BROWSER_ARGS="--no-sandbox"
agent-browser open "https://www.aibase.com/zh/news"
agent-browser wait --load networkidle
agent-browser snapshot > /tmp/aibase.txt
Then the second source as a separate call:
agent-browser open "https://www.qbitai.com/"
agent-browser wait --load networkidle
agent-browser snapshot > /tmp/qbitai.txt
agent-browser close
Extract headlines + timestamps from the two text snapshots:
- AIbase: lines containing
阅读文章(each entry also carries a relative time like2小时前/1天前). - 量子位:
heading "..."lines are the article titles.
Step 2 — Compile the white-theme HTML digest
Copy assets/digest-template.html as the starting point — it already carries the mandatory white-background / black-text :root palette plus light source/time tags. Replace the placeholder content with the day's real news, grouped into sections (typical: 大模型与公司动态 / 产品与发布 / 安全与法律 / 机器人与硬件 / 研究与仿真). Each item records 来源 + 时间. Save as 每日AI资讯_YYYY-MM-DD.html.
Hard rules for the output:
- Never write a dark default. Never rely on
@media (prefers-color-scheme: dark). - Keep the light palette as the only mode (any device/preview shows white bg + black text).
- Source tags: light-blue background, blue text. Time tags: light-gray background, gray text. No dark/near-black chip backgrounds.
Step 3 — Present the result
Use present_files on the generated HTML so the user can open it on desktop and mobile.
Step 4 (optional) — Schedule as a recurring automation
Create a daily automation. Critical settings (details in references/troubleshooting.md):
rruleMUST includeTZID=Asia/Shanghai, e.g.FREQ=DAILY;BYHOUR=9;BYMINUTE=0;TZID=Asia/Shanghai.- Embed the browser env vars and the rule "do not run
agent-browser install; reuse the cached Chrome" into the automation prompt. - Reality of delivery: runs land in
PENDING_REVIEWand do not auto-push a card; the client must be online around the trigger time, or the day is silently skipped (no backfill). The most reliable "push" is to re-present the generated HTML viapresent_fileswhen the user asks.
Resources
icon.png— 512×512 市场展示图标(蓝色新闻卡片风格)。assets/digest-template.html— white-background / black-text report template (start here).references/troubleshooting.md— environment pitfalls and automation delivery notes.scripts/setup_browser.sh— idempotent Chromium cache setup from npmmirror.
Key pitfalls (summary)
- Chained
;commands: the firstopensometimes exits 1 with no output. Runopen/wait/snapshotas separate Bash calls; re-running usually succeeds. - Stuck daemon: if a fetch hangs,
taskkill /F /IM chrome.exeandtaskkill /F /IM agent-browser.exe, then retry. - Chromium download from Google times out → use the npmmirror cached build via
scripts/setup_browser.sh. closeconnection error: the snapshot is usually already saved beforecloseruns; the error is harmless to ignore.
Scan to join WeChat group