# ai-news

Adopt this skill: https://proskills.md/skills/other/alan-houxj-ai-news-follow-skills-ai-news

Page: https://proskills.md/skills/other/alan-houxj-ai-news-follow-skills-ai-news
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/ai-news/SKILL.md
size: 10044
sha: 662050e7e58b5f81dc300ae0db669ac4418e4aa9
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/SKILL.md

````text
---
name: ai-news
description: 生成每日 AI 新闻日报并推送到飞书。当用户想要 AI 每日热点、AI 日报、AI 新闻，或想把日报接入飞书时使用。
---

# AI 每日资讯采集技能

> **什么时候用这个技能**：用户提到"AI 日报 / AI 新闻 / 今天 AI 圈有什么动态 / 推送日报 / 写入飞书表格"等意图时，按本文件流程执行。
>
> **用户可能怎么说**："帮我跑一下今天的 AI 日报" / "看看今天 AI 圈有什么大事" / "把日报推到我飞书"。

抓取当日 AI 资讯，筛选摘要成日报；若已配置飞书则同步落地三件套（多维表格 / 机器人推送 / 云文档归档）。**每条信息保留原始链接，可溯源**。

## 工作流程（Agent 严格按此执行）

### 第 0 步：环境准备

```bash
cd <skill目录>/scripts
python -c "import feedparser, requests" || pip install feedparser requests
```

lark-cli 无需手动指定：脚本自动探测 PATH 和常见安装位置（含 Windows npm 全局目录）。确实找不到且用户要做飞书配置时，先 `npx @larksuite/cli@latest install`。

### 第 1 步：采集原始条目

```bash
python fetch_sources.py --hours 24        # 输出 items.json（每日定时跑建议 --hours 26）
```

- 每个源在 `sources.json` 声明 `network: proxy|direct`：海外源走代理，中文源强制直连
- 个别源失败会记入 `items.json` 的 `errors`，继续执行，不要中断

### 第 2 步：筛选与摘要（Agent/LLM 的职责）

读取 `items.json` 全部条目，然后：

1. **去噪**：剔除与 AI 无关的条目（HN/InfoQ 混入大量非 AI 内容）
2. **去重合并**：同一事件多源报道合并，保留最权威的原文链接
3. **摘要**：每条 2-3 句中文，只陈述事实
4. **打标**：`category`（前沿动态/社区热点/中文资讯/论文速递/产品动态）、`importance`（高=行业级发布·融资·政策 / 中 / 低）、自由 `tags`
5. **当日总评**：写 2-3 句 `digest`，概括今天的爆点与大势

把结果写入 `scripts/selection.json`，格式如下（`idx` 引用 items.json 的数组下标；`source_override` 可选，用于把来源归一为表格选项名）：

```json
{
  "digest": "2-3 句当日总评",
  "items": [
    {"idx": 0, "title": "可覆盖标题", "summary": "摘要", "importance": "高",
     "category": "前沿动态", "tags": ["标签"], "source_override": "OpenAI"}
  ]
}
```

然后：

```bash
python make_curated.py       # 合成 curated.json（10-30 条）
```

**铁律**：`url` 只能取自 items.json 原文，不得改写或猜测——可溯源是本技能的核心价值。

### 第 3 步：落地（按配置分支，必须先判断）

**先检查 `scripts/config.json` 是否存在且 `base_token`/`table_id`/`user_open_id`/`base_url` 齐全：**

#### 分支 A：已配置 → 执行落地

```bash
python run_daily.py curated.json    # 写表格 + 卡片推送 + 云文档归档
```

- 写入前自动合并来源/标签选项池，逐条写入
- 推送三级降级保送达（卡片→markdown→纯文本）；归档未配置自动跳过
- 重复运行会重复写入，勿重跑

#### 分支 B：未配置 → 对话输出 + 现场引导

1. 把 curated.json 整理成日报正文直接回复用户（总评 + 每条"标题 / 摘要 / 原文链接"）
2. 然后问一句："要不要接入你的飞书？接入后日报会写进你的表格、每天推送到你私聊。"
3. 用户同意 → 执行「首次配置引导」（见下节），完成后再跑上面的落地命令
4. 用户拒绝 → 到此为止，不追问

### 首次配置引导（仅在用户同意接入飞书时执行）

前置：lark-cli 未安装则先 `npx @larksuite/cli@latest install`（需 Node.js）。

按顺序执行，每步把产物/链接直接发给用户：

1. **创建应用**：`lark-cli config init --new`（阻塞命令，输出授权链接和二维码）→
   把链接发给用户点确认。完成后凭证自动保存；但 bot 身份尚未开通任何 base/im 权限，需第 3 步申请并发布
2. **用户授权**：`lark-cli auth login --recommend`（同样输出链接/二维码）→
   用户扫码确认，所需权限自动申请自动审批。从输出提取 `ou_` 开头的 open_id
3. **给应用开通 bot 的 base/im 权限并发布**（漏掉会在最后一步报 access denied）：
   先 `lark-cli whoami` 取 `appId`，再把下面链接发给用户，让用户浏览器打开、逐条开通：

   ```text
   https://open.feishu.cn/page/scope-apply?clientID=<appId>&scopes=base%3Afield%3Aread,base%3Afield%3Aupdate,base%3Arecord%3Acreate,base%3Arecord%3Aread,im%3Amessage%3Asend_as_bot
   ```

   需开通的权限：base 字段/记录读写（base:field:read、base:field:update、
   base:record:create、base:record:read）和 im 发消息（细粒度 `im:message:send_as_bot`，
   别选聚合 `im:message`，个人账号开不了）。开通后到开发者后台「版本管理与发布」
   创建并发布一个版本，权限才生效。

   注意：`auth scopes` 查的是 user 身份、不产出 bot 权限链接；若脚本报 access denied，
   报错信息里会自带 `console_url`，直接用它最省事
4. **建表（--as user，表归用户所有）**：
   ```bash
   lark-cli base +base-create --name "AI资讯库" --table-name "AI日报" --time-zone "Asia/Shanghai" --as user --fields '[
    {"name":"标题","type":"text"},
    {"name":"摘要","type":"text"},
    {"name":"原文链接","type":"text"},
    {"name":"来源","type":"select","options":[{"name":"OpenAI"},{"name":"DeepMind"},{"name":"Anthropic"},{"name":"HuggingFace"},{"name":"Hacker News"},{"name":"TechCrunch"},{"name":"The Verge"},{"name":"MIT TR"},{"name":"InfoQ"},{"name":"arXiv"},{"name":"其他"}]},
    {"name":"分类","type":"select","multiple":true,"options":[{"name":"前沿动态"},{"name":"社区热点"},{"name":"中文资讯"},{"name":"论文速递"},{"name":"产品动态"}]},
    {"name":"标签","type":"select","multiple":true},
    {"name":"重要度","type":"select","options":[{"name":"高"},{"name":"中"},{"name":"低"}]},
    {"name":"日期","type":"dateTime"}
   ]'
   ```
   记下输出里的 `base_token` 和 `url`；再用 `base +table-list --base-token <token> --as user` 取 `table_id`
5. **把应用授权进表**（bot 后续写入需要）：
   ```bash
   lark-cli drive +member-add --token <base_token> --type bitable      --member-type appid --member-id <该应用的AppID，形如 cli_xxx> --perm full_access --as user --yes
   ```
   ⚠️ 不要用 bot 身份建表再授用户——新应用 bot 缺 drive 系权限且需发版生效；
   user 建表 + 授权 app 是实测通畅的组合，且表天然归用户所有
6. **建归档文档**（可选）：
   ```bash
   lark-cli docs +create --title "AI 日报归档" --content "本文档由 ai-news 技能每日自动维护：最新日报始终在最上方。" --doc-format markdown --as user
   lark-cli docs +fetch --doc <doc_token> --detail with-ids --as user   # 取"本文档由…"段的 <p id="..."> 作锚点
   ```
7. **写 `scripts/config.json`**：
   ```json
   {"base_token": "…", "table_id": "tbl…", "user_open_id": "ou_…",
    "base_url": "表格完整链接", "archive_doc_id": "…或空", "archive_anchor_block": "…或空"}
   ```
8. **端到端验证**：`python run_daily.py curated.json`，并告诉用户去飞书查看测试消息
9. **引导定时（重要，别漏）**：验证成功后主动问用户——"要不要设置每天早上 8 点自动推送？"
   - 用户同意 → 按当前 Agent 宿主的方式创建定时任务（ZCode 用 CronCreate 建 `0 8 * * *`，
     prompt 为"按 ai-news 技能完整执行今日 AI 日报流程"；其他宿主见仓库 `docs/scheduling.md`）
   - 用户拒绝 → 不追问，告知随时可以再说一声设置

引导失败时：把报错原样告诉用户，指路仓库 `docs/faq.md`，不要自行反复重试。

### 完成后：向用户报告

- **分支 A（已配置）**：四项报告——**今日条数、分类分布、总评一句话、失败源**
- **分支 B（未配置）**：日报正文 + 配置引导结果

若端到端失败：报告具体错误即可，不要重试超过一次。

## 用户配置（scripts/config.json）

由首次配置引导自动生成，一般无需手改。字段含义与获取方式见 `config.example.json` 注释；全部字段支持环境变量覆盖（`FEISHU_BASE_TOKEN` 等）。**本 skill 不含任何密钥**，飞书凭据由 lark-cli 全局配置管理。

## 前置依赖

1. Python 3.10+：`pip install feedparser requests`（第 0 步会自检）
2. 飞书落地（第 3 步分支 A）需 lark-cli：`npx @larksuite/cli@latest install`（需 Node.js）

## 信息源清单（sources.json，可增删）

| 源 | 方式 | 网络 |
|---|---|---|
| OpenAI 官方新闻 | RSS | 代理 |
| Google DeepMind 博客 | RSS | 代理 |
| Anthropic 新闻 | sitemap（官方无 RSS） | 代理 |
| Hugging Face 博客 | RSS | 代理 |
| TechCrunch AI | RSS | 代理 |
| The Verge AI | RSS | 代理 |
| MIT Tech Review AI | RSS | 代理 |
| Hacker News AI 热帖 | Algolia API（时间窗+票数+词边界过滤） | 直连 |
| InfoQ 中文 | RSS（AI 相关由第 2 步筛） | 直连 |
| arXiv cs.AI | arXiv API | 代理 |
| arXiv cs.CL | arXiv API | 代理 |

失效处理：RSS 地址变更时先 curl 验证再更新 sources.json；机器之心/量子位（免费接口关闭）、xAI/Stability（反爬与导航页噪音）均已不可用，不要浪费时间重试。

## 定时执行

技能无状态，任意调度器可调，推荐每天 08:00（Asia/Shanghai）。**用户表达"每天自动 / 定时推送"意图时，主动帮他配好**：ZCode 宿主直接用 CronCreate 建 `0 8 * * *`（prompt："按 ai-news 技能完整执行今日 AI 日报流程"）；其他宿主的方式见仓库 `docs/scheduling.md`。定时触发与对话触发走的是同一套本文件流程。
````

## File: skills/ai-news/scripts/config.example.json
size: 1448
sha: 555864e98cfa64cdbef4ac893a3df5d539588291
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/scripts/config.example.json

```text
{
  "_说明": "复制本文件为 config.json 并填写。每项的获取方式见下方对应 _注释（自包含）；更详细的操作步骤见仓库 docs/setup.md。所有字段也可用同名大写环境变量覆盖（FEISHU_BASE_TOKEN / FEISHU_TABLE_ID / FEISHU_USER_OPEN_ID / FEISHU_ARCHIVE_DOC_ID / FEISHU_ARCHIVE_ANCHOR_BLOCK）。",

  "base_token": "",
  "_base_token": "多维表格 app_token：打开表格，浏览器地址栏 .../base/ 后面那串（如 QVO5xxxx），?table= 之前",

  "table_id": "",
  "_table_id": "数据表 table_id：表格地址栏 ?table= 后面那串（以 tbl 开头）；或用 lark-cli base +table-list --base-token <token> 查询",

  "user_open_id": "",
  "_user_open_id": "接收机器人私聊推送的用户 open_id（ou_ 开头）：lark-cli auth login 成功后输出里有；或 lark-cli whoami",

  "base_url": "",
  "_base_url": "必填。多维表格的完整链接：打开表格后直接复制浏览器地址栏整条 URL（域名因账号而异，无法自动拼接）",

  "archive_doc_id": "",
  "_archive_doc_id": "可选，日报归档云文档 token：文档地址栏 .../docx/ 后面那串；不需要归档功能就留空",

  "archive_anchor_block": "",
  "_archive_anchor_block": "可选，归档插入锚点块 id：文档说明段落块的 id，用 lark-cli docs +fetch --doc <doc> --detail with-ids 查（<p id=\"...\">本文档由...段）；新日报会插在它之后"
}
```

## File: skills/ai-news/scripts/fetch_sources.py
size: 6773
sha: a46ff6265238eac923b07354c51aa798b04a9078
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/scripts/fetch_sources.py

```text
#!/usr/bin/env python3
"""AI 资讯采集脚本：从各信息源抓取近 N 小时条目，输出结构化 JSON。

用法（任意目录均可）：
    python fetch_sources.py [--hours 24] [--out items.json]

输出的每条记录包含：source, category, title, url, published, summary_raw。
本脚本只负责"抓原文、给原始链接"，不做摘要与筛选——那是 Agent/LLM 的职责。

网络策略：每个源在 sources.json 里声明 network=proxy|direct。
  proxy  -> 使用环境变量 HTTPS_PROXY/HTTP_PROXY（无则直连）
  direct -> 强制直连（中文站点，走代理反而会被重置）
"""
import argparse
import json
import re
import sys
import time
from datetime import datetime, timedelta, timezone
from pathlib import Path
from xml.etree import ElementTree

import feedparser
import requests

HERE = Path(__file__).parent
UA = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/128.0 Safari/537.36"}

def make_session(network):
    s = requests.Session()
    s.headers.update(UA)
    if network == "direct":
        s.trust_env = False  # 忽略环境代理，强制直连
    return s

def within_hours(entry_dt, hours):
    if entry_dt is None:
        return True
    return (datetime.now(timezone.utc) - entry_dt) < timedelta(hours=hours)

def parse_published(parsed):
    if not parsed:
        return None
    try:
        return datetime(*parsed[:6], tzinfo=timezone.utc)
    except Exception:
        return None

def get_with_retry(session, url, params=None, attempts=3):
    last = None
    for i in range(attempts):
        try:
            return session.get(url, params=params, timeout=30)
        except requests.RequestException as exc:
            last = exc
            time.sleep(2 * (i + 1))
    raise last

def fetch_rss(src, hours):
    resp = get_with_retry(make_session(src.get("network")), src["url"])
    resp.raise_for_status()
    feed = feedparser.parse(resp.content)
    items = []
    for e in feed.entries:
        dt = parse_published(getattr(e, "published_parsed", None))
        if not within_hours(dt, hours):
            continue
        items.append({
            "source": src["name"],
            "category": src["category"],
            "title": e.get("title", "").strip(),
            "url": e.get("link", ""),
            "published": dt.isoformat() if dt else None,
            "summary_raw": (e.get("summary") or "")[:2000],
        })
    return items

AI_WORDS = ("ai", "llm", "gpt", "claude", "gemini", "openai", "anthropic",
            "deepmind", "agent", "transformer", "diffusion", "machine learning",
            "deep learning", "neural net", "copilot", "deepseek", "llama",
            "mistral", "foundation model", "inference")
# 词边界正则：避免 "ai" 子串误伤 said/email/detail 等
AI_WORDS_RE = re.compile(r"\b(?:" + "|".join(w.replace(" ", r"\s+") for w in AI_WORDS) + r")\b", re.I)

def fetch_hn(src, hours):
    # 按热度排序 + 动态时间窗口 + 最低票数；关键词过滤交给下游 LLM 做精准分类
    since = time.time() - hours * 3600
    params = {"tags": "story", "hitsPerPage": "30",
              "numericFilters": f"created_at_i>{int(since)},points>20"}
    resp = get_with_retry(make_session(src.get("network")), src["url"], params=params)
    resp.raise_for_status()
    items = []
    for hit in resp.json().get("hits", []):
        if hit.get("created_at_i", 0) < since:
            continue
        if not AI_WORDS_RE.search(hit.get("title") or ""):
            continue
        items.append({
            "source": src["name"],
            "category": src["category"],
            "title": hit.get("title") or hit.get("story_title") or "",
            "url": hit.get("url") or f"https://news.ycombinator.com/item?id={hit.get('objectID')}",
            "published": datetime.fromtimestamp(
                hit.get("created_at_i", 0), tz=timezone.utc).isoformat(),
            "summary_raw": (hit.get("story_text") or "")[:2000],
        })
    return items

def fetch_sitemap(src, hours):
    """从 sitemap.xml 抓取新闻 URL（无 RSS 的站点用）。lastmod 在窗口内才收录。"""
    resp = get_with_retry(make_session(src.get("network")), src["url"])
    resp.raise_for_status()
    ns = {"sm": "http://www.sitemaps.org/schemas/sitemap/0.9"}
    root = ElementTree.fromstring(resp.content)
    prefix = src.get("url_prefix", "")
    items = []
    for url_el in root.findall("sm:url", ns):
        loc = (url_el.findtext("sm:loc", "", ns) or "").strip()
        if not loc.startswith(prefix):
            continue
        lastmod = url_el.findtext("sm:lastmod", "", ns)
        dt = None
        if lastmod:
            try:
                dt = datetime.fromisoformat(lastmod.replace("Z", "+00:00"))
                if dt.tzinfo is None:
                    dt = dt.replace(tzinfo=timezone.utc)
            except ValueError:
                pass
        if not within_hours(dt, hours):
            continue
        slug = loc.rstrip("/").rsplit("/", 1)[-1]
        title = re.sub(r"[-_]", " ", slug).strip()
        items.append({
            "source": src["name"],
            "category": src["category"],
            "title": title,
            "url": loc,
            "published": dt.isoformat() if dt else None,
            "summary_raw": "",
        })
    return items

fetchers = {"rss": fetch_rss, "hn": fetch_hn, "arxiv": fetch_rss, "sitemap": fetch_sitemap}

def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--hours", type=int, default=24, help="时间窗口，默认 24 小时")
    ap.add_argument("--out", default=str(HERE / "items.json"))
    args = ap.parse_args()

    cfg = json.loads((HERE / "sources.json").read_text(encoding="utf-8"))
    all_items, errors = [], []
    for src in cfg["sources"]:
        try:
            got = fetchers[src["type"]](src, args.hours)
            all_items.extend(got)
            print(f"[ok] {src['id']}: {len(got)} items", file=sys.stderr)
        except Exception as exc:
            errors.append({"source": src["id"], "error": str(exc)})
            print(f"[fail] {src['id']}: {exc}", file=sys.stderr)

    seen, deduped = set(), []
    for it in all_items:
        if it["url"] and it["url"] not in seen:
            seen.add(it["url"])
            deduped.append(it)

    Path(args.out).write_text(
        json.dumps({"fetched_at": datetime.now(timezone.utc).isoformat(),
                    "window_hours": args.hours,
                    "errors": errors,
                    "items": deduped},
                   ensure_ascii=False, indent=2),
        encoding="utf-8")
    print(f"total {len(deduped)} items -> {args.out}", file=sys.stderr)

if __name__ == "__main__":
    main()
```

## File: skills/ai-news/scripts/make_curated.py
size: 1856
sha: 70fca5ef4ab3e7016c76728751d654407c252e17
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/scripts/make_curated.py

```text
#!/usr/bin/env python3
"""把人工/LLM 的筛选结果与 items.json 合成 curated.json。
selection.json 格式:
  {"digest": "今日总评：2-3 句话概括当天爆点与大势（LLM 撰写，可选）",
   "items": [{idx, title, summary, importance, category, tags, source_override}]}
输出 curated.json: {"digest": ..., "items": [...]}（run_daily 兼容两种结构）
"""
import json
import sys
from datetime import datetime, timezone
from pathlib import Path

HERE = Path(__file__).parent

def main():
    items = {i: it for i, it in enumerate(
        json.loads((HERE / "items.json").read_text(encoding="utf-8"))["items"])}
    raw = json.loads((HERE / "selection.json").read_text(encoding="utf-8"))
    if isinstance(raw, list):          # 兼容旧格式（纯数组）
        raw = {"digest": None, "items": raw}
    sel = raw["items"]

    out = []
    for s in sel:
        idx = s.get("idx")
        if idx not in items:
            sys.exit(f"[curate] selection.json 引用了不存在的 idx={idx}（items.json 共 {len(items)} 条，0 起）")
        src = items[idx]
        out.append({
            "title": s.get("title") or src["title"],
            "summary": s.get("summary", ""),
            "url": src["url"],
            "source": s.get("source_override") or src["source"],
            "category": s.get("category") or src["category"],
            "tags": s.get("tags", []),
            "importance": s.get("importance", "中"),
            "published": src.get("published"),
            "fetched_at": datetime.now(timezone.utc).isoformat(),
        })

    (HERE / "curated.json").write_text(
        json.dumps({"digest": raw.get("digest"), "items": out},
                   ensure_ascii=False, indent=2), encoding="utf-8")
    print(f"curated {len(out)} items -> curated.json")

if __name__ == "__main__":
    main()
```

## File: skills/ai-news/scripts/run_daily.py
size: 15226
sha: b64d25a540635afa95c799b0f8de98b5032eb535
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/scripts/run_daily.py

```text
#!/usr/bin/env python3
"""日报主执行脚本：把 curated.json 写入飞书多维表格、机器人卡片推送、云文档归档。

依赖 lark-cli 已配置（config init + auth login 完成）。

用法：
    python run_daily.py curated.json            # 写表 + 推送 + 归档
    python run_daily.py curated.json --dry-run  # 只打印，不执行
"""
import html
import json
import os
import shutil
import subprocess
import sys
import time
from datetime import datetime
from pathlib import Path

HERE = Path(__file__).parent

def _load_config():
    """用户配置：config.json（复制自 config.example.json 或由首次配置引导生成）。
    未配置时返回 None（调用方据此走"仅输出日报"分支），环境变量可覆盖。"""
    f = HERE / "config.json"
    if not f.exists():
        return None
    cfg = json.loads(f.read_text(encoding="utf-8"))
    for env, key in [("FEISHU_BASE_TOKEN", "base_token"), ("FEISHU_TABLE_ID", "table_id"),
                     ("FEISHU_USER_OPEN_ID", "user_open_id"), ("FEISHU_ARCHIVE_DOC_ID", "archive_doc_id"),
                     ("FEISHU_ARCHIVE_ANCHOR_BLOCK", "archive_anchor_block")]:
        if os.environ.get(env):
            cfg[key] = os.environ[env]
    if not all(cfg.get(k) for k in ("base_token", "table_id", "user_open_id", "base_url")):
        return None
    return cfg

CONFIG = _load_config()
CONFIGURED = CONFIG is not None
BASE_TOKEN = CONFIG.get("base_token", "") if CONFIG else ""
TABLE_ID = CONFIG.get("table_id", "") if CONFIG else ""
USER_OPEN_ID = CONFIG.get("user_open_id", "") if CONFIG else ""
BASE_URL = CONFIG.get("base_url", "") if CONFIG else ""
# 日报归档云文档（可选）：每日 block_insert_after 到锚点块之后，最新永远在最上
ARCHIVE_DOC_ID = CONFIG.get("archive_doc_id", "") if CONFIG else ""
ARCHIVE_ANCHOR_BLOCK = CONFIG.get("archive_anchor_block", "") if CONFIG else ""

LARK = os.environ.get("LARK_CLI", "lark-cli")

def _resolve_lark():
    """定位 lark-cli 可执行文件。
    优先级：LARK_CLI 环境变量 → 真实 exe（Windows 上 npm 的 lark-cli 是 .CMD shim，
    经 cmd.exe 输出 GBK 会损坏中文，必须优先用 exe）→ which → 常见安装位置。"""
    if os.environ.get("LARK_CLI"):
        return [os.environ["LARK_CLI"]]
    guesses = [
        Path.home() / "AppData/Roaming/npm/node_modules/@larksuite/cli/bin/lark-cli.exe",
        Path("/usr/local/bin/lark-cli"),
        Path.home() / ".local/bin/lark-cli",
    ]
    for g in guesses:
        if g.exists():
            return [str(g)]
    exe = shutil.which(LARK) or shutil.which(LARK + ".exe")
    if exe:
        return [exe]
    return [LARK]

LARK_CMD = _resolve_lark()
FIELDS = ("标题", "摘要", "原文链接", "来源", "分类", "标签", "重要度", "日期")
# curated.json 的英文键 -> 表格中文字段
KEY_MAP = {"title": "标题", "summary": "摘要", "url": "原文链接",
           "source": "来源", "category": "分类", "tags": "标签",
           "importance": "重要度", "published": "日期"}
# 源站名 -> 表格"来源"单选选项；未匹配的一律归"其他"
SOURCE_ALIASES = {
    "OpenAI 官方新闻": "OpenAI", "Google DeepMind 博客": "DeepMind",
    "Anthropic 新闻": "Anthropic",
    "Hugging Face 博客": "HuggingFace", "Hacker News AI 热帖": "Hacker News",
    "TechCrunch AI": "TechCrunch", "The Verge AI": "The Verge",
    "MIT Tech Review AI": "MIT TR", "InfoQ 中文": "InfoQ",
    "arXiv cs.AI 新论文": "arXiv", "arXiv cs.CL 新论文": "arXiv",
}
KNOWN_SOURCES = {"OpenAI", "DeepMind", "Anthropic", "HuggingFace",
                 "Hacker News", "TechCrunch", "The Verge", "MIT TR",
                 "InfoQ", "arXiv", "其他"}
# 表格"来源"字段的完整选项池（ensure_source_options 用）
SOURCE_OPTIONS = list(KNOWN_SOURCES)

def _decode(raw):
    """自适应解码 lark-cli 输出：优先 UTF-8，失败回退 GBK（Windows 中文代码页）。"""
    if not raw:
        return ""
    for enc in ("utf-8", "gbk"):
        try:
            return raw.decode(enc)
        except UnicodeDecodeError:
            continue
    return raw.decode("utf-8", errors="replace")

def run(args):
    """执行 lark-cli 命令；对瞬时错误（如选项池更新后的索引延迟）间隔重试一次。"""
    for attempt in (1, 2):
        r = subprocess.run(LARK_CMD + args, capture_output=True, shell=False)
        out, err = _decode(r.stdout), _decode(r.stderr)
        if r.returncode == 0 and '"ok": false' not in out:
            return json.loads(out)
        if attempt == 1:
            time.sleep(2)
        else:
            print(out or err, file=sys.stderr)
            raise RuntimeError(f"command failed: {args[0]} {args[1]} ...")

def to_fields(it):
    # 英文键归一成中文字段名（两种命名都兼容）
    it = {KEY_MAP.get(k, k): v for k, v in it.items()}
    rec = {k: it[k] for k in FIELDS if k in it and it[k]}
    if isinstance(rec.get("分类"), str):
        rec["分类"] = [rec["分类"]]
    if isinstance(rec.get("来源"), list):
        rec["来源"] = rec["来源"][:1]
    if rec.get("来源"):
        src = rec["来源"][0] if isinstance(rec["来源"], list) else rec["来源"]
        rec["来源"] = [SOURCE_ALIASES.get(src, src if src in KNOWN_SOURCES else "其他")]
    if isinstance(rec.get("重要度"), str):
        rec["重要度"] = [rec["重要度"]]
    if not rec.get("日期"):
        rec["日期"] = datetime.now().strftime("%Y-%m-%d %H:%M")
    else:
        try:  # ISO(含Z) -> 本地时间字符串，CLI 兼容性最好
            dt = datetime.fromisoformat(str(rec["日期"]).replace("Z", "+00:00"))
            rec["日期"] = dt.astimezone().strftime("%Y-%m-%d %H:%M")
        except ValueError:
            pass
    return rec

def ensure_source_options():
    """把 SOURCE_OPTIONS 合并进表格"来源"字段选项池（幂等，只增不减）。"""
    d = run(["base", "+field-get", "--base-token", BASE_TOKEN,
             "--table-id", TABLE_ID, "--field-id", "来源", "--as", "bot"])
    field = d.get("data", {}).get("field", {})
    opts = [o.get("name") for o in field.get("options", []) if o.get("name")]
    merged = opts + [s for s in SOURCE_OPTIONS if s not in opts]
    if merged == opts:
        return
    run(["base", "+field-update", "--base-token", BASE_TOKEN, "--table-id", TABLE_ID,
         "--field-id", "来源", "--json", json.dumps(
             {"name": "来源", "type": "select", "multiple": False,
              "options": [{"name": t} for t in merged]}, ensure_ascii=False),
         "--as", "bot", "--yes"])
    print(f"[feishu] source options: +{len(merged) - len(opts)}")

def ensure_tag_options(items):
    """标签是自由词：写入前把本次出现的标签合并进"标签"字段选项池，避免 option not_found。"""
    new_tags = sorted({t for it in items for t in (it.get("tags") or [])})
    if not new_tags:
        return
    d = run(["base", "+field-get", "--base-token", BASE_TOKEN,
             "--table-id", TABLE_ID, "--field-id", "标签", "--as", "bot"])
    field = d.get("data", {}).get("field", {})
    opts = [o.get("name") for o in field.get("options", []) if o.get("name")]
    merged = opts + [t for t in new_tags if t not in opts]
    if merged == opts:
        return
    run(["base", "+field-update", "--base-token", BASE_TOKEN, "--table-id", TABLE_ID,
         "--field-id", "标签", "--json", json.dumps(
             {"name": "标签", "type": "select", "multiple": True,
              "options": [{"name": t} for t in merged]}, ensure_ascii=False),
         "--as", "bot", "--yes"])
    print(f"[feishu] tag options: +{len(merged) - len(opts)}")

def write_records(items):
    # 逐条写入：批量 payload 经命令行传参在部分环境下会静默丢字段，
    # 单条已实测稳定；每天 <30 条，串行调用开销可忽略
    ensure_source_options()
    ensure_tag_options(items)
    total = 0
    for x in items:
        payload = json.dumps({"create_records": [to_fields(x)]}, ensure_ascii=False)
        data = run(["base", "+record-batch-create",
                    "--base-token", BASE_TOKEN, "--table-id", TABLE_ID,
                    "--json", payload, "--as", "bot"])
        total += len(data.get("data", {}).get("record_id_list", []))
    print(f"[feishu] wrote {total} records")
    return total

WEEKDAYS = "日一二三四五六"  # %w: 0=周日

def _card_row(imp, title, url, cat, summary):
    title_md = f"[{title}]({url})" if url else f"**{title}**"
    main = [{'tag': 'markdown', 'content': title_md}]
    if summary:
        main.append({'tag': 'markdown', 'content': summary})
    return {'tag': 'column_set', 'flex_mode': 'bisect', 'columns': [
        {'tag': 'column', 'width': 'auto',
         'elements': [{'tag': 'markdown', 'content': imp}]},
        {'tag': 'column', 'width': 'weighted', 'weight': 1, 'vertical_align': 'top',
         'elements': main},
        {'tag': 'column', 'width': 'auto', 'vertical_align': 'top',
         'elements': [{'tag': 'markdown', 'content': cat}]},
    ]}

def push_digest(items, digest=None):
    """卡片(column_set 分栏) → markdown → text 三级降级，日报必达。"""
    today = time.strftime("%Y-%m-%d")
    weekday = WEEKDAYS[int(time.strftime("%w")) % 7]
    n_high = sum(1 for i in items if i.get("importance") == "高")
    if not digest:
        tops = [it["title"] for it in items if it.get("importance") == "高"]
        digest = ("**今日重点：**" + "；".join(tops[:3]) + "。") if tops else "今日无高重要度条目。"

    card = {
        'config': {'wide_screen_mode': True},
        'header': {'template': 'blue', 'title': {
            'tag': 'plain_text', 'content': f'📰 AI 日报 · {today}（周{weekday}）'}},
        'elements': [
            {'tag': 'markdown',
             'content': f"共 **{len(items)}** 条 · 🔥 高关注 **{n_high}** 条\n\n**今日爆点**\n{digest}"},
            {'tag': 'hr'},
        ],
    }
    for i, it in enumerate(items[:30], 1):
        card['elements'].append(_card_row(
            imp="🔥" if it.get("importance") == "高" else f"{i}.",
            title=it['title'], url=it.get("url", ""),
            cat=it.get("category", ""), summary=it.get("summary", "")))
        card['elements'].append({'tag': 'hr'})
    card['elements'].append({
        'tag': 'markdown',
        'content': "📊 完整数据（筛选 / 分组 / 回溯）👉 [AI资讯库 · 多维表格](" + BASE_URL + ")"})

    md = (f"# 📰 AI 日报 · {today}（周{weekday}）\n共 {len(items)} 条\n\n**今日爆点**\n{digest}\n---\n" +
          "\n".join(f"{i}. {'' if (x := it.get('importance')) != '高' else '🔥 '}{it['title']}\n"
                    f"{it.get('summary', '')}\n👉 [阅读原文]({it.get('url', '')})"
                    for i, it in enumerate(items[:30], 1)) +
          f"\n---\n📊 完整数据 👉 [AI资讯库]({BASE_URL})")
    try:
        run(["im", "+messages-send", "--user-id", USER_OPEN_ID, "--msg-type",
             "interactive", "--content", json.dumps(card, ensure_ascii=False), "--as", "bot"])
    except Exception:
        try:
            run(["im", "+messages-send", "--user-id", USER_OPEN_ID,
                 "--markdown", md, "--as", "bot"])
        except Exception:
            plain = md.replace("**", "")
            for seg in range(0, len(plain), 9000):
                run(["im", "+messages-send", "--user-id", USER_OPEN_ID,
                     "--text", plain[seg:seg + 9000], "--as", "bot"])
    print("[feishu] digest pushed")

CAT_EMOJI = {"前沿动态": "🧪", "社区热点": "💬", "中文资讯": "🇨🇳",
             "论文速递": "📄", "产品动态": "🚀"}

def _esc(s):
    return html.escape(str(s or ""), quote=False)

def archive_to_doc(items, digest=None):
    """把当日日报插入归档云文档锚点块之后（最新在最上方）。未配置归档则跳过。"""
    if not (ARCHIVE_DOC_ID and ARCHIVE_ANCHOR_BLOCK):
        print("[feishu] archive skipped (not configured)")
        return
    today = time.strftime("%Y-%m-%d")
    weekday = WEEKDAYS[int(time.strftime("%w")) % 7]
    if not digest:
        digest = "（无总评）"
    for prefix in ("今日爆点：", "今日爆点:", "今日爆点"):
        digest = digest.removeprefix(prefix)

    xml = [f"<hr/>",
           f"<h2>📰 {today}（周{weekday}）· {len(items)} 条</h2>",
           f'<callout emoji="🔥" background-color="light-orange">'
           f"<p><b>今日爆点</b>　{_esc(digest)}</p></callout>"]

    by_cat = {}
    for it in items:
        by_cat.setdefault(it.get("category", "其他"), []).append(it)
    n = 0
    for cat, group in by_cat.items():
        emoji = CAT_EMOJI.get(cat, "📌")
        xml.append(f"<h3>{emoji} {_esc(cat)} · {len(group)}</h3><ul>")
        for it in group:
            n += 1
            star = "🔥 " if it.get("importance") == "高" else ""
            title = _esc(it["title"])
            if it.get("url"):
                head = f'<a href="{html_href(it["url"])}"><b>{title}</b></a>'
            else:
                head = f"<b>{title}</b>"
            line = f"<li><p>{star}{head}"
            if it.get("summary"):
                line += f'<br/><span text-color="gray">{_esc(it["summary"])}</span>'
            line += "</p></li>"
            xml.append(line)
        xml.append("</ul>")

    xml.append(f'<p><span text-color="gray">完整数据与历史回溯 👉 '
               f'<a href="{BASE_URL}">AI资讯库 · 多维表格</a></span></p>')
    f = Path(__file__).parent / "today_doc.xml"
    f.write_text("".join(xml), encoding="utf-8")
    run(["docs", "+update", "--doc", ARCHIVE_DOC_ID,
         "--command", "block_insert_after", "--block-id", ARCHIVE_ANCHOR_BLOCK,
         "--content", f"@{f}", "--as", "user"])
    print("[feishu] archived to doc")

def html_href(url):
    return html.escape(url, quote=True)

def main():
    dry = "--dry-run" in sys.argv
    path = Path(sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith("-")
                else HERE / "curated.json")
    raw = json.loads(path.read_text(encoding="utf-8"))
    digest = None
    if isinstance(raw, dict):
        digest = raw.get("digest")
        items = raw.get("items", [])
    else:
        items = raw
    if not CONFIGURED:
        # 未配置飞书：输出日报 JSON 供 Agent 整理回复，不报错、不写任何东西
        print(json.dumps({"mode": "chat_only", "digest": digest, "items": items},
                         ensure_ascii=False, indent=2))
        print("[run_daily] 未配置飞书（config.json 缺失或不完整），已跳过落地。", file=sys.stderr)
        return
    if dry:
        print(f"[digest] {digest}")
        for it in items:
            print(json.dumps(to_fields(it), ensure_ascii=False))
        return
    write_records(items)
    push_digest(items, digest)
    try:
        archive_to_doc(items, digest)
    except Exception as exc:  # 归档失败不影响推送主链路
        print(f"[warn] archive failed: {exc}", file=sys.stderr)

if __name__ == "__main__":
    main()
```

## File: skills/ai-news/scripts/sources.json
size: 2608
sha: e45b03bb3529d82d8fff1bd3f17cdd3e3b3de83a
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/scripts/sources.json

```text
{
  "sources": [
    {
      "id": "openai_news",
      "name": "OpenAI 官方新闻",
      "type": "rss",
      "url": "https://openai.com/news/rss.xml",
      "network": "proxy",
      "category": "前沿动态"
    },
    {
      "id": "deepmind_blog",
      "name": "Google DeepMind 博客",
      "type": "rss",
      "url": "https://deepmind.google/blog/rss.xml",
      "network": "proxy",
      "category": "前沿动态"
    },
    {
      "id": "anthropic_news",
      "name": "Anthropic 新闻",
      "type": "sitemap",
      "url": "https://www.anthropic.com/sitemap.xml",
      "url_prefix": "https://www.anthropic.com/news/",
      "network": "proxy",
      "category": "前沿动态"
    },
    {
      "id": "huggingface_blog",
      "name": "Hugging Face 博客",
      "type": "rss",
      "url": "https://huggingface.co/blog/feed.xml",
      "network": "proxy",
      "category": "前沿动态"
    },
    {
      "id": "techcrunch_ai",
      "name": "TechCrunch AI",
      "type": "rss",
      "url": "https://techcrunch.com/category/artificial-intelligence/feed/",
      "network": "proxy",
      "category": "产品动态"
    },
    {
      "id": "theverge_ai",
      "name": "The Verge AI",
      "type": "rss",
      "url": "https://www.theverge.com/rss/ai-artificial-intelligence/index.xml",
      "network": "proxy",
      "category": "产品动态"
    },
    {
      "id": "mit_tr_ai",
      "name": "MIT Tech Review AI",
      "type": "rss",
      "url": "https://www.technologyreview.com/topic/artificial-intelligence/feed",
      "network": "proxy",
      "category": "前沿动态"
    },
    {
      "id": "hackernews_ai",
      "name": "Hacker News AI 热帖",
      "type": "hn",
      "url": "https://hn.algolia.com/api/v1/search",
      "network": "direct",
      "category": "社区热点"
    },
    {
      "id": "infoq",
      "name": "InfoQ 中文",
      "type": "rss",
      "url": "https://www.infoq.cn/feed",
      "network": "direct",
      "category": "中文资讯"
    },
    {
      "id": "arxiv_csai",
      "name": "arXiv cs.AI 新论文",
      "type": "arxiv",
      "url": "http://export.arxiv.org/api/query?search_query=cat:cs.AI&sortBy=submittedDate&sortOrder=descending&max_results=30",
      "network": "proxy",
      "category": "论文速递"
    },
    {
      "id": "arxiv_cscl",
      "name": "arXiv cs.CL 新论文",
      "type": "arxiv",
      "url": "http://export.arxiv.org/api/query?search_query=cat:cs.CL&sortBy=submittedDate&sortOrder=descending&max_results=30",
      "network": "proxy",
      "category": "论文速递"
    }
  ]
}
```

## File: skills/ai-news/.gitignore
size: 216
sha: 20aaed035eba613731313062c24c9e1108a895ae
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/skills/ai-news/.gitignore

```text
# 本地配置与运行产物，不入库
scripts/config.json
scripts/config.json.bak
scripts/config.json.*.bak
scripts/items.json
scripts/curated.json
scripts/selection.json
scripts/today_doc.xml
*.bak
__pycache__/
```

## File: README.md
upstream: https://github.com/alan-houxj/ai-news-follow/blob/main/README.md

````text
<div align="center">

<h1>AI 时讯跟进</h1>

<p><strong>每天早上 8 点，一份帮你筛好、看完就能聊的 AI 日报，自动送到你的飞书。</strong></p>

<p>
  <img alt="Agent Skill" src="https://img.shields.io/badge/Agent_Skill-ai--news-6366f1">
  <img alt="Python" src="https://img.shields.io/badge/Python-3.10%2B-3776AB">
  <img alt="Feishu" src="https://img.shields.io/badge/Feishu-%E9%A3%9E%E4%B9%A6-3370FF">
  <img alt="License" src="https://img.shields.io/badge/license-MIT-green">
  <img alt="CI" src="https://img.shields.io/github/actions/workflow/status/Alan-Houxj/ai-news-follow/ci.yml?branch=main">
  <img alt="Version" src="https://img.shields.io/github/v/tag/Alan-Houxj/ai-news-follow">
</p>

</div>

---

你不是没时间刷新闻，你是没时间在一百条噪音里找出那三条真正重要的事。
这个工具替你盯着 AI 圈最值得追的源头，把当天发生的事挑出来、讲清楚、附上原文——
你只需要每天早上花 30 秒扫一眼，就知道今天该聊什么、该关注什么。

它是一个通用的 [Agent Skill](https://agentskills.io)：一条命令装进你正在用的 AI Agent，
之后就长在你身边，天天替你盯 AI 圈。Claude Code、ZCode、Cursor、Codex CLI 等主流工具
都能装，不绑定任何一家。不折腾服务器、不折腾数据库，装完就能用。

---

## 📰 你每天早上会看到什么

一条飞书消息，长这样：

> **📰 AI 日报 · 2026-09-03（周四）· 15 条**
>
> 🔥 **今日爆点**　模型层进入"性能翻倍 + 成本砍半"的密集发布期——Google 与
> Anthropic 同日发新模型，Agent 推理成本成为主战场……
>
> **1. 🔥 Gemini 3.8 Flash 发布**　`前沿动态`
> Google 发布两款新模型，主打高性价比推理，Cyber 版面向安全场景
> 👉 阅读原文
>
> **2. 🔥 Cursor 推出 Origin：GitHub 的智能体替代方案**　`产品动态`
> 面向 AI 智能体的代码托管与协作空间，冲击传统开发者工作流
> 👉 阅读原文
>
> **3. 李飞飞首个多模态世界模型 Atlas 发布**　`前沿动态`
> 从零开始预训练，几张图就能构建对物理世界的理解
> 👉 阅读原文
>
> ……

这条消息的结构，就是为了"快速刷完"设计的：

- **开头一句"今日爆点"**：两三句话讲清今天 AI 圈的主线，帮你建立当日叙事——
  不是孤立的一条条新闻，而是"今天到底发生了什么、趋势往哪走"
- **每条一句话说清是什么**：标题本身就讲完了，不用点进去才知道讲啥
- **再补一句为什么值得关注**：摘要只做导航，不替你下结论
- **点开就是原文**：链接从采集层一路带到你面前，任何环节不改写。拿不准的，
  点进去自己核实——不传二手信息

## 📊 日报去了哪

一条消息看完就沉底，但数据不会。同一份日报，同时落在飞书的三个地方：

| 去处 | 什么时候用 |
|---|---|
| **飞书私聊消息** | 每天早上扫一眼，知道今天发生了什么 |
| **多维表格「AI 日报」** | 想筛选、统计、检索历史时——比如"上个月 Anthropic 发了哪些东西" |
| **云文档「AI 日报归档」** | 想按时间线回顾一段行业脉络，像翻一本持续更新的杂志 |

表格里每条记录有 8 个字段：标题、摘要、原文链接、来源、分类、标签、重要度、日期。
攒上一个月，这就是一份你自己的 AI 行业动态数据库——随时可查，越攒越值钱。

## 🌐 它盯哪些源头

| 来源 | 覆盖什么 |
|---|---|
| OpenAI 官方新闻 | 模型发布、产品公告 |
| Google DeepMind 博客 | 研究进展、模型动态 |
| Anthropic 新闻 | Claude 系列发布与更新 |
| Hugging Face 博客 | 开源模型、数据集、榜单风向 |
| TechCrunch AI | 海外 AI 融资、产品、商业动态 |
| The Verge AI | 海外 AI 产品与商业动态 |
| MIT Tech Review AI | 深度技术分析 |
| Hacker News AI 热帖 | 海外社区热议的 AI 高票帖 |
| InfoQ 中文 | 中文技术媒体的 AI 报道 |
| arXiv cs.AI | 每日最新 AI 论文 |
| arXiv cs.CL | 每日最新 NLP 论文 |

每天这十一个源头加起来上百条原始信息，经过三重处理——**去噪**（剔除无关内容）、
**去重**（多源报道同一件事时合并）、**按重要度排序**——最后只留 10 到 30 条。

## ✨ 为什么值得装

⏱️ **省下的是你筛选的时间，不是你的判断**
AI 摘要负责"把这条消息讲清楚"，但结论永远由你点开原文自己下。它不制造观点，
只负责把值得你花注意力的东西递到你眼前。

🔁 **装一次，天天都在**
作为一个标准 Agent Skill，一条命令装进你正在用的 AI Agent。装完就没有"下次再用"
这回事了——它就是你的 AI 资讯接口，对话里说一句"今天的日报"就能跑。

🔒 **你的数据，只经过你自己**
数据流是"信息源 → 你的 Agent → 你自己的飞书"，不经过任何第三方服务器。
仓库不含任何密钥，飞书配置只存在你本地的 config.json 里。

🛡️ **每天都在，风雨无阻**
某个信息源偶尔挂掉会自动跳过，推送失败会自动重试——日报明天、后天、大后天都会按时出现。

## 🚀 怎么开始

### 第 1 步：安装 Node.js

装 Skill 用到的安装器（`npx skills`）基于 Node.js，先装一次，以后不用再管。打算用下方"手动复制"方式装 Skill 的话，这一步可以跳过。

- **Windows**：打开 PowerShell，执行
  ```powershell
  winget install OpenJS.NodeJS.LTS
  ```
- **macOS**：打开终端，执行
  ```bash
  brew install node
  ```
- 或者直接去 [nodejs.org](https://nodejs.org) 下载 LTS 版本安装包，一路下一步。

装完验证一下：`node --version` 能打印出版本号（如 `v20.11.0`）就成功了。

### 第 2 步：确认电脑里有 Python

日报的采集脚本是用 Python 写的，电脑里要有 Python 3.10 或更高版本。这一步不能跳过。

- **Windows**：打开 PowerShell，执行
  ```powershell
  winget install Python.Python.3.12
  ```
- **macOS**：打开终端，执行
  ```bash
  brew install python
  ```
- 或者直接去 [python.org](https://python.org) 下载 3.10 以上版本，一路下一步。

装完验证一下：`python --version` 能打印出版本号（如 `Python 3.12.8`）就成功了。

### 第 3 步：安装 Skill

在终端执行这一条命令：

```bash
npx skills add https://github.com/Alan-Houxj/ai-news-follow -g
```

它会自动找到并安装仓库里的 `ai-news` 技能。

如果你的 Agent 没有被自动识别，也可以手动安装：把仓库里 `skills/ai-news/` 这个
文件夹，复制到你的 Agent 的技能目录（各家路径不同，例如 Claude Code 是
`~/.claude/skills/`，以你 Agent 的文档为准）。

### 第 4 步：对话里跑一次

打开你的 Agent，说：

> 帮我跑一下今天的 AI 日报

日报会直接出现在对话里。这一版先不接飞书，看看内容是不是你要的。

### 第 5 步（可选）：接入你自己的飞书

直接在对话里说"**把日报接入我的飞书**"——Agent 现场引导，你只需点一次链接、
扫一次码，其余自动完成（建表、授权、归档、测试消息），约 5 分钟。
细节见 **[docs/setup.md](docs/setup.md)**。

### 第 6 步（可选）：每天自动运行

在你的 Agent 里设一个定时任务，以后每天早上自动跑，见
**[docs/scheduling.md](docs/scheduling.md)**。

---

## 📚 文档导读

| 文档 | 什么时候看 |
|---|---|
| [docs/setup.md](docs/setup.md) | 想接通自己的飞书时 |
| [docs/scheduling.md](docs/scheduling.md) | 想配置每日自动化时 |
| [docs/faq.md](docs/faq.md) | 出问题时，按症状查 |
| [examples/cron-prompt.txt](examples/cron-prompt.txt) | 配定时任务时的 prompt 模板 |
````
