Opys Calendar Skill
by @21j3phy
A local markdown-backed calendar with CLI and optional two-way Google Calendar sync.
clawhub install opys-calendarπ About This Skill
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
calendar.md## Event Records (fenced event YAML blocks)## Event ChecklistEvent Identity Rules
id: local identifierexternalId: stable cross-system identifier used for dedupegoogleEventIds: per-calendar Google event mappingupdatedAt: event-level timestamp for conflict resolutionDo not remove externalId from existing records.
Preferred Interface
Use CLI from repo root:
npm run cli --
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 "
2. Update:
npm run cli -- update --id
If changing --start or --end, include --shift-to-next or --allow-overlap in non-interactive runs.
3. Check/uncheck:
npm run cli -- check --id or --undone
4. Delete:
npm run cli -- delete --id
5. Add category:
npm run cli -- category-add --id
6. Remove category:
npm run cli -- category-remove --id
Conflict handling:
add and time-changing update detect overlaps with existing events.--shift-to-next to auto-resolve to the next open window.--allow-overlap to keep the requested overlapping time.Agent snapshot output:
./agent-snapshot.mdCALENDAR_AGENT_SNAPSHOT.CALENDAR_AGENT_DAYS.UI Constraints
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.jsonImport/Export
npm run cli -- export --out backup-calendar.mdnpm run cli -- import --in backup-calendar.mdNotes for Agents
id, label, and color fields valid.Environment Variables
This skill uses the following environment variables (defined in .env):
GOOGLE_CLIENT_ID: Google OAuth Client ID
- GOOGLE_CLIENT_SECRET: Google OAuth Client Secret
- GOOGLE_REDIRECT_URI: Should be http://localhost:/api/google/auth/callback 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.