Opys Calendar Skill

👤 21j3phy 📦 v0.1.2 ⭐ 4.4 ⬇️ 1.2K 下載
🏠 生活服務 免費

📖 技能介紹


name: opys-calendar-skill description: A local markdown-backed calendar with CLI and optional two-way Google Calendar sync. env: - GOOGLE_CLIENT_ID - GOOGLE_CLIENT_SECRET - GOOGLE_REDIRECT_URI - APP_BASE_URL - CALENDAR_AGENT_SNAPSHOT - CALENDAR_AGENT_DAYS


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

    7w4.net小蔥技能站,你的AI助手技能庫。

  • googleEventIds: per-calendar Google event mapping
  • updatedAt: 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

  1. Run npm run cli -- summary.
  2. If raw markdown is needed, run npm run cli -- export.

Safe Update Flow

  1. Add (preferred for new events): npm run cli -- add --title "..." --start "<ISO>" --end "<ISO>" --category <id> [--shift-to-next|--allow-overlap]
  2. 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.
  3. Check/uncheck: npm run cli -- check --id <event_id> or --undone
  4. Delete: npm run cli -- delete --id <event_id>
  5. Add category: npm run cli -- category-add --id <id> --label "Label" --color "#9ca3af" --description "..."
  6. Remove category: npm run cli -- category-remove --id <id> --reassign <id>

Conflict handling:

  • add and time-changing update detect 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-next to auto-resolve to the next open window.
  • --allow-overlap to keep the requested overlapping time.

Agent snapshot output:

  • Every mutating CLI command writes a rolling markdown snapshot.
  • Default path: ./agent-snapshot.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

  1. In UI, sign in with Google.
  2. Select target calendar via calendar selector controls.
  3. 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.

Environment Variables

This skill uses the following environment variables (defined in .env):

  • Google Calendar Sync (Optional)
  • GOOGLE_CLIENT_ID: Google OAuth Client ID
  • GOOGLE_CLIENT_SECRET: Google OAuth Client Secret
  • GOOGLE_REDIRECT_URI: Should be http://localhost:<PORT>/api/google/auth/callback

  • Agent Configuration (Optional)

  • CALENDAR_AGENT_SNAPSHOT: Custom absolute or relative path to write the Markdown snapshot. Defaults to ./agent-snapshot.md.
  • CALENDAR_AGENT_DAYS: Number of historical days to include in the snapshot (defaults to 14).
  • PORT: API server port (defaults to 8787).
  • APP_BASE_URL: Base URL for the frontend UI.

🤖 AI 評測

這是一款高質量的智慧日曆工具,核心亮點是將日程資料儲存為可讀的 Markdown 檔案,讓 AI 能夠準確理解和修改你的日程安排,同時提供美觀的 Web 介面供手動操作。它還支援與 Google Calendar 雙向同步,功能完整。不足之處是初始配置稍顯複雜,特別是 Google 同步需要申請 OAuth 憑證;大日程資料下效能可能受影響。總體而言,設計理念先進、文件詳盡,適合需要 AI 輔助日程管理的使用者。

📊 多維度評分

適應性4.5
規範性4.1
有效性4.8
可靠性4.3
可信度4.5

📁 包含檔案 (23 個)

📄 .calendar-google-sync-state.json 27.9 KB
📄 .calendar-settings.json 24 B
📄 .tmp-recent-calendar.md 1.4 KB
📄 README.md 3 KB
📄 SKILL.md 3.7 KB
📄 _meta.json 132 B
📄 calendar.md 163.7 KB
📄 index.html 301 B
📄 package-lock.json 129.4 KB
📄 package.json 2.3 KB
📄 scripts/calendar-cli.ts 20.7 KB
📄 scripts/check_error.js 518 B
📄 scripts/take_screenshots.js 662 B
📄 server/index.ts 37.7 KB
📄 shared/calendarMarkdown.ts 8.9 KB
📄 shared/types.ts 668 B
📄 src/App.tsx 20.8 KB
📄 src/StatsView.tsx 10.8 KB
📄 src/main.tsx 231 B
📄 src/styles.css 9.3 KB
📄 src/vite-env.d.ts 38 B
📄 tsconfig.json 414 B
📄 vite.config.ts 279 B