Skip to main content

digest

Generate and publish a dated news digest for a source defined in ROUTINE.md (e.g. "hn" or "nixos"). Fetches the top submissions for the source's window, summarizes each item's content + discussion via that source's committed workflow, writes the digest in the source-first layout (hn/YYYY/MM/DD.md or nixos/YYYY/Www.md), then opens and merges a PR. Use when asked to run the <source> digest/routine, or to produce today's HN/Reddit digest.

来源信息

仓库
srid/claude-dump
最近来源活动
2026年6月23日 22:40
检测到的 SKILL.md 语言
英语
星标
2
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
digest
description
Generate and publish a dated news digest for a source defined in ROUTINE.md (e.g. "hn" or "nixos"). Fetches the top submissions for the source's window, summarizes each item's content + discussion via that source's committed workflow, writes the digest in the source-first layout (hn/YYYY/MM/DD.md or nixos/YYYY/Www.md), then opens and merges a PR. Use when asked to run the <source> digest/routine, or to produce today's HN/Reddit digest.
# /digest — run and publish a source's digest **Argument:** the source NAME (`hn`, `nixos`, …). If omitted, ask which source (or run every source that is due per its cadence). Read [ROUTINE.md](../../../ROUTINE.md) for the per-source spec and [CLAUDE.md](../../../CLAUDE.md) for conventions (browser UA, fetch fallbacks, format, self-improvement). Then: ## 1. Resolve the source From ROUTINE.md get: feed/subreddit, cadence, output NAME, item count, and which committed workflow to use. Output path is **source-first** for the current date/week: - daily → `./<name>/YYYY/MM/DD.md` (e.g. `hn/2026/06/22.md`) - weekly → `./<name>/YYYY/Www.md` using the ISO week from `date +%G/W%V` (e.g. `nixos/2026/W26.md`) ## 2. Fetch the ranked listing - **`hn`** — HN Algolia API (top of last 24h, by points): `https://hn.algolia.com/api/v1/search?tags=story&numericFilters=created_at_i>{epoch_24h_ago}&hitsPerPage=30` - **Reddit (`nixos`, `haskell`, …)** — **primary:** `https://old.reddit.com/r/<sub>/top.json?t=week&limit=30` with a real **Chrome UA**. If it 403s (datacenter/sandbox IPs are blocked), **fall back** to the RSS feed `https://www.reddit.com/r/<sub>/top.rss?t=week` and parse titles, permalinks, selftext, and the external `[link]` href. (`WebFetch` cannot fetch Reddit — curl only.) **Take the top 10 posts** for weekly Reddit digests. ## 3. Summarize (fan-out workflow) Run the source's committed workflow with the listing as `args`: - `hn` → `Workflow({ scriptPath: "workflows/hn-digest-summaries.js", args: [ …stories ] })` — the args is the stories **array** directly (each `{rank,id,title,url,points,num_comments}`); one subagent per story fetches article + comments. - Reddit → `Workflow({ scriptPath: "workflows/reddit-digest-summaries.js", args: {subreddit, cacheDir, posts:[…]} })` — **two-phase**: one fetcher agent caches all threads serially (avoids HTTP 429), then summarizer agents read the cache in parallel. Pass a writable `cacheDir`. Backfill any items the workflow failed (structured-output retries exceeded) by summarizing them directly. ## 4. Assemble the digest file (source-first path from step 1) Established format: a title + source line, then a numbered list. Per item: `## N. [title](url) | [N comments](commentsPermalink) | score`, then **Article:**/**Content:** and **Discussion:** summaries. **Note fetch errors inline** (and roll them up in a footer). Preserve titles verbatim. For Reddit RSS-fallback runs, say scores/counts are approximate. ## 5. Publish (branch → PR → merge) 1. `git checkout -b <name>-YYYY-MM-DD`, add the new file(s), commit. 2. Open a PR whose body has **(a)** master permalinks to the new file(s) (`https://github.com/srid/claude-dump/blob/master/<path>`) and **(b)** the file content **inline**. 3. **Merge immediately** (`gh pr merge --squash --delete-branch`). Repo watchers get the email. ## Self-improve If you hit a fetch/parse bug or find a better approach, **fix the workflow `.js` (and this skill / ROUTINE.md) and include it in the same PR.** See CLAUDE.md — you have standing permission.
在 GitHub 查看