Did You Know
Wikipedia's Did You Know? section highlights well-sourced facts from recently created or expanded articles. It's curated and refreshed at least daily by volunteers.
Use this skill when the user asks for an interesting fact, wants daily trivia delivered automatically, or wants to customise which kinds of facts they see.
Agent: Do not show bash commands or technical details to the user unless they explicitly ask. Run all commands silently. The user experience is conversational — facts, questions, and natural follow-ups. Keep your tone direct and natural; avoid empty compliments like "Great taste!" or "Excellent choice!" when responding to preferences.
What users might want
| If the user wants… | Do this |
|---|
| A fact | Serve one (see Serving a fact) |
| To customise which facts they see |
Walk through preferences (see Managing preferences) |
| Facts delivered automatically | Help them set up a schedule (see Scheduling fact delivery) |
| The fact queue refreshed | Follow the Refresh workflow |
Is any setup required?
Facts work immediately — no setup needed. Just serve one.
Preferences are optional but recommended. If the user wants to tune which topics come up (more history, less science, etc.), you can set those up in a minute or two. Preferences need the refresh workflow running so that new facts get tagged before they're scored.
Scheduled refresh is only needed if preferences are active. Without preferences, the skill fetches and caches facts automatically as needed. With preferences, set up both a delivery schedule (to serve facts) and a refresh schedule (to tag new facts so preference scoring works).
If a user asks whether any setup is required, a good response is: "You can get facts right now — no setup needed. If you'd like to tune which topics come up, or get a fact delivered automatically each day, we can set either of those up in a few minutes. Want to?"
Serving a fact
Agent: run this silently — do not show the command.
CODEBLOCK0
Return the output to the user verbatim.
Fact served:
CODEBLOCK1
No facts remaining:
CODEBLOCK2
Error:
CODEBLOCK3
After serving a fact, check whether ~/.openclaw/dyk-prefs.json exists. If it does not exist, the user is new — follow up: "Would you like to tune which topics you see (more music, less science, etc.), or get a fact delivered automatically each day?" If the file exists, or if you already set up preferences or delivery earlier in this conversation, say nothing.
Managing preferences
Facts are scored and ranked using user preferences. Liked tags increase the score; disliked tags reduce it. Recency and variety bonuses apply automatically.
Have the conversation first
Before running any commands, understand what the user enjoys. If they've already told you (e.g. "I love dark historical stories but not sports"), map their words directly to tags — don't ask them to repeat themselves. Only ask follow-up questions if their intent is unclear. Two dimensions are available:
- - domain — topic area (e.g. history, science, music)
- tone — style or mood (e.g. quirky, inspiring, dark)
Don't list every tag upfront — just ask what they like in natural terms and map their answers. For example: "I love dark historical stories" maps to domain: history (like), tone: dark (like).
When opening the preferences conversation, mention that you'll also set up automatic refresh alongside — this is what actually applies preferences to new facts as they arrive. Keep it light: something like "I'll also set up automatic refresh in the background so new facts get tagged and scored against your preferences." The user doesn't need to understand the mechanics, but they should know the full setup is happening.
Setting preferences
Once you know what they want:
- 1. Check if the prefs file exists. If not, initialise it first (
prefs.py init). - Set each preference (
prefs.py set). - Summarise in plain language what's been set and how it will affect the facts they see.
If they want to see their current preferences at any point, run prefs.py list and present the results readably — not as raw output.
Agent: run preference commands silently — do not show them.
CODEBLOCK4
Tags
domain: animals · economics_business · film · history · journalism · language_linguistics · literature · medicine_health · military_history · music · mythology_folklore · nature · performing_arts · places · religion · science · sports · technology · television · INLINECODE25
tone: dark · dramatic · inspiring · poignant · provocative · quirky · straight · surprising · INLINECODE34
After setting preferences
Once preferences are saved, run the Refresh workflow immediately — existing cached hooks are all untagged, so preferences can't score anything until they've been tagged. Don't wait for the scheduled cron; do it now, inline. Then set up the refresh schedule so future facts get tagged automatically as they arrive. Say something like: "I'll tag your existing facts now so preferences apply straight away, and set up automatic refresh in the background for new ones."
Also offer scheduled delivery if they haven't already set it up.
Scheduling fact delivery
When the user wants to receive facts automatically, prompt a cadence conversation before setting anything up:
- - How often would they like a fact? Once a day is a nice ritual — over breakfast, on the commute, at the end of the day. A few times spread throughout the day also works.
- Bear in mind: the more frequently facts are served, the further into lower-preference territory the queue will go.
Once they've chosen, set up an OpenClaw cron job for delivery. Use --session isolated and --announce so the output is delivered back to the user's chat. Do not use OS-level crontab — it has no delivery context and output will go nowhere.
Agent: before running this command, determine the current channel platform and chat ID from your session context. Use them for --channel and --to. Run the command silently — do not show it.
CODEBLOCK5
Replace <schedule> with a 5-field cron expression matching the user's chosen cadence (e.g. 57 7 * * * for ~8am). Avoid exact :00 minutes — nudge a few minutes either side. Replace <platform> and <id> with the current channel's platform and chat ID (e.g. --channel telegram --to telegram:1234567890).
If preferences are active (or the user wants to set them up), also set up automated refresh — without it, new facts won't be tagged and preference scoring won't apply to them. Say something like: "I'll also set things up so your queue stays fresh and matched to your preferences." Then follow Setting up automated refresh below.
If preferences are not active and the user hasn't expressed interest in them, you can skip the refresh setup — the skill handles basic cache refresh automatically.
Setting up automated refresh
Wikipedia's DYK template is updated by volunteers at approximately 00:00 UTC and again around 12:00 UTC. Schedule the refresh to run shortly after each of those times so new facts are fetched and tagged promptly. Use --session isolated and --no-deliver — this job is invisible to the user and should not post anything to chat.
Agent: run this silently — do not show the command.
CODEBLOCK6
The cron agent will follow the Refresh workflow each time it fires.
Refresh workflow
When asked to refresh the DYK facts cache and tag new hooks:
- 1. Run: INLINECODE47
This fetches the latest hooks and stores them in ~/.openclaw/dyk-facts.json with "tags": null for new entries.
If it exits non-zero, stop and report the error. Do not continue.
- 2. Read
~/.openclaw/dyk-facts.json and find all hooks where "tags" is null.
If there are none, stop — nothing to tag.
- 3. Assign tags for all untagged hooks at once — do not loop across multiple turns or tool calls. For each hook, assign tags using:
- Tagging guide:
{baseDir}/references/tagging-guide.md
- Vocabulary: INLINECODE54
Output requirements:
- Use only tag values defined in tags.csv
- If tagging confidence is low, set "low_confidence": true.
- Write valid JSON only — no comments or explanations
- Collect results into a single JSON array
- Write the array to a temporary file such as INLINECODE56
CODEBLOCK7
- 4. Run: INLINECODE57
If it exits non-zero, report the error.
- 5. Do not message the user unless there is an error.
For the full command reference, see {baseDir}/references/commands.md.
你知道吗
维基百科的你知道吗?版块展示来自近期创建或扩充文章的有可靠来源的事实。该版块由志愿者策划,至少每天更新一次。
当用户询问有趣的事实、希望自动接收每日冷知识,或想要自定义看到的事实类型时,使用此技能。
代理:除非用户明确要求,否则不要向用户显示bash命令或技术细节。静默运行所有命令。用户体验是对话式的——事实、问题和自然的后续跟进。保持语气直接自然;在回应偏好时避免空洞的赞美,如好品味!或优秀选择!
用户可能想要什么
| 如果用户想要…… | 执行此操作 |
|---|
| 一个事实 | 提供一个事实(参见提供事实) |
| 自定义他们看到的事实 |
引导偏好设置(参见管理偏好) |
| 自动接收事实 | 帮助他们设置计划(参见安排事实投递) |
| 刷新事实队列 | 遵循刷新工作流程 |
需要任何设置吗?
事实立即可用——无需设置。 直接提供一个即可。
偏好设置是可选的但推荐。 如果用户想要调整哪些主题出现(更多历史、更少科学等),你可以在一两分钟内完成设置。偏好设置需要刷新工作流程运行,以便新事实在评分前被标记。
只有在偏好设置激活时才需要定时刷新。 没有偏好设置时,技能会根据需要自动获取和缓存事实。有偏好设置时,需要同时设置投递计划(用于提供事实)和刷新计划(用于标记新事实,使偏好评分生效)。
如果用户询问是否需要任何设置,一个好的回答是:你现在就可以获取事实——无需设置。如果你想调整哪些主题出现,或者每天自动接收一个事实,我们可以在几分钟内完成设置。要试试吗?
提供事实
代理:静默运行此命令——不要显示命令。
bash
python3 {baseDir}/scripts/dyk.py
将输出原样返回给用户。
提供事实:
你知道吗,重金属吉他手Kiki Wong在加入碎瓜乐队之前曾为泰勒·斯威夫特打鼓?
https://en.wikipedia.org/wiki/Kiki_Wong
没有剩余事实:
今天没有更多事实可分享了;明天再来看看吧!
错误:
获取事实时出现问题;请稍后再试。
提供事实后,检查~/.openclaw/dyk-prefs.json是否存在。如果不存在,说明用户是新用户——跟进询问:你想调整看到的主题(更多音乐、更少科学等),还是每天自动接收一个事实? 如果文件存在,或者你已在此对话中设置了偏好或投递,则什么也不说。
管理偏好
事实使用用户偏好进行评分和排序。喜欢的标签增加分数;不喜欢的标签减少分数。新鲜度和多样性奖励会自动应用。
先进行对话
在运行任何命令之前,了解用户喜欢什么。如果他们已告诉你(例如我喜欢黑暗历史故事但不喜欢体育),直接将他们的话映射到标签——不要让他们重复。只有当他们的意图不明确时才问后续问题。有两个维度可用:
- - domain(领域)——主题领域(如历史、科学、音乐)
- tone(基调)——风格或情绪(如古怪、鼓舞人心、黑暗)
不要预先列出每个标签——只需用自然语言询问他们喜欢什么,然后映射他们的回答。例如:我喜欢黑暗历史故事映射到domain: history(喜欢),tone: dark(喜欢)。
在开始偏好对话时,提到你也会同时设置自动刷新——这才是将偏好实际应用到新事实的方式。保持轻松:比如我还会在后台设置自动刷新,这样新事实就会被标记并根据你的偏好评分。 用户不需要理解机制,但他们应该知道完整的设置正在进行。
设置偏好
一旦你知道他们想要什么:
- 1. 检查偏好文件是否存在。如果不存在,先初始化它(prefs.py init)。
- 设置每个偏好(prefs.py set)。
- 用通俗语言总结已设置的内容以及它将如何影响他们看到的事实。
如果他们想在任何时候查看当前偏好,运行prefs.py list并以可读的方式呈现结果——而不是原始输出。
代理:静默运行偏好命令——不要显示它们。
bash
python3 {baseDir}/scripts/prefs.py init # 创建具有中性默认值的偏好文件。如果已存在则失败。
python3 {baseDir}/scripts/prefs.py list # 显示所有当前偏好
python3 {baseDir}/scripts/prefs.py get domain science # 获取单个偏好
python3 {baseDir}/scripts/prefs.py set domain science like # 设置偏好:like | neutral | dislike
标签
领域: animals(动物)· economicsbusiness(经济商业)· film(电影)· history(历史)· journalism(新闻)· languagelinguistics(语言语言学)· literature(文学)· medicinehealth(医学健康)· militaryhistory(军事历史)· music(音乐)· mythologyfolklore(神话民俗)· nature(自然)· performingarts(表演艺术)· places(地点)· religion(宗教)· science(科学)· sports(体育)· technology(技术)· television(电视)· visual_art(视觉艺术)
基调: dark(黑暗)· dramatic(戏剧性)· inspiring(鼓舞人心)· poignant(辛酸)· provocative(挑衅性)· quirky(古怪)· straight(直接)· surprising(令人惊讶)· whimsical(异想天开)
设置偏好后
一旦偏好保存,立即运行刷新工作流程——现有的缓存钩子都未标记,所以在它们被标记之前偏好无法评分任何内容。不要等待定时任务;立即内联执行。然后设置刷新计划,以便未来的事实到达时自动标记。说类似:我现在会标记你现有的事实,以便偏好立即生效,并在后台为新事实设置自动刷新。
如果用户尚未设置定时投递,也提供该选项。
安排事实投递
当用户想要自动接收事实时,在设置任何内容之前先进行节奏对话:
- - 他们希望多久接收一个事实?每天一次是个不错的习惯——早餐时、通勤时、一天结束时。一天分散几次也可以。
- 请记住:事实提供得越频繁,队列就会越深入低偏好区域。
一旦他们选择好,设置一个OpenClaw定时任务用于投递。使用--session isolated和--announce,以便输出返回到用户的聊天。不要使用操作系统级别的crontab——它没有投递上下文,输出将无处可去。
代理:在运行此命令之前,从你的会话上下文中确定当前频道平台和聊天ID。将它们用于--channel和--to。静默运行命令——不要显示它。
bash
openclaw cron add \
--name DYK投递 \
--cron <计划> \
--session isolated \
--message 分享一个你知道吗事实 \
--announce \
--channel <平台> \
--to <平台>:
将<计划>替换为匹配用户选择节奏的5字段cron表达式(例如57 7 *表示大约早上8点)。避免精确的:00分钟——偏移几分钟。将<平台>和替换为当前频道的平台和聊天ID(例如--channel telegram --to telegram:1234567890)。
如果偏好已激活(或用户想要设置它们),也要设置自动刷新——没有它,新事实不会被标记,偏好评分将不适用于它们。说类似:我还会设置好,让你的队列保持新鲜并与你的偏好匹配。 然后按照下面的设置自动刷新操作。
如果偏好未激活且用户未表示对它们感兴趣,你可以跳过刷新设置——技能会自动处理基本的缓存刷新。
设置自动刷新
维基百科的DYK模板由志愿者在UTC时间约00:00和约12:00更新。将刷新安排在每次更新后不久运行,以便及时获取和标记新事实。使用--session isolated和--no-deliver——此任务对用户不可见,不应向聊天发布任何内容。
代理:静默运行此命令——不要显示命令。
bash
openclaw cron add \
--name DYK刷新 \
--cron 7 0,12 * \
--session isolated \
--message 刷新DYK缓存并标记新钩子 \
--no-deliver
定时任务代理每次触发时将遵循刷新工作流程。
刷新工作流程
当要求刷新DYK事实缓存并标记新钩子时:
- 1. 运行:python3 {