Markdown 本地日历 · Google 双向同步
简介
安全的 Markdown 本地日历管理工具,支持 CLI 操作与 Google Calendar 双向同步,具备事件冲突检测与自动重排能力。
原始描述
A local markdown-backed calendar with CLI and optional two-way Google Calendar sync.
通过你的 Agent 添加
安装目录:opys-calendar-skill/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Calendar Markdown + Google Sync Skill 是一套以本地 Markdown 文件(calendar.md)为数据源的日历管理系统。用户通过 CLI 工具完成所有事件操作,数据以 YAML frontmatter 格式存储在 fenced event 代码块中,确保人类可读与版本控制友好。
查询流程:运行 npm run cli -- summary 获取事件概览;如需原始数据,执行 npm run cli -- export。
更新流程:
add:创建新事件,自动检测时间冲突update:修改事件字段,时间变更时需指定冲突处理策略check/undone:标记事件完成状态delete:删除事件category-add/remove:管理事件分类
冲突处理:系统内置智能冲突检测,交互模式下可选择接受重叠、自动移至下一可用时段或自定义时间;非交互模式通过 --shift-to-next 或 --allow-overlap 参数自动处理。
Google 同步:通过 UI 完成 OAuth 授权,选择目标日历后执行双向合并,同步状态持久化至 .calendar-google-sync-state.json。
显著优点
- 数据主权:Markdown 本地优先,完全掌控数据,避免云服务锁定
- 版本控制友好:纯文本格式天然支持 Git 追踪变更历史
- CLI 自动化:适合脚本化批量操作与开发者工作流集成
- 智能冲突处理:自动检测重叠事件并提供多种解决策略
- 事件追踪:每次变更自动生成滚动快照(
/Users/nrav/.openclaw/workspace/recent-calendar.md),便于审计与回滚
- 跨系统标识:
externalId 与 googleEventIds 实现多平台事件去重与关联
潜在局限
- 无原生 UI 创建:必须通过 CLI 添加事件,对非技术用户门槛较高
- 手动同步触发:Google 同步需人工点击,非实时自动同步
- 单用户设计:缺乏多用户协作与权限管理
- 时间格式严格:要求 ISO 格式输入,容错性有限
- 依赖 Node.js 环境:需要本地 npm 生态支持
适合人群
- 偏好本地优先、数据可控的技术用户
- 习惯 Markdown 与 Git 工作流的开发者
- 需要离线可用、偶尔同步云端的轻量日历需求者
- 追求可自动化、可脚本化的日历管理极客
常规风险
- 数据完整性:手动修改 frontmatter 可能导致 YAML 解析失败,需严格遵循
id, label, color 字段规范
- 冲突处理误操作:非交互模式使用
--allow-overlap 可能产生意外的时间重叠
- 同步状态丢失:
.calendar-google-sync-state.json 若被删除或损坏,可能导致重复同步或冲突
- 快照隐私:自动快照写入固定路径,多用户环境需注意敏感日程信息泄露
- 外部依赖:Google API 变更或 OAuth 令牌过期可能影响同步功能
/Users/nrav/.openclaw/workspace/recent-calendar.md),便于审计与回滚externalId 与 googleEventIds 实现多平台事件去重与关联- 无原生 UI 创建:必须通过 CLI 添加事件,对非技术用户门槛较高
- 手动同步触发:Google 同步需人工点击,非实时自动同步
- 单用户设计:缺乏多用户协作与权限管理
- 时间格式严格:要求 ISO 格式输入,容错性有限
- 依赖 Node.js 环境:需要本地 npm 生态支持
适合人群
- 偏好本地优先、数据可控的技术用户
- 习惯 Markdown 与 Git 工作流的开发者
- 需要离线可用、偶尔同步云端的轻量日历需求者
- 追求可自动化、可脚本化的日历管理极客
常规风险
- 数据完整性:手动修改 frontmatter 可能导致 YAML 解析失败,需严格遵循
id, label, color 字段规范
- 冲突处理误操作:非交互模式使用
--allow-overlap 可能产生意外的时间重叠
- 同步状态丢失:
.calendar-google-sync-state.json 若被删除或损坏,可能导致重复同步或冲突
- 快照隐私:自动快照写入固定路径,多用户环境需注意敏感日程信息泄露
- 外部依赖:Google API 变更或 OAuth 令牌过期可能影响同步功能
- 数据完整性:手动修改 frontmatter 可能导致 YAML 解析失败,需严格遵循
id,label,color字段规范 - 冲突处理误操作:非交互模式使用
--allow-overlap可能产生意外的时间重叠 - 同步状态丢失:
.calendar-google-sync-state.json若被删除或损坏,可能导致重复同步或冲突 - 快照隐私:自动快照写入固定路径,多用户环境需注意敏感日程信息泄露
- 外部依赖:Google API 变更或 OAuth 令牌过期可能影响同步功能
技能正文
Calendar Markdown + Google Sync Skill
Use this skill to query/update the local markdown-backed calendar safely and sync it with Google Calendar.
Source of Truth
- File:
calendar.md
- Authoritative section:
## Event Records (fenced event YAML blocks)
- Human summary section:
## Event Checklist
Event Identity Rules
id: local identifier
externalId: stable cross-system identifier used for dedupe
googleEventIds: per-calendar Google event mapping
updatedAt: event-level timestamp for conflict resolution
calendar.md## Event Records (fenced event YAML blocks)## Event Checklistid: local identifierexternalId: stable cross-system identifier used for dedupegoogleEventIds: per-calendar Google event mappingupdatedAt: event-level timestamp for conflict resolution
Do not remove externalId from existing records.
Preferred Interface
Use CLI from repo root:
npm run cli -- <command>
Safe Query Flow
- Run
npm run cli -- summary.
- If raw markdown is needed, run
npm run cli -- export.
Safe Update Flow
- Add (preferred for new events):
npm run cli -- add --title "..." --start "<ISO>" --end "<ISO>" --category <id> [--shift-to-next|--allow-overlap]
- Update:
npm run cli -- update --id <event_id> [fields...]
If changing --start or --end, include --shift-to-next or --allow-overlap in non-interactive runs.
- Check/uncheck:
npm run cli -- check --id <event_id> or --undone
- Delete:
npm run cli -- delete --id <event_id>
- Add category:
npm run cli -- category-add --id <id> --label "Label" --color "#9ca3af" --description "..."
- Remove category:
npm run cli -- category-remove --id <id> --reassign <id>
npm run cli -- summary.npm run cli -- export.- Add (preferred for new events):
npm run cli -- add --title "..." --start "<ISO>" --end "<ISO>" --category <id> [--shift-to-next|--allow-overlap] - Update:
npm run cli -- update --id <event_id> [fields...]If changing--startor--end, include--shift-to-nextor--allow-overlapin non-interactive runs. - Check/uncheck:
npm run cli -- check --id <event_id>or--undone - Delete:
npm run cli -- delete --id <event_id> - Add category:
npm run cli -- category-add --id <id> --label "Label" --color "#9ca3af" --description "..." - Remove category:
npm run cli -- category-remove --id <id> --reassign <id>
Conflict handling:
addand time-changingupdatedetect overlaps with existing events.- Interactive runs can choose accept overlap, shift to next available slot, or provide a custom time.
- Non-interactive runs:
--shift-to-nextto auto-resolve to the next open window.--allow-overlapto keep the requested overlapping time.
Agent snapshot output:
- Every mutating CLI command writes a rolling markdown snapshot.
- Default path:
/Users/nrav/.openclaw/workspace/recent-calendar.md - Override with
CALENDAR_AGENT_SNAPSHOT. - Recent window defaults to 14 days and is configurable with
CALENDAR_AGENT_DAYS. - Snapshot also includes upcoming 7 days when events exist.
UI Constraints
- UI does not provide add-event form/button.
- Events are created via CLI agents only.
- UI still supports drag/drop, resize, and check-off.
Google Sync Flow
- In UI, sign in with Google.
- Select target calendar via calendar selector controls.
- Click Sync Now for two-way merge.
- In UI, sign in with Google.
- Select target calendar via calendar selector controls.
- Click Sync Now for two-way merge.
Sync state file:
.calendar-google-sync-state.json
Import/Export
- Export:
npm run cli -- export --out backup-calendar.md
- Import:
npm run cli -- import --in backup-calendar.md
Notes for Agents
- Keep datetimes in ISO format.
- Prefer CLI operations over manual markdown edits.
- If categories are changed manually in frontmatter, keep
id, label, and color fields valid.
npm run cli -- export --out backup-calendar.mdnpm run cli -- import --in backup-calendar.md- Keep datetimes in ISO format.
- Prefer CLI operations over manual markdown edits.
- If categories are changed manually in frontmatter, keep
id,label, andcolorfields valid.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。