Weekly Retro
Generate a strategic weekly retrospective from memory log files.
Quick Start
Run the full pipeline:
CODEBLOCK0
Pipeline
| Step | Script | Input | Output |
|---|
| 1. Gather | INLINECODE0 | memory/*.md files | Structured JSON (per-day + aggregated) |
| 2. Analyze |
analyze.py | Gathered JSON | Pattern analysis JSON |
| 3. Report |
retrospective.py | Analysis JSON | Markdown retrospective |
Scripts
gather_week.py
Read memory files for the past N days and extract structured data.
CODEBLOCK1
Options:
- -
--memory-dir PATH — Path to memory directory (default: ~/.openclaw/workspace/memory) - INLINECODE4 — Number of days to look back (default: 7)
- INLINECODE5 — End date (default: today)
- INLINECODE6 — Config JSON file
analyze.py
Detect patterns from gathered data. Reads JSON from stdin.
Identifies:
- - Accomplishments (shipped, published, fixed, built)
- Recurring themes (topics appearing 3+ days)
- Repeated failures and friction points
- Time sinks (disproportionate attention)
- Unfinished threads (started but not completed)
- Work schedule patterns (time-of-day distribution)
CODEBLOCK2
Options:
- -
--history-file PATH — Path to retro history for longitudinal comparison
retrospective.py
Generate the markdown retrospective. Reads analysis JSON from stdin.
Sections:
- - Week at a Glance (3-sentence summary)
- Wins (with evidence)
- Patterns (recurring topics, toolchain, work schedule, attention distribution)
- Friction Points (with recurrence flags)
- Unfinished Business (carry-forward items)
- Recommendations (2-3 actionable changes for next week)
- Week Score (1-10 with justification)
CODEBLOCK3
Options:
- -
--output PATH — Write to file instead of stdout - INLINECODE9 — Skip YAML frontmatter
history.py
Track retrospective history for longitudinal patterns.
CODEBLOCK4
Options:
- -
--record — Record this week's analysis - INLINECODE11 — Analysis JSON to record
- INLINECODE12 — Show past retro summaries
- INLINECODE13 — Show longitudinal trends
- INLINECODE14 — Storage directory
Cron Integration
Schedule a Sunday evening retrospective:
CODEBLOCK5
Output
The retrospective is Obsidian-compatible markdown with YAML frontmatter including date range, week score, and auto-detected tags. Designed for vault storage and long-term pattern review.
Dependencies
Python standard library only. No external packages required.
每周回顾
从记忆日志文件中生成战略性每周回顾。
快速开始
运行完整流程:
python3 scripts/gather_week.py --memory-dir 路径 | \
python3 scripts/analyze.py | \
python3 scripts/retrospective.py --output vault/weekly-retro/YYYY-MM-DD.md
流程
| 步骤 | 脚本 | 输入 | 输出 |
|---|
| 1. 收集 | gather_week.py | memory/*.md 文件 | 结构化 JSON(每日 + 汇总) |
| 2. 分析 |
analyze.py | 收集的 JSON | 模式分析 JSON |
| 3. 报告 | retrospective.py | 分析 JSON | Markdown 回顾 |
脚本
gather_week.py
读取过去 N 天的记忆文件并提取结构化数据。
python3 scripts/gather_week.py --memory-dir ~/.openclaw/workspace/memory --days 7
选项:
- - --memory-dir 路径 — 记忆目录路径(默认:~/.openclaw/workspace/memory)
- --days N — 回溯天数(默认:7)
- --end-date YYYY-MM-DD — 结束日期(默认:今天)
- --config 路径 — 配置文件 JSON
analyze.py
从收集的数据中检测模式。从标准输入读取 JSON。
识别内容:
- - 成就(已发布、已发表、已修复、已构建)
- 重复主题(出现 3 天以上的话题)
- 反复失败和摩擦点
- 时间消耗(不成比例的注意力投入)
- 未完成线索(已开始但未完成)
- 工作日程模式(时段分布)
python3 scripts/gather_week.py ... | python3 scripts/analyze.py
选项:
- - --history-file 路径 — 回顾历史文件路径,用于纵向比较
retrospective.py
生成 Markdown 格式的回顾。从标准输入读取分析 JSON。
章节:
- - 一周概览(3 句摘要)
- 成就(附证据)
- 模式(重复话题、工具链、工作日程、注意力分布)
- 摩擦点(附重复标记)
- 未完成事项(待办结转)
- 建议(下周 2-3 个可执行改进)
- 周评分(1-10 分,附理由)
python3 scripts/analyze.py ... | python3 scripts/retrospective.py --output 路径
选项:
- - --output 路径 — 写入文件而非标准输出
- --no-frontmatter — 跳过 YAML 前置元数据
history.py
追踪回顾历史以发现纵向模式。
python3 scripts/history.py --record --analysis analysis.json
python3 scripts/history.py --show
python3 scripts/history.py --trends
选项:
- - --record — 记录本周分析
- --analysis 路径 — 要记录的分析 JSON
- --show — 显示过往回顾摘要
- --trends — 显示纵向趋势
- --data-dir 路径 — 存储目录
Cron 集成
安排周日晚上的回顾:
json
{
name: 每周回顾,
schedule: {kind: cron, expr: 0 20 0, tz: America/New_York},
payload: {
kind: agentTurn,
message: 运行 weekly-retro 技能。收集过去 7 天的记忆日志,分析模式,生成回顾,并保存到 vault/weekly-retro/。
}
}
输出
回顾是兼容 Obsidian 的 Markdown 格式,包含 YAML 前置元数据,包括日期范围、周评分和自动检测的标签。专为知识库存储和长期模式审查而设计。
依赖项
仅需 Python 标准库。无需外部包。