diff --git a/.gitignore b/.gitignore index 0a6c94a..b73969e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,7 @@ __pycache__/ *.pyc .worktrees/ + +# Skill 构建产物不入库,发布时另行分发 +*.zip +*.zip.sha256 diff --git a/google-calendar-skill/SKILL.md b/google-calendar-skill/SKILL.md index 79832f4..82d6461 100644 --- a/google-calendar-skill/SKILL.md +++ b/google-calendar-skill/SKILL.md @@ -1,11 +1,43 @@ --- name: google-calendar -description: Use the bundled Google Workspace CLI (gws) to read, create, update, and delete Google Calendar events, list calendars, and show agendas. Use when the user asks to connect or operate Google Calendar, check their schedule, or manage Google Calendar events. +description: Use the bundled Google Workspace CLI (gws) to read, create, update, and delete Google Calendar events, list calendars, and show agendas. Use when the user asks to connect or operate Google Calendar, or to manage events on their Google Calendar, or says "谷歌日历"、"Google 日历"、"看看我 Google 日历上的安排". +metadata: + version: 1.0.1 + requires: + bins: ["gws"] --- # Google Calendar (gws) -Use the bundled `gws` executable. This Skill targets exactly `gws 0.22.5`; invoke `gws` from `PATH`. +This Skill targets exactly `gws 0.22.5`. + +## Locate the executable + +Always use the copy bundled with this Skill; never a `gws` that happens to be on `PATH`, which may be an unrelated version. Resolve it once per session: + +1. Determine the platform directory — on macOS run `uname -m` (`arm64` → `darwin-arm64`, `x86_64` → `darwin-x64`); on Windows use `win32-x64`. +2. Resolve `scripts/bin//gws` against this document's directory — on Windows the file is `gws.exe` — and use that absolute path for every command below. + +This package ships macOS and Windows builds only; on any other platform report that Google Calendar is not available there rather than looking for another installation. + +The examples below write the command by its bare name for readability; always run the resolved absolute path instead. + +If that file is missing, report that Google Calendar is not ready yet — never describe it as an account problem or a broken connector. + +## Talk like Cola + +These rules govern what you SAY to the user. They never change which commands you RUN. + +- **Product words are fine.** 配置、授权、连接、账号、日程、App 专用密码 — the user should always know which step they are in. +- **Implementation details never reach the user.** Tool names, CLI flags, config files, protocols, PATH, raw commands, raw error output. Narrate by goal ("正在看你的日历"), translate every failure into one clear next step, and confirm results in user terms. + +## 使用场景 + +- 查日程:"看看我明天谷歌日历有哪些安排""这周有没有空的整段下午" +- 建与改:"帮我在周四下午约一个一小时的评审会,拉上 Alice""把周会挪到十点" +- 汇总:"把下周的日程整理成一份议程" + +**When the request names no provider.** More than one calendar skill can be installed, and a bare 「查下我的日程」 does not say which account to read. Use this skill without asking only when it is the only calendar connected, or when the conversation already established that Google Calendar is the one in play. Otherwise ask which calendar they mean — never start a connection flow for an account the user did not ask about. This installation is **calendar-only**. Authorization covers Google Calendar and nothing else: other Google services (`gmail`, `drive`, `sheets`, `docs`, `tasks`, …) will fail with permission errors. Do not attempt them, and do not suggest them as available. @@ -30,7 +62,7 @@ Out of scope (will fail; do not call): calendar `acl`, creating/deleting calenda ### Show agenda (read-only) ```bash -gws calendar +agenda +gws calendar +agenda --timezone ``` | Flag | Description | @@ -40,16 +72,18 @@ gws calendar +agenda | `--week` | Show this week's events | | `--days ` | Number of days ahead to show | | `--calendar ` | Filter to a specific calendar | -| `--timezone ` | Timezone override (e.g. `Asia/Shanghai`); defaults to the Google account timezone | +| `--timezone ` | Timezone override (e.g. `Asia/Shanghai`). **Always pass it** — see below | ```bash -gws calendar +agenda --today -gws calendar +agenda --week --format table -gws calendar +agenda --days 3 --calendar 'Work' +gws calendar +agenda --today --timezone 'Asia/Shanghai' +gws calendar +agenda --week --format table --timezone 'Asia/Shanghai' +gws calendar +agenda --days 3 --calendar 'Work' --timezone 'Asia/Shanghai' ``` Read-only — never modifies events. Queries all calendars by default. +Always pass `--timezone`. The helper's own default reads the account timezone from `settings`, which this installation's scopes exclude, so it silently falls back to the machine's local timezone — on a machine in a different timezone from the calendar, `--today` and `--week` then query the wrong day boundaries. Ask the user for their timezone, or take it from an event's own timezone, and pass it explicitly. + ### Create an event ```bash @@ -64,7 +98,7 @@ gws calendar +insert --summary --start