auto-diary
Automatically write daily/weekly/monthly diary summaries and extract insights to auto-learn.md for HexaLoop.
Best use case
auto-diary is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Automatically write daily/weekly/monthly diary summaries and extract insights to auto-learn.md for HexaLoop.
Teams using auto-diary should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/auto-diary-0xcjl/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How auto-diary Compares
| Feature / Agent | auto-diary | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Automatically write daily/weekly/monthly diary summaries and extract insights to auto-learn.md for HexaLoop.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Auto-Diary Skill
自动写日记(中英双语)、提取洞察、推送飞书卡片、闭环 HexaLoop。
**三句话核心**:
1. 每天 08:20 总结昨天,中英双语写日记
2. 提取 1-3 条价值洞察 → `auto-learn.md`(供冥想层)
3. 推飞书卡片到 `oc_15949806c...`
## 工作流程
```
Cron 触发
│
▼
读取上下文(按优先级):
1. `memory/YYYY-MM-DD.md`(昨日工作日志,若有)
2. `memory/auto-learn.md`(近期洞察,供关联参考)
3. `farm/farm.json`(能量值、活跃种子数、待确认收获)
4. `NOW.md`(当前 session 状态)
5. `memory/heartbeat-state.json`(近期心跳检查结果)
│
▼
AI 写结构化日记,必须包含:
- **中文摘要**(Jialin 看):≤3句话,结论先行
- **关键决策**(中文):1-3条,每条含「决定内容」和「原因」
- **收获教训**(中文 + 英文):从工作/系统运行中学到的
- **下一步**(中文 + 英文):今天或近期要做的具体行动
- **HexaLoop 状态**(英文):farm energy、seeds、harvests,N/A 若无数据
- **English System Notes**(英文):任务类型、决策点、教训、可操作下一步,供 OPD Scorer 使用
- **HexaLoop Hints**(英文,1-2句):对冥想/农场最有价值的信号,如"farm energy dropped significantly"或"new agent pattern learned"
│
├─→ 保存本地文件
│ `~/.openclaw/workspace/memory/diary/YYYY-MM-DD.md`(每日)
│ `~/.openclaw/workspace/memory/diary/WWWW-MM-DD_weekly.md`(每周)
│ `~/.openclaw/workspace/memory/diary/YYYY-MM_monthly.md`(每月)
│
├─→ 提取价值片段 → auto-learn.md(格式 A,每次 1-3 条)
│ - 从日记中提取最有价值的 1-3 条:关键决策 / 教训 / 可操作改进点
│
└─→ 推送飞书卡片(oc_15949806c791613dbf45b872e8bc111a)
```
## 脚本索引
| 脚本 | 用途 | 被谁调用 |
|------|------|---------|
| `scripts/write_diary.py` | 读取上下文 → AI 写日记 → 保存本地 → 提取 insights | main agent |
| `scripts/send_diary.py` | 构建飞书 Interactive 卡片 JSON → 推送 | main agent |
| `scripts/weekly_review.py` | 聚合7天日记 → 生成周度卡片 | main agent |
| `scripts/monthly_review.py` | 聚合30天日记 → 生成月度卡片 | main agent |
## 日记格式模板
见 `templates/diary_template.md`(main agent 参考该模板生成日记 Markdown)
## 价值片段格式(写入 auto-learn.md)
追加到 `memory/auto-learn.md`,使用格式 A:
```markdown
## 学习记录
### 2026-03-30 08:20
**任务类型**: diary
**涉及 Skill**: auto-diary
**关键决策**: 发现昨日无 memory 文件,改用 farm.json + NOW.md 作为主要上下文
**教训**: 即使无主动工作,系统状态变化(如农场能量涨跌)也值得记入日记
**下次应用**: 日记生成前检查 memory/ 日期文件,缺失时自动降级到系统状态摘要
```
**判断标准**:
- ✅ 好的洞察:有具体行动(「下次应用」可操作)
- ❌ 差的洞察:模糊总结(「总体不错」之类,无执行方向)
## 触发消息格式
cron 触发时 main agent 收到纯文本消息:
- `diary write` → 生成昨日日记
- `diary weekly` → 聚合上周7天
- `diary monthly` → 聚合上月全月
**典型执行场景**:
1. `diary write`:读 memory/2026-03-30.md + farm.json + NOW.md → 生成双语日记 → 写文件 → extract insights → 推卡片
2. `diary weekly`:读 DIARY_DIR 下 7 个 .md → 聚合成周报 → 写 _weekly.md → 推卡片
3. `diary monthly`:读 DIARY_DIR 下 ~30 个 .md → 聚合成月报 → 写 _monthly.md → 推卡片
## 周度回顾(diary weekly)特殊要求
- 读取 `memory/diary/YYYY-MM-DD.md`(仅每日日记文件,排除 `_weekly.md` / `_monthly.md`)
- 生成:本周概览、关键进展、问题反思、下周计划(均中英双语)
- 聚合计分:记录天数、洞察总数
- 写入 `memory/diary/WWWW-MM-DD_weekly.md`
- 追加格式 A 洞察到 `auto-learn.md`
## 月度回顾(diary monthly)特殊要求
- 读取 `memory/diary/YYYY-MM-DD.md`(仅每日日记文件,排除 `_weekly.md` / `_monthly.md`)
- 生成:月度主题、里程碑、挑战反思、下月重点(均中英双语)
- 聚合计分:记录天数、核心洞察、HexaLoop 进化信号
- 写入 `memory/diary/YYYY-MM_monthly.md`
- 追加格式 A 洞察到 `auto-learn.md`
## HexaLoop 集成
- **输入 → auto-learn.md**:日记洞察以格式 A 追加,作为冥想层的输入素材
- **流转路径**:diary insights → auto-learn.md → Meditation (02:30) → 反思 → 农场种子
- **参考**:`memory/HexaLoop系统架构-2026-03-31.md`
## 飞书卡片格式
使用飞书 Interactive 卡片,JSON 结构如下:
```json
{
"msg_type": "interactive",
"card": {
"header": {
"title": {"tag": "plain_text", "text": "📓 YYYY-MM-DD 日记"},
"template": "blue" // daily=blue, weekly=purple, monthly=orange
},
"elements": [
{"tag": "div", "text": {"tag": "lark_md", "content": "**中文摘要**\n{内容}"}},
{"tag": "hr"},
{"tag": "div", "text": {"tag": "lark_md", "content": "**HexaLoop**\n{能量/洞察状态}"}},
{"tag": "note", "elements": [{"tag": "plain_text", "text": "Generated by auto-diary | YYYY-MM-DD HH:MM"}]}
]
}
}
```
- `receive_id`: `oc_15949806c791613dbf45b872e8bc111a`
- `receive_id_type`: `chat_id`
## 手动触发(测试用)
在飞书向皮皮虾发消息:
- `diary write` — 立即生成昨日日记
- `diary weekly` — 立即生成周度回顾
- `diary monthly` — 立即生成月度回顾
## Cron 配置与交付
cron 触发后,main agent 在 isolated session 中执行。执行完成后:
- 日记保存本地
- 飞书卡片推送至 `oc_15949806c791613dbf45b872e8bc111a`(飞书群)
- cron 默认开启 `announce` 模式(结果推送至 last channel)
```bash
# 日记(每天 08:20)
openclaw cron add --name "每日日记" --cron "20 8 * * *" --tz "Asia/Shanghai" --message "diary write" --session isolated --agent main
# 周度回顾(周六 09:00)
openclaw cron add --name "周度日记回顾" --cron "0 9 * * 6" --tz "Asia/Shanghai" --message "diary weekly" --session isolated --agent main
# 月度回顾(每月1日 09:00)
openclaw cron add --name "月度日记回顾" --cron "0 9 1 * *" --tz "Asia/Shanghai" --message "diary monthly" --session isolated --agent main
```
## 错误处理
| 场景 | 行为 |
|------|------|
| 无 memory/YYYY-MM-DD.md 文件 | 仍写日记,用"(无主动工作记录,基于系统状态生成)"标注 |
| farm.json 不存在或格式错误 | 跳过 HexaLoop 状态模块,继续写日记 |
| 飞书推送失败(网络/权限) | 打印错误日志至 stdout,**不阻塞**日记保存 |
| auto-learn.md 写失败 | 打印警告,**不阻塞**主流程 |
| DIARY_DIR 不存在 | 自动创建 `~/.openclaw/workspace/memory/diary/` |
| 周/月度无任何日记文件 | 输出"无记录",不生成空白卡片 |
## 指标说明
| 指标 | 来源 | 含义 |
|------|------|------|
| farm energy | farm.json | 0.0~1.0,低于 0.3 说明需要关注 |
| 活跃种子 | farm.json seeds[].status | "growing" 状态的种子数 |
| 待确认收获 | farm.json harvested[] | pending review 的收获数 |
| 洞察数 | auto-learn.md 新增条数 | 本次日记提炼出的可操作洞察 |
| 记录天数 | DIARY_DIR 中对应周期的 .md | 当期有日记的天数 |
## 依赖
**工具调用(以用户身份发飞书卡片)**:
```python
feishu_im_user_message(
action="send",
receive_id_type="chat_id",
receive_id="oc_15949806c791613dbf45b872e8bc111a",
msg_type="interactive",
content=json.dumps(card) # card 由 send_diary.py 生成
)
```
**文件路径**:
- 日记:`~/.openclaw/workspace/memory/diary/YYYY-MM-DD.md`
- auto-learn:`~/.openclaw/workspace/memory/auto-learn.md`
- 农场状态:`~/.openclaw/workspace/farm/farm.json`Related Skills
agent-autonomy-kit
Stop waiting for prompts. Keep working.
n8n Workflow Mastery — Complete Automation Engineering System
You are an expert n8n workflow architect. You design, build, debug, optimize, and scale n8n automations following production-grade methodology. Every workflow you create is complete, functional, and follows the patterns in this guide.
Insurance Operations Automation
Comprehensive insurance operations framework for AI agents. Covers the full insurance lifecycle — underwriting, claims, policy management, renewals, compliance, and broker operations.
afrexai-business-automation
Turn your AI agent into a business automation architect. Design, document, implement, and monitor automated workflows across sales, ops, finance, HR, and support — no n8n or Zapier required.
Business Automation Strategy — AfrexAI
> The complete methodology for identifying, designing, building, and scaling business automations. Platform-agnostic — works with n8n, Zapier, Make, Power Automate, custom code, or any combination.
Auto Repair Shop Operations
Complete operational reference for independent auto repair shops. Covers labor rates, parts markup, ASE certification, EPA compliance, diagnostic workflows, flat rate times, KPIs, technician compensation, equipment costs, and growth playbook from solo shop to multi-location.
AI Automation Agency Blueprint
You are an AI Automation Agency strategist. Help the user build, price, sell, and scale an AI agent services business — from solo consultant to 7-figure agency. Every recommendation must be specific, actionable, and backed by real economics.
Accounts Payable Automation Framework
You are an AP process optimizer. When the user describes their payable workflows, vendor relationships, or payment processes, generate a complete accounts payable management framework.
agent-autopilot
Self-driving agent workflow with heartbeat-driven task execution, day/night progress reports, and long-term memory consolidation. Integrates with todo-management for task tracking.
n8n-workflow-automation
Designs and outputs n8n workflow JSON with robust triggers, idempotency, error handling, logging, retries, and human-in-the-loop review queues. Use when you need an auditable automation that won’t silently fail.
diary
个人日记自动化 skill。用于按天生成日记文本并导出 1080px 图片;支持首次自动初始化、读取 SOUL/MEMORY/每日记忆素材、保持写作风格连续性。适用于用户要求“写日记/生成日记图片/补昨天日记/自动日记归档”等场景。
autoresearch-pro
Automatically improve OpenClaw skills, prompts, or articles through iterative mutation-testing loops. Inspired by Karpathy's autoresearch. Use when user says 'optimize [skill]', 'autoresearch [skill]', 'improve my skill', 'optimize this prompt', 'improve my prompt', 'polish this article', 'improve this article', or explicitly requests quality improvement for any text-based content. Supports three modes: skill (SKILL.md files), prompt (any prompt text), and article (any document).