当用户要求生成 om-generator 指定日期范围周报时使用;整合 Git 提交、Claude Code 会话、Codex 会话和可选本机记忆记录。
npx skills add https://github.com/majiayu000/spellbook --skill weekly
根据用户提供的日期范围 $ARGUMENTS,收集 om-generator 前后端两个仓库的工作记录,生成周报文档。
从 $ARGUMENTS 中提取起止日期。支持格式:
2-1到2-7 → 2026-02-01 ~ 2026-02-071-27到2-2 → 2026-01-27 ~ 2026-02-022026-02-01到2026-02-07 → 完整日期将解析结果存为变量 DATE_START 和 DATE_END(格式 YYYY-MM-DD)。年份默认 2026。
先获取当前用户名:
git config user.name
然后分别从两个仓库收集该用户在日期范围内的提交:
前端仓库:
git -C $HOME/Desktop/code/work/mutil-om/om-generator-web log --author="<用户名>" --after="<DATE_START>" --before="<DATE_END + 1天>" --oneline --no-merges --all
后端仓库:
git -C $HOME/Desktop/code/work/mutil-om/om-generator log --author="<用户名>" --after="<DATE_START>" --before="<DATE_END + 1天>" --oneline --no-merges --all
对每个有意义的提交,用 git show --stat <hash> 查看改动范围。
读取两个项目的 sessions-index.json:
~/.claude/projects/<om-generator-web 绝对路径转义>/sessions-index.json~/.claude/projects/<om-generator 绝对路径转义>/sessions-index.json> 注:Claude Code 把项目 cwd 绝对路径转义为目录名(/ 替换为 -),例如 $HOME/Desktop/code/work/mutil-om/om-generator → -Users-<用户名>-Desktop-code-work-mutil-om-om-generator。
JSON 结构为 { version, entries: [{ sessionId, summary, firstPrompt, created, modified, gitBranch, messageCount }] }。
过滤 created 或 modified 在日期范围内的会话,提取 summary 和 firstPrompt。
遍历日期范围内每天的 Codex 会话目录:
~/.codex/sessions/2026/MM/DD/*.jsonl
对每个 JSONL 文件,读取第一行(type: session_meta),检查 payload.cwd 是否包含 om-generator。
如果匹配,提取:
payload.cwd — 工作目录(区分前端/后端)payload.timestamp — 会话时间payload.git.branch — 分支然后读取文件中 type 为 message 且 payload.role 为 user 的第一条消息作为会话主题。
如果当前环境提供可用的记忆搜索工具或本机记忆索引,搜索日期范围内与 om-generator 相关的记录,并把有明确证据的 session 摘要和工作记录补充到周报中。
如果没有可用的记忆工具,不要阻塞生成;在“数据来源”里写明未使用记忆补充数据。
将所有收集到的信息按以下类别分类:
每个条目包含:
输出文件路径:$HOME/Desktop/code/work/mutil-om/docs/weekly/YYYY-MM-DD_to_YYYY-MM-DD.md
文档格式:
# OM Generator 周报
**周期**: YYYY-MM-DD ~ YYYY-MM-DD
**作者**: <git user.name>
---
## 本周概要
<!-- 2-3 句话总结本周主要工作方向和成果 -->
## 工作详情
### 架构重构
- [ 条目 ]
### 新功能
- [ 条目 ]
### Bug 修复
- [ 条目 ]
### 研究与设计
- [ 条目 ]
### 其他
- [ 条目 ]
---
## 数据来源
### Git 提交统计
- 前端 (om-generator-web): X 个提交
- 后端 (om-generator): X 个提交
### AI 辅助会话
- Claude Code 会话: X 个
- Codex 会话: X 个
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take majiayu000/weekly from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.