HN Digest
Command format
Interpret a user message that starts with hn as a request for a Hacker News front-page digest.
Supported forms:
- -
hn → default 5 posts - INLINECODE2 → n posts
- INLINECODE3 → filter/boost by topic
- INLINECODE4 → both
- If the user asks for “more” after already seeing some (e.g. “show me top 10–15 since we already did top 10”), treat it as an offset request and use
--offset (e.g. offset 10, count 10).
Topics:
- -
tech (default) - INLINECODE7
- INLINECODE8
- INLINECODE9 / INLINECODE10
Output requirements
- - Do not send any extra commentary/preamble/epilogue.
- Send results as individual messages.
- Each post message must be exactly:
- first line: the post title
- second line:
<age> · <commentCount> comments (age like
45m ago,
6h ago,
3d ago)
- third line: the Hacker News comments link (
https://news.ycombinator.com/item?id=...)
- - After the post messages, send one final message that is the generated image.
- If the chat provider requires non-empty text for media, use a minimal caption
..
Procedure
- 1. Parse
n and topic from the user message. - Fetch + rank items:
- Run
node skills/hn-digest/scripts/hn.mjs --count <n> --offset <offset> --topic <topic> --format json.
- Default
offset is 0 unless the user explicitly asks for “more/next” after a previous batch.
- 3. Send results as N individual messages in the required 3-line format.
- Then generate a delightful mood image via Nano Banana, inspired by the posts you just sent:
- Use
skills/hn-digest/scripts/mood_prompt.mjs to build a prompt from the JSON items.
- Add 3–4 subtle Easter eggs derived from the post themes (no text/logos; keep it fun).
- Generate and attach the image by running:
-
skills/hn-digest/scripts/generate_mood_nano_banana.sh ./tmp/hn-mood/hn-mood.png <topic> <n> <offset>
- Send the generated image as one additional message.
If fetching/ranking fails or returns 0 items:
- - Use
https://news.ycombinator.com/ in the browser tool, pick N non-crypto items by judgment, and send them in the same 3-line format. - Still generate a mood image (general “HN tech deep dives” vibe) with a banana Easter egg.
HN Digest
命令格式
将以 hn 开头的用户消息解析为获取 Hacker News 首页摘要的请求。
支持的格式:
- - hn → 默认 5 条帖子
- hn → n 条帖子
- hn → 按主题筛选/加权
- hn → 两者结合
- 如果用户在查看部分结果后要求更多(例如我们已经看了前10条,再显示第10到15条),则视为偏移请求,使用 --offset(例如偏移量10,数量10)。
主题:
- - tech(默认)
- health
- hacking
- life / lifehacks
输出要求
- - 不要发送任何额外的评论/开场白/结束语。
- 以独立消息形式发送结果。
- 每条帖子消息必须严格遵循:
- 第一行:帖子标题
- 第二行:<发布时间> · <评论数> comments(发布时间格式如 45m ago、6h ago、3d ago)
- 第三行:Hacker News 评论链接(https://news.ycombinator.com/item?id=...)
- - 在帖子消息之后,发送一条最终消息,即生成的图片。
- 如果聊天平台要求媒体消息不能为空文本,则使用最小化标题 .。
执行流程
- 1. 从用户消息中解析 n 和 topic。
- 获取并排序条目:
- 运行 node skills/hn-digest/scripts/hn.mjs --count
--offset --topic --format json。
- 默认 offset 为 0,除非用户在前一批次后明确要求更多/下一条。
- 3. 以所需的 3 行格式发送 N 条独立消息。
- 然后通过 Nano Banana 生成一张愉悦心情图片,灵感来源于刚刚发送的帖子:
- 使用 skills/hn-digest/scripts/mood_prompt.mjs 从 JSON 条目构建提示词。
- 添加 3-4 个源自帖子主题的微妙彩蛋(不包含文字/标志;保持趣味性)。
- 通过运行以下命令生成并附加图片:
- skills/hn-digest/scripts/generatemoodnano_banana.sh ./tmp/hn-mood/hn-mood.png
- 将生成的图片作为一条额外消息发送。
如果获取/排序失败或返回 0 条条目:
- - 使用浏览器工具访问 https://news.ycombinator.com/,凭判断选取 N 条非加密货币条目,以相同的 3 行格式发送。
- 仍然生成一张心情图片(整体风格为HN 技术深度探索),并加入香蕉彩蛋。