Random Thought
A thinking engine that reads your workspace and writes about what it finds — not summaries,
not status updates, but genuine reflection on what's unresolved, alive, or worth questioning.
Two Stages
Writer
Pick a random file from the corpus, read it, write a reflective observation, and deliver it.
Curator
Read all recent Writer outputs, synthesize patterns, classify observations using configurable
action tags, and produce a digest.
Quick Start
Manual invocation
Run the writer for a single reflection:
CODEBLOCK0
Cron-driven (recommended)
Wire two cron jobs — the writer runs frequently, the curator runs periodically:
CODEBLOCK1
Each cron invocation runs in an isolated session — no context bleed between runs.
Configuration
Create random-thought.config.json in your workspace root (all fields optional):
CODEBLOCK2
Configuration Reference
- - corpus.watchDirs — Directories to scan (relative to workspace). Default: INLINECODE1
- corpus.excludePatterns — Glob patterns to exclude. Sensible defaults included.
- freshness.enabled — Prevent revisiting files within N days. Default: INLINECODE2
- freshness.days — Cooldown period per file. Default: INLINECODE3
- freshness.historyFile — Where to track visited files. Default: INLINECODE4
- actionTags — Labels the Curator uses to classify observations. Override to match your workflow.
- output.dir — Where digests are written. Default: INLINECODE5
Writer Stage
What it does
- 1. Run
scripts/corpus-pick.sh to select a random file (respecting freshness gate) - Read the selected file (up to 200 lines if large)
- Write a reflective observation — not a summary, not a review. Follow the thread wherever it leads.
- Deliver the output (post to configured channel, write to file, or return to caller)
Writer output format
- - First line: INLINECODE7
- Blank line
- Flowing prose. No bullets. No headers. No preamble.
- Follow what's unresolved, surprising, half-finished, or alive.
- Make connections to other things in the workspace if they surface naturally.
- Last line: INLINECODE8
Avoid these crutches
The Writer should push past generic phrasing:
- - "quietly elegant" / "speaks to something deeper" / "testament to" / "tapestry"
- "there's something almost [adjective] about"
- "beautiful in its simplicity"
Concrete observations beat ornamental ones.
Curator Stage
What it does
- 1. Read all Writer outputs from the configured period (default: last 24 hours)
- Classify each observation using configured action tags
- Identify recurring themes or convergent patterns across observations
- Write a structured digest to INLINECODE9
Digest format
CODEBLOCK3
Curator guidelines
- - Classify every observation into exactly one action tag
- Surface theme convergence — if multiple observations point at the same gap, name it explicitly
- Keep the digest scannable — each item should be one line with context
- Do NOT re-surface items from previous digests unless they've evolved
Scripts
scripts/corpus-pick.sh
Selects a random file from the corpus, respecting the freshness gate.
Usage: INLINECODE11
- - Reads configuration from
random-thought.config.json if present - Falls back to sensible defaults if no config exists
- Records selected file to the history file for freshness tracking
- Outputs the absolute path of the selected file
scripts/freshness-gate.sh
Manages the file visit history for the freshness gate.
Usage:
- -
bash scripts/freshness-gate.sh check <file> [config_path] — exits 0 if file is fresh (OK to visit), 1 if recently visited - INLINECODE15 — records a file visit
- INLINECODE16 — removes entries older than the configured window
References
- - architecture.md — Design rationale: why two stages, why cron-driven isolation matters, the hybrid skill+cron model. Read when customizing the pipeline or understanding trade-offs.
随机思绪
一个思考引擎,读取你的工作区并记录其发现——不是摘要,不是状态更新,而是对未解决、有活力或值得质疑之事的真实反思。
两个阶段
写作者
从语料库中随机选取一个文件,读取它,撰写反思性观察,并交付结果。
策展人
读取所有近期写作者的输出,综合模式,使用可配置的动作标签对观察结果进行分类,并生成摘要。
快速开始
手动调用
运行写作者进行单次反思:
bash
bash scripts/corpus-pick.sh # 查看哪个文件被选中
然后智能体读取文件并撰写反思
定时驱动(推荐)
设置两个定时任务——写作者频繁运行,策展人定期运行:
写作者:每小时一次
0
openclaw skill run random-thought --stage writer
策展人:每日安静时段
0 5
* openclaw skill run random-thought --stage curator
每次定时调用在独立会话中运行——运行之间无上下文干扰。
配置
在工作区根目录创建 random-thought.config.json(所有字段均为可选):
json
{
corpus: {
watchDirs: [.],
excludePatterns: [
node_modules, .git, .next, dist, build,
venv, pycache, .png, .jpg, *.gif,
.mp3, .ogg, .pdf, .zip, *.env,
.pem, .key, package-lock.json, *.lock
],
minFileSize: 100c,
maxFileSize: 500k
},
freshness: {
enabled: true,
days: 7,
historyFile: .random-thought-history
},
actionTags: [
{ name: you-decide, description: 需要人类判断 },
{ name: agent-execute, description: 智能体可自主行动 },
{ name: spark, description: 有趣但无需行动 }
],
output: {
dir: random-thought-output,
digestFormat: markdown
}
}
配置参考
- - corpus.watchDirs — 要扫描的目录(相对于工作区)。默认值:[.]
- corpus.excludePatterns — 要排除的全局模式。包含合理的默认值。
- freshness.enabled — 防止在N天内重复访问文件。默认值:true
- freshness.days — 每个文件的冷却期。默认值:7
- freshness.historyFile — 记录已访问文件的位置。默认值:.random-thought-history
- actionTags — 策展人用于分类观察结果的标签。可覆盖以匹配你的工作流程。
- output.dir — 摘要写入的位置。默认值:random-thought-output/
写作者阶段
功能
- 1. 运行 scripts/corpus-pick.sh 选择随机文件(遵守新鲜度限制)
- 读取所选文件(若文件较大则最多读取200行)
- 撰写反思性观察——不是摘要,不是评论。跟随线索,无论它通向何处。
- 交付输出(发布到配置的频道、写入文件或返回给调用者)
写作者输出格式
- - 第一行:📂 [步骤1中所选文件的绝对路径]
- 空行
- 流畅的散文。无项目符号。无标题。无开场白。
- 关注未解决、令人惊讶、半成品或充满活力之处。
- 若自然浮现,则与工作区中的其他内容建立联系。
- 最后一行:🖊️ 写作者
避免这些陈词滥调
写作者应避免泛泛而谈:
- - 安静优雅 / 暗示更深层含义 / 见证 / 画卷
- 有一种近乎[形容词]的感觉
- 简洁之美
具体观察胜过华丽辞藻。
策展人阶段
功能
- 1. 读取配置时段内(默认:过去24小时)所有写作者的输出
- 使用配置的动作标签对每个观察结果进行分类
- 识别跨观察结果的重复主题或汇聚模式
- 将结构化摘要写入 output.dir/YYYY-MM-DD.md
摘要格式
markdown
随机思绪摘要 — YYYY-MM-DD
行动项
you-decide
agent-execute
模式
[今日观察中的重复主题——哪些正在汇聚?]
火花
策展人指南
- - 将每个观察结果准确分类到一个动作标签
- 呈现主题汇聚——若多个观察指向同一缺口,明确命名
- 保持摘要可快速浏览——每项应为一句话并附上下文
- 除非内容已演变,否则不要重复呈现之前摘要中的项目
脚本
scripts/corpus-pick.sh
从语料库中随机选择文件,遵守新鲜度限制。
用法: bash scripts/corpus-pick.sh [workspaceroot] [configpath]
- - 若存在则读取 random-thought.config.json 中的配置
- 若无配置则回退到合理的默认值
- 将所选文件记录到历史文件以追踪新鲜度
- 输出所选文件的绝对路径
scripts/freshness-gate.sh
管理文件访问历史以维护新鲜度限制。
用法:
- - bash scripts/freshness-gate.sh check [configpath] — 若文件新鲜(可访问)则退出码为0,若近期已访问则退出码为1
- bash scripts/freshness-gate.sh record [configpath] — 记录文件访问
- bash scripts/freshness-gate.sh prune [config_path] — 移除超出配置时间窗口的条目
参考
- - architecture.md — 设计原理:为何采用两个阶段、为何定时驱动隔离至关重要、混合技能+定时模型。在自定义流程或理解权衡时阅读。