Three-stage workflow:Fetch metadata → Generate summaries → Output daily digest
Working directory
On first run, ask for the working directory path (e.g. ~/daily-news), then remember it.
<workspace>/
├── profile.yaml # 用户画像(关于我、关注什么)
├── settings.yaml # 日报设置(语言、格式偏好)
├── methods/ # 信源获取方法
├── data/news.db # SQLite 数据库
└── output/YYYY-MM-DD.md # 日报输出
Initialization:
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
After initialization completes, write the working directory to ~/.claude/CLAUDE.md:
- daily-news skill 的项目目录在:<workspace>
Stage 1: Fetch metadata
Iterate over the <workspace>/methods/ directory, and run the fetch for each method file.
Incremental fetching: each source independently tracks last_fetched_date, which exists in two places: the method YAML and the DB. Default is incremental mode; on the first fetch, ask the user for the date range.
python3 scripts/db.py source-status --db <db> --source <source_id>
Deduplication: three layers of protection — filter by since during fetching → check-existing pre-check before inserting into the DB → DB UNIQUE constraint as a fallback.
Method execution:
# extends: rss
python3 references/methods/rss.py --url "<source_url>"
# extends: webfetch-smart 或 browser-smart
# 遵循 web-access skill 进行联网操作
# 无 extends:*.py 直接执行,*.md 按内容操作
Insert into DB:
python3 scripts/db.py add-items-incremental \
--db <db> --source <source_id> --items '<json>' --since "YYYY-MM-DD"
Stage 2: Generate summaries
python3 scripts/db.py list-pending --db <workspace>/data/news.db
For each item, fetch the body according to the method's detail_method field (follow the web-access skill), and generate a summary according to references/prompts/summary.md :
python3 scripts/db.py update-summary --db <db> --id <item_id> --data '<摘要JSON>'
Stage 3: Generate daily digest
python3 scripts/db.py list-today --db <workspace>/data/news.db
Read profile.yaml, generate the daily digest according to references/prompts/report.md , and output to output/YYYY-MM-DD.md。
User profile
profile.yaml format:
about: |
(关于我:身份、工作)
focus: |
(当前关注:最近在意的话题)
low_priority: |
(不太关心:降低优先级的内容)
Add source
Try in order of priority:
- Check RSS — try
/feed、/rss、/atom.xml, or the page<link rel="alternate">, if present useextends: rss - WebFetch or browser — follow the web-access skill, if reachable use
extends: webfetch-smart, otherwiseextends: browser-smart
For creating a method file, see references/schemas/method.md
Reference materials
| Material | Path | Load timing |
|---|---|---|
| Method specification | references/schemas/method.md |
When adding a source |
| Summary prompt | references/prompts/summary.md |
Stage 2 |
| Daily digest prompt | references/prompts/report.md |
Stage 3 |
| RSS method | references/methods/rss.py |
Stage 1 (extends: rss) |
| Method metadata example | references/examples/method-with-metadata.example.yaml |
When adding a source / configuring incremental tracking |
| Website deployment | references/website-deployment.md |
When the user requests deployment |
Dependencies
pip install pyyaml feedparser requests beautifulsoup4