Workflow Crystallizer
Mines memory logs (memory/YYYY-MM-DD.md) for recurring patterns — repeated requests,
multi-step workflows, time-correlated tasks — and generates actionable suggestions:
cron jobs, skill drafts, workflow shortcuts, or monitoring proposals.
Unlike a one-shot "analyze my logs" prompt, this skill persists state across runs.
It remembers what it suggested, what was accepted/rejected, and only surfaces new
insights backed by real evidence.
All scripts live in scripts/ relative to this SKILL.md.
Quick Run (Full Pipeline)
CODEBLOCK0
This analyzes all memory files, generates suggestions, and prints a markdown report.
Incremental Run (Cached — Recommended)
CODEBLOCK1
Only processes new/modified memory files. Uses cached events from prior runs.
Managing Suggestions
Check state: python3 scripts/state.py — shows cached dates, events, suggestions.
To accept/reject/snooze: edit state.json directly. Set status to accepted,
rejected (add rejection_reason), or snoozed. Or use state.py imports.
Reset everything: python3 scripts/state.py --reset
Individual Scripts
Each script accepts --help. Key options:
- -
analyze_patterns.py: --memory-dir PATH, --state-file PATH, --full, INLINECODE16 - INLINECODE17 :
--state-file PATH, --cron-path PATH, INLINECODE20 - INLINECODE21 :
--state-file PATH, --output PATH, --clusters FILE, INLINECODE25 - INLINECODE26 : (no args = inspect state),
--reset (clear everything)
What It Detects
| Pattern Type | Evidence Needed | Suggestion Output |
|---|
| Recurring request | 3+ occurrences, 2+ days | Workflow shortcut or monitor |
| Multi-step workflow |
2+ occurrences with step similarity | Skill draft |
| Time-correlated | 2+ at similar times/days | Cron job definition |
| Already formalized | Contains "cron", "automated", etc. | Skipped (no suggestion) |
| Project (not pattern) | Same entity, different actions | Skipped |
See references/pattern-types.md for detailed detection logic and scoring weights.
How It Avoids Being Annoying
- - Max 3 suggestions per run — quality over quantity
- Confidence threshold (60%) — no low-quality guesses
- Deduplication — checks existing crons and skills before suggesting
- Never repeats — tracks what was already suggested
- Snooze — deferred suggestions resurface after 30 days
- Rejected = dormant — only resurfaces at 80%+ confidence with new evidence
Scheduling
Run weekly via cron or heartbeat. Cost: ~5-10K tokens incremental, ~30K first run.
CODEBLOCK2
Troubleshooting
- - No patterns: Need 3+ days of substantive memory files
- All filtered: Existing crons/skills already cover detected patterns
- State corrupt: INLINECODE29
- Too noisy: Increase
min_confidence in state.json config
工作流结晶器
挖掘内存日志(memory/YYYY-MM-DD.md)中的重复模式——重复请求、多步骤工作流、时间关联任务——并生成可操作建议:定时任务、技能草稿、工作流快捷方式或监控方案。
与一次性分析我的日志提示不同,此技能在多次运行间保持状态。它会记住自己建议了什么、哪些被接受/拒绝,并且只呈现有真实证据支持的新洞察。
所有脚本位于此SKILL.md所在目录的scripts/子目录中。
快速运行(完整流水线)
bash
cd /Users/openclaw/.openclaw/workspace/skills/workflow-crystallizer
python3 scripts/analyzepatterns.py --full | python3 scripts/generatesuggestions.py | python3 scripts/report.py --state-file state.json
分析所有内存文件,生成建议,并输出Markdown格式报告。
增量运行(推荐缓存模式)
bash
cd /Users/openclaw/.openclaw/workspace/skills/workflow-crystallizer
python3 scripts/analyzepatterns.py | python3 scripts/generatesuggestions.py | python3 scripts/report.py --state-file state.json
仅处理新增/修改的内存文件。使用先前运行的缓存事件。
管理建议
检查状态:python3 scripts/state.py — 显示缓存日期、事件、建议。
接受/拒绝/推迟:直接编辑state.json。将status设置为accepted、rejected(添加rejection_reason)或snoozed。或使用state.py导入功能。
重置所有内容:python3 scripts/state.py --reset
独立脚本
每个脚本接受--help参数。关键选项:
- - analyzepatterns.py:--memory-dir PATH、--state-file PATH、--full、--min-confidence 0.4
- generatesuggestions.py:--state-file PATH、--cron-path PATH、--clusters FILE
- report.py:--state-file PATH、--output PATH、--clusters FILE、--suggestions FILE
- state.py:(无参数=检查状态)、--reset(清除所有内容)
检测内容
| 模式类型 | 所需证据 | 建议输出 |
|---|
| 重复请求 | 出现3次以上,跨越2天以上 | 工作流快捷方式或监控方案 |
| 多步骤工作流 |
出现2次以上且步骤相似 | 技能草稿 |
| 时间关联 | 相似时间/天出现2次以上 | 定时任务定义 |
| 已形式化 | 包含cron、automated等关键词 | 跳过(不生成建议) |
| 项目(非模式) | 同一实体,不同操作 | 跳过 |
详细检测逻辑和评分权重请参见references/pattern-types.md。
避免烦扰的机制
- - 每次运行最多3条建议 — 质量优先于数量
- 置信度阈值(60%) — 不输出低质量猜测
- 去重 — 建议前检查现有定时任务和技能
- 从不重复 — 追踪已建议过的内容
- 推迟 — 推迟的建议30天后重新出现
- 拒绝=休眠 — 仅在有新证据且置信度达到80%以上时重新出现
调度
通过cron或心跳机制每周运行。成本:增量运行约5-10K tokens,首次运行约30K tokens。
名称:每周工作流结晶器
调度:0 20 0(美国东部时间周日晚上8点)
消息:运行workflow-crystallizer技能并呈现任何新建议。
故障排除
- - 无模式: 需要3天以上的实质性内存文件
- 全部被过滤: 现有定时任务/技能已覆盖检测到的模式
- 状态损坏: python3 scripts/state.py --reset
- 过于嘈杂: 在state.json配置中增加min_confidence