Scribe | OpenClaw Skill
Comprehensive note-taking system that scans multiple OpenClaw data sources to generate daily and weekly notes with summaries.
Description
Scribe automatically scans and analyzes:
- - OpenClaw logs - Errors, warnings, gateway events, subagent activity
- Config files - Model preferences, gateway settings, agent configurations
- Chat history - Cursor IDE chat messages from SQLite databases
- Cursor history - Workspace-specific conversation history
- Memory files - Daily notes and long-term memory (MEMORY.md)
- Behavior files - BEHAVIOR.md, DESIRES.md, TASTES.md, PREFERENCES.md
- Drafts - Blog posts, tweets, and other draft files
Generates structured markdown notes with summaries at the top of each file.
Installation
CODEBLOCK0
Or clone into your skills directory:
CODEBLOCK1
Usage
Daily Notes
Generate a daily note covering the last 24 hours:
CODEBLOCK2
Weekly Notes
Generate a weekly note covering the last 7 days:
CODEBLOCK3
Both Daily and Weekly
Generate both notes at once:
CODEBLOCK4
JSON Output
Get results in JSON format:
CODEBLOCK5
Examples
Example 1: Daily Note Generation
Scenario: You want a daily summary of OpenClaw activity.
Action: Run python3 workspace/skills/scribe/scripts/scribe.py --mode daily.
Outcome: A markdown file workspace/Notes/daily/YYYY-MM-DD.md with a summary at the top, followed by detailed sections for logs, chat history, memory, drafts, behavior, and config.
Example 2: Weekly Summary
Scenario: You want a weekly overview of patterns and trends.
Action: Run python3 workspace/skills/scribe/scripts/scribe.py --mode weekly.
Outcome: A markdown file workspace/Notes/weekly/YYYY-MM-DD.md with weekly statistics, trends, and activity summaries.
Example 3: Cron Job Integration
Scenario: Automate daily note generation.
Action: Add a cron job that runs scribe.py --mode daily every day at midnight.
Outcome: Daily notes are automatically generated and saved to workspace/Notes/daily/.
Commands
CODEBLOCK6
- - --mode — Choose
daily, weekly, or both (default: daily) - --json — Output results in JSON format instead of markdown files
- --openclaw-home — Specify OpenClaw home directory (default:
~/.openclaw)
What this skill does
- 1. Scans logs - Analyzes all
.log files in logs/ directory for errors, warnings, gateway events, and subagent spawns - Reads config - Extracts model preferences, gateway settings, and agent configurations from INLINECODE13
- Extracts chat history - Queries Cursor's SQLite databases (
state.vscdb) for recent chat messages - Scans memory files - Reads daily notes (
memory/YYYY-MM-DD.md) and long-term memory (MEMORY.md) - Finds drafts - Searches for draft files matching patterns like
*draft*.txt, *draft*.md, blog/**/*.md, INLINECODE20 - Reads behavior files - Looks for
BEHAVIOR.md, DESIRES.md, TASTES.md, INLINECODE24 - Generates notes - Creates structured markdown files with summaries at the top
- Saves to Notes - Writes daily notes to
workspace/Notes/daily/YYYY-MM-DD.md and weekly notes to INLINECODE26
Output Format
Daily Note Structure
CODEBLOCK7
Weekly Note Structure
CODEBLOCK8
Requirements
- - Python 3.7+
- OpenClaw installation with
~/.openclaw directory structure - Cursor IDE installed (for chat history scanning)
- SQLite3 available (usually pre-installed on macOS)
- Write access to
workspace/Notes/ directory
Integration as a Cron Job
Example Cron Job Configuration:
CODEBLOCK9
Or run directly via shell script:
CODEBLOCK10
Security & Privacy
- - File access: Reads
openclaw.json (config only, no secrets), logs/*.log, memory/*.md, and Cursor SQLite databases - No data exfiltration: All data stays local; notes are saved to
workspace/Notes/ directory - Safe execution: Uses read-only access to config and logs; only writes to
workspace/Notes/daily/ and workspace/Notes/weekly/ directories
Limitations
- - Chat history extraction depends on Cursor's database schema (may need updates if Cursor changes storage format)
- Draft file detection uses pattern matching; may miss files with non-standard naming
- Behavior file detection looks for common filenames; custom locations may not be found
- Large log files may take time to process
技能名称: scribe
详细描述:
Scribe | OpenClaw 技能
全面的笔记系统,可扫描多个 OpenClaw 数据源,生成带有摘要的每日和每周笔记。
描述
Scribe 自动扫描并分析:
- - OpenClaw 日志 - 错误、警告、网关事件、子代理活动
- 配置文件 - 模型偏好、网关设置、代理配置
- 聊天历史 - 来自 SQLite 数据库的 Cursor IDE 聊天消息
- Cursor 历史 - 特定工作区的对话历史
- 记忆文件 - 每日笔记和长期记忆 (MEMORY.md)
- 行为文件 - BEHAVIOR.md、DESIRES.md、TASTES.md、PREFERENCES.md
- 草稿 - 博客文章、推文和其他草稿文件
在每个文件顶部生成带有摘要的结构化 Markdown 笔记。
安装
bash
clawhub install scribe
或克隆到你的技能目录:
bash
git clone https://github.com/Org/scribe.git workspace/skills/scribe
用法
每日笔记
生成涵盖过去 24 小时的每日笔记:
bash
python3 workspace/skills/scribe/scripts/scribe.py --mode daily
每周笔记
生成涵盖过去 7 天的每周笔记:
bash
python3 workspace/skills/scribe/scripts/scribe.py --mode weekly
同时生成每日和每周笔记
一次性生成两种笔记:
bash
python3 workspace/skills/scribe/scripts/scribe.py --mode both
JSON 输出
以 JSON 格式获取结果:
bash
python3 workspace/skills/scribe/scripts/scribe.py --mode daily --json
示例
示例 1:生成每日笔记
场景: 你想要一份 OpenClaw 活动的每日摘要。
操作: 运行 python3 workspace/skills/scribe/scripts/scribe.py --mode daily。
结果: 生成一个 Markdown 文件 workspace/Notes/daily/YYYY-MM-DD.md,顶部有摘要,后跟日志、聊天历史、记忆、草稿、行为和配置的详细部分。
示例 2:每周摘要
场景: 你想要一份模式和趋势的每周概览。
操作: 运行 python3 workspace/skills/scribe/scripts/scribe.py --mode weekly。
结果: 生成一个 Markdown 文件 workspace/Notes/weekly/YYYY-MM-DD.md,包含每周统计、趋势和活动摘要。
示例 3:Cron 任务集成
场景: 自动化每日笔记生成。
操作: 添加一个 cron 任务,每天午夜运行 scribe.py --mode daily。
结果: 每日笔记自动生成并保存到 workspace/Notes/daily/。
命令
bash
python3 workspace/skills/scribe/scripts/scribe.py --mode daily # 生成每日笔记
python3 workspace/skills/scribe/scripts/scribe.py --mode weekly # 生成每周笔记
python3 workspace/skills/scribe/scripts/scribe.py --mode both # 生成两种笔记
python3 workspace/skills/scribe/scripts/scribe.py --mode daily --json # JSON 输出
python3 workspace/skills/scribe/scripts/scribe.py --openclaw-home /path/to/openclaw # 自定义主目录
- - --mode — 选择 daily、weekly 或 both(默认:daily)
- --json — 以 JSON 格式输出结果,而不是 Markdown 文件
- --openclaw-home — 指定 OpenClaw 主目录(默认:~/.openclaw)
此技能的功能
- 1. 扫描日志 - 分析 logs/ 目录中的所有 .log 文件,查找错误、警告、网关事件和子代理生成
- 读取配置 - 从 openclaw.json 中提取模型偏好、网关设置和代理配置
- 提取聊天历史 - 查询 Cursor 的 SQLite 数据库 (state.vscdb) 以获取最近的聊天消息
- 扫描记忆文件 - 读取每日笔记 (memory/YYYY-MM-DD.md) 和长期记忆 (MEMORY.md)
- 查找草稿 - 搜索匹配模式如 draft.txt、draft.md、blog//.md、tweet.txt 的草稿文件
- 读取行为文件 - 查找 BEHAVIOR.md、DESIRES.md、TASTES.md、PREFERENCES.md
- 生成笔记 - 创建顶部带有摘要的结构化 Markdown 文件
- 保存到 Notes - 将每日笔记写入 workspace/Notes/daily/YYYY-MM-DD.md,每周笔记写入 workspace/Notes/weekly/YYYY-MM-DD.md
输出格式
每日笔记结构
markdown
每日摘要 - YYYY-MM-DD HH:MM:SS
- - 日志: X 个错误,Y 个警告
- 网关事件: Z 个事件
- 子代理活动: N 次生成
- 聊天消息: M 条消息
- 每日笔记: K 个文件
- 草稿: L 个草稿文件
- 配置: 加载成功
每日笔记
日志
错误 (X)
警告 (Y)
聊天历史
在过去 24 小时内找到 M 条消息。
用户 (X 条消息)
记忆文件
每日笔记 (K)
草稿
[草稿路径]
- - 大小: X 字节
- 修改时间: [时间戳]
- 预览: [内容预览]
行为与偏好
行为文件
配置
模型偏好
每周笔记结构
markdown
每周摘要 - YYYY-MM-DD HH:MM:SS
[摘要统计]
每周笔记 - YYYY-MM-DD 至 YYYY-MM-DD
每周摘要
- - 总错误数: X
- 总警告数: Y
- 网关事件: Z
- 子代理生成: N
聊天活动 (M 条消息)
记忆活动 (K 条每日笔记)
草稿 (L 个文件)
- - [路径]: X 字节(修改时间: [时间戳])
趋势与模式
- - ⚠️ 错误率: 本周 X 个错误
- 🤖 子代理活动: 本周 N 次生成
- 💬 聊天活动: 本周 M 条消息
要求
- - Python 3.7+
- 已安装 OpenClaw,并具有 ~/.openclaw 目录结构
- 已安装 Cursor IDE(用于扫描聊天历史)
- 可用的 SQLite3(通常在 macOS 上预装)
- 对 workspace/Notes/ 目录的写入权限
作为 Cron 任务集成
示例 Cron 任务配置:
json
{
payload: {
kind: agentTurn,
message: 运行 scribe.py --mode daily 以生成每日笔记。,
model: openrouter/google/gemini-2.5-flash,
thinking: low,
timeoutSeconds: 300
},
schedule: {
kind: cron,
cron: 0 0 *
},
delivery: {
mode: announce
},
sessionTarget: isolated,
name: 每日 Scribe 笔记
}
或通过 shell 脚本直接运行:
bash
添加到 crontab (crontab -e)
每天午夜运行
0 0
* /Users/ghost/.openclaw/workspace/skills/scribe/scripts/scribe.py --mode daily >> /Users/ghost/.openclaw/logs/scribe.log 2>&1
安全与隐私
- - 文件访问:读取 openclaw.json(仅配置,无密钥)、logs/.log、memory/.md 和 Cursor SQLite 数据库
- 无数据泄露:所有数据保留在本地