first commit
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
---
|
||||
name: reader-digest-flow
|
||||
description: Orchestrate the end-to-end daily digest workflow around the reader project. Use when the user wants to run the AI daily digest flow, generate a daily report from reader payloads, publish the digest to Hugo, report the digest back in chat, select valuable articles, and then summarize only the selected articles into IMA knowledge notes. Triggers include requests like '跑今天日报', '生成日报', '汇报今天内容', '把选中的文章沉淀', '更新 Hugo', or any request to operate the reader → digest → selection → knowledge-base flow.
|
||||
---
|
||||
|
||||
# Reader Digest Flow
|
||||
|
||||
Run the reader-based daily digest as a fixed SOP. Treat this skill as the orchestrator for the workflow; do not move Hugo, Feishu reporting, or IMA upload logic into the reader project itself.
|
||||
|
||||
## Core Rules
|
||||
|
||||
- Run `reader` / MCP for upstream fetching, extraction, filtering, payload generation, and selected-article post-processing.
|
||||
- **For normal production runs, mark processed FreshRSS items as read. Only skip mark-read when the user explicitly says the run is debug/test/validation.**
|
||||
- **Do not generate the daily digest from examples or placeholder data. Always require a real payload first.**
|
||||
- Generate the daily digest markdown from the payload in OpenClaw.
|
||||
- Split outputs into a **public digest** for Hugo and an **internal review digest** for chat / operator decision-making.
|
||||
- Publish only the public digest to Hugo.
|
||||
- Report the internal review digest back to the user in chat.
|
||||
- **Do not upload the full daily digest to IMA.**
|
||||
- **Do not upload any selected article summary to IMA until the user has explicitly confirmed the selection.**
|
||||
- Upload **only user-selected articles** to IMA as individual knowledge notes.
|
||||
- Default IMA target for daily single-article summaries is the `daily` knowledge base.
|
||||
- Resolve that default target from reader `.env` (`IMA_DAILY_KNOWLEDGE_BASE_ID`, `IMA_DAILY_KNOWLEDGE_BASE_NAME`) and verify it at runtime before upload.
|
||||
- If the configured daily knowledge base is missing, try to locate it by name; if still missing, create `daily` and continue.
|
||||
- For selected article notes, use the dedicated article-summary flow in `reader`.
|
||||
- Prefer `ARTICLE_SUMMARY_*` LLM settings for selected article summaries; fall back to the main `LLM_*` settings only if the dedicated settings are absent.
|
||||
- Do not re-fetch original article URLs for selected summaries; always use the existing extracted article text.
|
||||
- Default selected-article summary output should be organized by date, for example under `outputs/freshrss/single_summaries/YYYY-MM-DD/`.
|
||||
|
||||
## Fixed Flow
|
||||
|
||||
### Phase 1: Run reader pipeline
|
||||
|
||||
In the `reader` project, run the FreshRSS pipeline and obtain a real payload.
|
||||
|
||||
Minimum expected artifacts:
|
||||
|
||||
- `outputs/freshrss/rerun/<run-id>/candidates/openclaw-delivery-payload.json`
|
||||
- `outputs/freshrss/rerun/<run-id>/run-report.json`
|
||||
- extracted article data, such as:
|
||||
- `outputs/freshrss/extracted/freshrss.extracted.json`
|
||||
|
||||
If the pipeline fails, stop and report the exact failure point.
|
||||
|
||||
### Phase 2: Generate daily digest markdown
|
||||
|
||||
Read the real payload and generate digest markdown for the day.
|
||||
If there is no real payload, stop instead of writing a fake or example digest.
|
||||
|
||||
Produce two output views from the same payload:
|
||||
|
||||
1. **Public digest** — for Hugo / public browsing
|
||||
2. **Internal review digest** — for chat reporting and operator decisions
|
||||
|
||||
Write only the public digest into Hugo using this structure:
|
||||
|
||||
- `content/daily/YYYY-MM-DD/index.md`
|
||||
|
||||
The public digest is the browsing layer, not the long-term knowledge layer.
|
||||
It must not expose internal workflow states or operator-facing review labels.
|
||||
|
||||
Recommended **public digest** structure:
|
||||
|
||||
- `今日概览`
|
||||
- `今日重点`
|
||||
- `趋势观察`
|
||||
- `延伸阅读`
|
||||
- `信息来源`
|
||||
|
||||
Recommended **internal review digest** structure:
|
||||
|
||||
- `今日候选概况`
|
||||
- `已入选重点`
|
||||
- `待你确认`
|
||||
- `建议沉淀到 IMA`
|
||||
- `原始候选清单`
|
||||
|
||||
### Phase 3: Publish to Hugo
|
||||
|
||||
Publish only the public digest to Hugo and verify:
|
||||
|
||||
- list page works
|
||||
- detail page works
|
||||
- latest digest is visible
|
||||
|
||||
Do not block on style polish unless the user explicitly asks.
|
||||
|
||||
### Phase 4: Report digest back to the user
|
||||
|
||||
Send the internal review digest in chat and ask the user which articles should be retained for long-term knowledge.
|
||||
|
||||
At this step:
|
||||
|
||||
- the public digest is already in Hugo
|
||||
- the internal review digest stays in chat / operator workflow
|
||||
- the digest is **not** uploaded to IMA
|
||||
- the user decides which articles are worth preserving
|
||||
|
||||
### Phase 5: Summarize selected articles
|
||||
|
||||
For every article explicitly selected by the user:
|
||||
|
||||
1. use the `reader` article-summary capability
|
||||
2. point it at the existing extracted payload
|
||||
3. pass the selected `item_id` values
|
||||
4. generate one markdown summary per article
|
||||
|
||||
Preferred routes:
|
||||
|
||||
- MCP tool: `generate_article_summaries`
|
||||
- CLI fallback: `scripts/run_article_summaries.py`
|
||||
|
||||
Use the real extracted JSON structure already produced by the project. Do not invent alternative inputs.
|
||||
|
||||
### Phase 6: Upload selected article notes to IMA
|
||||
|
||||
Upload only the generated single-article markdown summaries to IMA.
|
||||
|
||||
Default target knowledge base for this phase:
|
||||
|
||||
- `daily`
|
||||
- Read from reader `.env` via `IMA_DAILY_KNOWLEDGE_BASE_ID` and `IMA_DAILY_KNOWLEDGE_BASE_NAME`
|
||||
- Verify the target at runtime through IMA APIs / skill lookups before upload
|
||||
- If the configured target does not exist, try to find `daily` by name; if still absent, create it and continue
|
||||
|
||||
Do not upload:
|
||||
|
||||
- the full daily digest
|
||||
- raw payloads
|
||||
- raw extraction output
|
||||
|
||||
## Operational Guidance
|
||||
|
||||
- Prefer real run outputs over examples.
|
||||
- Verify at each boundary with real files or accessible URLs.
|
||||
- When validating selected article summaries, confirm that a markdown file is actually generated.
|
||||
- If Codex or another coding agent is asked to implement workflow changes inside `reader`, keep the project boundary clean:
|
||||
- workflow logic in `reader`
|
||||
- orchestration logic in this skill / OpenClaw
|
||||
|
||||
## Key Paths
|
||||
|
||||
### Reader project
|
||||
|
||||
- `/home/ubuntu/zhu/github/reader`
|
||||
|
||||
### Hugo project
|
||||
|
||||
- `/home/ubuntu/zhu/apps/hugo-site`
|
||||
- digest content root:
|
||||
- `/home/ubuntu/zhu/apps/hugo-site/content/daily/`
|
||||
|
||||
## References
|
||||
|
||||
Read `references/flow.md` when you need the concrete step-by-step command checklist and file expectations.
|
||||
@@ -0,0 +1,162 @@
|
||||
# Reader Digest Flow Reference
|
||||
|
||||
## Purpose
|
||||
|
||||
Concrete operational checklist for the `reader-digest-flow` skill.
|
||||
|
||||
## Default Operating Model
|
||||
|
||||
### Layering
|
||||
|
||||
- `reader` layer:
|
||||
- FreshRSS pull
|
||||
- extraction
|
||||
- summary/filter/payload generation
|
||||
- selected-article summary capability
|
||||
- OpenClaw / skill layer:
|
||||
- public digest generation
|
||||
- internal review digest generation
|
||||
- Hugo publishing
|
||||
- chat reporting
|
||||
- user confirmation handling
|
||||
- calling selected-article summaries
|
||||
- IMA upload orchestration
|
||||
- Hugo layer:
|
||||
- public digest browsing and archive only
|
||||
- IMA layer:
|
||||
- long-term storage for selected article notes only
|
||||
|
||||
### Hard rules
|
||||
|
||||
- Do not upload the full digest to IMA.
|
||||
- Upload only explicitly user-selected articles to IMA.
|
||||
- Do not generate a digest without a real payload.
|
||||
- Generate two views from the same payload: a public digest for Hugo and an internal review digest for chat/operator workflow.
|
||||
- Do not expose internal review states or operator-facing labels in the public digest.
|
||||
- Do not re-fetch original URLs for selected summaries; use existing extracted text.
|
||||
- Prefer `ARTICLE_SUMMARY_*` for selected article summarization, with fallback to main `LLM_*` only if needed.
|
||||
- Actively report progress after each completed phase.
|
||||
|
||||
## Step-by-step checklist
|
||||
|
||||
### 1. Run reader pipeline
|
||||
|
||||
Project root:
|
||||
|
||||
```bash
|
||||
/home/ubuntu/zhu/github/reader
|
||||
```
|
||||
|
||||
Default behavior for a normal production run:
|
||||
|
||||
- run with mark-read enabled
|
||||
- only skip mark-read if the user explicitly says the run is debug, test, or validation
|
||||
|
||||
Typical artifacts to inspect after a successful run:
|
||||
|
||||
```text
|
||||
outputs/freshrss/rerun/<run-id>/candidates/openclaw-delivery-payload.json
|
||||
outputs/freshrss/rerun/<run-id>/run-report.json
|
||||
outputs/freshrss/rerun/<run-id>/extracted/item-XX.extracted.json
|
||||
```
|
||||
|
||||
### 2. Generate digest markdown
|
||||
|
||||
Generate two output views from the same payload:
|
||||
|
||||
1. a **public digest** for Hugo / public readers
|
||||
2. an **internal review digest** for chat / operator workflow
|
||||
|
||||
Write only the public digest into Hugo here:
|
||||
|
||||
```text
|
||||
/home/ubuntu/zhu/apps/hugo-site/content/daily/YYYY-MM-DD/index.md
|
||||
```
|
||||
|
||||
Recommended public-digest front matter:
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "AI 日报 · YYYY-MM-DD"
|
||||
date = YYYY-MM-DDTHH:MM:SS+08:00
|
||||
summary = "当日日报摘要"
|
||||
+++
|
||||
```
|
||||
|
||||
Recommended **public digest** structure:
|
||||
|
||||
- `今日概览`
|
||||
- `今日重点`
|
||||
- `趋势观察`
|
||||
- `延伸阅读`
|
||||
- `信息来源`
|
||||
|
||||
Recommended **internal review digest** structure:
|
||||
|
||||
- `今日候选概况`
|
||||
- `已入选重点`
|
||||
- `待你确认`
|
||||
- `建议沉淀到 IMA`
|
||||
- `原始候选清单`
|
||||
|
||||
### 3. Publish Hugo
|
||||
|
||||
Publish only the public digest to Hugo.
|
||||
|
||||
Expected verification targets:
|
||||
|
||||
- homepage works
|
||||
- `/daily/` works
|
||||
- `/daily/YYYY-MM-DD/` works
|
||||
|
||||
### 4. Report digest in chat
|
||||
|
||||
Provide the internal review digest in chat and ask which articles should be retained.
|
||||
|
||||
### 5. Generate selected article summaries
|
||||
|
||||
Only do this after the user explicitly confirms which articles to retain.
|
||||
|
||||
Preferred MCP tool:
|
||||
|
||||
- `generate_article_summaries`
|
||||
|
||||
Expected inputs:
|
||||
|
||||
- `extracted_path`
|
||||
- `selected_ids`
|
||||
- optional `output_dir`
|
||||
- optional article-summary LLM overrides
|
||||
|
||||
Recommended output layout:
|
||||
|
||||
- `outputs/freshrss/single_summaries/YYYY-MM-DD/`
|
||||
|
||||
CLI fallback:
|
||||
|
||||
```bash
|
||||
python scripts/run_article_summaries.py \
|
||||
--extracted outputs/freshrss/rerun/<run-id>/extracted/item-01.extracted.json \
|
||||
--ids <item_id_1> <item_id_2> \
|
||||
--output-dir outputs/freshrss/single_summaries/YYYY-MM-DD
|
||||
```
|
||||
|
||||
### 6. Upload selected summaries to IMA
|
||||
|
||||
Upload only the generated markdown files for the selected articles.
|
||||
|
||||
Default target knowledge base:
|
||||
|
||||
- `daily`
|
||||
- Read `IMA_DAILY_KNOWLEDGE_BASE_ID` / `IMA_DAILY_KNOWLEDGE_BASE_NAME` from reader `.env`
|
||||
- Verify the configured target at runtime before upload
|
||||
- If the configured target is unavailable, resolve by name `daily`; if still absent, create `daily`
|
||||
|
||||
## Hard rules recap
|
||||
|
||||
- Never generate a digest from placeholder or example data when a real run is expected.
|
||||
- For normal runs, mark processed FreshRSS items as read unless the user explicitly requested a debug/test/validation run.
|
||||
- Public digest goes to Hugo; internal review digest goes to chat; neither full digest goes to IMA.
|
||||
- Only explicitly user-selected articles go to IMA.
|
||||
- Selected article summaries use extracted text, not live refetch.
|
||||
- Prefer `ARTICLE_SUMMARY_*` for selected article summarization.
|
||||
Reference in New Issue
Block a user