@qvac/skills 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundled.js CHANGED
@@ -2,7 +2,7 @@
2
2
  export { SKILLS_HASH } from './hash.js'
3
3
 
4
4
  export const SKILLS = {
5
- "apple-notes/SKILL.md": "---\nname: apple-notes\ndescription: Read, search, create, edit, append to, and delete notes in the macOS Notes app through bundled AppleScript operations.\ntools: [exec(osascript)]\nplatform: [darwin]\nmetadata:\n {\n 'openclaw':\n {\n 'requires': { 'bins': ['osascript'] },\n 'setup':\n {\n 'summary': 'Apple Notes works through macOS automation (osascript), which ships with macOS — nothing to install. The first command triggers a one-time permission prompt to let this app control Notes.',\n 'routes':\n [\n {\n 'kind': 'instructions',\n 'label': 'Allow Notes automation',\n 'description': \"macOS asks once for permission to control Notes. Commands fail until it's granted.\",\n 'steps':\n [\n 'Use the skill once — macOS shows a permission prompt to allow control of Notes.',\n 'Click Allow.',\n 'If it was denied, enable it under System Settings → Privacy & Security → Automation.'\n ]\n }\n ]\n }\n }\n }\n---\n\n# Apple Notes (osascript)\n\nDrive the macOS Notes app through the bundled AppleScript operations, one per\n`exec` call: `osascript {{SKILL_DIR}}/<file>.applescript <args...>`.\n`{{SKILL_DIR}}` resolves to this skill's absolute directory. Never use\n`osascript -e` or any other AppleScript file: the exec grant permits only the\nbundled Notes operations.\n\n## Load the Recipe File First\n\nThis file carries no commands. The working recipes live in two reference files —\nload the one for the job with the `skill` tool BEFORE calling `exec`, then copy\nits command and change only the arguments:\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing.\n\n- **Finding or reading notes** — \"list my notes\", \"what notes do I have\",\n \"find / search notes about X\", \"read / open / summarize note X\": call the\n `skill` tool with `name: \"apple-notes\"` and `file: \"references/read.md\"`.\n- **Changing notes** — \"add a note\", \"add to note X\", \"rewrite / replace note\n X\", \"delete note X\": call the `skill` tool with `name: \"apple-notes\"` and\n `file: \"references/write.md\"`. It also covers how to get the note id that\n edit and delete need.\n\nMost requests are ONE command. Run that single command, read its output, then\nanswer — do not chain extra searches to \"double-check\" or enumerate. An\nempty-query search already lists every note; never enumerate notes by trying\nseveral queries.\n\n## When to Use\n\n- User explicitly mentions \"Notes\" (capital N), \"Notes app\", or \"Apple Notes\".\n- User wants a personal note that syncs to iCloud and shows up on their iPhone/iPad.\n- Note creation needs rich content (formatting, attachments) that Reminders cannot hold.\n\n## When NOT to Use\n\n- User wants a to-do or reminder (use the `apple-reminders` skill).\n- User wants a markdown vault, backlinks, or knowledge graph (use the `obsidian` skill).\n- User wants project tracking or shared docs (use Notion or another tool).\n- User just wants to dump text to a file (use the filesystem tools).\n\n## Setup\n\n- No install required. `osascript` ships with macOS.\n- Grant automation permission the first time: macOS prompts the user to allow\n the parent terminal/app to control Notes. If denied, tell the user to enable it\n under System Settings → Privacy & Security → Automation.\n\n## Output Policy\n\n- Note bodies are HTML: strip tags or convert to plain text before answering\n unless the user asked for the raw markup. If the note is empty, say so.\n- Present search results as note names; keep the raw ids for follow-up\n edit/delete calls rather than showing them to the user.\n- `execution error: Not authorized to send Apple events` → tell the user to\n grant Automation permission in System Settings.\n- If the Notes app is not open and the operation fails, tell the user to open\n Notes once (it usually auto-launches on first call).\n",
5
+ "apple-notes/SKILL.md": "---\nname: apple-notes\ndescription: Read, search, create, edit, append to, and delete notes in the macOS Notes app through bundled AppleScript operations.\ntools: [exec(osascript)]\nplatform: [darwin]\nmetadata:\n {\n \"openclaw\": {\n \"requires\": {\n \"bins\": [\n \"osascript\"\n ]\n },\n \"setup\": {\n \"summary\": \"Apple Notes works through macOS automation (osascript), which ships with macOS — nothing to install. The first command triggers a one-time permission prompt to let this app control Notes.\",\n \"routes\": [\n {\n \"kind\": \"instructions\",\n \"label\": \"Allow Notes automation\",\n \"description\": \"macOS asks once for permission to control Notes. Commands fail until it's granted.\",\n \"steps\": [\n \"Use the skill once — macOS shows a permission prompt to allow control of Notes.\",\n \"Click Allow.\",\n \"If it was denied, enable it under System Settings → Privacy & Security → Automation.\"\n ]\n }\n ]\n }\n }\n }\n---\n\n# Apple Notes (osascript)\n\nDrive the macOS Notes app through the bundled AppleScript operations, one per\n`exec` call: `osascript {{SKILL_DIR}}/<file>.applescript <args...>`.\n`{{SKILL_DIR}}` resolves to this skill's absolute directory. Never use\n`osascript -e` or any other AppleScript file: the exec grant permits only the\nbundled Notes operations.\n\n## Load the Recipe File First\n\nThis file carries no commands. The working recipes live in two reference files —\nload the one for the job with the `skill` tool BEFORE calling `exec`, then copy\nits command and change only the arguments:\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing.\n\n- **Finding or reading notes** — \"list my notes\", \"what notes do I have\",\n \"find / search notes about X\", \"read / open / summarize note X\": call the\n `skill` tool with `name: \"apple-notes\"` and `file: \"references/read.md\"`.\n- **Changing notes** — \"add a note\", \"add to note X\", \"rewrite / replace note\n X\", \"delete note X\": call the `skill` tool with `name: \"apple-notes\"` and\n `file: \"references/write.md\"`. It also covers how to get the note id that\n edit and delete need.\n\nMost requests are ONE command. Run that single command, read its output, then\nanswer — do not chain extra searches to \"double-check\" or enumerate. An\nempty-query search already lists every note; never enumerate notes by trying\nseveral queries.\n\n## When to Use\n\n- User explicitly mentions \"Notes\" (capital N), \"Notes app\", or \"Apple Notes\".\n- User wants a personal note that syncs to iCloud and shows up on their iPhone/iPad.\n- Note creation needs rich content (formatting, attachments) that Reminders cannot hold.\n\n## When NOT to Use\n\n- User wants a to-do or reminder (use the `apple-reminders` skill).\n- User wants a markdown vault, backlinks, or knowledge graph (use the `obsidian` skill).\n- User wants project tracking or shared docs (use Notion or another tool).\n- User just wants to dump text to a file (use the filesystem tools).\n\n## Setup\n\n- No install required. `osascript` ships with macOS.\n- Grant automation permission the first time: macOS prompts the user to allow\n the parent terminal/app to control Notes. If denied, tell the user to enable it\n under System Settings → Privacy & Security → Automation.\n\n## Output Policy\n\n- Note bodies are HTML: strip tags or convert to plain text before answering\n unless the user asked for the raw markup. If the note is empty, say so.\n- Present search results as note names; keep the raw ids for follow-up\n edit/delete calls rather than showing them to the user.\n- `execution error: Not authorized to send Apple events` → tell the user to\n grant Automation permission in System Settings.\n- If the Notes app is not open and the operation fails, tell the user to open\n Notes once (it usually auto-launches on first call).\n",
6
6
  "apple-notes/append-note.applescript": "-- Append an HTML fragment to a note found by name. argv: noteName, htmlFragment\non run argv\n set noteName to item 1 of argv\n set extra to item 2 of argv\n tell application \"Notes\"\n set targetNote to first note whose name is noteName\n set body of targetNote to (body of targetNote) & extra\n end tell\nend run\n",
7
7
  "apple-notes/cli.schema.json": "{\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"x-positionals\": [\"script\"],\n \"x-rest\": \"args\",\n \"x-resource-files\": [\n \"create-note.applescript\",\n \"edit-note.applescript\",\n \"append-note.applescript\",\n \"read-note.applescript\",\n \"search-notes.applescript\",\n \"delete-note.applescript\"\n ],\n \"x-resource-effects\": {\n \"read-note.applescript\": \"read\",\n \"search-notes.applescript\": \"read\"\n },\n \"required\": [\"script\", \"args\"],\n \"properties\": {\n \"script\": {\n \"type\": \"string\",\n \"description\": \"absolute path to a bundled Apple Notes operation\"\n },\n \"args\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"minItems\": 1,\n \"maxItems\": 3,\n \"description\": \"argv passed to the bundled script\"\n }\n }\n}\n",
8
8
  "apple-notes/create-note.applescript": "-- Create a Notes note. argv: name, htmlBody, [folder]\n-- A note's title is its first line. iCloud notes carry no separate `name` and\n-- refuse `set name` (-10006) after the note already exists, which reported a\n-- created note as failed. So the title goes into the body as its heading.\non run argv\n set noteName to item 1 of argv\n set noteBody to item 2 of argv\n set heading to \"<h1>\" & noteName & \"</h1>\"\n if noteBody does not start with heading then set noteBody to heading & noteBody\n tell application \"Notes\"\n if (count of argv) > 2 then\n set newNote to make new note at folder (item 3 of argv) with properties {body:noteBody}\n else\n set newNote to make new note with properties {body:noteBody}\n end if\n return id of newNote\n end tell\nend run\n",
@@ -16,7 +16,7 @@ export const SKILLS = {
16
16
  "apple-reminders/cli.schema.json": "{\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"x-positionals\": [\n \"date\"\n ],\n \"properties\": {\n \"date\": {\n \"type\": \"string\"\n },\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n },\n \"today\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-effect\": \"read\"\n },\n \"tomorrow\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-effect\": \"read\"\n },\n \"week\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-effect\": \"read\"\n },\n \"overdue\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-effect\": \"read\"\n },\n \"all\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-effect\": \"read\"\n },\n \"list\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"create\": {\n \"type\": \"boolean\"\n },\n \"delete\": {\n \"type\": \"boolean\"\n },\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-positionals\": [\n \"name\"\n ]\n },\n \"add\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"title\": {\n \"type\": \"string\"\n },\n \"list\": {\n \"type\": \"string\"\n },\n \"due\": {\n \"type\": \"string\"\n },\n \"json\": {\n \"type\": \"boolean\"\n },\n \"plain\": {\n \"type\": \"boolean\"\n },\n \"quiet\": {\n \"type\": \"boolean\"\n }\n },\n \"x-positionals\": [\n \"title\"\n ]\n },\n \"complete\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ids\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"x-rest\": \"ids\"\n },\n \"delete\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"force\": {\n \"type\": \"boolean\"\n },\n \"ids\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"x-positionals\": [\n \"id\"\n ],\n \"x-rest\": \"ids\"\n },\n \"status\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {},\n \"x-effect\": \"read\"\n },\n \"authorize\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {}\n }\n }\n}\n",
17
17
  "apple-reminders/references/edit.md": "# Creating, Completing, and Deleting Reminders\n\nOne `remindctl` command per `exec` call, no chaining. Run `add` in the\nforeground (the default): the exit code confirms whether the reminder was\ncreated — never claim success unless the command succeeded.\n\n| Request | Command |\n| -------------------------------- | ------------------------------------------------ |\n| \"remind me to X\" | `remindctl add --title \"X\"` |\n| \"remind me to X tomorrow\" | `remindctl add --title \"X\" --due tomorrow` |\n| \"add X to my <List> list\" | `remindctl add --title \"X\" --list Personal` |\n| \"mark X done\" | `remindctl all --json` for its id, then `remindctl complete <id>` |\n| \"delete reminder X\" | `remindctl all --json` for its id, then `remindctl delete <id> --force` |\n| \"create a list called X\" | `remindctl list X --create` |\n| \"delete the list X\" | `remindctl list X --delete` |\n\n## Create reminders\n\n```bash\nremindctl add \"Buy milk\"\nremindctl add --title \"Call mom\" --list Personal --due tomorrow\nremindctl add --title \"Meeting prep\" --due \"2026-02-15 09:00\"\n```\n\n`--due` accepts `today`, `tomorrow`, `YYYY-MM-DD`, `YYYY-MM-DD HH:mm`, and ISO\n8601 (`2026-01-04T12:34:56Z`). Without `--list` the reminder lands in the\ndefault list.\n\n## Finding the id\n\n`complete` and `delete` take reminder ids, and there is NO search command —\n`remindctl search`, `remindctl show`, `remindctl find` all fail. Get the id\nfrom a JSON view: `remindctl all --json` lists every reminder in every list,\nincluding completed ones, one object per reminder with `id`, `title`,\n`listName`, `dueDate`, `isCompleted`. Pick the entry whose `title` matches\nwhat the user named and copy its `id` (a short prefix like `4A83` is enough).\nNarrow with `remindctl list <Name> --json` or `remindctl today --json` when the\nlist or day is known.\n\n```bash\nremindctl all --json\nremindctl list Personal --json\n```\n\n## Complete / delete\n\n```bash\nremindctl complete 4A83\nremindctl complete 1 2 3\nremindctl delete 4A83 --force\n```\n\nOnly delete a reminder when the user explicitly asks; prefer `complete` for\nfinished to-dos. `--force` skips the confirmation prompt, which cannot be\nanswered from `exec`.\n\n## Lists\n\n```bash\nremindctl list Projects --create\nremindctl list Work --delete\n```\n\n## Answering\n\nOnly the commands shown in this file exist; if one fails, fix its arguments\nrather than inventing another subcommand. Confirm with the title, list, and due date of what changed. If the command\nfails because `remindctl` is missing or access is denied, report that and ask\nthe user to install or authorize; never switch to another tool.\n",
18
18
  "apple-reminders/references/view.md": "# Viewing Reminders and Lists\n\nOne `remindctl` command per `exec` call, no chaining. Pick the command from the\nrequest and answer from its output.\n\n| Request | Command |\n| ---------------------------------------- | --------------------------- |\n| \"what are my reminders\" / \"due today\" | `remindctl today` |\n| \"what's due tomorrow\" / \"this week\" | `remindctl tomorrow` · `remindctl week` |\n| \"what's overdue\" | `remindctl overdue` |\n| \"everything\" / \"all my reminders\" | `remindctl all` |\n| \"what's due on <date>\" | `remindctl 2026-01-04` |\n| \"show my reminder lists\" | `remindctl list` |\n| \"show my <List> reminders\" | `remindctl list Work` |\n\n## View by date\n\n```bash\nremindctl today\nremindctl tomorrow\nremindctl week\nremindctl overdue\nremindctl all\nremindctl 2026-01-04\n```\n\nDate filters accept `today`, `tomorrow`, `yesterday`, `YYYY-MM-DD`,\n`YYYY-MM-DD HH:mm`, and ISO 8601 (`2026-01-04T12:34:56Z`).\n\n## Lists\n\n```bash\nremindctl list\nremindctl list Work\n```\n\n`remindctl list` alone names the lists; `remindctl list <Name>` shows the\nreminders in that list, including ones without a due date.\n\n## Output formats\n\n```bash\nremindctl today --json\nremindctl today --plain\nremindctl today --quiet\n```\n\nUse `--json` when you need structured fields (ids, due dates) before a\nfollow-up command; the `id` field is what `complete` and `delete` take.\n`remindctl all --json` covers every list including completed reminders. There\nis no search command — filter the JSON view by `title` yourself.\n\n## Answering\n\nReport the title, its list, and its due date for each reminder — not the whole\ndatabase. An empty result means nothing is due: say so plainly. If the command\nfails because `remindctl` is missing or access is denied, report that and ask\nthe user to install or authorize; never switch to another tool.\n",
19
- "asana/SKILL.md": "---\nname: asana\ndescription: Asana tasks, projects, and comments via the official Asana MCP server (OAuth). Also handles pasted app.asana.com task links.\ntools: [mcp_call]\nplatform: [darwin, linux, win32]\ncredentials: [asana_mcp_access_token]\nallow_list: [https://mcp.asana.com/v2/mcp]\nmcp_reads: [get_task, get_tasks, get_my_tasks, get_projects, search_tasks, search_objects]\n---\n\n# Asana\n\nOne wired transport: the official Asana MCP server (v2), authorized with a pre-registered Asana OAuth app.\n\nUse the `mcp_call` tool against `https://mcp.asana.com/v2/mcp`. Authentication uses a pre-registered Asana MCP app (client ID and secret) with PKCE — the user connects \"Asana\" from the Asana skill's setup, which stores the access token under the credential key `asana_mcp_access_token`. If the credential is connected, act immediately and call the tool(s) — do NOT ask the user for a token. If the credential is missing (a tool result reports it), tell the user to connect \"Asana\"; do not attempt to drive OAuth yourself.\n\nSessions are automatic: `mcp_call` runs the initialize handshake itself and threads the session for you. Do NOT call `initialize` or `notifications/initialized`, and do NOT pass `sessionId`.\n\nIf a call returns `Status: 401`, the token is expired/invalid — tell the user to reconnect \"Asana\" from the Asana skill's setup.\n\n## Workflow\n\nPass the **tool name as `method`** and the **tool's args as `params`** directly. The MCP `url` must be a top-level field beside `method` and `params` — never put `url` inside `params`. Do NOT build a `{ \"name\": …, \"arguments\": … }` envelope, and do NOT pass `tokenCredentialKey` — the runtime wraps the envelope and injects the bearer token by host for you.\n\nV2's tool set evolves. Call `tools/list` once before the first Asana operation in a conversation, then use the exact returned name and schema. Common tools include:\n\n| tool | use for |\n| --- | --- |\n| `get_my_tasks` | list tasks assigned to the connected user |\n| `get_tasks` / `search_tasks` | list or search tasks |\n| `get_task` | fetch one task |\n| `create_tasks` / `update_tasks` | create or update tasks |\n| `search_objects` | find projects, users, teams, tags, or portfolios |\n| `get_projects` | list projects in the authorized workspace |\n\nIf a tool is absent, do not invent or fall back to a V1 `asana_*` name. Explain the V2 limitation. If a call returns an input validation error, use the `tools/list` schema and retry the same tool once.\n\n### Example: list my tasks\n\n```json\n{\n \"url\": \"https://mcp.asana.com/v2/mcp\",\n \"method\": \"get_my_tasks\",\n \"params\": {}\n}\n```\n\n## Tool choice and pasted links\n\n- Use `mcp_call` only. NEVER use `http_request` for Asana, and NEVER fetch `app.asana.com` URLs — they serve the browser login page, not data.\n- When the user pastes an Asana link, extract the task gid and pass it to the matching MCP tool: the number after `/task/` (`…/project/<p>/task/1215448540812360` → `1215448540812360`), or the last path segment in the older `app.asana.com/0/<project>/<task>` form.\n\n## Output Policy\n\n- Always quote the task `gid` when reporting tasks back so follow-up actions stay deterministic.\n- Surface workspace and project names, not just GIDs, when human-friendly.\n- For list responses, show name, assignee, due date, and completion state. Fetch full detail only on request.\n- Confirm with the user before deleting anything — task deletion is permanent and takes subtasks with it.\n- Do not ask for or echo credentials in chat. If a tool result reports the credential is missing, tell the user to connect \"Asana\" from the Asana skill's setup.\n",
19
+ "asana/SKILL.md": "---\nname: asana\ndescription: Asana tasks, projects, and comments via the official Asana MCP server (OAuth). Also handles pasted app.asana.com task links.\ntools: [mcp_call]\nplatform: [darwin, linux, win32]\ncredentials: [asana_mcp_access_token]\nallow_list: [https://mcp.asana.com/v2/mcp]\nmcp_reads: [get_task, get_tasks, get_my_tasks, get_projects, search_tasks, search_objects]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Asana\",\n \"provider\": \"asana\",\n \"credentialKey\": \"asana_mcp_access_token\",\n \"description\": \"Tasks, projects, and comments\",\n \"helpUrl\": \"https://app.asana.com/0/my-apps\",\n \"steps\": [\n \"Click Connect and approve access in the browser. Approving grants access to the Asana workspace you allow.\"\n ],\n \"configSteps\": [\n \"[Open the Asana developer console](https://app.asana.com/0/my-apps) and create an MCP app\",\n \"In OAuth settings, add the exact redirect URI shown below\",\n \"In \\\"Manage distribution\\\", allow the workspace you want this connection to access\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"OAuth client ID from your app\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"Client Secret\",\n \"secret\": true\n }\n ],\n \"oauth\": {\n \"stateKey\": \"asana_oauth\",\n \"authUrl\": \"https://app.asana.com/-/oauth_authorize\",\n \"tokenUrl\": \"https://app.asana.com/-/oauth_token\",\n \"tokenAuth\": \"secret-in-body\",\n \"port\": 18981,\n \"scopes\": [],\n \"extraAuthParams\": {\n \"resource\": \"https://mcp.asana.com/v2\"\n }\n }\n }\n ]\n }\n }\n }\n---\n\n# Asana\n\nOne wired transport: the official Asana MCP server (v2), authorized with a pre-registered Asana OAuth app.\n\nUse the `mcp_call` tool against `https://mcp.asana.com/v2/mcp`. Authentication uses a pre-registered Asana MCP app (client ID and secret) with PKCE — the user connects \"Asana\" from the Asana skill's setup, which stores the access token under the credential key `asana_mcp_access_token`. If the credential is connected, act immediately and call the tool(s) — do NOT ask the user for a token. If the credential is missing (a tool result reports it), tell the user to connect \"Asana\"; do not attempt to drive OAuth yourself.\n\nSessions are automatic: `mcp_call` runs the initialize handshake itself and threads the session for you. Do NOT call `initialize` or `notifications/initialized`, and do NOT pass `sessionId`.\n\nIf a call returns `Status: 401`, the token is expired/invalid — tell the user to reconnect \"Asana\" from the Asana skill's setup.\n\n## Workflow\n\nPass the **tool name as `method`** and the **tool's args as `params`** directly. The MCP `url` must be a top-level field beside `method` and `params` — never put `url` inside `params`. Do NOT build a `{ \"name\": …, \"arguments\": … }` envelope, and do NOT pass `tokenCredentialKey` — the runtime wraps the envelope and injects the bearer token by host for you.\n\nV2's tool set evolves. Call `tools/list` once before the first Asana operation in a conversation, then use the exact returned name and schema. Common tools include:\n\n| tool | use for |\n| --- | --- |\n| `get_my_tasks` | list tasks assigned to the connected user |\n| `get_tasks` / `search_tasks` | list or search tasks |\n| `get_task` | fetch one task |\n| `create_tasks` / `update_tasks` | create or update tasks |\n| `search_objects` | find projects, users, teams, tags, or portfolios |\n| `get_projects` | list projects in the authorized workspace |\n\nIf a tool is absent, do not invent or fall back to a V1 `asana_*` name. Explain the V2 limitation. If a call returns an input validation error, use the `tools/list` schema and retry the same tool once.\n\n### Example: list my tasks\n\n```json\n{\n \"url\": \"https://mcp.asana.com/v2/mcp\",\n \"method\": \"get_my_tasks\",\n \"params\": {}\n}\n```\n\n## Tool choice and pasted links\n\n- Use `mcp_call` only. NEVER use `http_request` for Asana, and NEVER fetch `app.asana.com` URLs — they serve the browser login page, not data.\n- When the user pastes an Asana link, extract the task gid and pass it to the matching MCP tool: the number after `/task/` (`…/project/<p>/task/1215448540812360` → `1215448540812360`), or the last path segment in the older `app.asana.com/0/<project>/<task>` form.\n\n## Output Policy\n\n- Always quote the task `gid` when reporting tasks back so follow-up actions stay deterministic.\n- Surface workspace and project names, not just GIDs, when human-friendly.\n- For list responses, show name, assignee, due date, and completion state. Fetch full detail only on request.\n- Confirm with the user before deleting anything — task deletion is permanent and takes subtasks with it.\n- Do not ask for or echo credentials in chat. If a tool result reports the credential is missing, tell the user to connect \"Asana\" from the Asana skill's setup.\n",
20
20
  "diagrams/SKILL.md": "---\nname: diagrams\ndescription: Draw diagrams in the chat - flowcharts, sequence, state and ER diagrams, Gantt charts, pie charts, mindmaps and timelines - written as Mermaid code blocks the app renders. Use when the user asks to draw, diagram, sketch, chart, plan, visualize, or map a process, flow, schedule, architecture, or relationship.\naliases: [diagram, mermaid, flowchart, mindmap]\nplatform: [darwin, linux, win32, ios, android]\n---\n\n# Diagrams\n\nDraw a diagram by writing one ```mermaid code block. The app renders it as a\npicture automatically - never describe the rendering, never apologize about\nbeing text-only, never paste ASCII art. A diagram, chart, or plan is ONLY a\nMermaid block in your reply: never run `exec`, Python, matplotlib, or fpdf2,\nnever call an image tool, and never deliver it as a PDF or image file.\n\nYour reply STARTS with the fence. No preamble, no plan, no \"I'll create a\ndiagram showing...\" - never announce or describe a diagram instead of drawing\nit. Decide the type silently, load its recipe, write the code block, close its\nfence, then add one short sentence saying what it shows - after the closing\nfence, never inside it. A complete reply looks like this:\n\n```mermaid\nflowchart TD\n A[\"User sends a message\"] --> B{\"Needs a tool?\"}\n B -->|yes| C[\"Run the tool\"]\n B -->|no| D[\"Answer directly\"]\n```\n\nFlow of a message through the assistant.\n\n## Pick the Type, Then Load Its Recipe\n\nEach type's syntax lives in its own reference file, named by the Mermaid\nkeyword. Pick the type from the ask, then call the `skill` tool with\n`name: \"diagrams\"` and `file: \"references/<type>.md\"` in the SAME turn you\ndraw, BEFORE writing the fence - even when you drew another diagram earlier in\nthis chat. Copy the recipe's syntax exactly; a diagram written from memory is\nthe usual cause of a parse error. Each load is a real `skill` tool call -\nprinting the call as JSON or text in your reply loads nothing. After the load,\nreply with the fenced block directly: no further tool calls of any kind.\n\n| The ask | Type | File |\n| ---------------------------------------------------- | ------------------- | --------------------------- |\n| steps, decisions, a process, \"map / structure this\" | `flowchart TD` | `references/flowchart.md` |\n| a pipeline left to right | `flowchart LR` | `references/flowchart.md` |\n| a family tree, org chart, reporting lines | `flowchart TD` | `references/flowchart.md` |\n| who calls whom over time, requests and replies | `sequenceDiagram` | `references/sequence.md` |\n| modes and transitions | `stateDiagram-v2` | `references/state.md` |\n| tables and their relations | `erDiagram` | `references/er.md` |\n| code types, classes, inheritance | `classDiagram` | `references/class.md` |\n| a schedule or plan with durations | `gantt` | `references/gantt.md` |\n| dated events in order | `timeline` | `references/timeline.md` |\n| shares of a whole, percentages | `pie` | `references/pie.md` |\n| a brainstorm, idea tree, \"mindmap\" | `mindmap` | `references/mindmap.md` |\n\nUse `gitGraph` ONLY when the user names it. Never use experimental or beta\ndiagram types, and never invent a keyword a recipe does not show.\n\n## Hard Rules (every type)\n\n- One diagram per code block, and the fence language is exactly `mermaid`. The\n first line inside the fence is the type keyword from the table. Default to\n ONE block; use two only when the recipe's budget forces an overview plus one\n detail. Never more than two.\n- Except in mindmaps, node ids are letters, digits, and underscores, starting\n with a letter, never reused. Mindmap nodes have no ids.\n- Except in mindmaps, every label with a space, punctuation, or brackets goes\n in double quotes: `A[\"Send request (HTTP)\"]`. Never leave bare `()[]{}` `:`\n `;` inside a label. Mindmap labels are unquoted text.\n- Never write lowercase `end` as a node or label - write `\"End\"`. Line breaks\n inside a label are `<br/>`, never `\\n`.\n- No `%%{init}%%` directives, no `%%` comments, no `classDef` or `style`\n lines. The app themes the diagram itself.\n- Keep every label at 40 characters or fewer, one node per concept, with its\n attributes inside that node's label. Dates, roles, counts, and statuses are\n never standalone nodes.\n- Syntax in one line per type, so a skimmed recipe still lands: flowchart\n `A[\"x\"] --> B{\"y?\"}` with `-->|yes|` labels; sequence `A->>B: msg` and\n `B-->>A: reply`; state `[*] --> Idle` and `Idle --> Run : start`; pie\n `\"Sleep\" : 8` (quoted label, plain number); gantt `Name :id, 2026-09-01, 5d`\n or `after id`; timeline `2024 : Event`; mindmap `root[Topic]` then every\n other line indented deeper than the root, unquoted, no ids (a line at the\n root's indentation is a second root and fails).\n\n## When NOT to use\n\n- Images, scenes, logos, or anything artistic - use the `image-generation`\n skill instead.\n- Plots of numeric data - use `pie` for shares, otherwise a markdown table.\n- Family trees, org charts, and reporting lines - `flowchart TD`, not\n `mindmap`; a mindmap is for ideas around a topic, not people in a hierarchy.\n\n## If the diagram fails\n\nWhen a diagram cannot render, the app sends its parse error back to you once\non its own, and the user may send it again. Re-load the type's recipe and fix\nby rewriting the ENTIRE code block, never a partial patch.\n\n| Error contains | Fix |\n| --- | --- |\n| `Lexical error` / `Unrecognized text` | Remove every backslash in front of a quote and rewrite the block |\n| `Expecting 'taskData'` | A gantt line is neither a header keyword nor a complete `Name :id, start, Nd` task - fix it or delete it |\n| `Expecting ...` at a flowchart or sequence label | Put the whole label in double quotes |\n| `got 'end'` | Rename the node label to `\"End\"` |\n| `Maximum text size` or edge limit | Shrink the diagram or split it in two |\n| `No diagram type detected` | Start the fence with one type keyword from the table |\n| `Duplicate id` | Give every node a fresh unique id |\n",
21
21
  "diagrams/references/class.md": "# Class Diagram\n\nFor code types: classes, their members, inheritance.\n\nBudget: 7 classes.\n\n```mermaid\nclassDiagram\n class Animal {\n +String name\n +speak()\n }\n Animal <|-- Dog\n```\n\nRules:\n\n- Members go inside `class Name { }`, one per line, `+` public and `-`\n private, methods end with `()`.\n- Inheritance is `Parent <|-- Child`; composition `Whole *-- Part`;\n association `A --> B`.\n- Class names are single tokens; no quotes, no `classDef` lines.\n\n## Now draw\n\nThis recipe is all you need. Your next output is the reply itself: one fenced\nMermaid code block (fence language `mermaid`), then one sentence. Do not call\nany tool - not `exec`, not `skill` again, not an image tool. A tool call here\nmeans the diagram was never drawn.\n",
22
22
  "diagrams/references/er.md": "# ER Diagram\n\nFor tables and their relations.\n\nBudget: 8 entities.\n\n```mermaid\nerDiagram\n USER ||--o{ ORDER : \"places\"\n ORDER ||--|{ LINE_ITEM : \"contains\"\n```\n\nRules:\n\n- Entities are UPPER_CASE single tokens.\n- `||--o{` reads \"one to zero-or-many\"; `||--|{` \"one to one-or-many\";\n `||--||` \"one to one\".\n- The relationship label follows the colon in plain double quotes typed directly (no backslash in front).\n- Attributes are optional; if used, list them inside `ENTITY { string name }`\n blocks with one `type name` per line.\n\n## Now draw\n\nThis recipe is all you need. Your next output is the reply itself: one fenced\nMermaid code block (fence language `mermaid`), then one sentence. Do not call\nany tool - not `exec`, not `skill` again, not an image tool. A tool call here\nmeans the diagram was never drawn.\n",
@@ -32,25 +32,25 @@ export const SKILLS = {
32
32
  "excel/references/edit.md": "# Editing an Attached Workbook (openpyxl)\n\nEdit a workbook that is already in this chat by running Python through the\n`exec` tool: change cells, add or insert rows, add columns or sheets, delete\nrows, columns, or sheets. Stage the workbook as an input, modify it, and save\nunder a **new** output name such as `revised.xlsx` — never overwrite the staged\ninput.\n\nMacro-enabled files (`.xlsm`) can be staged as inputs and read, but this\nruntime cannot deliver `.xlsm` back — macros never survive. Save the edit as\n`.xlsx` and tell the user the macros were not preserved.\n\n## Staging the Workbook\n\n**A workbook you built earlier in this chat is edited exactly like any other\nattachment — through its id.** The `exec` result that produced it carried\n`attachments: [{ attachmentId, fileName, byteLength }]`; scroll back, copy that\n`attachmentId` character for character, and stage it. The working directory is\nwiped between calls, so a file you saved last turn is not on disk — without a\nstaged input `load_workbook(\"report.xlsx\")` raises\n`FileNotFoundError: [Errno 44] No such file or directory`.\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"openpyxl==3.1.5\"],\n \"inputs\": [{ \"attachmentId\": \"<the id from the earlier exec result>\", \"path\": \"existing.xlsx\" }],\n \"outputs\": [\"revised.xlsx\"],\n \"command\": \"...\"\n}\n```\n\n**A workbook the user uploaded is staged the same way — by its id.** The\n`[Attached file …]` line on their message names it:\n\n```\n[Attached file \"budget.xlsx\" (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) — attachmentId: 4f9c2ab1]\n```\n\nCopy that id verbatim into `attachmentId`, exactly as for a workbook a tool\nproduced. This holds for **`.csv` and `.xlsm` uploads too**, not just `.xlsx`: an\nid-less entry resolves to an uploaded *image*, so any `inputs` entry whose `path`\nnames a data or document file is rejected outright. Only an uploaded **image** is\nstaged with `path` alone and no `attachmentId` key.\n\nStaged files land in the working directory under the bare `path` names —\nreference `load_workbook(\"existing.xlsx\")` by that name only.\n`attachment … not found in this chat` means you invented an id or the file is not\nattached. Re-copy the exact id from the `exec` result or the `[Attached file …]`\nline that names the workbook; if no id appears anywhere in the chat, ask the\nuser to attach the file again.\n\n`wb.save(\"revised.xlsx\")` must match the declared output name. Keep the\n`command` source multi-line with real newlines — never collapse it with `;`.\n\n## Adding an Image to an Existing Workbook\n\nStage two files: the workbook by its `attachmentId`, and the picture. Add `\"pillow\"`\nto `packages` — **deliberately unpinned**, since the runtime owns its version and a\npin sends openpyxl to PyPI with it.\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"openpyxl==3.1.5\", \"pillow\"],\n \"inputs\": [\n { \"attachmentId\": \"<id of the workbook>\", \"path\": \"existing.xlsx\" },\n { \"attachmentId\": \"<id from the generate_image result>\", \"path\": \"photo.png\" }\n ],\n \"outputs\": [\"revised.xlsx\"],\n \"command\": \"...\"\n}\n```\n\n`path` is a name you choose; it has nothing to do with the attachment id, and a\n`fileName` seen in a tool result is not a file on disk. A `generate_image` result\nanywhere in the conversation is the image the request points at — stage that id\nrather than asking the user to attach it again.\n\n```python\nfrom openpyxl.drawing.image import Image as XLImage\n\nimg = XLImage(\"photo.png\") # the path from inputs, nothing else\nimg.width, img.height = 320, 320 # pixels\nws.add_image(img, \"A1\") # a worksheet method; A1 is the top-left corner\n```\n\nOne `add_image` per workbook — inside a loop over sheets it embeds a copy per sheet.\nNever wrap the import or the call in a `try`/`except` that saves anyway.\n\n## The Golden Rule of Edits\n\n**The staged sheet already has its header and all its data.** Editing never\nre-creates them: no `HEADERS`, no `ROWS`, no copy of the create template. Append\nonly what is genuinely new, and change only the cells you were asked to change.\nRe-appending the header and the rows writes the whole table a second time and the\nuser opens a file where every row appears twice — the create template belongs to\nthe create path (`references/create.md`) and nowhere else.\n\nAdding one row is the whole program:\n\n```python\nfrom openpyxl import load_workbook\n\nwb = load_workbook(\"existing.xlsx\")\nws = wb.active # wb[\"Sheet Name\"] to pick another\n\nbefore = ws.max_row # the sheet is already this long\nws.append([2026, 82500, 135000, 107500])\n\nwb.save(\"revised.xlsx\") # NEW name, matching the declared output\nprint(f\"{before} rows in, {ws.max_row} rows out\")\n```\n\nThat print is the check: one added row means the count goes up by exactly one. If\nit roughly doubles, the run re-appended the existing data — fix it and rerun\nrather than delivering a workbook with the table in it twice.\n\n## Putting the Row Where It Belongs\n\nAppending is right when the table has no order, and wrong when it has one: a sheet\nrunning 2016…2026 with 2015 stuck on the end reads as broken. When the new row\nbelongs inside an existing order, insert it at that position instead.\n\nYou already know the position — 2015 sorts above 2016, and the data starts at row 2\n— so write the index as a number. Do not scan, sort, or compare anything to work it\nout:\n\n```python\nfrom openpyxl import load_workbook\n\nwb = load_workbook(\"existing.xlsx\")\nws = wb.active\n\nROW = [2015, 278, 930, 45.5]\nAT = 2 # 2015 goes above 2016 — row 1 is the header\n\nassert not any(m.max_row >= AT for m in ws.merged_cells.ranges) and not any(\n isinstance(c.value, str) and c.value.startswith(\"=\") for r in ws.iter_rows() for c in r\n), \"a merged range at or below AT, or a formula — append instead, their ranges do not move\"\n\nbefore = ws.max_row\nws.insert_rows(AT)\nfor column, value in enumerate(ROW, start=1):\n cell = ws.cell(row=AT, column=column, value=value)\n cell.number_format = ws.cell(row=AT + 1, column=column).number_format\n\nwb.save(\"revised.xlsx\")\nprint(f\"{before} rows in, {ws.max_row} rows out\")\n```\n\n`AT` is never `1` — that would push the header down into the data.\n\nThe two lines that look optional are the ones that matter. An inserted cell starts\nwith no number format, so without the copy the new row shows a bare `278` in a\ncolumn of `278.00`s; taking the format from `AT + 1` uses the row that used to sit\nthere. And `insert_rows` moves cells but neither formula ranges nor merged ranges,\nso a `=SUM(B2:B11)` total would go on summing the old span and quietly leave the\nnew row out, while a `Total` merged across `A8:B8` would stay pinned to row 8 as\nits row slid to 9 — the assert stops both before anything is saved.\n\nThe two halves are scoped differently on purpose. A merged range is disturbed only\nif it sits at or below `AT`, which is why the check is `m.max_row >= AT` rather than\n\"any merged cell\": a title merged across `A1:C1` is untouched by an insert further\ndown, and failing on it would push you to append out of order for no reason. A\nformula gives no such signal — one in `D1` can reference `B2:B11` — so any formula\nat all is enough to stop the insert.\n\nWhen the assert fires, do not delete it. Append the row at the end with the\nprevious template and tell the user the table kept its file order so their totals\nstay correct.\n\n## Other Edits — Touch Only What Changes\n\n```python\nfrom openpyxl import load_workbook\nfrom openpyxl.styles import Font\n\nwb = load_workbook(\"existing.xlsx\")\nws = wb[\"Q1 Sales\"] # or wb.active; wb.sheetnames lists them\n\nws.cell(row=1, column=5, value=\"Margin %\").font = Font(bold=True)\nfor row, margin in [(2, 0.31), (3, 0.42), (4, 0.18)]:\n cell = ws.cell(row=row, column=5, value=margin)\n cell.number_format = '0.0%'\n\nws[\"B2\"] = 150 # update a cell in place\n\nnotes = wb.create_sheet(\"Notes\")\nnotes[\"A1\"] = \"Updated unit counts for North\"\n\nwb.save(\"revised.xlsx\") # NEW name, matching the declared output\nprint(f\"{len(wb.sheetnames)} sheets: {wb.sheetnames}\")\n```\n\n`wb[\"Sheet Name\"]` raises `KeyError` when the name does not exist — when unsure,\nprint `wb.sheetnames` in the same run that edits, pick from it, and never guess.\n\n## Deleting Rows, Columns and Sheets\n\nopenpyxl deletes for real, so none of this needs XML work. `ws.delete_rows(index)`\nand `ws.delete_cols(index)` take a **1-based** index and an optional count, so\n`ws.delete_rows(5, 3)` drops rows 5, 6 and 7 together; a sheet goes with\n`del wb[\"Notes\"]`. Row 1 is the header — `delete_rows(1)` throws it away, and data\nrows start at 2, exactly as for an insert.\n\n**Delete from the bottom up.** Each delete shifts everything below it, so a loop\nover ascending indices removes the wrong rows after the first: dropping rows 3 and\n5 top-down deletes row 3, then deletes what used to be row 6. Collect the row\nnumbers first and walk them in reverse — the same rule applies right-to-left for\n`delete_cols`:\n\n```python\nfrom openpyxl import load_workbook\n\nwb = load_workbook(\"existing.xlsx\")\nws = wb.active\n\nDROP = (2021, 2023) # the column-A values whose rows go\n\nbefore = ws.max_row\ntargets = [r for r in range(2, ws.max_row + 1) if ws.cell(row=r, column=1).value in DROP]\nassert targets, f\"no row matched {DROP} — check the values are numbers, not strings\"\n\nassert not any(m.max_row >= min(targets) for m in ws.merged_cells.ranges) and not any(\n isinstance(c.value, str) and c.value.startswith(\"=\") for r in ws.iter_rows() for c in r\n), \"a merged range at or below the first deleted row, or a formula — their ranges do not move\"\n\nfor row in reversed(targets): # bottom-up; ascending order deletes the wrong rows\n ws.delete_rows(row)\n\nwb.save(\"revised.xlsx\") # NEW name, matching the declared output\nprint(f\"{before} rows in, {ws.max_row} rows out\")\n```\n\nThe `assert targets` line is what stops a no-op being delivered, and it belongs\nbefore the loop rather than after it. Without it, values that match nothing leave\nthe sheet untouched and the workbook still saves at `exitCode 0` with an\nattachment indistinguishable from a real delete. With it the run raises, nothing\nis written, and the result carries `missingOutputs` instead. The usual cause is a\ntype mismatch — the string `\"2021\"` is not the number `2021` — or a wrong column\nindex. **An assert that fires is a failed turn to diagnose, not a workbook to\ndeliver**: fix the match and rerun, and never delete the assert to get a file out.\nThe printed `rows in / rows out` line is then the reply line, not the check, and it\nstill costs no extra call — both live in the run that does the deleting.\n\nThe second assert is the `insert_rows` hazard in reverse, and it covers the same two\nthings with the same scoping. `delete_rows` moves cells but leaves formula text\nalone, so a `=SUM(B2:B11)` total goes on summing eleven rows of a table that now\nholds nine, pulling in blanks or the wrong cells. It leaves merged ranges alone too:\na `Total` merged at `A8:B8` keeps covering row 8 after a row above it is deleted, and\na title merged across `A1:C1` still claims three columns after a `delete_cols`. Both\nare silent — no error, and the damage only shows when the user opens the file.\n\nMerges are again checked from the first deleted row down (`m.max_row >= min(targets)`),\nso a banner above every deletion does not block the edit, while any formula anywhere\ndoes. When it fires, do not delete it: say which rows you would have removed and ask\nwhether to drop the merges and formulas too, or tell the user the deletion has to\nhappen in Excel, where the ranges follow. Note the column case is not covered by that\nrow check — if you are calling `delete_cols` on a sheet with horizontal merges, treat\nany merged range as a stop.\n\n## Reading Cell Values During an Edit\n\n`load_workbook` has two modes, and neither gives both formulas and values:\n\n- `load_workbook(\"f.xlsx\")` — formula cells hold the formula **string**\n (`\"=SUM(D2:D4)\"`).\n- `load_workbook(\"f.xlsx\", data_only=True)` — formula cells hold the value the\n last spreadsheet app **cached** when it saved. A file that openpyxl itself wrote\n has no cache, so these cells read `None`.\n\nPlain data cells read the same either way. When a formula cell reads `None` under\n`data_only=True`, the file was never recalculated by a spreadsheet app — compute\nthe number in Python from the data cells instead of hunting for it.\n\n**Never `save()` a workbook opened with `data_only=True`.** That mode loads values\nin place of formulas, so saving writes the values back and every formula the user\nhad is gone — silently, at `exitCode 0`, with an attachment that looks fine. A\nworkbook you intend to save is always opened plainly:\n\n```python\nfrom openpyxl import load_workbook\n\nvalues = load_workbook(\"existing.xlsx\", data_only=True) # read numbers here\nwb = load_workbook(\"existing.xlsx\") # edit and save this one\n```\n\nRead from `values`, write to `wb`, and save `wb`. One open, one job.\n\nThat is reading in service of an edit. Reading for the *user* — a summary or an\nanswer delivered as chat text — is its own flow with its own call shape: load\n`references/read.md`.\n\n## Errors\n\n- Never print the workbook's bytes or base64 — stdout is capped and the file\n travels through `outputs`. A build call prints only a short summary line.\n Never pass an absolute path to `save()`.\n- `attachment … not found in this chat` — `inputs` listed an id that is not in\n this chat (often a copied placeholder). Only stage real ids from prior tool\n results or `[Attached file …]` lines.\n- `an id-less input stages an uploaded image, and this path names a document` —\n an `.xlsx` was staged with no `attachmentId`. Spreadsheets are always staged\n by id.\n- `no uploaded image in this chat — attach an image or pass an attachmentId` —\n an id-less input was sent when the user uploaded no image at all.\n- `FileNotFoundError: [Errno 44] No such file or directory` on a workbook you\n saved in an earlier call means it was never staged: the working directory is\n fresh every call. Add the file to `inputs` with its `attachmentId`.\n- A delivered workbook whose formulas have turned into blanks means it was opened\n with `data_only=True` and then saved. Open a second, plain workbook to edit.\n- A delivered workbook whose table appears twice means the edit re-appended the\n header and rows onto the staged sheet. An edit adds only what is new.\n- `AssertionError: a merged range at or below AT, or a formula — append instead …`\n means a merged range sits at or below the insertion row, or the sheet has a formula\n whose range `insert_rows` would not move. Append the row at the end instead and say\n why in the reply.\n- `AssertionError: a merged range at or below the first deleted row, or a formula …`\n is the same hazard on a delete, and has no safe fallback: say which rows you would\n remove and ask the user how to handle the merges and formulas.\n- `AssertionError: no row matched …` means the delete found nothing, usually because\n the compared values are strings on one side and numbers on the other. Diagnose the\n match and rerun; do not remove the assert, because the workbook it would deliver\n is the staged one unchanged.\n- Rows that disappeared from the wrong places mean the delete loop ran over\n ascending indices. Collect the targets first and delete in reverse.\n- A row that renders unlike the rest of its column — `278` among `278.00`s — was\n inserted without copying `number_format` from the row below it.\n- `'MergedCell' object attribute 'value' is read-only` means the write hit a merged\n non-anchor cell — write the range's top-left cell instead.\n- `\".xlsm\" is not an allowed output type` means the run tried to deliver a\n macro-enabled file — save as `.xlsx` and tell the user macros were not preserved.\n- `KeyError` on `wb[\"Sheet Name\"]` — the sheet name does not exist; print\n `wb.sheetnames` in the run that edits and pick from it.\n- `ModuleNotFoundError: No module named 'openpyxl'` — add\n `[\"openpyxl==3.1.5\"]` to `packages` and rerun. Never try to install it.\n- `ImportError: You must install Pillow to fetch image objects` means an image was\n embedded without `\"pillow\"` in `packages` — openpyxl does not install it.\n- `FileNotFoundError` on a 32-character hex name means an attachment id was opened as\n a path. The id belongs in `attachmentId`; open the `path` you chose.\n- On an `AttributeError` from openpyxl the API name is wrong, and on a `TypeError`\n about missing positional arguments a required argument was left out — fix either\n against this file's examples. Do not retry the same call, and do not switch to a\n shell.\n\n## Finish\n\nWhen `exitCode` is `0` and `attachments` lists the `.xlsx`, stop tool use and\nanswer with one line: file name + the `rows in / rows out` (or sheets) summary\nfrom stdout. Exactly one successful `exec` per request. If the result has\n`missingOutputs`, read stderr first — an `AssertionError` there means a guard\nstopped the save on purpose and its message names what to fix.\n",
33
33
  "excel/references/read.md": "# Reading a Workbook to Answer in Chat (openpyxl)\n\nWhen the user asks what an attached workbook *holds* — a summary, a question\nanswered, specific values pulled out — the deliverable is your reply in the\nchat, not a file. This is a **read request**: exactly one `exec` call, staging\nthe workbook in `inputs` and declaring **no `outputs`**, whose whole job is to\nprint the sheets so you can read them in the result.\n\n## The exec call\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"openpyxl==3.1.5\"],\n \"inputs\": [{ \"attachmentId\": \"<id from the [Attached file …] line>\", \"path\": \"existing.xlsx\" }],\n \"maxOutputChars\": 24000,\n \"command\": \"...\"\n}\n```\n\nThe id rules: copy it verbatim from the `[Attached file …]` line on the user's\nmessage or from the earlier `exec` result that produced the file, never invent\none, never stage a workbook id-less (an id-less entry resolves to an uploaded\n*image*). If no id appears anywhere in the chat, ask the user to attach the\nfile again. `maxOutputChars` raises the stdout cap so a full workbook comes\nback in one result; keep the sample's 24000. Declare no `outputs` — a read\nbuilds nothing.\n\n## The Read Program\n\nPrints every sheet under a `[Sheet]` marker, then its rows — one printed line\nper row:\n\n```python\nfrom openpyxl import load_workbook\n\nwb = load_workbook(\"existing.xlsx\", data_only=True)\nfor name in wb.sheetnames:\n ws = wb[name]\n print(f\"[Sheet] {name} ({ws.max_row} rows)\")\n for row in ws.iter_rows(values_only=True):\n print(\" | \".join(\"\" if v is None else str(v).replace(\"\\n\", \" \") for v in row))\n```\n\nThe `replace` is load-bearing: a multi-line cell (Alt+Enter in Excel) embeds\n`\"\\n\"` in its value, and an embedded newline would split one row across two\nprinted lines. Flattened, every printed line is exactly one sheet row.\n\n`data_only=True` is the right mode here: a formula cell prints the value the\nlast spreadsheet app cached, or an empty field when the file was never\nrecalculated (`None` prints as nothing). An empty field under a `Total` header\nis that, not missing data — say so, and when the answer needs the number, work\nit out from the data rows that did print.\n\n**You cannot summarize in the call that reads.** The words in `command` are\nfixed before the program runs, so one call cannot inform itself: any summary\nwritten into it was written blind — recalled or invented, not read. Python only\n*transports* the values; the summarizing happens in your reply, after the\nresult comes back.\n\n## A Successful Read Ends Tool Use\n\nWhen the result prints the sheets, reply with the summary or the answer as chat\ntext — when the user asked for the table in the chat, that reply is a markdown\ntable built from the rows you read, never from memory. **Scale the reply to the\nworkbook**: a summary is much shorter than what it summarizes — a small sheet\nearns a few sentences, and only a many-sheet workbook earns sections. Restating\nevery row is not a summary. Do **not**:\n\n- call `exec` again to \"re-check\", \"read more\", or read the same workbook a\n second time;\n- build a summary `.xlsx` the user never asked for — an unrequested file is a\n failed turn, not a bonus.\n\nIf stdout ends with `… [truncated]`, the workbook is longer than the cap:\nanswer from what came back and say the answer covers the sheets up to that\npoint. Do not rerun the read — it prints the same beginning again.\n\nIf the user asks for the summary **as a file**, that is a read followed by a\nbuild: the read call above first, then one build call that writes the new\nworkbook from the values you actually read (load `references/create.md` for the\nbuild). The read still declares no `outputs`.\n\n## Errors\n\n- `attachment … not found in this chat` — the id was invented or the file is\n not attached. Re-copy the exact id; if none exists, ask the user to attach\n the file again instead of retrying.\n- `an id-less input stages an uploaded image, and this path names a document` —\n the workbook was staged with no `attachmentId`. Spreadsheets (`.xlsx`,\n `.csv`, `.xlsm`) are always staged by id.\n- `FileNotFoundError: [Errno 44] No such file or directory` — the file was\n never staged; the working directory is fresh every call. Add it to `inputs`\n with its `attachmentId`.\n- `ModuleNotFoundError: No module named 'openpyxl'` — add\n `[\"openpyxl==3.1.5\"]` to `packages` and rerun. Never try to install it.\n- A formula cell that prints nothing is not a bug — the file was never\n recalculated by a spreadsheet app. Compute the number from the data rows\n instead of rerunning.\n",
34
34
  "github/SKILL.md": "---\nname: github\ndescription: Search, read, and write GitHub repos, issues, and pull requests via the REST API.\ntools: [http_request]\nplatform: [darwin, linux, win32, ios, android]\ncredentials: [github_access_token]\nallow_list: [https://api.github.com/]\n---\n\n# GitHub\n\nUse `http_request` against `https://api.github.com` on every call, with `headers: {\"Accept\": \"application/vnd.github+json\"}`. The GitHub PAT credential is attached automatically to every `api.github.com` request — **never include an `auth` block**. Never fetch `github.com` web pages — they return HTML, not data; translate a pasted link to its API path instead (e.g. `github.com/{owner}/{repo}/pull/{n}` → `/repos/{owner}/{repo}/pulls/{n}`).\n\n```json\n{\n \"url\": \"https://api.github.com/search/issues?q=is:pr+is:open+repo:owner/repo&per_page=5\",\n \"method\": \"GET\",\n \"headers\": { \"Accept\": \"application/vnd.github+json\" }\n}\n```\n\n## Reads\n\n- Search repos → `GET /search/repositories?q=...`\n- Search issues/PRs → `GET /search/issues?q=...` (always qualify with `is:pr` or `is:issue` — it returns both)\n- List issues → `GET /repos/{owner}/{repo}/issues?state=open` (items with a `pull_request` key are PRs, not issues)\n- List PRs → `GET /repos/{owner}/{repo}/pulls?state=open`\n- Read a file → `GET /repos/{owner}/{repo}/contents/{path}` (`content` is base64-encoded)\n- List a user's repos → `GET /user/repos?sort=updated`\n\n## Writes\n\n- Create an issue → `POST /repos/{owner}/{repo}/issues` with `body: {\"title\": \"...\", \"body\": \"...\"}`\n- Comment on an issue or PR → `POST /repos/{owner}/{repo}/issues/{n}/comments` with `body: {\"body\": \"...\"}` (PRs are issues for commenting — use the PR number on the issues endpoint)\n- Close or edit an issue → `PATCH /repos/{owner}/{repo}/issues/{n}` with `body: {\"state\": \"closed\"}`\n\n## Notes\n\n- Paginate with `per_page` (default small — 5, rarely above 30) and `page`; never fetch more than the request needs.\n- Ask for specific fields where the endpoint supports it, and summarize in plain language rather than echoing raw JSON — responses get truncated past 8KB.\n- **401** — token missing or revoked: tell the user to connect GitHub, don't retry. **404** on a resource the user linked directly usually means it's private, not nonexistent — search can't see private repos either. **403/429** mentioning rate limits — say so and stop.\n- Never print the token or the `Authorization` header, and don't claim a write succeeded without a successful response in this turn.\n",
35
- "gmail/SKILL.md": "---\nname: gmail\ndescription: Read, search, send, and manage Gmail messages and labels via the Gmail REST API.\naliases: [inbox, email+send, email+draft, email+reply, email+forward]\ntools: [http_request, gmail_send, gmail_draft]\nplatform: [darwin, linux, win32]\ncredentials: [gmail_access_token]\nallow_list: [https://gmail.googleapis.com/gmail/v1/users/me/]\n---\n\n# Gmail\n\nUse `gmail_send` to send, `gmail_draft` to draft, and `http_request` for everything else (list, search, get, labels, trash). The Gmail credential is attached automatically to every `gmail.googleapis.com` request — **never include an `auth` block**.\n\n## Prerequisites\n\nGmail must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Gmail from Settings, or to\nset the `gmail_access_token` credential.\n\n## Base URL\n\n`https://gmail.googleapis.com/gmail/v1/users/me`\n\nThe host is `gmail.googleapis.com` — not `www.googleapis.com`. Send is at `/messages/send`, never `/send`.\n\n## Common Operations\n\n### List or search messages\n\n`messages.list` returns `{id, threadId}` pairs only — no subjects, no snippets. To summarize you need a follow-up `messages.get` per id. Use `q` for Gmail search syntax (`from:`, `subject:`, `is:unread`, `newer_than:7d`, `has:attachment`, `label:work`). Keep `maxResults` ≤ 10.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages\",\n \"method\": \"GET\",\n \"query\": { \"q\": \"is:unread newer_than:7d\", \"labelIds\": \"INBOX\", \"maxResults\": 10 }\n}\n```\n\n### Get a message (metadata)\n\nFor lists and summaries always use `format=metadata` — it skips the body and is far cheaper than `full`.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}\",\n \"method\": \"GET\",\n \"query\": {\n \"format\": \"metadata\",\n \"metadataHeaders\": \"Subject,From,To,Date,Message-ID,References\"\n }\n}\n```\n\n### Get a message (full body)\n\nOnly when the user needs the content. The body is base64url-encoded in `payload.parts[].body.data` (or `payload.body.data`); decode it before presenting. Prefer the `text/plain` part over `text/html`.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}\",\n \"method\": \"GET\",\n \"query\": { \"format\": \"full\" }\n}\n```\n\n### Send a message\n\nUse `gmail_send` with semantic args: `to` (array), `subject`, and `text` (or `html`). Optional: `cc`, `bcc`, `replyTo`. The tool builds the RFC 2822 message and base64url-encodes it — never construct `raw` yourself.\n\n```json\n{ \"to\": [\"<RECIPIENT_EMAIL>\"], \"subject\": \"Subject line\", \"text\": \"Message body\" }\n```\n\nIf you supply both `text` and `html`, only `text` is sent — pick one.\n\nConfirm recipient, subject, and body with the user before sending. Report success only when the response contains a message `id`.\n\n### Draft a message\n\nUse `gmail_draft` with the same envelope as `gmail_send`.\n\n```json\n{ \"to\": [\"<RECIPIENT_EMAIL>\"], \"subject\": \"Subject line\", \"text\": \"Draft body\" }\n```\n\n### Reply to a message (preserves threading)\n\nA reply is `gmail_send` with the original's `threadId`, `inReplyTo`, and `references`. Without these Gmail starts a new thread.\n\n1. Get the original with `format=metadata` and headers `Message-ID,References,Subject,From,Reply-To`; capture its `threadId`.\n2. Send with `to` <- original From (or Reply-To), `subject` <- `Re: ` + original (don't double-prefix), `inReplyTo` <- original Message-ID, `references` <- original References then that Message-ID. Keep angle brackets.\n\n```json\n{\n \"to\": [\"<RECIPIENT_EMAIL>\"],\n \"subject\": \"Re: Original subject\",\n \"text\": \"Reply body\",\n \"threadId\": \"{originalThreadId}\",\n \"inReplyTo\": \"<msg-id@mail.gmail.com>\",\n \"references\": \"<msg-id@mail.gmail.com>\"\n}\n```\n\n### Modify labels (mark read, archive, star)\n\nSystem labels: `INBOX`, `UNREAD`, `STARRED`, `IMPORTANT`, `SPAM`, `TRASH`. Mark read = remove `UNREAD`; archive = remove `INBOX`; star = add `STARRED`.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}/modify\",\n \"method\": \"POST\",\n \"body\": { \"removeLabelIds\": [\"UNREAD\", \"INBOX\"] }\n}\n```\n\n### Trash a message\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}/trash\",\n \"method\": \"POST\"\n}\n```\n\n## Output Policy\n\n- Lists: up to 5 entries with subject, sender, and a human-readable date. Fetch full bodies only when asked.\n- Decode base64 message bodies before presenting; never include raw base64 blobs.\n- Modify/trash: state the user-facing effect (\"marked 3 messages as read\"), not the label diff.\n- Confirm destructive or outgoing actions (send, reply, trash) with the user first.\n\n## Common Mistakes\n\n- Using `www.googleapis.com` for Gmail, or building send/draft/reply through `http_request` instead of `gmail_send`/`gmail_draft`.\n- Treating `messages.list` results as if they had subjects — they need a follow-up `messages.get`.\n- Replying without `threadId` + `inReplyTo`/`references` — Gmail starts a new thread.\n- Sending a placeholder (`<RECIPIENT_EMAIL>`, `recipient@example.com`) — the runtime refuses these.\n- Inventing an address. The runtime refuses any recipient absent from the conversation and from earlier tool results; search Gmail or ask the user.\n- Including an `auth` block by hand — credentials attach automatically; a mistyped key breaks the request.\n",
35
+ "gmail/SKILL.md": "---\nname: gmail\ndescription: Read, search, send, and manage Gmail messages and labels via the Gmail REST API.\naliases: [inbox, email+send, email+draft, email+reply, email+forward]\ntools: [http_request, gmail_send, gmail_draft]\nplatform: [darwin, linux, win32]\ncredentials: [gmail_access_token]\nallow_list: [https://gmail.googleapis.com/gmail/v1/users/me/]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Gmail\",\n \"provider\": \"google\",\n \"credentialKey\": \"gmail_access_token\",\n \"description\": \"Read, search, send, and manage Gmail messages and labels\",\n \"steps\": [\n \"Click Connect and approve access in the browser. Approving grants access to your Gmail only.\",\n \"Each Google skill is connected separately, with its own app and its own approval.\"\n ],\n \"configSteps\": [\n \"[Open Google Cloud Console](https://console.cloud.google.com/flows/enableapi?apiid=gmail.googleapis.com) to enable the Gmail API\",\n \"[Open OAuth clients](https://console.cloud.google.com/auth/clients) to create an OAuth client — choose \\\"Desktop app\\\" as the type\",\n \"[Open OAuth audience](https://console.cloud.google.com/auth/audience) and add your Google account as a test user\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"OAuth client ID from your app\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"Client Secret\",\n \"secret\": true\n }\n ],\n \"oauth\": {\n \"stateKey\": \"gmail_oauth\",\n \"authUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"tokenAuth\": \"secret-in-body\",\n \"port\": 18978,\n \"scopes\": [\n \"https://www.googleapis.com/auth/gmail.modify\"\n ],\n \"extraAuthParams\": {\n \"access_type\": \"offline\",\n \"prompt\": \"consent\"\n }\n }\n }\n ]\n }\n }\n }\n---\n\n# Gmail\n\nUse `gmail_send` to send, `gmail_draft` to draft, and `http_request` for everything else (list, search, get, labels, trash). The Gmail credential is attached automatically to every `gmail.googleapis.com` request — **never include an `auth` block**.\n\n## Prerequisites\n\nGmail must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Gmail from Settings, or to\nset the `gmail_access_token` credential.\n\n## Base URL\n\n`https://gmail.googleapis.com/gmail/v1/users/me`\n\nThe host is `gmail.googleapis.com` — not `www.googleapis.com`. Send is at `/messages/send`, never `/send`.\n\n## Common Operations\n\n### List or search messages\n\n`messages.list` returns `{id, threadId}` pairs only — no subjects, no snippets. To summarize you need a follow-up `messages.get` per id. Use `q` for Gmail search syntax (`from:`, `subject:`, `is:unread`, `newer_than:7d`, `has:attachment`, `label:work`). Keep `maxResults` ≤ 10.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages\",\n \"method\": \"GET\",\n \"query\": { \"q\": \"is:unread newer_than:7d\", \"labelIds\": \"INBOX\", \"maxResults\": 10 }\n}\n```\n\n### Get a message (metadata)\n\nFor lists and summaries always use `format=metadata` — it skips the body and is far cheaper than `full`.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}\",\n \"method\": \"GET\",\n \"query\": {\n \"format\": \"metadata\",\n \"metadataHeaders\": \"Subject,From,To,Date,Message-ID,References\"\n }\n}\n```\n\n### Get a message (full body)\n\nOnly when the user needs the content. The body is base64url-encoded in `payload.parts[].body.data` (or `payload.body.data`); decode it before presenting. Prefer the `text/plain` part over `text/html`.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}\",\n \"method\": \"GET\",\n \"query\": { \"format\": \"full\" }\n}\n```\n\n### Send a message\n\nUse `gmail_send` with semantic args: `to` (array), `subject`, and `text` (or `html`). Optional: `cc`, `bcc`, `replyTo`. The tool builds the RFC 2822 message and base64url-encodes it — never construct `raw` yourself.\n\n```json\n{ \"to\": [\"<RECIPIENT_EMAIL>\"], \"subject\": \"Subject line\", \"text\": \"Message body\" }\n```\n\nIf you supply both `text` and `html`, only `text` is sent — pick one.\n\nConfirm recipient, subject, and body with the user before sending. Report success only when the response contains a message `id`.\n\n### Draft a message\n\nUse `gmail_draft` with the same envelope as `gmail_send`.\n\n```json\n{ \"to\": [\"<RECIPIENT_EMAIL>\"], \"subject\": \"Subject line\", \"text\": \"Draft body\" }\n```\n\n### Reply to a message (preserves threading)\n\nA reply is `gmail_send` with the original's `threadId`, `inReplyTo`, and `references`. Without these Gmail starts a new thread.\n\n1. Get the original with `format=metadata` and headers `Message-ID,References,Subject,From,Reply-To`; capture its `threadId`.\n2. Send with `to` <- original From (or Reply-To), `subject` <- `Re: ` + original (don't double-prefix), `inReplyTo` <- original Message-ID, `references` <- original References then that Message-ID. Keep angle brackets.\n\n```json\n{\n \"to\": [\"<RECIPIENT_EMAIL>\"],\n \"subject\": \"Re: Original subject\",\n \"text\": \"Reply body\",\n \"threadId\": \"{originalThreadId}\",\n \"inReplyTo\": \"<msg-id@mail.gmail.com>\",\n \"references\": \"<msg-id@mail.gmail.com>\"\n}\n```\n\n### Modify labels (mark read, archive, star)\n\nSystem labels: `INBOX`, `UNREAD`, `STARRED`, `IMPORTANT`, `SPAM`, `TRASH`. Mark read = remove `UNREAD`; archive = remove `INBOX`; star = add `STARRED`.\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}/modify\",\n \"method\": \"POST\",\n \"body\": { \"removeLabelIds\": [\"UNREAD\", \"INBOX\"] }\n}\n```\n\n### Trash a message\n\n```json\n{\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/{id}/trash\",\n \"method\": \"POST\"\n}\n```\n\n## Output Policy\n\n- Lists: up to 5 entries with subject, sender, and a human-readable date. Fetch full bodies only when asked.\n- Decode base64 message bodies before presenting; never include raw base64 blobs.\n- Modify/trash: state the user-facing effect (\"marked 3 messages as read\"), not the label diff.\n- Confirm destructive or outgoing actions (send, reply, trash) with the user first.\n\n## Common Mistakes\n\n- Using `www.googleapis.com` for Gmail, or building send/draft/reply through `http_request` instead of `gmail_send`/`gmail_draft`.\n- Treating `messages.list` results as if they had subjects — they need a follow-up `messages.get`.\n- Replying without `threadId` + `inReplyTo`/`references` — Gmail starts a new thread.\n- Sending a placeholder (`<RECIPIENT_EMAIL>`, `recipient@example.com`) — the runtime refuses these.\n- Inventing an address. The runtime refuses any recipient absent from the conversation and from earlier tool results; search Gmail or ask the user.\n- Including an `auth` block by hand — credentials attach automatically; a mistyped key breaks the request.\n",
36
36
  "gmail/operations.json": "{\n \"operations\": [\n {\n \"tool\": \"gmail_send\",\n \"description\": \"Send an email through Gmail, or reply in a thread when threadId and inReplyTo are given. Pass the message as plain fields — never build the RFC 2822 message or base64 yourself. Confirm the recipient and body with the user before sending.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"to\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Recipient email addresses\"\n },\n \"subject\": { \"type\": \"string\", \"description\": \"Subject line\" },\n \"text\": { \"type\": \"string\", \"description\": \"Plain-text body\" },\n \"html\": { \"type\": \"string\", \"description\": \"HTML body, used when text is absent\" },\n \"cc\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"bcc\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"replyTo\": { \"type\": \"string\" },\n \"threadId\": {\n \"type\": \"string\",\n \"description\": \"Thread to reply in, from a previous messages.list or messages.get\"\n },\n \"inReplyTo\": {\n \"type\": \"string\",\n \"description\": \"Message-ID header of the message being replied to\"\n },\n \"references\": { \"type\": \"string\", \"description\": \"References header of the thread\" }\n },\n \"required\": [\"to\", \"subject\"]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/messages/send\",\n \"builder\": \"gmail-send\"\n }\n },\n {\n \"tool\": \"gmail_draft\",\n \"description\": \"Create a Gmail draft without sending it. Pass the message as plain fields — never build the RFC 2822 message or base64 yourself.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"to\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Recipient email addresses\"\n },\n \"subject\": { \"type\": \"string\", \"description\": \"Subject line\" },\n \"text\": { \"type\": \"string\", \"description\": \"Plain-text body\" },\n \"html\": { \"type\": \"string\", \"description\": \"HTML body, used when text is absent\" },\n \"cc\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"bcc\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } },\n \"replyTo\": { \"type\": \"string\" },\n \"threadId\": { \"type\": \"string\", \"description\": \"Thread the draft replies in\" },\n \"inReplyTo\": {\n \"type\": \"string\",\n \"description\": \"Message-ID header of the message being replied to\"\n },\n \"references\": { \"type\": \"string\", \"description\": \"References header of the thread\" }\n },\n \"required\": [\"to\", \"subject\"]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://gmail.googleapis.com/gmail/v1/users/me/drafts\",\n \"builder\": \"gmail-draft\"\n }\n }\n ]\n}\n",
37
- "google-calendar/SKILL.md": "---\nname: google-calendar\ndescription: List, create, update, and delete Google Calendar events via the Google Calendar REST API.\naliases: [calendar, meeting+create, meeting+schedule, meeting+book, meeting+move, meeting+cancel, event+create]\ntools: [http_request, calendar_create_meet_event, calendar_add_meet]\nplatform: [darwin, linux, win32]\ncredentials: [google_calendar_access_token]\nallow_list: [https://www.googleapis.com/calendar/v3/]\n---\n\n# Google Calendar\n\nUse `calendar_create_meet_event` and `calendar_add_meet` for Google Meet links, and `http_request` for everything else (list, plain create/update/delete, free/busy). The Google Calendar credential is attached automatically to every `www.googleapis.com/calendar/v3/` request — **never include an `auth` block**.\n\n## Prerequisites\n\nGoogle Calendar must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Calendar from Settings, or to\nset the `google_calendar_access_token` credential.\n\n## Base URL\n\n`https://www.googleapis.com/calendar/v3` — default `calendarId` is `primary` unless the user names another calendar.\n\n## Temporal Accuracy (Critical)\n\n- Resolve relative dates (\"today\", \"tomorrow\", \"next week\", \"in 2 hours\") to absolute ISO 8601 timestamps **with timezone offset** before calling the API.\n- Never infer \"now\" from memory when building `timeMin`, `timeMax`, or event start/end values.\n- If the date or time is ambiguous, ask the user instead of guessing.\n\nExample: annotation `[Current local time: 2026-08-12 14:00:00 (UTC-03:00)]`, user asks \"in 30 minutes for 1 hour\" -> `start.dateTime` = `2026-08-12T14:30:00-03:00`, `end.dateTime` = `2026-08-12T15:30:00-03:00`.\n\n## Common Operations\n\n### List upcoming events\n\nAlways use `singleEvents=true` and `orderBy=startTime` so recurring events expand and sort correctly.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events\",\n \"method\": \"GET\",\n \"query\": {\n \"timeMin\": \"<resolved ISO 8601 with offset>\",\n \"maxResults\": 10,\n \"singleEvents\": true,\n \"orderBy\": \"startTime\"\n }\n}\n```\n\n### Create an event\n\nAsk for missing required fields (summary, start, end) before creating.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events\",\n \"method\": \"POST\",\n \"body\": {\n \"summary\": \"Design review\",\n \"start\": { \"dateTime\": \"2026-06-10T14:00:00-03:00\" },\n \"end\": { \"dateTime\": \"2026-06-10T15:00:00-03:00\" },\n \"attendees\": [{ \"email\": \"colleague@example.com\" }]\n }\n}\n```\n\n### Create an event with a Google Meet link\n\nUse `calendar_create_meet_event` with `summary`, `start`, `end` (ISO 8601 with offset), and optionally `timeZone`, `description`, `location`, `attendees`, `calendarId`.\n\n```json\n{\n \"summary\": \"Sync call\",\n \"start\": \"2026-06-10T14:00:00-03:00\",\n \"end\": \"2026-06-10T14:30:00-03:00\"\n}\n```\n\nTo add a Meet link to an event that already exists, use `calendar_add_meet` with `eventId` (and `calendarId` if not `primary`).\n\n### Update an event\n\n`PATCH` with only the fields to change.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events/{eventId}\",\n \"method\": \"PATCH\",\n \"body\": { \"summary\": \"Updated title\" }\n}\n```\n\n### Delete an event\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events/{eventId}\",\n \"method\": \"DELETE\"\n}\n```\n\n### Free/busy query\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/freeBusy\",\n \"method\": \"POST\",\n \"body\": {\n \"timeMin\": \"2026-06-10T00:00:00Z\",\n \"timeMax\": \"2026-06-11T00:00:00Z\",\n \"items\": [{ \"id\": \"primary\" }]\n }\n}\n```\n\n### List calendars\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/users/me/calendarList\",\n \"method\": \"GET\"\n}\n```\n\n## Output Policy\n\n- Present events with title, date/time (with timezone), location, and attendees when available.\n- For create/update, report the event `id`, start/end time, and `htmlLink` rendered as a Markdown link — e.g. `[event title](htmlLink)`. Never present the URL bare or wrapped in backticks, or it won't be clickable.\n- Confirm before deleting events; show the event title and time so the user can verify.\n\n## Common Mistakes\n\n- Sending natural-language dates instead of absolute ISO 8601 with timezone offset.\n- Listing without `singleEvents=true` — recurring events come back collapsed and unsorted.\n- Calling get/patch/delete without a real `eventId` — list/search first.\n- Including an `auth` block by hand — credentials attach automatically; a mistyped key breaks the request.\n",
37
+ "google-calendar/SKILL.md": "---\nname: google-calendar\ndescription: List, create, update, and delete Google Calendar events via the Google Calendar REST API.\naliases: [calendar, meeting+create, meeting+schedule, meeting+book, meeting+move, meeting+cancel, event+create]\ntools: [http_request, calendar_create_meet_event, calendar_add_meet]\nplatform: [darwin, linux, win32]\ncredentials: [google_calendar_access_token]\nallow_list: [https://www.googleapis.com/calendar/v3/]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Google Calendar\",\n \"provider\": \"google\",\n \"credentialKey\": \"google_calendar_access_token\",\n \"description\": \"List, create, update, and delete Google Calendar events\",\n \"steps\": [\n \"Click Connect and approve access in the browser. Approving grants access to your calendars only.\",\n \"Each Google skill is connected separately, with its own app and its own approval.\"\n ],\n \"configSteps\": [\n \"[Open Google Cloud Console](https://console.cloud.google.com/flows/enableapi?apiid=calendar-json.googleapis.com) to enable the Google Calendar API\",\n \"[Open OAuth clients](https://console.cloud.google.com/auth/clients) to create an OAuth client — choose \\\"Desktop app\\\" as the type\",\n \"[Open OAuth audience](https://console.cloud.google.com/auth/audience) and add your Google account as a test user\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"OAuth client ID from your app\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"Client Secret\",\n \"secret\": true\n }\n ],\n \"oauth\": {\n \"stateKey\": \"google_calendar_oauth\",\n \"authUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"tokenAuth\": \"secret-in-body\",\n \"port\": 18978,\n \"scopes\": [\n \"https://www.googleapis.com/auth/calendar\"\n ],\n \"extraAuthParams\": {\n \"access_type\": \"offline\",\n \"prompt\": \"consent\"\n }\n }\n }\n ]\n }\n }\n }\n---\n\n# Google Calendar\n\nUse `calendar_create_meet_event` and `calendar_add_meet` for Google Meet links, and `http_request` for everything else (list, plain create/update/delete, free/busy). The Google Calendar credential is attached automatically to every `www.googleapis.com/calendar/v3/` request — **never include an `auth` block**.\n\n## Prerequisites\n\nGoogle Calendar must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Calendar from Settings, or to\nset the `google_calendar_access_token` credential.\n\n## Base URL\n\n`https://www.googleapis.com/calendar/v3` — default `calendarId` is `primary` unless the user names another calendar.\n\n## Temporal Accuracy (Critical)\n\n- Resolve relative dates (\"today\", \"tomorrow\", \"next week\", \"in 2 hours\") to absolute ISO 8601 timestamps **with timezone offset** before calling the API.\n- Never infer \"now\" from memory when building `timeMin`, `timeMax`, or event start/end values.\n- If the date or time is ambiguous, ask the user instead of guessing.\n\nExample: annotation `[Current local time: 2026-08-12 14:00:00 (UTC-03:00)]`, user asks \"in 30 minutes for 1 hour\" -> `start.dateTime` = `2026-08-12T14:30:00-03:00`, `end.dateTime` = `2026-08-12T15:30:00-03:00`.\n\n## Common Operations\n\n### List upcoming events\n\nAlways use `singleEvents=true` and `orderBy=startTime` so recurring events expand and sort correctly.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events\",\n \"method\": \"GET\",\n \"query\": {\n \"timeMin\": \"<resolved ISO 8601 with offset>\",\n \"maxResults\": 10,\n \"singleEvents\": true,\n \"orderBy\": \"startTime\"\n }\n}\n```\n\n### Create an event\n\nAsk for missing required fields (summary, start, end) before creating.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events\",\n \"method\": \"POST\",\n \"body\": {\n \"summary\": \"Design review\",\n \"start\": { \"dateTime\": \"2026-06-10T14:00:00-03:00\" },\n \"end\": { \"dateTime\": \"2026-06-10T15:00:00-03:00\" },\n \"attendees\": [{ \"email\": \"colleague@example.com\" }]\n }\n}\n```\n\n### Create an event with a Google Meet link\n\nUse `calendar_create_meet_event` with `summary`, `start`, `end` (ISO 8601 with offset), and optionally `timeZone`, `description`, `location`, `attendees`, `calendarId`.\n\n```json\n{\n \"summary\": \"Sync call\",\n \"start\": \"2026-06-10T14:00:00-03:00\",\n \"end\": \"2026-06-10T14:30:00-03:00\"\n}\n```\n\nTo add a Meet link to an event that already exists, use `calendar_add_meet` with `eventId` (and `calendarId` if not `primary`).\n\n### Update an event\n\n`PATCH` with only the fields to change.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events/{eventId}\",\n \"method\": \"PATCH\",\n \"body\": { \"summary\": \"Updated title\" }\n}\n```\n\n### Delete an event\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/primary/events/{eventId}\",\n \"method\": \"DELETE\"\n}\n```\n\n### Free/busy query\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/freeBusy\",\n \"method\": \"POST\",\n \"body\": {\n \"timeMin\": \"2026-06-10T00:00:00Z\",\n \"timeMax\": \"2026-06-11T00:00:00Z\",\n \"items\": [{ \"id\": \"primary\" }]\n }\n}\n```\n\n### List calendars\n\n```json\n{\n \"url\": \"https://www.googleapis.com/calendar/v3/users/me/calendarList\",\n \"method\": \"GET\"\n}\n```\n\n## Output Policy\n\n- Present events with title, date/time (with timezone), location, and attendees when available.\n- For create/update, report the event `id`, start/end time, and `htmlLink` rendered as a Markdown link — e.g. `[event title](htmlLink)`. Never present the URL bare or wrapped in backticks, or it won't be clickable.\n- Confirm before deleting events; show the event title and time so the user can verify.\n\n## Common Mistakes\n\n- Sending natural-language dates instead of absolute ISO 8601 with timezone offset.\n- Listing without `singleEvents=true` — recurring events come back collapsed and unsorted.\n- Calling get/patch/delete without a real `eventId` — list/search first.\n- Including an `auth` block by hand — credentials attach automatically; a mistyped key breaks the request.\n",
38
38
  "google-calendar/operations.json": "{\n \"operations\": [\n {\n \"tool\": \"calendar_create_meet_event\",\n \"description\": \"Create a Google Calendar event that has a Google Meet link. Use this whenever the user asks for a meeting with a video call; a plain event without a call stays on http_request.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"summary\": { \"type\": \"string\", \"description\": \"Event title\" },\n \"start\": {\n \"type\": \"string\",\n \"description\": \"Start time, ISO 8601 with a UTC offset, e.g. 2026-03-04T15:00:00-03:00\"\n },\n \"end\": {\n \"type\": \"string\",\n \"description\": \"End time, ISO 8601 with a UTC offset\"\n },\n \"timeZone\": {\n \"type\": \"string\",\n \"description\": \"IANA time zone, e.g. America/Sao_Paulo\"\n },\n \"description\": { \"type\": \"string\" },\n \"location\": { \"type\": \"string\" },\n \"attendees\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Attendee email addresses\"\n },\n \"calendarId\": { \"type\": \"string\", \"description\": \"Defaults to primary\" }\n },\n \"required\": [\"summary\", \"start\", \"end\"]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events\",\n \"urlDefaults\": { \"calendarId\": \"primary\" },\n \"builder\": \"calendar-meet-event\"\n }\n },\n {\n \"tool\": \"calendar_add_meet\",\n \"description\": \"Add a Google Meet link to an existing Google Calendar event.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"eventId\": {\n \"type\": \"string\",\n \"description\": \"Event id, from a previous events.list or events.insert\"\n },\n \"calendarId\": { \"type\": \"string\", \"description\": \"Defaults to primary\" }\n },\n \"required\": [\"eventId\"]\n },\n \"request\": {\n \"method\": \"PATCH\",\n \"url\": \"https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}\",\n \"urlDefaults\": { \"calendarId\": \"primary\" },\n \"builder\": \"calendar-add-meet\"\n }\n }\n ]\n}\n",
39
- "google-docs/SKILL.md": "---\nname: google-docs\ndescription: Create, read, and edit Google Docs documents via the Google Docs REST API.\ntools: [http_request, docs_create, docs_append_text]\nplatform: [darwin, linux, win32]\ncredentials: [google_docs_access_token]\nallow_list: [https://docs.googleapis.com/v1/documents, https://www.googleapis.com/drive/v3/files]\n---\n\n# Google Docs\n\nUse `docs_create` to create a document and `docs_append_text` to add text or\npages to it; use `http_request` for everything else (get, replace, insert at a\nposition, delete ranges, Drive search, trash). For each `http_request`, set\n`auth.tokenCredentialKey` to `google_docs_access_token`.\n\nNever use `exec`, Python, curl, shell flags such as `-H`/`-d`, or a JSON string\nto make a Google Docs request. Call one tool per operation with one complete\nstructured object. In particular, `body` must be an object, not a serialized\nJSON string; the tool JSON-encodes it and sets `Content-Type: application/json`\nautomatically.\n\n## Load the Recipe File First\n\nThis file carries no requests. The working request shapes live in three\nreference files — load the one for the job with the `skill` tool BEFORE calling\n`http_request`, then copy its request and change only the values:\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing.\n\n- **Reading or finding documents** — \"what does document X say\", \"summarize\n my doc\", \"find / list my documents\": call the `skill` tool with\n `name: \"google-docs\"` and `file: \"references/read.md\"`.\n- **Creating a new document** (no existing document involved; one page or\n many): call the `skill` tool with `name: \"google-docs\"` and\n `file: \"references/create.md\"` — it covers `docs_create` and filling the\n document with `docs_append_text`.\n- **Changing an existing document** — append or insert text, find and\n replace, delete a passage, move it to the trash: call the `skill` tool with\n `name: \"google-docs\"` and `file: \"references/edit.md\"`.\n\nNever write a request from memory. The recipes carry the exact request shapes\n(`batchUpdate` request names, index rules, page limits) that fail in\nnon-obvious ways when improvised; loading the file is one cheap read-only call.\n\n## Prerequisites\n\nGoogle Docs must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Docs from Settings, or to\nset the `google_docs_access_token` credential.\n\nIf Google returns `403 PERMISSION_DENIED` with reason `SERVICE_DISABLED`, the\ncredential is working but the OAuth client's Google Cloud project has not\nenabled the Google Docs API. Do not ask the user to reconnect. Tell the project\nowner to open the response's `activationUrl`, enable the API, and retry after\npropagation.\n\n## Identifiers\n\nDocuments are identified by `documentId` — the alphanumeric string in the URL\n`docs.google.com/document/d/{documentId}/...`, and the `documentId` field of a\ncreate response. Listing and searching documents go through the Google Drive\nAPI (`references/read.md`), never the Docs API.\n\n## Output Policy\n\n- For document reads, extract and present the text content clearly — do not\n echo the raw JSON structure.\n- For edits, confirm the change with the user first (what text is being\n inserted, replaced, or deleted) unless they already spelled it out.\n- Report success only when the `batchUpdate` response contains `replies` with\n no errors, and name the document (title or link) in the answer.\n",
39
+ "google-docs/SKILL.md": "---\nname: google-docs\ndescription: Create, read, and edit Google Docs documents via the Google Docs REST API.\ntools: [http_request, docs_create, docs_append_text]\nplatform: [darwin, linux, win32]\ncredentials: [google_docs_access_token]\nallow_list: [https://docs.googleapis.com/v1/documents, https://www.googleapis.com/drive/v3/files]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Google Docs\",\n \"provider\": \"google\",\n \"credentialKey\": \"google_docs_access_token\",\n \"description\": \"Create, read, and edit Google Docs documents\",\n \"steps\": [\n \"Click Connect and approve access in the browser. Approving grants access to your documents and Drive files only.\",\n \"Each Google skill is connected separately, with its own app and its own approval.\"\n ],\n \"configSteps\": [\n \"[Open Google Cloud Console](https://console.cloud.google.com/flows/enableapi?apiid=docs.googleapis.com,drive.googleapis.com) to enable the Google Docs API\",\n \"[Open OAuth clients](https://console.cloud.google.com/auth/clients) to create an OAuth client — choose \\\"Desktop app\\\" as the type\",\n \"[Open OAuth audience](https://console.cloud.google.com/auth/audience) and add your Google account as a test user\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"OAuth client ID from your app\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"Client Secret\",\n \"secret\": true\n }\n ],\n \"oauth\": {\n \"stateKey\": \"google_docs_oauth\",\n \"authUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"tokenAuth\": \"secret-in-body\",\n \"port\": 18978,\n \"scopes\": [\n \"https://www.googleapis.com/auth/documents\",\n \"https://www.googleapis.com/auth/drive\"\n ],\n \"extraAuthParams\": {\n \"access_type\": \"offline\",\n \"prompt\": \"consent\"\n }\n }\n }\n ]\n }\n }\n }\n---\n\n# Google Docs\n\nUse `docs_create` to create a document and `docs_append_text` to add text or\npages to it; use `http_request` for everything else (get, replace, insert at a\nposition, delete ranges, Drive search, trash). For each `http_request`, set\n`auth.tokenCredentialKey` to `google_docs_access_token`.\n\nNever use `exec`, Python, curl, shell flags such as `-H`/`-d`, or a JSON string\nto make a Google Docs request. Call one tool per operation with one complete\nstructured object. In particular, `body` must be an object, not a serialized\nJSON string; the tool JSON-encodes it and sets `Content-Type: application/json`\nautomatically.\n\n## Load the Recipe File First\n\nThis file carries no requests. The working request shapes live in three\nreference files — load the one for the job with the `skill` tool BEFORE calling\n`http_request`, then copy its request and change only the values:\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing.\n\n- **Reading or finding documents** — \"what does document X say\", \"summarize\n my doc\", \"find / list my documents\": call the `skill` tool with\n `name: \"google-docs\"` and `file: \"references/read.md\"`.\n- **Creating a new document** (no existing document involved; one page or\n many): call the `skill` tool with `name: \"google-docs\"` and\n `file: \"references/create.md\"` — it covers `docs_create` and filling the\n document with `docs_append_text`.\n- **Changing an existing document** — append or insert text, find and\n replace, delete a passage, move it to the trash: call the `skill` tool with\n `name: \"google-docs\"` and `file: \"references/edit.md\"`.\n\nNever write a request from memory. The recipes carry the exact request shapes\n(`batchUpdate` request names, index rules, page limits) that fail in\nnon-obvious ways when improvised; loading the file is one cheap read-only call.\n\n## Prerequisites\n\nGoogle Docs must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Docs from Settings, or to\nset the `google_docs_access_token` credential.\n\nIf Google returns `403 PERMISSION_DENIED` with reason `SERVICE_DISABLED`, the\ncredential is working but the OAuth client's Google Cloud project has not\nenabled the Google Docs API. Do not ask the user to reconnect. Tell the project\nowner to open the response's `activationUrl`, enable the API, and retry after\npropagation.\n\n## Identifiers\n\nDocuments are identified by `documentId` — the alphanumeric string in the URL\n`docs.google.com/document/d/{documentId}/...`, and the `documentId` field of a\ncreate response. Listing and searching documents go through the Google Drive\nAPI (`references/read.md`), never the Docs API.\n\n## Output Policy\n\n- For document reads, extract and present the text content clearly — do not\n echo the raw JSON structure.\n- For edits, confirm the change with the user first (what text is being\n inserted, replaced, or deleted) unless they already spelled it out.\n- Report success only when the `batchUpdate` response contains `replies` with\n no errors, and name the document (title or link) in the answer.\n",
40
40
  "google-docs/operations.json": "{\n \"operations\": [\n {\n \"tool\": \"docs_create\",\n \"description\": \"Create an empty Google Doc with a title. Call it exactly once per requested document, then append content with docs_append_text using the returned documentId.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Document title\"\n }\n },\n \"required\": [\n \"title\"\n ]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://docs.googleapis.com/v1/documents\",\n \"builder\": \"docs-create\"\n },\n \"response\": {\n \"pick\": [\n \"documentId\",\n \"title\"\n ]\n }\n },\n {\n \"tool\": \"docs_append_text\",\n \"description\": \"Append text to the end of a Google Doc, optionally followed by a page break. One page (80 words or fewer) per call; set pageBreak on every page except the last. Never compute indexes yourself.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"documentId\": {\n \"type\": \"string\",\n \"description\": \"Document id, from docs_create or the docs.google.com/document/d/{id} URL\"\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"Text to append; end it with a newline\"\n },\n \"pageBreak\": {\n \"type\": \"boolean\",\n \"description\": \"Insert a page break after the text\"\n }\n },\n \"required\": [\n \"documentId\",\n \"text\"\n ]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate\",\n \"builder\": \"docs-append-text\"\n }\n }\n ]\n}\n",
41
41
  "google-docs/references/create.md": "# Creating a Google Doc\n\nTwo typed tools do the whole job: `docs_create` makes the document,\n`docs_append_text` fills it. Typed tools select their own credential. For each fallback `http_request`,\nset `auth.tokenCredentialKey` to `google_docs_access_token`.\n\n## Create the document\n\nCall `docs_create` with the title:\n\n```json\n{ \"title\": \"My Document\" }\n```\n\nThe result contains the `documentId`. Capture it and keep using it.\nCreate the document exactly once. Do not follow a successful create with a\nDrive search, a GET, or another create just to rediscover the ID. If the result has no\n`documentId`, stop and report that response problem; never append without the\nID.\n\n## Add the content\n\nCall `docs_append_text` once per page. Put the document title as the first\nline of the first page instead of spending a call on a heading, end the text\nwith a newline, and keep each call at 80 words or fewer. The 80-word limit\napplies even when the user asks for only one page. Never expand a one-page\nrequest into a long list in one call.\n\n```json\n{\n \"documentId\": \"<id from docs_create>\",\n \"text\": \"My Document\\n\\nConcise content.\\n\",\n \"pageBreak\": false\n}\n```\n\n## Multi-page documents\n\nOne requested page per `docs_append_text` call, in order, each 80 words or\nfewer, with `\"pageBreak\": true` on every page except the last — five requested\npages therefore take five append calls. Wait for a successful result before\nappending the next page. Do not place several pages of text in one call: if\nthe tool reports the arguments are not valid JSON, the call was too large or\nincomplete, so retry only that page with shorter text.\n\n## Finishing\n\nReport success only when every append result came back without an error.\nAnswer with the document title and the link\n`https://docs.google.com/document/d/{documentId}/edit`; do not read the\ndocument back to \"confirm\".\n\n## Without the typed tools\n\nThe typed tools wrap these two Docs API requests; use them only if the typed\ntools are missing from this chat:\n\n```json\n{\n \"url\": \"https://docs.googleapis.com/v1/documents\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"POST\",\n \"body\": { \"title\": \"My Document\" }\n}\n```\n\n```json\n{\n \"url\": \"https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"POST\",\n \"body\": {\n \"requests\": [\n {\n \"insertText\": {\n \"endOfSegmentLocation\": {},\n \"text\": \"Page heading\\n\\nConcise page content.\\n\"\n }\n },\n { \"insertPageBreak\": { \"endOfSegmentLocation\": {} } }\n ]\n }\n}\n```\n\nThen it is one requested page per `batchUpdate` call, the same 80-word limit,\nand the `insertPageBreak` request omitted on the last page;\nnever call `/v1/documents:batchUpdate` without the ID.\n\n## Common Mistakes\n\n- Recreating or searching for a document after a successful create instead of\n using the returned `documentId` — this produces duplicates and wastes rounds.\n- Sending a whole multi-page document in one call — one page of at most 80\n words per call, `pageBreak` on every page except the last.\n- Computing indexes yourself — `docs_append_text` and `endOfSegmentLocation`\n never need one.\n",
42
42
  "google-docs/references/edit.md": "# Editing an Existing Google Doc\n\nEvery request is one `http_request` call with a structured object. For each request, set `auth.tokenCredentialKey` to `google_docs_access_token`. All content edits go through\n`batchUpdate` — there is no PATCH endpoint for document body changes.\n\nGet the `documentId` from the URL the user gave, from an earlier create\nresponse, or from a Drive search (`references/read.md`).\n\nEvery `http_request` edit is ONE `POST …:batchUpdate` whose body is `{ \"requests\": [ … ] }` —\na bare request object without the `requests` array is rejected with 400. Copy\nthe request shapes below exactly: the field names are fixed by Google, and any\nother name (`searchText`, `replacementText`, `find`, `replace`, `newText`) fails\nwith `Unknown name`. One edit per user request — an edit never needs a\npreceding insert of text that is already in the document.\n\n## Append text\n\nCall `docs_append_text` — it appends at the end of the document with no index\narithmetic and no preliminary GET. End the text with a newline; keep it at 80\nwords or fewer per call.\n\n```json\n{\n \"documentId\": \"<documentId>\",\n \"text\": \"\\nNew paragraph.\\n\",\n \"pageBreak\": false\n}\n```\n\nThe raw equivalent, for when the typed tool is missing from this chat, is a\n`batchUpdate` with `\"insertText\": { \"endOfSegmentLocation\": {}, \"text\": \"…\" }`.\n\n## Insert text at a position\n\nUse an explicit `location.index` only when editing at a known position. A new\nblank document's first valid insertion point is index 1; index 2 is outside its\nempty paragraph. Indexes count UTF-16 code units and change with every edit, so\n`GET` the document first when you need one.\n\n```json\n{\n \"url\": \"https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"POST\",\n \"body\": {\n \"requests\": [\n {\n \"insertText\": {\n \"location\": { \"index\": 1 },\n \"text\": \"Hello, World!\"\n }\n }\n ]\n }\n}\n```\n\n## Replace all text matching a pattern\n\nUse `replaceAllText` to find and replace — exactly these keys:\n`containsText` (with `text` and optional `matchCase`) and `replaceText`.\n`containsText.text` is a regex — escape special characters (`.`, `*`, `+`,\n`?`, `[`, `]`, `(`, `)`, `{`, `}`, `^`, `$`, `|`, `\\`). No `GET` is needed\nfirst, and no `insertText` belongs in the same request.\n\n```json\n{\n \"url\": \"https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"POST\",\n \"body\": {\n \"requests\": [\n {\n \"replaceAllText\": {\n \"containsText\": { \"text\": \"old text\", \"matchCase\": true },\n \"replaceText\": \"new text\"\n }\n }\n ]\n }\n}\n```\n\nThe reply's `occurrencesChanged` says how many matches were replaced; `0` means\nthe text was not found — tell the user instead of retrying with guesses.\n\n## Delete a range of text\n\nFetch the document first, then specify the start and exclusive end index.\n\n```json\n{\n \"url\": \"https://docs.googleapis.com/v1/documents/{documentId}:batchUpdate\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"POST\",\n \"body\": {\n \"requests\": [\n {\n \"deleteContentRange\": {\n \"range\": { \"startIndex\": 10, \"endIndex\": 20 }\n }\n }\n ]\n }\n}\n```\n\n## Move a document to the trash\n\nTrashing goes through the Drive API; the user can restore it from Drive's\ntrash. Only do this when the user explicitly asks to delete or remove the\ndocument.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{documentId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"PATCH\",\n \"body\": { \"trashed\": true }\n}\n```\n\n## Finishing\n\nReport success only when the `batchUpdate` response contains `replies` with no\nerrors. Do not read the document back to confirm an edit.\n\n## Common Mistakes\n\n- Using PATCH on the document body instead of `batchUpdate` — PATCH only\n updates metadata like title, not content.\n- Treating indexes like array offsets — they count UTF-16 code units, range\n ends are exclusive, and a blank document's first usable body index is 1.\n- Using `insertionIndex` or placing `location.index` directly under\n `insertText` — the supported shape is `insertText.location.index`; for\n appends, prefer `insertText.endOfSegmentLocation`.\n- Attempting a numeric-position edit without fetching the document first — you\n won't know the current indexes.\n- Not escaping regex special characters in `containsText` patterns.\n- Renaming the fields — `searchText`, `replacementText`, `replacement`, `find`\n all return 400 `Unknown name`; only `containsText` + `replaceText` exist.\n- Sending a request object without the `{ \"requests\": [ … ] }` wrapper.\n- Inserting text that is already in the document before an edit — a replace or\n delete works on the existing content directly.\n- Passing curl/Python text or serialized JSON to `http_request` instead of one\n structured tool-call object.\n",
43
43
  "google-docs/references/read.md": "# Reading and Finding Google Docs\n\nEvery request is one `http_request` call with a structured object. For each request, set `auth.tokenCredentialKey` to `google_docs_access_token`.\n\n## Get a document\n\n```json\n{\n \"url\": \"https://docs.googleapis.com/v1/documents/{documentId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"GET\"\n}\n```\n\nReturns the full document structure with all content, styling, and revisions.\nThe text lives in `body.content[]` → `paragraph.elements[]` → `textRun.content`;\nwalk that array and join the `content` strings to reconstruct the text. Present\nthe text, not the JSON. A read-only question (\"what does the doc say\", \"summarize\nit\") ends here — do not follow a read with an edit.\n\n## List or search for documents\n\nUse the Google Drive API with a MIME type filter to find Google Docs by name.\nThe `documentId` you need for a follow-up read or edit is the file `id`.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"auth\": { \"tokenCredentialKey\": \"google_docs_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"q\": \"mimeType='application/vnd.google-apps.document' and name contains 'report'\",\n \"pageSize\": 10,\n \"fields\": \"files(id,name,modifiedTime,webViewLink)\"\n }\n}\n```\n\nTo list recent documents without a name filter, drop the `and name contains …`\nclause and add `\"orderBy\": \"modifiedTime desc\"` to the query. Run the search\nONCE; if it returns nothing, say so rather than retrying with variations.\n\n## Common Mistakes\n\n- Searching with the wrong MIME type — it must be\n `application/vnd.google-apps.document`.\n- Echoing the raw JSON to the user instead of the extracted text.\n- Fetching the document through the Drive API — content comes only from the\n Docs API `GET`.\n",
44
- "google-drive/SKILL.md": "---\nname: google-drive\ndescription: Search, list, download metadata, and manage Google Drive files and folders via the Google Drive REST API.\ntools: [http_request, drive_create_folder, drive_trash]\nplatform: [darwin, linux, win32]\ncredentials: [google_drive_access_token]\nallow_list: [https://www.googleapis.com/drive/v3/]\n---\n\n# Google Drive\n\nUse `drive_create_folder` to create folders and `drive_trash` to trash files; use `http_request` for everything else (list, search, get, export, rename). For each `http_request`, set `auth.tokenCredentialKey` to `google_drive_access_token`.\n\n## Prerequisites\n\nGoogle Drive must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Drive from Settings, or to\nset the `google_drive_access_token` credential.\n\n## Base URL\n\n`https://www.googleapis.com/drive/v3`\n\nAlways pass a `fields` mask on list/get calls — default payloads are huge. Keep `pageSize` small (5–10) unless the user asks for more.\n\n## Common Operations\n\n### List recent files\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"pageSize\": 5,\n \"orderBy\": \"modifiedTime desc\",\n \"fields\": \"files(id,name,mimeType,modifiedTime,webViewLink),nextPageToken\"\n }\n}\n```\n\n### Search by name\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"q\": \"name contains 'roadmap' and trashed = false\",\n \"pageSize\": 5,\n \"fields\": \"files(id,name,mimeType,modifiedTime,webViewLink),nextPageToken\"\n }\n}\n```\n\nOther useful `q` recipes: folders only → `mimeType = 'application/vnd.google-apps.folder' and trashed = false`; inside a folder → `'{folderId}' in parents and trashed = false`.\n\n### Get file metadata\n\nOnly when the `fileId` is known — list/search first instead of guessing ids.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"fields\": \"id,name,mimeType,size,modifiedTime,owners(displayName,emailAddress),webViewLink\"\n }\n}\n```\n\n### Export Google Doc as plain text\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}/export\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": { \"mimeType\": \"text/plain\" }\n}\n```\n\n### Rename or move a file to trash\n\n`PATCH` with only the fields to change.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"PATCH\",\n \"body\": { \"trashed\": true }\n}\n```\n\n## MIME Types Reference\n\n- Google Docs: `application/vnd.google-apps.document` — export as `text/plain`\n- Google Sheets: `application/vnd.google-apps.spreadsheet` — export as `text/csv`\n- Google Slides: `application/vnd.google-apps.presentation` — export as `text/plain`\n- Folder: `application/vnd.google-apps.folder`\n\n## Output Policy\n\n- For lists, show name, type, and last modified; limit to 5 files unless asked for more.\n- When `webViewLink` is available, render the file name as a Markdown link to it — `[name](webViewLink)`. Never present the URL bare or wrapped in backticks, or it won't be clickable.\n- Never attempt to download large binary files; export text content instead.\n- Confirm before trashing files; show the file name so the user can verify.\n\n## Common Mistakes\n\n- Calling `files.list` without a `fields` mask — payloads are huge by default.\n- Calling `files.get` with a guessed file id — list/search first.\n- Downloading binaries instead of exporting text.\n",
44
+ "google-drive/SKILL.md": "---\nname: google-drive\ndescription: Search, list, download metadata, and manage Google Drive files and folders via the Google Drive REST API.\ntools: [http_request, drive_create_folder, drive_trash]\nplatform: [darwin, linux, win32]\ncredentials: [google_drive_access_token]\nallow_list: [https://www.googleapis.com/drive/v3/]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Google Drive\",\n \"provider\": \"google\",\n \"credentialKey\": \"google_drive_access_token\",\n \"description\": \"Search, list, and manage Google Drive files and folders\",\n \"steps\": [\n \"Click Connect and approve access in the browser. Approving grants access to your Drive files only.\",\n \"Each Google skill is connected separately, with its own app and its own approval.\"\n ],\n \"configSteps\": [\n \"[Open Google Cloud Console](https://console.cloud.google.com/flows/enableapi?apiid=drive.googleapis.com) to enable the Google Drive API\",\n \"[Open OAuth clients](https://console.cloud.google.com/auth/clients) to create an OAuth client — choose \\\"Desktop app\\\" as the type\",\n \"[Open OAuth audience](https://console.cloud.google.com/auth/audience) and add your Google account as a test user\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"OAuth client ID from your app\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"Client Secret\",\n \"secret\": true\n }\n ],\n \"oauth\": {\n \"stateKey\": \"google_drive_oauth\",\n \"authUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"tokenAuth\": \"secret-in-body\",\n \"port\": 18978,\n \"scopes\": [\n \"https://www.googleapis.com/auth/drive\"\n ],\n \"extraAuthParams\": {\n \"access_type\": \"offline\",\n \"prompt\": \"consent\"\n }\n }\n }\n ]\n }\n }\n }\n---\n\n# Google Drive\n\nUse `drive_create_folder` to create folders and `drive_trash` to trash files; use `http_request` for everything else (list, search, get, export, rename). For each `http_request`, set `auth.tokenCredentialKey` to `google_drive_access_token`.\n\n## Prerequisites\n\nGoogle Drive must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Drive from Settings, or to\nset the `google_drive_access_token` credential.\n\n## Base URL\n\n`https://www.googleapis.com/drive/v3`\n\nAlways pass a `fields` mask on list/get calls — default payloads are huge. Keep `pageSize` small (5–10) unless the user asks for more.\n\n## Common Operations\n\n### List recent files\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"pageSize\": 5,\n \"orderBy\": \"modifiedTime desc\",\n \"fields\": \"files(id,name,mimeType,modifiedTime,webViewLink),nextPageToken\"\n }\n}\n```\n\n### Search by name\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"q\": \"name contains 'roadmap' and trashed = false\",\n \"pageSize\": 5,\n \"fields\": \"files(id,name,mimeType,modifiedTime,webViewLink),nextPageToken\"\n }\n}\n```\n\nOther useful `q` recipes: folders only → `mimeType = 'application/vnd.google-apps.folder' and trashed = false`; inside a folder → `'{folderId}' in parents and trashed = false`.\n\n### Get file metadata\n\nOnly when the `fileId` is known — list/search first instead of guessing ids.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"fields\": \"id,name,mimeType,size,modifiedTime,owners(displayName,emailAddress),webViewLink\"\n }\n}\n```\n\n### Export Google Doc as plain text\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}/export\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"GET\",\n \"query\": { \"mimeType\": \"text/plain\" }\n}\n```\n\n### Rename or move a file to trash\n\n`PATCH` with only the fields to change.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_drive_access_token\" },\n \"method\": \"PATCH\",\n \"body\": { \"trashed\": true }\n}\n```\n\n## MIME Types Reference\n\n- Google Docs: `application/vnd.google-apps.document` — export as `text/plain`\n- Google Sheets: `application/vnd.google-apps.spreadsheet` — export as `text/csv`\n- Google Slides: `application/vnd.google-apps.presentation` — export as `text/plain`\n- Folder: `application/vnd.google-apps.folder`\n\n## Output Policy\n\n- For lists, show name, type, and last modified; limit to 5 files unless asked for more.\n- When `webViewLink` is available, render the file name as a Markdown link to it — `[name](webViewLink)`. Never present the URL bare or wrapped in backticks, or it won't be clickable.\n- Never attempt to download large binary files; export text content instead.\n- Confirm before trashing files; show the file name so the user can verify.\n\n## Common Mistakes\n\n- Calling `files.list` without a `fields` mask — payloads are huge by default.\n- Calling `files.get` with a guessed file id — list/search first.\n- Downloading binaries instead of exporting text.\n",
45
45
  "google-drive/operations.json": "{\n \"operations\": [\n {\n \"tool\": \"drive_create_folder\",\n \"description\": \"Create a Google Drive folder, optionally inside a parent folder.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\", \"description\": \"Folder name\" },\n \"parentId\": {\n \"type\": \"string\",\n \"description\": \"Parent folder id; omit for the Drive root\"\n }\n },\n \"required\": [\"name\"]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"builder\": \"drive-create-folder\"\n }\n },\n {\n \"tool\": \"drive_trash\",\n \"description\": \"Move a Google Drive file or folder to the trash. Confirm the file name with the user first; list or search for the id, never guess it.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"fileId\": { \"type\": \"string\", \"description\": \"File id from a previous files.list\" }\n },\n \"required\": [\"fileId\"]\n },\n \"request\": {\n \"method\": \"PATCH\",\n \"url\": \"https://www.googleapis.com/drive/v3/files/{fileId}\",\n \"builder\": \"drive-trash\"\n }\n }\n ]\n}\n",
46
- "google-sheets/SKILL.md": "---\nname: google-sheets\ndescription: Create, read, and update Google Sheets spreadsheets via the Google Sheets REST API.\ntools: [http_request, sheets_create, sheets_write_values, sheets_append_values]\nplatform: [darwin, linux, win32]\ncredentials: [google_sheets_access_token]\nallow_list:\n [https://sheets.googleapis.com/v4/spreadsheets, https://www.googleapis.com/drive/v3/files]\n---\n\n# Google Sheets\n\nUse `sheets_create`, `sheets_write_values`, and `sheets_append_values` for\ncreating and writing cells — they set `valueInputOption` for you. Use\n`http_request` for everything else (reads, `batchUpdate`, Drive search, trash).\nFor each `http_request`, set `auth.tokenCredentialKey` to\n`google_sheets_access_token`. Call one tool per operation with one complete structured\nobject; `body` and `values` are JSON values, never serialized strings.\n\n## Load the Recipe File First\n\nThis file carries no requests. The working calls live in three reference\nfiles — load the one for the job with the `skill` tool BEFORE calling any tool,\nthen copy its call and change only the values:\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing.\n\n- **Reading or finding spreadsheets** — \"what's in the sheet\", \"show me the\n values\", \"find / list my spreadsheets\": call the `skill` tool with\n `name: \"google-sheets\"` and `file: \"references/read.md\"`.\n- **Creating a new spreadsheet** (no existing spreadsheet involved; may fill\n it with a first table): call the `skill` tool with `name: \"google-sheets\"`\n and `file: \"references/create.md\"`.\n- **Changing an existing spreadsheet** — write or overwrite cells, append rows,\n clear a range, add a sheet tab, other structural changes, move it to the\n trash: call the `skill` tool with `name: \"google-sheets\"` and\n `file: \"references/edit.md\"`.\n\nNever write a call from memory. The recipes carry the range rules and the\nexact request shapes that fail in non-obvious ways when improvised; loading\nthe file is one cheap read-only call.\n\n## Prerequisites\n\nGoogle Sheets must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Sheets from Settings, or to\nset the `google_sheets_access_token` credential.\n\n## Identifiers and Ranges\n\nSpreadsheets are identified by `spreadsheetId` — the alphanumeric string in the\nURL `docs.google.com/spreadsheets/d/{spreadsheetId}/...`, or the `id` of a\n`sheets_create` result or Drive search hit. Listing and searching use the\nGoogle Drive API, not the Sheets API.\n\nRanges use A1 notation: `Sheet1!A1`, `Sheet1!A1:B10`, `Sheet1!A:A` (entire\ncolumn), `Sheet1!1:1` (entire row); quote sheet names with spaces:\n`'My Sheet'!A1`. The first sheet of a spreadsheet is NOT always called\n`Sheet1` — Google names it in the account's language (`Página1`, `Feuille1`,\n`Tabellenblatt1`, …). A range with no sheet name (`A1:C3`) always targets the\nfirst sheet; the recipe files say when to use it.\n\n## Output Policy\n\n- For reads, present values in a table format with headers when available.\n- For writes, confirm the range and values with the user first unless they\n already spelled them out.\n- Report success only when the response contains the `spreadsheetId` and the\n updated range, and name the spreadsheet (title or link) in the answer.\n",
46
+ "google-sheets/SKILL.md": "---\nname: google-sheets\ndescription: Create, read, and update Google Sheets spreadsheets via the Google Sheets REST API.\ntools: [http_request, sheets_create, sheets_write_values, sheets_append_values]\nplatform: [darwin, linux, win32]\ncredentials: [google_sheets_access_token]\nallow_list:\n [https://sheets.googleapis.com/v4/spreadsheets, https://www.googleapis.com/drive/v3/files]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Google Sheets\",\n \"provider\": \"google\",\n \"credentialKey\": \"google_sheets_access_token\",\n \"description\": \"Create, read, and update Google Sheets spreadsheets\",\n \"steps\": [\n \"Click Connect and approve access in the browser. Approving grants access to your spreadsheets and Drive files only.\",\n \"Each Google skill is connected separately, with its own app and its own approval.\"\n ],\n \"configSteps\": [\n \"[Open Google Cloud Console](https://console.cloud.google.com/flows/enableapi?apiid=sheets.googleapis.com,drive.googleapis.com) to enable the Google Sheets API\",\n \"[Open OAuth clients](https://console.cloud.google.com/auth/clients) to create an OAuth client — choose \\\"Desktop app\\\" as the type\",\n \"[Open OAuth audience](https://console.cloud.google.com/auth/audience) and add your Google account as a test user\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"OAuth client ID from your app\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"Client Secret\",\n \"secret\": true\n }\n ],\n \"oauth\": {\n \"stateKey\": \"google_sheets_oauth\",\n \"authUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"tokenAuth\": \"secret-in-body\",\n \"port\": 18978,\n \"scopes\": [\n \"https://www.googleapis.com/auth/spreadsheets\",\n \"https://www.googleapis.com/auth/drive\"\n ],\n \"extraAuthParams\": {\n \"access_type\": \"offline\",\n \"prompt\": \"consent\"\n }\n }\n }\n ]\n }\n }\n }\n---\n\n# Google Sheets\n\nUse `sheets_create`, `sheets_write_values`, and `sheets_append_values` for\ncreating and writing cells — they set `valueInputOption` for you. Use\n`http_request` for everything else (reads, `batchUpdate`, Drive search, trash).\nFor each `http_request`, set `auth.tokenCredentialKey` to\n`google_sheets_access_token`. Call one tool per operation with one complete structured\nobject; `body` and `values` are JSON values, never serialized strings.\n\n## Load the Recipe File First\n\nThis file carries no requests. The working calls live in three reference\nfiles — load the one for the job with the `skill` tool BEFORE calling any tool,\nthen copy its call and change only the values:\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing.\n\n- **Reading or finding spreadsheets** — \"what's in the sheet\", \"show me the\n values\", \"find / list my spreadsheets\": call the `skill` tool with\n `name: \"google-sheets\"` and `file: \"references/read.md\"`.\n- **Creating a new spreadsheet** (no existing spreadsheet involved; may fill\n it with a first table): call the `skill` tool with `name: \"google-sheets\"`\n and `file: \"references/create.md\"`.\n- **Changing an existing spreadsheet** — write or overwrite cells, append rows,\n clear a range, add a sheet tab, other structural changes, move it to the\n trash: call the `skill` tool with `name: \"google-sheets\"` and\n `file: \"references/edit.md\"`.\n\nNever write a call from memory. The recipes carry the range rules and the\nexact request shapes that fail in non-obvious ways when improvised; loading\nthe file is one cheap read-only call.\n\n## Prerequisites\n\nGoogle Sheets must be connected. Each Google skill is connected separately, with its\nown app and its own approval — connecting one grants nothing to the others. If\ncredentials are missing, tell the user to connect Google Sheets from Settings, or to\nset the `google_sheets_access_token` credential.\n\n## Identifiers and Ranges\n\nSpreadsheets are identified by `spreadsheetId` — the alphanumeric string in the\nURL `docs.google.com/spreadsheets/d/{spreadsheetId}/...`, or the `id` of a\n`sheets_create` result or Drive search hit. Listing and searching use the\nGoogle Drive API, not the Sheets API.\n\nRanges use A1 notation: `Sheet1!A1`, `Sheet1!A1:B10`, `Sheet1!A:A` (entire\ncolumn), `Sheet1!1:1` (entire row); quote sheet names with spaces:\n`'My Sheet'!A1`. The first sheet of a spreadsheet is NOT always called\n`Sheet1` — Google names it in the account's language (`Página1`, `Feuille1`,\n`Tabellenblatt1`, …). A range with no sheet name (`A1:C3`) always targets the\nfirst sheet; the recipe files say when to use it.\n\n## Output Policy\n\n- For reads, present values in a table format with headers when available.\n- For writes, confirm the range and values with the user first unless they\n already spelled them out.\n- Report success only when the response contains the `spreadsheetId` and the\n updated range, and name the spreadsheet (title or link) in the answer.\n",
47
47
  "google-sheets/operations.json": "{\n \"operations\": [\n {\n \"tool\": \"sheets_create\",\n \"description\": \"Create an empty Google Sheets spreadsheet. The response id is the spreadsheetId for later writes.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\", \"description\": \"Spreadsheet name\" }\n },\n \"required\": [\"name\"]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"builder\": \"sheets-create\"\n }\n },\n {\n \"tool\": \"sheets_write_values\",\n \"description\": \"Overwrite cells in a range with a 2D array of rows. The range must match the data dimensions or be a single top-left cell. valueInputOption defaults to USER_ENTERED (formulas and dates are parsed).\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"spreadsheetId\": { \"type\": \"string\", \"description\": \"Spreadsheet id\" },\n \"range\": {\n \"type\": \"string\",\n \"description\": \"A1 notation. Omit the sheet name to target the first sheet whatever its language (e.g. A1); name a sheet only for another tab, quoted if it has spaces (e.g. 'My Sheet'!A1)\"\n },\n \"values\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"array\",\n \"items\": { \"type\": [\"string\", \"number\", \"boolean\", \"null\"] }\n },\n \"description\": \"Rows of cell values\"\n },\n \"valueInputOption\": {\n \"type\": \"string\",\n \"enum\": [\"RAW\", \"USER_ENTERED\"],\n \"description\": \"RAW inserts values as-is; USER_ENTERED parses formulas and dates\"\n }\n },\n \"required\": [\"spreadsheetId\", \"range\", \"values\"]\n },\n \"request\": {\n \"method\": \"PUT\",\n \"url\": \"https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}\",\n \"builder\": \"sheets-write-values\"\n }\n },\n {\n \"tool\": \"sheets_append_values\",\n \"description\": \"Append rows after the last row of data in a range. valueInputOption defaults to USER_ENTERED.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"spreadsheetId\": { \"type\": \"string\", \"description\": \"Spreadsheet id\" },\n \"range\": {\n \"type\": \"string\",\n \"description\": \"A1 notation of the table's columns to append to. Omit the sheet name for the first sheet (e.g. A:C); name a sheet only for another tab (e.g. 'My Sheet'!A:C)\"\n },\n \"values\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"array\",\n \"items\": { \"type\": [\"string\", \"number\", \"boolean\", \"null\"] }\n },\n \"description\": \"Rows of cell values\"\n },\n \"valueInputOption\": {\n \"type\": \"string\",\n \"enum\": [\"RAW\", \"USER_ENTERED\"]\n }\n },\n \"required\": [\"spreadsheetId\", \"range\", \"values\"]\n },\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append\",\n \"builder\": \"sheets-append-values\"\n }\n }\n ]\n}\n",
48
48
  "google-sheets/references/create.md": "# Creating a Spreadsheet\n\nTwo tool calls: `sheets_create` makes the file, `sheets_write_values` fills\nit. Typed tools select their own credential.\n\n## Create the spreadsheet\n\n```json\n{ \"name\": \"My Spreadsheet\" }\n```\n\nCall `sheets_create` with that object. The result's `id` is the\n`spreadsheetId`. Capture it and keep using it. Create exactly once — never\nfollow a successful create with a Drive search or another create to rediscover\nthe id.\n\n## Fill it with a first table\n\nCall `sheets_write_values`. `values` is an array of rows; every row is an array\nof cells. Use the range `A1` with NO sheet name: the new file's only sheet is\nnamed in the account's language (`Sheet1`, `Página1`, `Feuille1`, …), and a\nrange without a sheet name always targets the first sheet, so the write cannot\nfail on the name.\n\n```json\n{\n \"spreadsheetId\": \"<id from sheets_create>\",\n \"range\": \"A1\",\n \"values\": [\n [\"Name\", \"Age\"],\n [\"Alice\", 30],\n [\"Bob\", 25]\n ]\n}\n```\n\n`valueInputOption` defaults to `USER_ENTERED` (formulas, numbers and dates are\nparsed like typing them in); pass `\"valueInputOption\": \"RAW\"` only to store\nevery value exactly as given. The response reports `updatedRange` and\n`updatedCells` — that is the confirmation.\n\n## Finishing\n\nAnswer with the spreadsheet name and the link\n`https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit`. Do not read the\nvalues back to \"confirm\" a write that already reported `updatedCells`.\n\n## Common Mistakes\n\n- Writing to `Sheet1!A1` on a freshly created file — if the account's language\n is not English the sheet is not called `Sheet1` and the write fails with\n `Unable to parse range`. Use `A1` without a sheet name.\n- Creating through `http_request` — `sheets_create` is the supported path.\n- Passing `values` as a string, or rows that are not arrays.\n",
49
49
  "google-sheets/references/edit.md": "# Editing an Existing Spreadsheet\n\nCell writes use the typed tools `sheets_write_values` (overwrite) and\n`sheets_append_values` (add rows) — they set `valueInputOption` for you.\nEverything else (clear, structural changes, trash) is one `http_request` with\na structured object. For each `http_request`, set `auth.tokenCredentialKey` to `google_sheets_access_token`. Get the `spreadsheetId` from the URL the user gave, an earlier\n`sheets_create` result, or a Drive search (`references/read.md`).\n\nRanges: a range with no sheet name (`A1`, `A2:B10`) targets the first sheet\nwhatever its language. Name a sheet only for another tab, quoted if it has\nspaces (`'My Sheet'!A1`).\n\n## Overwrite cells\n\nCall `sheets_write_values`. The range is the top-left cell; the values block\ngrows from there. `values` is an array of rows, each an array of cells.\n\n```json\n{\n \"spreadsheetId\": \"<id>\",\n \"range\": \"A1\",\n \"values\": [\n [\"Name\", \"Age\"],\n [\"Alice\", 30],\n [\"Bob\", 25]\n ]\n}\n```\n\nTo change one cell, use that cell as the range with a single-row, single-cell\n`values` array (`\"range\": \"B2\", \"values\": [[\"100\"]]`). Pass\n`\"valueInputOption\": \"RAW\"` only to store values exactly as given; the default\n`USER_ENTERED` parses formulas, numbers and dates.\n\n## Append rows\n\nCall `sheets_append_values` with the range of the table the rows belong to\n(its columns, not the empty row you expect); the API finds the first empty row\nafter that table.\n\n```json\n{\n \"spreadsheetId\": \"<id>\",\n \"range\": \"A:B\",\n \"values\": [\n [\"Charlie\", 28],\n [\"Diana\", 32]\n ]\n}\n```\n\n## Clear a range\n\n```json\n{\n \"url\": \"https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/A2:B10:clear\",\n \"auth\": { \"tokenCredentialKey\": \"google_sheets_access_token\" },\n \"method\": \"POST\",\n \"body\": {}\n}\n```\n\n## Structural changes (batchUpdate)\n\nAdding or removing sheets, resizing, formatting, and other structural\noperations use `batchUpdate`; its items are always wrapped in\n`{ \"requests\": [ … ] }`, and cell values never go through it:\n\n```json\n{\n \"url\": \"https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate\",\n \"auth\": { \"tokenCredentialKey\": \"google_sheets_access_token\" },\n \"method\": \"POST\",\n \"body\": {\n \"requests\": [\n {\n \"addSheet\": {\n \"properties\": { \"title\": \"New Sheet\", \"sheetType\": \"GRID\" }\n }\n }\n ]\n }\n}\n```\n\nRequests that target a sheet by `sheetId` (delete, resize, format) need the\nnumeric id from the metadata call in `references/read.md`, not the tab name.\n\n## Move a spreadsheet to the trash\n\nTrashing goes through the Drive API; the user can restore it from Drive's\ntrash. Only do this when the user explicitly asks to delete or remove the\nspreadsheet.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files/{spreadsheetId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_sheets_access_token\" },\n \"method\": \"PATCH\",\n \"body\": { \"trashed\": true }\n}\n```\n\n## If a range is rejected\n\n`400 Unable to parse range: Sheet1!A1` means the spreadsheet has no sheet\ncalled `Sheet1` — Google names the first sheet in the account's language. Do\nNOT retry the same range: drop the sheet name, or GET the metadata\n(`references/read.md`) for the real title.\n\n## Finishing\n\nA write is confirmed by `updatedRange`/`updatedCells` (or `updates` for\nappend, `replies` for batchUpdate) in the response — do not read the values\nback to check. Name the spreadsheet in the answer.\n\n## Common Mistakes\n\n- Writing cell values with `http_request` PUT or with `batchUpdate` — use the\n typed tools.\n- Naming a sheet that does not exist (`Sheet1!…` on a non-English account) —\n leave the sheet name out for the first sheet.\n- Appending to an empty row range instead of the table's columns.\n- Passing `values` as a string, or rows that are not arrays.\n",
50
50
  "google-sheets/references/read.md": "# Reading and Finding Spreadsheets\n\nReads go through `http_request` with a structured object. For each request, set `auth.tokenCredentialKey` to `google_sheets_access_token`.\n\n## Get values from a range\n\nAlways specify `valueRenderOption`: `FORMATTED_VALUE` for displayed values\n(formulas evaluated) or `UNFORMATTED_VALUE` for raw cell content.\n\n```json\n{\n \"url\": \"https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/A1:C10\",\n \"auth\": { \"tokenCredentialKey\": \"google_sheets_access_token\" },\n \"method\": \"GET\",\n \"query\": { \"valueRenderOption\": \"FORMATTED_VALUE\" }\n}\n```\n\nA range with no sheet name (`A1:C10`) reads the first sheet whatever its\nlanguage; add a sheet name only for another tab, quoted if it has spaces\n(`'My Sheet'!A1:C10`). The response contains a `values` array of rows; each row\nis an array of cell strings. Trailing empty cells are omitted, so rows can\ndiffer in length. To read everything on the first sheet, GET the spreadsheet\nmetadata below for the tab title and use it alone as the range. Present the\nrows as a table with the first row as headers when it looks like one.\n\n## Get spreadsheet metadata (sheet names)\n\nWhen you need the tab names or their numeric ids before a follow-up call:\n\n```json\n{\n \"url\": \"https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}\",\n \"auth\": { \"tokenCredentialKey\": \"google_sheets_access_token\" },\n \"method\": \"GET\",\n \"query\": { \"fields\": \"spreadsheetId,properties.title,sheets.properties\" }\n}\n```\n\n## List or search for spreadsheets\n\nUse the Google Drive API with a MIME type filter to find spreadsheets by name.\nThe `spreadsheetId` you need for a follow-up call is the file `id`.\n\n```json\n{\n \"url\": \"https://www.googleapis.com/drive/v3/files\",\n \"auth\": { \"tokenCredentialKey\": \"google_sheets_access_token\" },\n \"method\": \"GET\",\n \"query\": {\n \"q\": \"mimeType='application/vnd.google-apps.spreadsheet' and name contains 'budget' and trashed = false\",\n \"pageSize\": 10,\n \"fields\": \"files(id,name,modifiedTime,webViewLink)\"\n }\n}\n```\n\nTo list recent spreadsheets without a name filter, drop the `and name contains …`\nclause and add `\"orderBy\": \"modifiedTime desc\"`. Run the search ONCE; if it\nreturns nothing, say so rather than retrying with variations.\n\n## If a range is rejected\n\n`400 Unable to parse range: Sheet1!A1` means the spreadsheet has no sheet\ncalled `Sheet1` — Google names the first sheet in the account's language. Do\nNOT retry the same range: drop the sheet name (`A1:C10`) or take the real title\nfrom the metadata call above.\n\n## Common Mistakes\n\n- Using the wrong MIME type when searching (should be\n `application/vnd.google-apps.spreadsheet`).\n- Reading values through the Drive API — cell values come only from the Sheets\n API `values` endpoint.\n",
51
51
  "image-generation/SKILL.md": "---\nname: image-generation\ndescription: Generate images from text prompts with the local diffusion model.\ntools: [generate_image, edit_image]\nplatform: [darwin, linux, win32]\n---\n\n# Image generation\n\nCall `generate_image` when the user asks for an image, picture, illustration,\ndrawing, or logo. The generated image is saved as a chat attachment and shown\nto the user automatically — never describe pixels, paste data, or apologize\nabout being text-only; just confirm what you generated.\n\n```json\n{ \"prompt\": \"a watercolor cat on a windowsill, soft morning light\" }\n```\n\n## Parameters\n\n- `prompt` (required) — describe subject, style, and mood in plain language.\n- `width` / `height` — pixels, multiples of 64, max 1024. Default 512×512;\n only change them when the user asks for a specific shape (e.g. wide banner\n → 1024×512).\n- `negative_prompt` — what to avoid (e.g. `blurry, low quality, watermark`).\n- `seed` — set only when the user wants a reproducible or slightly varied\n retry of a previous result.\n- `steps` — leave unset unless the user asks for a faster draft (lower) or\n higher quality (higher, max 100).\n\n## Editing an existing image\n\nCall `edit_image` when the user wants an image from this chat modified,\nrestyled, or varied (\"make it a watercolor\", \"same but at night\"). It edits\nthe most recent image by default; pass `attachment_id` (from an earlier\nresult) to target another. `strength` 0..1 sets how far to move from the\nsource: 0.3-0.5 for subtle changes, 0.7 (default) for restyling, 0.9 for\nloose reinterpretation. Output keeps the source dimensions.\n\n```json\n{ \"prompt\": \"turn it into a watercolor painting\", \"strength\": 0.7 }\n```\n\n## Notes\n\n- Generation takes a while; the result arrives as an attachment in this turn.\n- One generation or edit at a time — if the tool reports it is busy, wait and\n retry instead of stacking calls.\n",
52
52
  "music-generation/SKILL.md": "---\nname: music-generation\ndescription: Create original music from an idea, mood, scene, or lyrics. Make complete tracks, with instrumentals, vocals and variations in any music style.\ntools: [generate_music]\nplatform: [darwin, linux, win32]\n---\n\n# Music generation\n\nCall `generate_music` when the user asks for a song, track, beat, melody,\njingle, background music, or any generated audio. The result is saved as a chat\nattachment and played to the user automatically — never describe waveforms,\npaste data, or apologize about being text-only; just confirm what you generated.\nMatch your description to the tool result's `instrumental` flag: never tell the\nuser a track has vocals when it came back instrumental.\n\n```json\n{\n \"prompt\": \"lo-fi hip hop, mellow piano, soft drums, warm bass\",\n \"title\": \"midnight study session\"\n}\n```\n\n## Instrumental or sung\n\nVocals come from the `lyrics` argument. It is the only switch that makes the\nmodel sing: a voice cue in the `prompt` (e.g. \"male vocals\") only sets the voice\ntimbre, and with no `lyrics` the track is always instrumental, whatever the\nprompt says.\n\n- **Instrumental, background music, or a beat with no singing**: omit `lyrics`\n entirely. That produces an instrumental (the model's default).\n- **A song with singing, vocals, or words**: you must pass `lyrics`, structured\n with `[verse]` / `[chorus]` tags. Name who sings with a tag in the `prompt`\n (`male vocal`, `female vocal`, or for a duet `male and female duet, harmonized\n vocals`) to set the voice, and set `vocalLanguage` when the user names a\n language.\n- **The user wants singing but gave no words**: write short `[verse]` /\n `[chorus]` lyrics yourself from their topic and pass them as `lyrics`. Never\n leave `lyrics` empty for a sung request, or the track comes out instrumental.\n\nSet `duration` when the user asks for a specific length (\"30 seconds\", \"a\ntwo-minute track\"); otherwise leave it unset and let the model choose.\n\n## Parameters\n\n- `prompt` (required) - describe the genre, instruments, mood, and vocal\n arrangement in plain language. It is the caption ACE-Step reads for the sound\n and the voice timbre, so name who sings here; the singing itself still needs\n `lyrics` (see \"Instrumental or sung\").\n- `title` — a short, descriptive song title (2 to 5 words) used to name the\n saved audio file. Set it whenever you generate a track so the download has a\n human-readable name; keep it plain and omit any file extension. Without it the\n file falls back to a slug of the `prompt`.\n- `lyrics` - the sung words, and the switch that turns vocals on. Omit for an\n instrumental (the default). Structure them with `[verse]` / `[chorus]` tags. A\n voice cue in the `prompt` alone does not sing; vocals need `lyrics` here.\n- `vocalLanguage` — the language the vocals are sung in, as a short code\n (`en`, `es`, `de`, `it`, …). Set it when the user names a language; it only\n applies with lyrics and defaults to English.\n- `duration` — approximate length in seconds. Leave unset to let the model\n choose; set it only when the user asks for a specific length. The model rounds\n to its own frame grid, so the clip may be slightly shorter or longer.\n- `seed` — set only when the user wants a reproducible or slightly varied retry\n of a previous result; `-1` or omitted is random.\n- `bpm` — tempo in beats per minute; set it when the user names a tempo.\n- `keyscale` — musical key and scale (e.g. `C minor`, `A major`), when named.\n- `timesignature` — meter (e.g. `4/4`, `3/4`), when the user names one.\n\n## Notes\n\n- Generation takes a while; the result arrives as an attachment in this turn.\n- One generation at a time — if the tool reports it is busy, wait and retry\n instead of stacking calls.\n- The first use downloads several gigabytes of model weights; that happens once,\n before the first track is produced.\n",
53
- "notion/SKILL.md": "---\nname: notion\ndescription: Notion pages, databases, and blocks — search, read, create, update, and comment via the official Notion MCP server.\ntools: [mcp_call, notion_create_page, notion_insert_content]\nplatform: [darwin, linux, win32, ios, android]\ncredentials: [notion_mcp_access_token]\nallow_list: [https://mcp.notion.com/mcp]\nmcp_reads:\n [\n notion-search,\n notion-fetch,\n notion-get-comments,\n notion-get-teams,\n notion-get-users,\n notion-get-async-task,\n notion-query-data-sources\n ]\n---\n\n# Notion\n\nTwo typed tools cover the most common writes and are called directly, like `skill`: `notion_create_page` creates a page and `notion_insert_content` adds text to one. Everything else is one `mcp_call` against `https://mcp.notion.com/mcp` with the **tool name as `method`** and its **args as `params`** — the JSON-RPC envelope, session handshake, and bearer token are handled for you. Do **not** build a `{name, arguments}` envelope, pass a `sessionId`, or call `initialize`/`notifications/initialized`/`tools/list`.\n\n```json\n{\n \"url\": \"https://mcp.notion.com/mcp\",\n \"method\": \"notion-search\",\n \"params\": { \"query\": \"Q4 roadmap\", \"page_size\": 5 }\n}\n```\n\nRules that hold for every call:\n\n- `params` is a JSON object, never a string.\n- Page, database, and view ids come from a URL the user gave or from a previous result — never invented.\n- A page title is always a plain string: `\"properties\": { \"title\": \"The title\" }` when creating several pages or renaming one.\n- Deleting or archiving a page is not possible through this connection — say so instead of improvising (details in `references/pages.md`).\n- A `401` status means Notion isn't connected — tell the user to connect \"Notion\" from the skill's setup; do not drive OAuth yourself. An \"object not found\" / no-access error means the connection can't see that object — tell the user to share the page or database with the Notion connection.\n\n## Finding pages\n\nThere is no \"list all\" — `notion-search` is the entry point and `query` is required (min length 1). For a broad overview pass a keyword from the request, and always bound results with a small `page_size`. Each result carries `title`, `url`, and `id`. Results are ranked by semantic similarity, not by title — when one result's title matches the requested name (case-insensitive), take that one even if it isn't first. When the user named a specific page and no title matches, list the candidates as `[title](url)` and ask instead of guessing. Search once per request; do not re-run it with variations.\n\n`notion-search` knows nothing about the connected identity — for \"who am I\" / \"which workspace\" call `notion-fetch` with `id: \"self\"` (see `references/pages.md`).\n\n## Load the Recipe File First\n\nThis file carries no other calls. The tool tables and working calls live in four reference files — load the one for the job with the `skill` tool BEFORE calling a Notion tool, then copy its call and change only the values. Each load is a real `skill` tool call — printing the call as JSON or text in your reply loads nothing.\n\n- **Pages** — read or summarize a page, \"who am I / which workspace\", create a page, add / change / replace text, rename or set a property, delete / archive (and why it cannot), move, duplicate: call the `skill` tool with `name: \"notion\"` and `file: \"references/pages.md\"`.\n- **Databases, data sources and views** — create a database, add a row, read a database's schema, query or filter rows, create or change a view: call the `skill` tool with `name: \"notion\"` and `file: \"references/databases.md\"`.\n- **Comments** (also people and teamspaces) — read or add a comment, list workspace members, look up a user, list teamspaces: call the `skill` tool with `name: \"notion\"` and `file: \"references/comments.md\"`.\n- **Async tasks** — a result carried a `task_id`, or the user asks whether a duplicate / large write finished: call the `skill` tool with `name: \"notion\"` and `file: \"references/tasks.md\"`.\n\nNever write a call from memory. Each tool's arguments have one exact shape (`command` + its single companion field, `data.mode` + its fields) and the server rejects anything else; loading the file is one cheap read-only call. After the file is loaded, your next output is the tool call — no further loads.\n\n## Output\n\n- Show page titles and IDs together. When a result carries a `url`, render the title as a Markdown link — `[title](url)` — never bare or in backticks, or it won't be clickable.\n- For query results, lead with counts/rollups if present, then rows — don't dump the raw structured response. Surface user-visible property names, not IDs.\n- If a query tool responds with an upgrade prompt, tell the user their plan doesn't support it (single-source needs Business+Notion AI, multi-source needs Enterprise+Notion AI) — don't retry.\n",
53
+ "notion/SKILL.md": "---\nname: notion\ndescription: Notion pages, databases, and blocks — search, read, create, update, and comment via the official Notion MCP server.\ntools: [mcp_call, notion_create_page, notion_insert_content]\nplatform: [darwin, linux, win32, ios, android]\ncredentials: [notion_mcp_access_token]\nallow_list: [https://mcp.notion.com/mcp]\nmcp_reads:\n [\n notion-search,\n notion-fetch,\n notion-get-comments,\n notion-get-teams,\n notion-get-users,\n notion-get-async-task,\n notion-query-data-sources\n ]\nmetadata:\n {\n \"openclaw\": {\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Notion\",\n \"provider\": \"notion\",\n \"credentialKey\": \"notion_mcp_access_token\",\n \"description\": \"Pages, databases, and blocks\",\n \"steps\": [\n \"Click Connect and approve access in the browser — Workbench uses Notion's hosted MCP OAuth, so no app credentials are needed.\"\n ],\n \"oauth\": {\n \"stateKey\": \"notion_oauth\",\n \"authUrl\": \"https://mcp.notion.com/authorize\",\n \"tokenUrl\": \"https://mcp.notion.com/token\",\n \"tokenAuth\": \"pkce-only\",\n \"port\": 18982,\n \"registrationEndpoint\": \"https://mcp.notion.com/register\",\n \"sharedIosSession\": true,\n \"scopes\": []\n }\n }\n ]\n }\n }\n }\n---\n\n# Notion\n\nTwo typed tools cover the most common writes and are called directly, like `skill`: `notion_create_page` creates a page and `notion_insert_content` adds text to one. Everything else is one `mcp_call` against `https://mcp.notion.com/mcp` with the **tool name as `method`** and its **args as `params`** — the JSON-RPC envelope, session handshake, and bearer token are handled for you. Do **not** build a `{name, arguments}` envelope, pass a `sessionId`, or call `initialize`/`notifications/initialized`/`tools/list`.\n\n```json\n{\n \"url\": \"https://mcp.notion.com/mcp\",\n \"method\": \"notion-search\",\n \"params\": { \"query\": \"Q4 roadmap\", \"page_size\": 5 }\n}\n```\n\nRules that hold for every call:\n\n- `params` is a JSON object, never a string.\n- Page, database, and view ids come from a URL the user gave or from a previous result — never invented.\n- A page title is always a plain string: `\"properties\": { \"title\": \"The title\" }` when creating several pages or renaming one.\n- Deleting or archiving a page is not possible through this connection — say so instead of improvising (details in `references/pages.md`).\n- A `401` status means Notion isn't connected — tell the user to connect \"Notion\" from the skill's setup; do not drive OAuth yourself. An \"object not found\" / no-access error means the connection can't see that object — tell the user to share the page or database with the Notion connection.\n\n## Finding pages\n\nThere is no \"list all\" — `notion-search` is the entry point and `query` is required (min length 1). For a broad overview pass a keyword from the request, and always bound results with a small `page_size`. Each result carries `title`, `url`, and `id`. Results are ranked by semantic similarity, not by title — when one result's title matches the requested name (case-insensitive), take that one even if it isn't first. When the user named a specific page and no title matches, list the candidates as `[title](url)` and ask instead of guessing. Search once per request; do not re-run it with variations.\n\n`notion-search` knows nothing about the connected identity — for \"who am I\" / \"which workspace\" call `notion-fetch` with `id: \"self\"` (see `references/pages.md`).\n\n## Load the Recipe File First\n\nThis file carries no other calls. The tool tables and working calls live in four reference files — load the one for the job with the `skill` tool BEFORE calling a Notion tool, then copy its call and change only the values. Each load is a real `skill` tool call — printing the call as JSON or text in your reply loads nothing.\n\n- **Pages** — read or summarize a page, \"who am I / which workspace\", create a page, add / change / replace text, rename or set a property, delete / archive (and why it cannot), move, duplicate: call the `skill` tool with `name: \"notion\"` and `file: \"references/pages.md\"`.\n- **Databases, data sources and views** — create a database, add a row, read a database's schema, query or filter rows, create or change a view: call the `skill` tool with `name: \"notion\"` and `file: \"references/databases.md\"`.\n- **Comments** (also people and teamspaces) — read or add a comment, list workspace members, look up a user, list teamspaces: call the `skill` tool with `name: \"notion\"` and `file: \"references/comments.md\"`.\n- **Async tasks** — a result carried a `task_id`, or the user asks whether a duplicate / large write finished: call the `skill` tool with `name: \"notion\"` and `file: \"references/tasks.md\"`.\n\nNever write a call from memory. Each tool's arguments have one exact shape (`command` + its single companion field, `data.mode` + its fields) and the server rejects anything else; loading the file is one cheap read-only call. After the file is loaded, your next output is the tool call — no further loads.\n\n## Output\n\n- Show page titles and IDs together. When a result carries a `url`, render the title as a Markdown link — `[title](url)` — never bare or in backticks, or it won't be clickable.\n- For query results, lead with counts/rollups if present, then rows — don't dump the raw structured response. Surface user-visible property names, not IDs.\n- If a query tool responds with an upgrade prompt, tell the user their plan doesn't support it (single-source needs Business+Notion AI, multi-source needs Enterprise+Notion AI) — don't retry.\n",
54
54
  "notion/operations.json": "{\n \"operations\": [\n {\n \"tool\": \"notion_create_page\",\n \"description\": \"Create one Notion page with a title and optional Markdown body, under a parent page or database. One user request means one call; never recreate a page to make sure it landed.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\", \"description\": \"Exact title from the user\" },\n \"content\": {\n \"type\": \"string\",\n \"description\": \"Page body in Notion-flavored Markdown; do not repeat the title\"\n },\n \"parentPageId\": { \"type\": \"string\", \"description\": \"Parent page id or URL\" },\n \"parentDatabaseId\": {\n \"type\": \"string\",\n \"description\": \"Parent database id or URL, for a database row\"\n }\n },\n \"required\": [\"title\"]\n },\n \"request\": {\n \"transport\": \"mcp\",\n \"method\": \"notion-create-pages\",\n \"url\": \"https://mcp.notion.com/mcp\",\n \"builder\": \"notion-create-page\"\n }\n },\n {\n \"tool\": \"notion_insert_content\",\n \"description\": \"Add Markdown text to an existing Notion page, at the end by default or at the start. For changing text that is already there use notion-update-page with update_content via mcp_call.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"pageId\": { \"type\": \"string\", \"description\": \"Page id or URL\" },\n \"content\": { \"type\": \"string\", \"description\": \"Markdown to add\" },\n \"position\": {\n \"type\": \"string\",\n \"enum\": [\"start\", \"end\"],\n \"description\": \"Defaults to end\"\n }\n },\n \"required\": [\"pageId\", \"content\"]\n },\n \"request\": {\n \"transport\": \"mcp\",\n \"method\": \"notion-update-page\",\n \"url\": \"https://mcp.notion.com/mcp\",\n \"builder\": \"notion-insert-content\"\n }\n }\n ]\n}\n",
55
55
  "notion/references/comments.md": "# Notion Comments, People and Teamspaces\n\nEvery call is one `mcp_call` with `url: \"https://mcp.notion.com/mcp\"`, the tool name as `method`, and its args as `params` (a JSON object, never a string). Call these tools directly — no `tools/list`.\n\n| tool | required args | use for |\n| ----------------------- | ----------------------------- | ------------------------------------------- |\n| `notion-get-comments` | `page_id` | read a page's comments and discussions |\n| `notion-create-comment` | `page_id`, `rich_text` | comment on a page |\n| `notion-get-users` | — (optional `id` or `\"self\"`) | list workspace members, or look up one user |\n| `notion-get-teams` | — | list teamspaces |\n\n## Reading comments\n\n```json\n{\n \"url\": \"https://mcp.notion.com/mcp\",\n \"method\": \"notion-get-comments\",\n \"params\": { \"page_id\": \"<page id or URL>\" }\n}\n```\n\nThe result includes block-level and resolved threads. Report each comment with its author and text; a read-only question ends after the read.\n\n## Adding a comment\n\nThe comment text goes in `rich_text` as one text object:\n\n```json\n{\n \"url\": \"https://mcp.notion.com/mcp\",\n \"method\": \"notion-create-comment\",\n \"params\": {\n \"page_id\": \"<page id or URL>\",\n \"rich_text\": [{ \"text\": { \"content\": \"The comment\" } }]\n }\n}\n```\n\nOne user request → one comment. After the result, say the comment was added and link the page.\n\n## People\n\n`notion-get-users` with `params: {}` lists workspace members and guests (id, name, email, type). Pass `\"id\": \"self\"` for the connected user, or a user id to look one up:\n\n```json\n{ \"url\": \"https://mcp.notion.com/mcp\", \"method\": \"notion-get-users\", \"params\": {} }\n```\n\nFor \"who am I / which workspace\" prefer `notion-fetch` with `\"id\": \"self\"` (see `references/pages.md`) — it also names the workspace.\n\n## Teamspaces\n\n```json\n{ \"url\": \"https://mcp.notion.com/mcp\", \"method\": \"notion-get-teams\", \"params\": {} }\n```\n\nLists the teamspaces and whether the connected user is a member of each.\n\n## Output\n\nShow people by name (and email when present), pages as `[title](url)` links. Never invent a user id — take it from `notion-get-users`.\n\n## Now act\n\nYour next output is the tool call (or, after the result, the reply) — no further skill loads.\n",
56
56
  "notion/references/databases.md": "# Notion Databases, Data Sources and Views\n\nA database holds one or more **data sources** (the typed schema behind it) and **views** over them. Every call is one `mcp_call` with `url: \"https://mcp.notion.com/mcp\"`, the tool name as `method`, and its args as `params` (a JSON object, never a string). Call these tools directly — no `tools/list`.\n\n| tool | required args | use for |\n| --------------------------- | ---------------------------------------- | ------------------------------------------------------------------------ |\n| `notion-fetch` | `id` (database / data-source / view URL) | read the schema, the `collection://` data-source URLs, and the view URLs |\n| `notion-query-data-sources` | `data` (`mode` + its fields) | run a database view, or query rows by SQL |\n| `notion_create_page` | `title`, `parentDatabaseId` | add one row to a database (typed tool — no `params`) |\n| `notion-create-database` | properties for the new database | create a database + its initial data source + view |\n| `notion-update-data-source` | `data_source_id` + fields | rename a data source or edit its properties |\n| `notion-create-view` | `data_source_id`, `name`, `type` | add a table / board / list / calendar / timeline / gallery view |\n| `notion-update-view` | `view_id` + fields | edit a view's name, filters, sorts, or display |\n\n## Reading a database\n\nFetch the database first: the result carries the schema, each data source's `collection://<id>` URL (used as the SQL table name), and each view's URL (the one carrying `?v=<view-id>`).\n\n```json\n{\n \"url\": \"https://mcp.notion.com/mcp\",\n \"method\": \"notion-fetch\",\n \"params\": { \"id\": \"<database id or URL>\" }\n}\n```\n\n## Querying rows\n\n`notion-query-data-sources` nests every argument under `data`, and the two modes take different fields — send the wrong one and the server rejects the call:\n\n| `mode` | carries | for |\n| --------------- | ---------------------------- | ------------------------------------------- |\n| `view` | `view_url` | run a database view's own filters and sorts |\n| `sql` (default) | `data_source_urls` + `query` | filter, group or aggregate rows yourself |\n\nView mode works on every plan, so start there:\n\n```json\n{\n \"url\": \"https://mcp.notion.com/mcp\",\n \"method\": \"notion-query-data-sources\",\n \"params\": { \"data\": { \"mode\": \"view\", \"view_url\": \"<database url including ?v=>\" } }\n}\n```\n\nSQL mode is plan-gated: `data_source_urls` lists the `collection://` URLs and `query` is SQLite using them as table names. If the response is an upgrade prompt, tell the user their plan doesn't support it (single-source needs Business+Notion AI, multi-source needs Enterprise+Notion AI) — don't retry.\n\n## Adding a row\n\nA row is a page whose parent is the database. Use `notion_create_page` with `parentDatabaseId`; the `title` fills the title property and `content` becomes the row's page body:\n\n```json\n{ \"title\": \"Row title\", \"content\": \"Optional body\", \"parentDatabaseId\": \"<database id or URL>\" }\n```\n\nSet other properties afterwards with `notion-update-page` → `update_properties` (see `references/pages.md`).\n\n## Creating and changing structure\n\n`notion-create-database` creates the database with its first data source and view; `notion-update-data-source` renames a data source or changes its properties; `notion-create-view` / `notion-update-view` manage views. Take the `data_source_id` and `view_id` from a `notion-fetch` of the database — never guess them. If the server rejects the call, quote its message and ask the user how to proceed instead of retrying with invented fields.\n\n## Output\n\nLead with counts and rollups when present, then rows; surface user-visible property names, not IDs. Show the database as a `[title](url)` link.\n\n## Now act\n\nYour next output is the tool call (or, after the result, the reply) — no further skill loads.\n",
@@ -72,8 +72,8 @@ export const SKILLS = {
72
72
  "presentations/references/create.md": "# Building a New Deck (python-pptx)\n\nCreate a new `.pptx` from scratch by running Python through the `exec` tool.\nA new deck needs **no** `inputs` — do not invent attachment ids. **Exactly\none** `exec` call per user request when that call succeeds.\n\n**A deck that already exists in this chat is never rebuilt here.** \"Add a\nslide\", \"change a title\", \"revise the deck\" — any request that starts from an\nexisting `.pptx` is an EDIT: load `references/edit.md` and stage the deck by\nits `attachmentId`. Building a fresh deck for an edit request throws away\nevery slide the user already has.\n\n## The exec call\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-pptx==1.0.2\"],\n \"outputs\": [\"deck.pptx\"],\n \"command\": \"...\"\n}\n```\n\n- `language` (required) — always `\"python\"`.\n- `packages` (required) — `[\"python-pptx==1.0.2\"]` on every call. Pin the\n version; an unpinned install resolves a potentially different library\n version. This exact version ships with the app and installs with no network;\n any other version has to be downloaded, which fails on a device that is\n offline.\n- `outputs` — `[\"deck.pptx\"]`. `save(\"deck.pptx\")` must match the declared\n output name exactly. A file you write but do not declare here is discarded.\n- `command` — the multi-line Python source, with real newline characters.\n Never collapse it to one line joined by `;` — a `for`/`if`/`with` after a\n semicolon is a `SyntaxError`. `command` is the program: its first line is\n the first line of Python that runs. There is no shell and no interpreter to\n invoke, and no installer — packages are declared in `packages`.\n- No `inputs` key at all for a new deck.\n- `maxOutputChars` (stdout cap, default 8192, max 65536) is never needed on a\n build call — it prints one line.\n\n## Embedding images\n\nTwo kinds of image input, told apart by where the image came from:\n\n**Tool-produced files** (`generate_image` output, a prior deck return): stage\nthem with the exact `attachmentId` from the tool result — never placeholders\nlike `att_deck`, `att_image`, or any id you made up.\n\n**Images the user uploaded** (\"use this image\", a photo attached to their\nmessage): there is no id to copy — an uploaded image shows none. Stage them\nwith `path` only and **no `attachmentId` key**; the first id-less entry is the\nfirst image of the user's latest message, the second is its second image, and\nso on — never more id-less entries than that message has images. When it has\nnone, a single id-less entry resolves to the chat's most recent image instead.\n\nSeeing the image in your context is not the same as staging it: the deck is\nbuilt by Python, which reads the working directory and never your context, so\nan uploaded image reaches a slide only through an id-less `inputs` entry. Do\nnot call `generate_image` to recreate what the user attached, and do not tell\nthem the image cannot be used — the id-less entry is how it is used.\n\n**Files the user uploaded that are not images** (a `.pptx` to revise, any\ndocument): these *do* show an id, on the `[Attached file \"…\" — attachmentId:\n…]` line of the message that carried them. Copy it verbatim into\n`attachmentId`, exactly as for a tool-produced file. The id-less form never\nreaches them. (Revising an existing deck is its own flow — load\n`references/edit.md`.)\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-pptx==1.0.2\"],\n \"inputs\": [\n { \"attachmentId\": \"<id from generate_image or prior deck>\", \"path\": \"slide1.png\" },\n { \"path\": \"uploaded.png\" }\n ],\n \"outputs\": [\"deck.pptx\"],\n \"command\": \"...\"\n}\n```\n\nStaged files land in the working directory under the bare `path` names —\nreference `slide.shapes.add_picture(\"slide1.png\", …)` by that name only.\nPaths must be unique bare filenames. The working directory is fresh on every\ncall, so a file written by an earlier call is gone unless it is staged again\nas a chat attachment; an attachment from an earlier turn can be used when its\nattachment id is available in the conversation — from a tool result or an\n`[Attached file …]` line — otherwise ask the user to attach the file again.\n\n`attachment … not found in this chat` means you invented an id or the file is\nnot attached. If the file you meant is an image the user uploaded, drop the\n`attachmentId` key; if it came from a tool result or an `[Attached file …]`\nline, re-copy the exact id; for a new deck drop `inputs` entirely; otherwise\nask the user to re-attach.\n\nIf an image was staged in `inputs`, embed it in **that** single build with\n`slide.shapes.add_picture` — never deliver a deck and then rebuild to add the\nimage. Soft-failing (`try`/`except` around the picture) and saving without it\nis a failed turn, not a success.\n\n## Image URLs do not work — never download\n\nYour Python code has **no network access**: `requests`, `urllib`, and `socket`\nall fail with a network error, and `http_request` returns truncated text, never\nimage bytes. When the user gives an image URL, do not try to fetch it from Python\nand do not retry through other tools — that is a dead end. Say the link cannot be\ndownloaded and ask the user to attach the image itself, or offer `generate_image`\nfor a similar visual. Then build the deck with the staged attachment as above.\n\nSay it in the reply, every time. A deck that quietly ships without the image the\nuser linked is a failed turn: they asked for that image, and silence reads as\nthough it is on the slide. Name the URL you could not fetch and what you need\ninstead.\n\n## Writing the Deck\n\nStart from this. It is a complete, working deck — a title slide and a bullet slide,\n16:9, every paragraph sized, saved under the declared output name. Copy it and change\nthe content; do not assemble a deck from memory.\n\n**Keep the source multi-line.** A `for`/`if`/`with` after a semicolon is a\n`SyntaxError` — paste the block with real newlines, not `stmt; for x in y: …`.\n\n**Every length is a typed length — `Inches(...)`, `Pt(...)` or `Emu(...)`, never\na bare number.** This holds for every position and size anywhere in the deck:\nboth pairs of `add_textbox(left, top, width, height)`, the `left`/`top` and the\n`width`/`height` of `add_picture(...)`, `prs.slide_width` and `prs.slide_height`,\ntable column widths and row heights, and every margin or offset.\n\npython-pptx reads a bare number as **EMU**, and there are 914400 EMU to the inch.\nSo `add_textbox(0, 0, 12, 0)` is not \"12 wide\" — it is a box 0.000013in wide and\n0in tall, pinned to the top-left corner. Nothing raises: `exitCode` is `0`, there\nis no traceback and no warning, and the deck is delivered looking broken. Write\n`add_textbox(Inches(0.75), Inches(0.5), Inches(11.83), Inches(1.2))` instead.\n\nRecognise the symptom, because it is the only signal you get: **text crammed\ninto the top-left corner, or a box that has no size**, means a raw number reached\nan argument that required a typed length. Do not tune the numbers — wrap them.\n\n```python\nfrom pptx.util import Inches\n\nbox = slide.shapes.add_textbox(Inches(1), Inches(1), Inches(8), Inches(1.5))\n# NOT add_textbox(1, 1, 8, 2) — that is 8 EMU wide, an invisible box\n```\n\n**Keep every underscore in API names.** `text_frame`, `add_slide`, `slide_layouts`,\n`slide_width`, `word_wrap`, `add_paragraph`, `add_picture`, `add_textbox`, `PP_ALIGN`\n— stripping them to `textframe` / `addslide` / `addpicture` fails. Copy identifiers\nexactly as written below:\n\n```python\nfrom pptx import Presentation\nfrom pptx.util import Inches, Pt\nfrom pptx.enum.text import PP_ALIGN\n\nprs = Presentation()\nprs.slide_width = Inches(13.333) # 16:9 is not the default\nprs.slide_height = Inches(7.5)\n\n# Title slide — layout 0 owns a title and a subtitle\nslide = prs.slides.add_slide(prs.slide_layouts[0])\nslide.shapes.title.text = \"Why the Sky Is Blue\"\nslide.shapes.title.text_frame.paragraphs[0].font.size = Pt(44)\nsubtitle = slide.placeholders[1].text_frame\nsubtitle.text = \"Rayleigh scattering, in four points\"\nsubtitle.paragraphs[0].font.size = Pt(24)\n\n# Content slide — layout 1 owns a title and a body\nslide = prs.slides.add_slide(prs.slide_layouts[1])\nslide.shapes.title.text = \"What Happens\"\nslide.shapes.title.text_frame.paragraphs[0].font.size = Pt(36)\ntf = slide.placeholders[1].text_frame\ntf.word_wrap = True\nfor index, point in enumerate([\n \"Sunlight arrives carrying every visible wavelength\",\n \"Air molecules scatter short wavelengths hardest\",\n \"Blue scatters far more than red\",\n \"So the daytime sky reads blue in every direction\",\n]):\n p = tf.paragraphs[0] if index == 0 else tf.add_paragraph()\n p.text = point\n p.font.size = Pt(20)\n\nprs.save(\"deck.pptx\") # must match the declared output exactly\nprint(f\"{len(prs.slides)} slides\")\n```\n\nLayouts `0` and `1` own the placeholders that example writes to.\n\n**Choosing a layout has one rule, and it depends on where the deck came from:**\n\n- **Adding to a deck the user gave you** — reuse the layout its own slides\n already use: read a comparable existing slide and pass its `.slide_layout` to\n `add_slide`. That is the only way the new slide inherits the deck's theme.\n That flow is `references/edit.md` — load it.\n- **Building a new deck** — index the bundled template, which commonly uses `0`\n (title), `1` (title + content), `5` (title only), and `6` (blank). Those\n indices belong to *that* template and mean nothing on an uploaded deck.\n\nA layout only owns the placeholders it declares, and python-pptx returns `None` for\nthe rest — on the blank layout `shapes.title` is `None`, so `shapes.title.text = …`\nraises `AttributeError: 'NoneType' object has no attribute 'text'`, and\n`placeholders[1]` raises `KeyError`. So each slide is one of exactly two kinds, never\na mix:\n\n| slide kind | layout | how you write text |\n| --- | --- | --- |\n| title / title + body | the deck's own layout, or `0`, `1`, `5` in a new deck | `shapes.title`, `placeholders[1]` |\n| hand-designed | `6` (blank) | `shapes.add_textbox(...)` for **every** box, title included |\n\nOn layout `6` there is no title to reach for — the title is a text box you add.\n\nThe blank layout is **not** a co-equal way to write a content slide. It is for a\nslide you are genuinely designing by hand — a full-bleed image, a diagram, a\ncustom split — and it inherits no font, size, colour or position from the\ntemplate. Using it plus `add_textbox` to hold ordinary title-and-bullets content\non a deck the user uploaded produces a slide that visibly does not belong: wrong\ntypeface, wrong sizes, wrong margins, and no bullets. Placeholders exist so you\ndo not have to reproduce a theme you cannot see.\n\nBullets — set `tf.text` for the first bullet, then `add_paragraph()` for the rest.\nUsing `add_paragraph()` for the first one leaves a blank leading line.\n\nA new text frame holds exactly **one** paragraph, and `tf.paragraphs` is a tuple, so\n`tf.paragraphs[1]` raises `IndexError: tuple index out of range` until you have added\nit. Grow the frame with `p = tf.add_paragraph()`, which returns the new paragraph, and\nwrite through that. A paragraph owns `.text`, `.font` and `.alignment` and nothing\nelse — it has no `.paragraphs` and no `.add_paragraph()`, so never reassign your frame\nvariable to a paragraph.\n\nThe template's body placeholder inherits 28pt, so size every paragraph you add —\nincluding sub-levels — or it renders far larger than intended:\n\n```python\nfrom pptx.util import Pt\n\nslide = prs.slides.add_slide(prs.slide_layouts[1])\nslide.shapes.title.text = \"Agenda\"\ntf = slide.placeholders[1].text_frame\ntf.word_wrap = True\nfor index, point in enumerate([\"first point\", \"second point\"]):\n p = tf.paragraphs[0] if index == 0 else tf.add_paragraph()\n p.text = point\n p.font.size = Pt(20) # an unsized paragraph inherits 28pt\n```\n\nEvery deck returned through `outputs` is fitted before it reaches the user, so text\nthat would overflow its box is shrunk to fit automatically. That is a safety net, not\na licence to overfill: shrinking below about 16pt is unreadable from a room. Budget\neach slide at no more than five bullets of about 100 characters. A sixth bullet is a\nsecond slide titled `... (cont.)`, never a smaller font — and prose belongs in the\nchat reply, not on a slide.\n\nFree text — the only way to add text outside a placeholder is\n`shapes.add_textbox(left, top, width, height)` — all four are required, and all\nfour are typed lengths, never bare numbers — then write into its `.text_frame`.\nThere is no `add_text_frame`, no `add_text`, and no `add_paragraph` on `shapes`:\n\n```python\nslide = prs.slides.add_slide(prs.slide_layouts[6])\nbox = slide.shapes.add_textbox(Inches(0.75), Inches(0.5), Inches(11.83), Inches(1.2))\ntf = box.text_frame\ntf.word_wrap = True\ntf.text = \"Why the sky is blue\"\ntf.paragraphs[0].font.size = Pt(40) # from pptx.util import Pt\n```\n\nText always lives on the `.text_frame`, never on the shape: `box.paragraphs`,\n`box.add_paragraph()`, `box.word_wrap`, and `box.font` all raise AttributeError. Go\nthrough `tf = box.text_frame` first — `tf.text`, `tf.paragraphs[0]`,\n`tf.add_paragraph()`, `tf.word_wrap`. `shape.text` is the one shortcut that reads\nthrough to the frame; there is no matching `shape.font`.\n\nFormatting lives one level lower still — on a paragraph or a run, never on a shape or\na frame. A title is sized through its paragraph:\n\n```python\ntitle = slide.shapes.title\ntitle.text = \"Why the Sky is Blue\"\ntitle.text_frame.paragraphs[0].font.size = Pt(44) # not title.font.size\ntitle.text_frame.paragraphs[0].font.bold = True\ntitle.text_frame.paragraphs[0].alignment = PP_ALIGN.CENTER\n```\n\nSlides are added with `prs.slides.add_slide(layout)` — `prs.add_slide` does not\nexist. Alignment comes from an enum import, not an attribute path:\n\n```python\nfrom pptx.enum.text import PP_ALIGN\n\ntf.paragraphs[0].alignment = PP_ALIGN.CENTER\n```\n\nBullet characters are not needed — a placeholder body renders bullets itself. Give\neach bullet its own paragraph; never pack several `\\n`-joined bullets into one.\nNever type the marker into the text: `\"1. \"`, `\"2. \"`, `\"- \"` and `\"• \"` prefixes\nrender *next to* the bullet the placeholder already draws, in the wrong font.\nBullets belong in a body placeholder for exactly this reason — a bare\n`add_textbox` draws none, and typing them by hand to compensate is the wrong fix.\nPut the content in a placeholder instead.\n\nFont color — the type is `RGBColor` with **RGB in all caps**. Not `RgbColor`,\n`rgbColor`, or `rgb_color`:\n\n```python\nfrom pptx.dml.color import RGBColor\n\ntitle.text_frame.paragraphs[0].font.color.rgb = RGBColor(0x1A, 0x73, 0xE8)\n```\n\nBackgrounds and fills — `background` hangs off the slide itself, never off\n`slide.shapes` or a shape, and the fill is set in two steps: `solid()` first,\nthen the color:\n\n```python\nfrom pptx.dml.color import RGBColor\n\nfill = slide.background.fill # slide.shapes has no background\nfill.solid()\nfill.fore_color.rgb = RGBColor(0x0B, 0x1F, 0x3A)\n\nbox.fill.solid() # a shape is tinted through its own .fill\nbox.fill.fore_color.rgb = RGBColor(0xF2, 0xF2, 0xF2)\n```\n\nA paragraph has no `.fill` at all — coloring text goes through the font,\n`paragraph.font.color.rgb = RGBColor(...)`, as above. `fill` exists on a shape\nand on `slide.background`, nowhere else you will need.\n\nImages — go through the shapes collection: `slide.shapes.add_picture(...)`. A\n`Slide` has no picture or text-box methods of its own — `slide.add_picture`,\n`slide.addpicture`, `slide.add_textbox`, and `slide.addtextbox` all raise\n`AttributeError: 'Slide' object has no attribute '…'`. Fix: put `.shapes` between\n`slide` and the method. Pass only one of `width`/`height`; passing both distorts\nthe picture. Generate image-slide visuals at 1024×512 so they fill the content box;\na 512×512 square letterboxes with wide empty bands either side.\n\n**Do not soft-fail images or imports.** Never wrap `add_picture` or color imports in\n`try`/`except` that prints a warning and continues. A missing file or\n`cannot import name 'RgbColor'` must raise so you fix it and rerun — a deck that\nsaves without the requested image is a failed turn, not a success.\n\n```python\nslide = prs.slides.add_slide(prs.slide_layouts[6])\n# correct: slide.shapes.add_picture — never slide.add_picture / slide.addpicture\nslide.shapes.add_picture(\"slide1.png\", Inches(0.75), Inches(1.0), width=Inches(11.83))\nprs.save(\"deck.pptx\")\nprint(f\"{len(prs.slides)} slides\")\n```\n\n## Errors\n\n- Never print the deck's bytes or base64 — stdout is capped (8 KB by default)\n and the file travels through `outputs`. A build call prints only the slide\n count line (e.g. `7 slides`). No \"Presentation created successfully\", no\n try/except warnings on stdout.\n- `cannot import name 'RgbColor' from 'pptx.dml.color'` means the name is wrong —\n use `RGBColor` (all-caps RGB). Do not catch the ImportError and save anyway.\n- Never pass an absolute path to `save()`.\n- `SyntaxError: invalid syntax` on a one-line `for`/`if` means the source was\n collapsed — restore multi-line newlines from the sample and rerun. Underscores\n in names (`text_frame`, not `textframe`) must stay. Do not switch to `python -c`\n or change the package pin.\n- `outputs declare a .pptx but command does not build one` means the source never\n calls `Presentation(...).save(...)` — paste the skill sample (edited for content),\n not a diagnostic `os.listdir` or shell wrapper.\n- `ModuleNotFoundError: No module named 'pptx'` means `packages` was missing or\n wrong — add `[\"python-pptx==1.0.2\"]` and rerun. Never try to install it.\n- `attachment … not found in this chat` means `inputs` listed an id that is not in\n this chat (often a copied placeholder like `att_deck`). For a new deck, omit\n `inputs` entirely and rerun. Only stage real ids from prior tool results.\n- Text crammed into the top-left corner, or a shape with no visible size, means a\n bare number reached an argument that required a typed length — python-pptx reads\n it as EMU (914400 to the inch), so `add_textbox(0, 0, 12, 0)` is an invisible box\n in the corner. Nothing raises and `exitCode` is `0`, so this only ever shows up in\n the delivered deck. Wrap every position and size in `Inches(...)` / `Pt(...)` /\n `Emu(...)` and rerun — do not tune the raw numbers.\n- On an `AttributeError` from python-pptx the API name is wrong, and on a `TypeError`\n about missing positional arguments a required argument was left out — fix either\n against this file's examples. Do not retry the same call, and do not switch to a shell.\n- `AttributeError: 'Slide' object has no attribute 'add_picture'` (or `addpicture`,\n `add_textbox`, `addtextbox`) means the call skipped `.shapes` — use\n `slide.shapes.add_picture(...)` / `slide.shapes.add_textbox(...)`, never\n `slide.add_*`.\n- `AttributeError: 'SlideShapes' object has no attribute 'background'` means the\n background was reached through the shapes collection — it lives on the slide:\n `slide.background.fill.solid()` then `fill.fore_color.rgb = RGBColor(...)`.\n- `AttributeError: '_Paragraph' object has no attribute 'fill'` means a fill was\n asked of text — paragraphs have none. Color text with\n `paragraph.font.color.rgb = RGBColor(...)`; `.fill` belongs to a shape or to\n `slide.background`.\n\n## Finish\n\nWhen `exitCode` is `0` and `attachments` lists the `.pptx`, stop tool use and\nanswer with one line: file name + the slide count from stdout. Exactly one\nsuccessful build `exec` per request — re-running the same build is spam, not\nquality.\n",
73
73
  "presentations/references/edit.md": "# Editing an Existing Deck (python-pptx)\n\nEditing means opening the deck that already exists and changing only what the\nuser asked for.\n\n**The first line of an edit is always `Presentation(\"<staged path>\")`.** A bare\n`Presentation()` is only ever for a brand-new deck — it opens the bundled blank\ntemplate, not the user's file, so retyping the slides regenerates their text and\nthrows away the original content and design. A rebuilt deck is a failed turn.\nStage the deck as an input by its real `attachmentId` and open **that staged\nfile**. If no attachment id for the deck is available, ask the user to attach it\nagain.\n\n## Staging the deck\n\nThe id comes from wherever the deck entered the chat: the `exec` result that\ndelivered it, or — for a deck the **user uploaded** — the `[Attached file …]`\nline on their message, which names every non-image upload:\n\n```\n[Attached file \"quarterly.pptx\" (application/vnd.openxmlformats-officedocument.presentationml.presentation) — attachmentId: 4f9c2ab1]\n```\n\nCopy that id verbatim — never placeholders like `att_deck` or any id you made\nup. A `.pptx` is never staged id-less: the id-less form resolves to an uploaded\n*image*, so it cannot reach a deck. An attachment from an earlier turn can be\nused when its attachment id is available in the conversation — from a tool\nresult or an `[Attached file …]` line. Otherwise, ask the user to attach the\nfile again.\n\n## Read first, then edit\n\n**An edit that writes new prose is two `exec` calls, in this order:** a **read**\nthat stages the deck, prints what is on the slides and declares **no `outputs`**;\nthen the **edit** that stages the same deck, makes the change and declares the\noutput.\n\nThe read has to be its own call, because one call cannot inform itself. The words\nyou put on a new slide are in the source you submit — fixed before the program\nruns — so a `print` in that same program reports the deck back to you only after\nthe slide was already written and saved. A single call can still *compute*\nagainst the deck (`prs.slides[1].slide_layout`, `len(prs.slides)`), because that\nis code the runtime evaluates against the real file. What it cannot do is let you\n**write** from what the deck says.\n\nA mechanical edit needs no read: a font size, a colour, a slide whose text the\nuser already gave you. Read first when the new text has to agree with the deck —\na conclusion, a summary, a \"what changed\" slide — and go straight to the edit\nwhen it does not.\n\nStill forbidden, and unchanged: an `exec` opened *after* the deck is delivered to\ncheck what you sent. The result you already hold is the whole account of that\nrun — that is the loop `Success = stop` closes.\n\nThe read call declares **no `outputs`** — it builds nothing, it only reports:\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-pptx==1.0.2\"],\n \"inputs\": [{ \"attachmentId\": \"<id of the deck in this chat>\", \"path\": \"deck.pptx\" }],\n \"maxOutputChars\": 24000,\n \"command\": \"...\"\n}\n```\n\n`maxOutputChars` raises the stdout cap so the whole deck comes back in one\nresult — without it stdout is capped at 8 KB. Keep the sample's 24000 (the cap's\nmaximum is 65536). A build call prints one line and never needs it.\n\nThe edit call is the one that builds, and there is **exactly one** of those:\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-pptx==1.0.2\"],\n \"inputs\": [{ \"attachmentId\": \"<id of the deck in this chat>\", \"path\": \"deck.pptx\" }],\n \"outputs\": [\"deck-v2.pptx\"],\n \"command\": \"...\"\n}\n```\n\n- `packages` — pin exactly `python-pptx==1.0.2` on every call; an unpinned\n install resolves a potentially different library version. This exact version\n ships with the app and installs with no network; any other version has to be\n downloaded, which fails on a device that is offline.\n- `inputs` — the staged deck. Paths must be unique bare filenames; staged files\n land in the working directory under those names — reference\n `Presentation(\"deck.pptx\")` by that name only.\n- `outputs` — the file to deliver. A file you write but do not declare here is\n discarded. Omit on a read call — a read builds nothing.\n- `command` — the multi-line Python source, with real newline characters. Never\n collapse it to one line joined by `;` — a `for`/`if`/`with` after a semicolon\n is a `SyntaxError`.\n\nBoth stage the same deck by the same `attachmentId`: the working directory is\nfresh on every call, so the read leaves nothing behind for the edit to reuse.\n\nName the output after the deck you opened: keep its stem and bump a version —\n`deck.pptx` → `deck-v2.pptx`, and an edit of that one → `deck-v3.pptx`. The\nshared stem reads as one document's history in the chat, and the new name leaves\nthe version you opened still openable. Never overwrite the staged input.\n\n## The read call\n\nThe read call's whole program is the loop — layout name and every line, so the\nedit that follows can be written against real content:\n\n```python\nfrom pptx import Presentation\n\nprs = Presentation(\"deck.pptx\") # the staged input — never Presentation()\nfor index, slide in enumerate(prs.slides):\n lines = [s.text_frame.text.replace(\"\\n\", \" \") for s in slide.shapes if s.has_text_frame]\n print(f\"{index}: [{slide.slide_layout.name}] {' | '.join(lines)}\")\n```\n\nThe `replace` is load-bearing: a multi-paragraph body embeds `\"\\n\"` between its\nbullets, and an embedded newline would split one slide across several printed\nlines. Flattened, every printed line is exactly one slide, starting with its\nindex and layout name.\n\nIt saves nothing and declares no `outputs`. Read its result before writing the\nedit: the layout names decide which layout the new slide copies, and the lines\ndecide what it can truthfully say.\n\n**Read the deck before you write into it.** New content has to agree with what\nis already on the slides, and you cannot write a conclusion, a summary, or a\n\"what changed\" slide from the titles alone — the titles are headings, and the\nsubstance is in the bodies underneath them. Loop every slide and print every\nshape with `shape.has_text_frame` in the **read** call, then write the edit\nagainst what came back. A slide written from titles only reads as though it\nbelongs to a different deck: it restates the headings, invents specifics the\ndeck never claimed, and contradicts the bullets it is supposed to close.\n\nRead through `slide.shapes` **only**. `slide.placeholders` is not a second place\nto look — every placeholder is already in `slide.shapes`, the same shape reached\nby a narrower door, so looping both prints the whole deck twice and doubles what\nyou have to read back. Nor can you dedupe your way out of it: python-pptx builds\na fresh wrapper on each access, so the title reached through `shapes` and the\ntitle reached through `placeholders` are `==`-distinct objects over one XML\nelement — `in`, `is` and `set()` all fail to spot the repeat. One loop over\n`slide.shapes`, guarded by `shape.has_text_frame`, is the whole read.\n\nPrint `slide.slide_layout.name`, never the layout object — `print(slide.slide_layout)`\ngives `<pptx.slide.SlideLayout object at 0x…>`, which tells you nothing and leaves\nthe layout choice to guesswork. The name is the template's own label, like\n`Title Slide`, `Title and Content`, or `Section Header`.\n\nThat same read locates the slide to change: match on the text you printed, and\nedit through the shape you matched. python-pptx has no API to delete or reorder\nslides — say so instead of hacking at the XML.\n\n## The edit call\n\nThe edit call then opens the same staged file, changes it in place, and saves\nunder the versioned name — never over the staged input:\n\n```python\nfrom pptx import Presentation\nfrom pptx.util import Pt\nfrom pptx.dml.color import RGBColor\n\nprs = Presentation(\"deck.pptx\") # the staged input — never Presentation()\nbefore = len(prs.slides)\n\n# Retitle the first slide in place — every other shape keeps its text\ntitle = prs.slides[0].shapes.title\ntitle.text = \"Why the Sky Is Blue — Revised\"\ntitle.text_frame.paragraphs[0].font.size = Pt(44)\n\n# Recolor existing text through its paragraph font\nfirst_body = prs.slides[1].placeholders[1].text_frame\nfirst_body.paragraphs[0].font.color.rgb = RGBColor(0x1A, 0x73, 0xE8)\n\n# One new slide, on the layout a comparable BODY slide uses — never the cover's\nmodel = prs.slides[1] # a content slide; slide 0 is usually the cover\nslide = prs.slides.add_slide(model.slide_layout)\nslide.shapes.title.text = \"What Changed\"\ntf = slide.placeholders[1].text_frame\ntf.word_wrap = True\ntf.text = \"One new closing slide, nothing else touched\"\ntf.paragraphs[0].font.size = Pt(20)\n\nprs.save(\"deck-v2.pptx\") # the declared output — not deck.pptx\nprint(f\"{before} -> {len(prs.slides)} slides\")\n```\n\n**Reuse the deck's own layout — never the blank one.** `prs.slide_layouts[…]`\nindexes the *template's* layout list, and on an uploaded deck those indices mean\nwhatever that template says; a slide's own `.slide_layout` is the layout it is\nalready built on, so passing that to `add_slide` gives the new slide the same\nplaceholders, fonts, colours and positions as its neighbours. Choose the index\nby reading the deck — pick the existing slide that most resembles the one you\nare adding, a content slide for a content slide — and fill the placeholders it\nhands you. The index above is that choice, not a constant: a one-slide deck has\nonly `prs.slides[0]`, and `prs.slides[1]` raises `IndexError`.\n\n**Slide 0 is almost always the cover**, on a `Title Slide` layout that owns a big\ncentred title and a subtitle and nothing else. Copying *that* layout for a\nconclusion produces a second cover page in the middle of the deck — placeholders\nthat fit one line, no bullet body, and title styling that shouts. Take the layout\nfrom a slide that carries real content — typically `Title and Content` — and reach\nfor the cover's layout only when you are genuinely adding another cover. Reaching\nfor `slide_layouts[6]` (blank) and hand-placing text boxes on a themed deck\ninherits none of the theme and **guarantees a visual mismatch** with the slides\nbeside it.\n\n**Every length is a typed length — `Inches(...)`, `Pt(...)` or `Emu(...)`, never\na bare number** — for every `add_textbox(left, top, width, height)` argument,\nevery `add_picture(...)` position and size, and every margin or offset.\npython-pptx reads a bare number as EMU (914400 to the inch), nothing raises, and\nthe deck is delivered with text crammed into the top-left corner or a box that\nhas no size. Do not tune the numbers — wrap them:\n\n```python\nfrom pptx.util import Inches\n\nbox = slide.shapes.add_textbox(Inches(1), Inches(1), Inches(8), Inches(1.5))\n# NOT add_textbox(1, 1, 8, 2) — that is 8 EMU wide, an invisible box\n```\n\nSize every paragraph you add (`p.font.size = Pt(20)`, as in the sample) — the\ntemplate's body placeholder inherits 28pt, so an unsized paragraph renders far\nlarger than intended. Font color goes through `RGBColor` with **RGB in all\ncaps** (never `RgbColor`), on a paragraph's font — a paragraph has no `.fill`.\nFor the full slide-authoring API — placeholders vs. text boxes, bullets,\nformatting, backgrounds, pictures — load `references/create.md`.\n\nIf an image was staged in `inputs`, embed it in **that** single build with\n`slide.shapes.add_picture` — never deliver a deck and then rebuild to add the\nimage. Soft-failing (`try`/`except` around the picture) and saving without it\nis a failed turn, not a success.\n\n## Verify the slide count\n\n**Verify an added slide by the slide count.** Print `before` and `after` as the\nsample does, then read the number back: the delta has to be exactly what the user\nasked for — one added slide is `2 -> 3 slides`, and `2 -> 4 slides` means the\nslide got appended twice. A delta that does not match the request is a **failed\nturn to diagnose, not a result to report**: find the second `add_slide` (or the\none that never ran) and rerun. Note the count can only ever grow, since there is\nno API to delete a slide. This check is about slides you add — an edit that only\nchanges text on existing slides leaves the count flat, and that is correct.\n\nThat check lives inside the build, so it takes no extra call: the counts come\nfrom one `print` in the same `exec` that does the edit. A delivered deck is still\nnever reopened to \"verify\" it.\n\n**This is the one exception to `Success = stop`, and it is not a second call.**\nWhen the edit added slides, `exitCode: 0` plus an attachment cannot tell the\nedit you were asked for apart from one that fired twice or not at all — every\none of those produces both. Read the before/after count printed by that same\nrun before you reply. The fix is a corrected build, never an `exec` opened to\ninspect what was already delivered.\n\nThat corrected build goes out under the **next** version: `deck-v3.pptx` after a\nbroken `deck-v2.pptx`. The name you already delivered is refused on a second\nattach — `\"deck-v2.pptx\" was already attached this turn` — so reusing it turns a\nrecoverable turn into a dead one. The broken version stays in the chat either\nway, so name the good file in your reply.\n\n## Errors\n\n- `ModuleNotFoundError: No module named 'pptx'` means `packages` was missing or\n wrong — add `[\"python-pptx==1.0.2\"]` and rerun. Never try to install it.\n- `attachment … not found in this chat` means `inputs` listed an id that is not\n in this chat (often a copied placeholder like `att_deck`). Re-copy the exact\n id from the tool result or the `[Attached file …]` line that names the deck;\n if neither exists, ask the user to attach it again instead of retrying.\n- Every line showing up twice in the read output means the loop walked\n `slide.shapes` *and* `slide.placeholders`. Placeholders are already shapes, so\n the second pass re-reads what the first one found. Drop it — one loop over\n `slide.shapes` is the whole read.\n- A read result ending in `… [truncated]` means the deck outgrew the cap:\n answer from what came back and say the answer covers the deck up to that\n point. Do not rerun the read — it prints the same beginning again.\n- A slide count whose delta does not match the request (`2 -> 4 slides` when one\n slide was asked for) means `add_slide` ran twice, even at `exitCode 0`. Read the\n printed before/after count before replying — see Verify the slide count.\n- A new slide that does not match the deck around it — different font, size or\n colour, bullets missing — was added on the blank layout instead of the deck's\n own. Read a comparable existing slide, pass its `.slide_layout` to `add_slide`,\n and fill its placeholders.\n- Text crammed into the top-left corner, or a shape with no visible size, means a\n bare number reached an argument that required a typed length — wrap every\n position and size in `Inches(...)` / `Pt(...)` / `Emu(...)` and rerun.\n- `cannot import name 'RgbColor' from 'pptx.dml.color'` means the name is wrong —\n use `RGBColor` (all-caps RGB). Do not catch the ImportError and save anyway.\n- Never pass an absolute path to `save()`.\n- `SyntaxError: invalid syntax` on a one-line `for`/`if` means the source was\n collapsed — restore multi-line newlines from the sample and rerun. Underscores\n in names (`text_frame`, not `textframe`) must stay. Do not switch to `python -c`\n or change the package pin.\n- `outputs declare a .pptx but command does not build one` means the source never\n calls `Presentation(...).save(...)` — paste the skill sample (edited for content),\n not a diagnostic `os.listdir` or shell wrapper.\n- On an `AttributeError` from python-pptx the API name is wrong, and on a `TypeError`\n about missing positional arguments a required argument was left out — fix either\n against this file's examples. Do not retry the same call, and do not switch to a shell.\n- `AttributeError: 'Slide' object has no attribute 'add_picture'` (or `addpicture`,\n `add_textbox`, `addtextbox`) means the call skipped `.shapes` — use\n `slide.shapes.add_picture(...)` / `slide.shapes.add_textbox(...)`, never\n `slide.add_*`.\n- Never print the deck's bytes or base64 — stdout is capped and the file travels\n through `outputs`. A build call prints only the before/after slide count line;\n only a read call prints slide text.\n\n## Finish\n\nWhen `exitCode` is `0`, `attachments` lists the `.pptx`, and the printed\nbefore/after count matches the request, stop tool use and answer with one line:\nfile name + slide count from stdout. Exactly one successful build `exec` per\nrequest — the no-`outputs` read attaches nothing and is not that call.\n",
74
74
  "presentations/references/read.md": "# Reading a Deck to Answer in Chat (python-pptx)\n\nWhen the user asks what an attached `.pptx` *says* — a summary, a question\nanswered, specific content pulled out — the deliverable is your reply in the\nchat, not a file. This is a **read request**: one no-`outputs` read call,\nstaged by the deck's real `attachmentId`, is the only `exec` of the turn — no\nbuild call follows it.\n\n**You cannot summarize in the call that reads.** The words in `command` are\nfixed before the program runs, so one call cannot inform itself: any summary\nwritten into it was written blind — recalled or invented, not read. Python only\n*transports* the slides; the summarizing happens in your reply, after the\nresult comes back.\n\n## Staging the deck\n\nThe id comes from wherever the deck entered the chat: the `exec` result that\ndelivered it, or — for a deck the **user uploaded** — the `[Attached file …]`\nline on their message, which names every non-image upload:\n\n```\n[Attached file \"quarterly.pptx\" (application/vnd.openxmlformats-officedocument.presentationml.presentation) — attachmentId: 4f9c2ab1]\n```\n\nCopy that id verbatim — never placeholders like `att_deck` or any id you made\nup. A `.pptx` is never staged id-less: the id-less form resolves to an uploaded\n*image*, so it cannot reach a deck. If no attachment id for the deck is\navailable anywhere in the chat, ask the user to attach it again — the working\ndirectory is fresh on every call, so a file from an earlier call is gone unless\nstaged again by its id.\n\n## The exec call\n\nThe read call declares **no `outputs`** — it builds nothing, it only reports:\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-pptx==1.0.2\"],\n \"inputs\": [{ \"attachmentId\": \"<id of the deck in this chat>\", \"path\": \"deck.pptx\" }],\n \"maxOutputChars\": 24000,\n \"command\": \"...\"\n}\n```\n\n- `packages` — pin exactly `python-pptx==1.0.2`; this exact version ships with\n the app and installs with no network; any other version has to be downloaded,\n which fails on a device that is offline.\n- `inputs` — the staged deck, under a unique bare filename; reference\n `Presentation(\"deck.pptx\")` by that name only.\n- `maxOutputChars` — raises the stdout cap so the whole deck comes back in one\n result — without it stdout is capped at 8 KB. Keep the sample's 24000\n (default 8192, max 65536). Only a read call prints slide text.\n- `command` — the multi-line Python source, with real newline characters.\n Never collapse it to one line joined by `;`.\n\n## The recipe\n\nThe read call's whole program is the loop — layout name and every line:\n\n```python\nfrom pptx import Presentation\n\nprs = Presentation(\"deck.pptx\") # the staged input — never Presentation()\nfor index, slide in enumerate(prs.slides):\n lines = [s.text_frame.text.replace(\"\\n\", \" \") for s in slide.shapes if s.has_text_frame]\n print(f\"{index}: [{slide.slide_layout.name}] {' | '.join(lines)}\")\n```\n\nThe `replace` is load-bearing: a multi-paragraph body embeds `\"\\n\"` between its\nbullets, and an embedded newline would split one slide across several printed\nlines. Flattened, every printed line is exactly one slide, starting with its\nindex and layout name.\n\nA bare `Presentation()` opens the bundled blank template, not the user's file —\nthe first line is always the staged path. Loop every slide and print every\nshape guarded by `shape.has_text_frame`: the titles are headings, and the\nsubstance is in the bodies underneath them.\n\nRead through `slide.shapes` **only**. `slide.placeholders` is not a second place\nto look — every placeholder is already in `slide.shapes`, the same shape reached\nby a narrower door, so looping both prints the whole deck twice and doubles what\nyou have to read back. Nor can you dedupe your way out of it: python-pptx builds\na fresh wrapper on each access, so the title reached through `shapes` and the\ntitle reached through `placeholders` are `==`-distinct objects over one XML\nelement — `in`, `is` and `set()` all fail to spot the repeat. One loop over\n`slide.shapes`, guarded by `shape.has_text_frame`, is the whole read.\n\n## Finish: answer in the chat\n\n**A successful read ends tool use.** When the result prints the slides, reply\nwith the summary or the answer as chat text. **Scale the reply to the deck**: a\nsummary is much shorter than what it summarizes — a handful of slides earns\nthree to five sentences, and only a long deck earns sections. Restating every\nslide is not a summary. Do **not**:\n\n- call `exec` again to \"re-check\", \"read more\", or read the same deck a second\n time;\n- build a summary `.pptx` the user never asked for — an unrequested file is a\n failed turn, not a bonus.\n\nIf stdout ends with `… [truncated]`, the deck is longer than the cap: answer\nfrom what came back and say the answer covers the deck up to that point. Do not\nrerun the read — it prints the same beginning again.\n\nIf the user asks for the summary **as a file**, that is a read followed by a\nbuild: the read call first, then one build call that writes the new deck from\nthe slides you actually read. The build call follows `references/create.md` —\nload it; the read still declares no `outputs`.\n\n## Errors\n\n- `ModuleNotFoundError: No module named 'pptx'` means `packages` was missing or\n wrong — add `[\"python-pptx==1.0.2\"]` and rerun. Never try to install it.\n- `attachment … not found in this chat` means `inputs` listed an id that is not\n in this chat (often a copied placeholder like `att_deck`). Re-copy the exact\n id from the tool result or the `[Attached file …]` line that names the deck;\n if neither exists, ask the user to attach it again instead of retrying.\n- Every line showing up twice in the read output means the loop walked\n `slide.shapes` *and* `slide.placeholders`. Placeholders are already shapes —\n drop the second loop; one loop over `slide.shapes` is the whole read.\n- A read result ending in `… [truncated]` means the deck outgrew the cap:\n answer from what came back — do not rerun the read.\n- `SyntaxError: invalid syntax` on a one-line `for`/`if` means the source was\n collapsed — restore multi-line newlines from the sample and rerun. Underscores\n in names (`text_frame`, not `textframe`) must stay. Do not switch to `python -c`\n or change the package pin.\n",
75
- "spotify/SKILL.md": "---\nname: spotify\ndescription: Play, search, and control music on Spotify — songs, artists, albums, playlists, and playback.\nemoji: 🎵\ntools: [http_request]\nplatform: [darwin, linux, win32, ios, android]\ncredentials: [spotify_access_token]\nallow_list: [https://api.spotify.com/v1/]\nmetadata:\n {\n \"openclaw\":\n {\n \"requires\":\n {\n \"credentials\": [\"spotify_access_token\"],\n \"credentialChecks\":\n { \"spotify_access_token\": { \"url\": \"https://api.spotify.com/v1/me\" } }\n }\n }\n }\n---\n\n# Spotify\n\nUse `http_request` against `https://api.spotify.com/v1`. The Spotify credential is attached automatically to every `api.spotify.com` request — **never include an `auth` block**. Never invent track/album/artist URIs — search first and copy `uri` from the JSON response.\n\n```json\n{\n \"url\": \"https://api.spotify.com/v1/search\",\n \"method\": \"GET\",\n \"query\": { \"q\": \"Radiohead Creep\", \"type\": \"track\", \"limit\": 5 }\n}\n```\n\n## Hard rules\n\n- A bare song/artist/album/playlist name is enough — search immediately, take the top match, and tell the user what you picked. Do not ask \"which one?\" before searching.\n- Always search before playing by name. Play carries URIs only in the JSON `body` (`\"uris\": [\"…\"]`), never as query parameters.\n- A bare `PUT /me/player/play` with no body only resumes paused playback — it never plays a requested song. For an album/artist/playlist use `{ \"context_uri\": \"<uri>\" }` instead of `uris`.\n- Do not ask about tokens or setup up front. A **401** means Spotify isn't connected (tell the user to run `/connect spotify`). A **404** from `/me/player` means no active device (tell them to open Spotify).\n\n## Recipe: play a song by name\n\n1. Search:\n\n```json\n{\n \"url\": \"https://api.spotify.com/v1/search\",\n \"method\": \"GET\",\n \"query\": { \"q\": \"Radiohead Creep\", \"type\": \"track\", \"limit\": 5 }\n}\n```\n\n2. Copy `tracks.items[0].uri` into the play body:\n\n```json\n{\n \"url\": \"https://api.spotify.com/v1/me/player/play\",\n \"method\": \"PUT\",\n \"body\": { \"uris\": [\"spotify:track:70LcF31zb1H0PyJoS1Sx1r\"] }\n}\n```\n\n## Other operations\n\nAll paths are under `https://api.spotify.com/v1`.\n\n| Ask | Method and path |\n| --------------- | ----------------------------------------------------------------------- |\n| What's playing? | `GET /me/player/currently-playing` |\n| Pause | `PUT /me/player/pause` |\n| Resume | `PUT /me/player/play` (no body) |\n| Next track | `POST /me/player/next` |\n| Add to queue | `POST /me/player/queue` with `query`: `{ \"uri\": \"spotify:track:<id>\" }` |\n| My playlists | `GET /me/playlists` |\n| Top tracks | `GET /me/top/tracks` with `query`: `{ \"time_range\": \"medium_term\" }` |\n| Recently played | `GET /me/player/recently-played` |\n| List devices | `GET /me/player/devices` |\n\n## Notes\n\n- Keep responses small — they truncate past 8KB, and raw JSON burns tokens on small models. Keep `limit` at 5. On playlist/track endpoints request only what you need with `fields` (e.g. `query`: `{ \"fields\": \"items(track(name,artists(name),uri))\" }`). Read just the top item unless the user asked for a list.\n- Present results as a short numbered list — track, artist, album, duration — and devices as `1. Name (active/idle)`. Never dump raw JSON to the user.\n- Playback commands return **204 No Content** on success (empty body). A **204** from currently-playing means nothing is playing.\n- **403** with `PREMIUM_REQUIRED` → user needs Spotify Premium. Other **403**s are usually app-scope/Development Mode limits — report and stop.\n- Never print the token or the `Authorization` header, and don't claim a write succeeded without a successful response in this turn.\n",
76
- "weather/SKILL.md": "---\nname: weather\ndescription: Get current weather and short forecasts for cities via wttr.in.\ntools: [http_request]\nplatform: [darwin, linux, win32, ios, android]\nallow_list: [https://wttr.in/]\nversion: 3\n# Tuned on Qwen3.5-2B with an offline eval (33 prompts x mention/prose routes), QVAC-24701.\n# v2: few-shot table. 2 repeats: overall 51/132 -> 77/130, \"Nassau, Bahamas\" 1/4 -> 4/4, city+country 2/24 -> 18/24,\n# ambiguous city 0/20 -> 6/20; 4B control 41/66 -> 59/66. Rules-first layouts lost on suffix slips (?3, ?1T).\n# v3: + country row. 3 repeats: v2 110/198 -> v3 121/198 (city+country 25 -> 31/36, forecast 17 -> 23/30).\n# Aliases, a second ambiguity row, and dropping ?T were tried and did not help (73, 74, 54 of ~130).\n---\n\n# Weather\n\nOne `http_request` to wttr.in, then answer from the body. Always call it exactly like this, with `\"method\": \"GET\"`:\n\n```json\n{ \"url\": \"https://wttr.in/Nassau,+Bahamas?format=3\", \"method\": \"GET\" }\n```\n\nMatch the user's request to a row for the URL:\n\n| User asks | Call |\n| --- | --- |\n| \"weather in Nassau, Bahamas\" | `https://wttr.in/Nassau,+Bahamas?format=3` |\n| \"weather in London\" / \"London today\" | `https://wttr.in/London?format=3` |\n| \"Berlin tomorrow\" / \"this weekend\" | `https://wttr.in/Berlin?2T` |\n| \"Rome for the next 3 days\" | `https://wttr.in/Rome?T` |\n| \"how hot is it in Georgia, the country\" | `https://wttr.in/Tbilisi,+Georgia?format=3` (a country → its capital) |\n| \"weather in Nassau\" (Nassau exists in the Bahamas and in New York) | no call — ask: \"Which Nassau do you mean, the Bahamas or New York?\" |\n| \"what's the weather?\" (no place) | no call — ask which city |\n\n## Rules\n\n1. **The location is exactly what the user wrote, spaces as `+`.** Keep a country or state they gave (`Nassau,+Bahamas`, not `Nassau`). Never add one they did not give. A country → its capital (`Tbilisi`).\n2. **Ambiguous city names — Nassau, Springfield, Portland, Cambridge, Georgia, San Jose, Birmingham — with no country or state → do not call, ask which one.**\n3. **The URL ends in `?format=3`, `?2T` or `?T`. Nothing else.** `?format=3` is the default for now/today/current. Write it in full: `London?3`, `London?format=3&format=3` and a bare `London` are all wrong.\n4. **Status not 200, or body `location not found` → say the place could not be found and ask for a more specific name. Do not retry other cities. Never state a temperature you did not receive.**\n5. wttr.in stops at 3 days: for \"next week\" say so and offer `?T`.\n\nA `200` body like `Nassau, Bahamas: 🌦️ +30°C` is the answer: give that temperature and condition in one plain sentence.\n",
75
+ "spotify/SKILL.md": "---\nname: spotify\ndescription: Play, search, and control music on Spotify — songs, artists, albums, playlists, and playback.\nemoji: 🎵\ntools: [http_request]\nplatform: [darwin, linux, win32, ios, android]\ncredentials: [spotify_access_token]\nallow_list: [https://api.spotify.com/v1/]\nmetadata:\n {\n \"openclaw\": {\n \"requires\": {\n \"credentials\": [\n \"spotify_access_token\"\n ],\n \"credentialChecks\": {\n \"spotify_access_token\": {\n \"url\": \"https://api.spotify.com/v1/me\"\n }\n }\n },\n \"setup\": {\n \"routes\": [\n {\n \"kind\": \"oauth\",\n \"label\": \"Spotify\",\n \"provider\": \"spotify\",\n \"credentialKey\": \"spotify_access_token\",\n \"description\": \"Search, library, and playback control — playback requires Spotify Premium\",\n \"helpUrl\": \"https://developer.spotify.com/dashboard\",\n \"steps\": [\n \"Search and library browsing work with any Spotify account; controlling playback (play, pause, skip) requires Spotify Premium and an open Spotify app on a device.\",\n \"Create your own app at https://developer.spotify.com/dashboard (Spotify requires the app owner to hold a Premium subscription).\",\n \"In the app settings, add these exact Redirect URIs: http://127.0.0.1:18974/callback (desktop) and, for mobile, the Redirect URI shown in this connect form (the scheme varies per build, e.g. qvac://oauth-callback or qvac-dev://oauth-callback).\",\n \"Paste the Client ID above and click Connect, then approve access in the browser. No Client Secret is needed — Workbench uses PKCE.\"\n ],\n \"fields\": [\n {\n \"key\": \"clientId\",\n \"label\": \"Client ID\",\n \"placeholder\": \"From your app at developer.spotify.com\"\n }\n ],\n \"oauth\": {\n \"stateKey\": \"spotify_oauth\",\n \"authUrl\": \"https://accounts.spotify.com/authorize\",\n \"tokenUrl\": \"https://accounts.spotify.com/api/token\",\n \"tokenAuth\": \"pkce-only\",\n \"port\": 18974,\n \"sharedIosSession\": true,\n \"scopes\": [\n \"user-read-private\",\n \"user-read-playback-state\",\n \"user-modify-playback-state\",\n \"user-read-currently-playing\",\n \"playlist-read-private\",\n \"playlist-read-collaborative\",\n \"user-library-read\",\n \"user-top-read\",\n \"user-read-recently-played\"\n ]\n }\n }\n ]\n }\n }\n }\n---\n\n# Spotify\n\nUse `http_request` against `https://api.spotify.com/v1`. The Spotify credential is attached automatically to every `api.spotify.com` request — **never include an `auth` block**.\n\n## Playing a song takes two calls. Always two.\n\n\"Play X\" is not answered until **both** have run:\n\n1. `GET /v1/search` — find the track.\n2. `PUT /v1/me/player/play` — start it.\n\nSearch alone plays nothing. If you have searched and not yet called play, you are not finished: make the play call now.\n\n```json\n{\n \"url\": \"https://api.spotify.com/v1/search\",\n \"method\": \"GET\",\n \"query\": { \"q\": \"Radiohead Creep\", \"type\": \"track\", \"limit\": 3, \"market\": \"from_token\" }\n}\n```\n\n```json\n{\n \"url\": \"https://api.spotify.com/v1/me/player/play\",\n \"method\": \"PUT\",\n \"body\": { \"uris\": [\"spotify:track:70LcF31zb1H0PyJoS1Sx1r\"] }\n}\n```\n\nTake `tracks.items[0].uri` from the search response and paste it into `uris`. A 204 means it started.\n\n## Hard rules\n\n- **`q` carries every word the user named — the title and the artist.** \"play Creep by Radiohead\" searches `q=Radiohead Creep`, never `q=Creep`. Drop the artist and the top hit is a different band's song with the same title.\n- **Before playing, check the item you picked.** Compare its `artists[0].name` with the artist the user named. If they do not match, take the first result that does. A title match under the wrong artist is the wrong song, and the user hears it immediately.\n- **Never write a URI, a JSON block, or \"I'll play it now\" to the user in place of calling play.** Describing the call is not making it.\n- **Every URI you send is one you copied from a search response in this turn.** Never type a `spotify:track:` id from memory or from an earlier turn. A well-formed id that is not real stops what was playing and starts nothing.\n- **A track goes in `uris`. Only `uris`.** `context_uri` takes an album, artist or playlist URI — a track URI there plays nothing. URIs go in the JSON `body`, never in query parameters.\n- **One call per intent.** A 204 means the call landed; do not send it again. Repeating a queue or play call burns the turn and changes nothing.\n- **Name what actually played, read back from the item you used** — its `name` and `artists[0].name`. A 204 says the call was accepted, not which song it was, so never report a title you did not read out of the response.\n- A bare song/artist/album/playlist name is enough — search immediately, take the top match, and tell the user what you picked. Do not ask \"which one?\" before searching.\n- Do not ask about tokens or setup up front. A **401** means Spotify isn't connected (tell the user to run `/connect spotify`). A **404** from `/me/player` means no active device (tell them to open Spotify).\n\n## Other operations\n\nAll paths are under `https://api.spotify.com/v1`.\n\n| Ask | Method and path |\n| --------------- | ----------------------------------------------------------------------- |\n| What's playing? | `GET /me/player/currently-playing` |\n| Pause | `PUT /me/player/pause` |\n| Resume | `PUT /me/player/play` (no body — resumes only, never starts a new song) |\n| Next track | `POST /me/player/next` |\n| Add to queue | `POST /me/player/queue` with `query`: `{ \"uri\": \"spotify:track:<id>\" }` |\n| Play an album/artist/playlist | `PUT /me/player/play` with `body`: `{ \"context_uri\": \"<uri>\" }` |\n| My playlists | `GET /me/playlists` |\n| Top tracks | `GET /me/top/tracks` with `query`: `{ \"time_range\": \"medium_term\" }` |\n| Recently played | `GET /me/player/recently-played` |\n| List devices | `GET /me/player/devices` |\n\nQueueing is the same two calls as playing: search for the track, then `POST /me/player/queue` with the `uri` you just read. Queueing does not start playback.\n\n## Notes\n\n- Keep responses small — they truncate past 8KB, and raw JSON burns tokens on small models. Keep `limit` at 3 and **always pass `market`**: a search without it spends most of the budget on `available_markets`, and the results behind the first one are cut off before you can read them. `/search` has no `fields` param, so `market` is the only lever there. On playlist/track endpoints request only what you need with `fields` (e.g. `query`: `{ \"fields\": \"items(track(name,artists(name),uri))\" }`). Read just the top item unless the user asked for a list.\n- Present results as a short numbered list — track, artist, album, duration — and devices as `1. Name (active/idle)`. Never dump raw JSON to the user.\n- Playback commands return **204 No Content** on success (empty body). A **204** from currently-playing means nothing is playing.\n- **403** with `PREMIUM_REQUIRED` → user needs Spotify Premium. Other **403**s are usually app-scope/Development Mode limits — report and stop.\n- Never print the token or the `Authorization` header, and don't claim a write succeeded without a successful response in this turn.\n",
76
+ "weather/SKILL.md": "---\nname: weather\ndescription: Get current weather and short forecasts for cities via wttr.in.\ntools: [weather_lookup]\nplatform: [darwin, linux, win32, ios, android]\nversion: 4\n# Tuned on Qwen3.5-2B with an offline eval (35 prompts, mention route), QVAC-24701.\n# v2: few-shot table. 2 repeats: overall 51/132 -> 77/130, \"Nassau, Bahamas\" 1/4 -> 4/4, city+country 2/24 -> 18/24.\n# v3: + country row. 3 repeats: v2 110/198 -> v3 121/198 (city+country 25 -> 31/36, forecast 17 -> 23/30).\n# Aliases, a second ambiguity row and dropping ?T were tried and did not help (73, 74, 54 of ~130).\n# v4: weather_lookup instead of http_request, after v3 answered a 200 for a place that does not exist.\n# 5 repeats, all variants in one sweep so they share a baseline: v3 97/171 -> v4 120/169. city+country\n# 87 -> 93%, unambiguous 57 -> 91%, unknown 57 -> 84%, forecast 68 -> 88%, casual 65 -> 80%, the ticket\n# prompt 80 -> 100%. Context is a wash (2335 -> 2378) though the body is 387 bytes smaller: the tool owns\n# the URL, so three rules about spelling one went away.\n# Not fixed. \"Ask which Nassau\" is 3/25 on v3 and 0/25 here, and asking when no place is named is 1/10 for\n# both: a one-argument call is easy, so the model calls rather than asks. Rules that tell the model not to\n# act have never cleared ~17% on a 2B in four versions, and a variant that made the tool refuse an\n# ambiguous name measured 13% against 17%, so it was dropped rather than shipped.\n---\n\n# Weather\n\nOne `weather_lookup` call, then answer from the result. Always call it exactly like this:\n\n```json\n{ \"location\": \"Nassau, Bahamas\" }\n```\n\nMatch the user's request to a row for the call:\n\n| User asks | Call |\n| --- | --- |\n| \"what's the weather?\" — no place named | **no call.** Ask which city |\n| \"weather in Nassau, Bahamas\" | `{ \"location\": \"Nassau, Bahamas\" }` |\n| \"weather in London\" / \"London today\" | `{ \"location\": \"London\" }` |\n| \"Berlin tomorrow\" / \"this weekend\" | `{ \"location\": \"Berlin\" }` |\n| \"Rome for the next 3 days\" | `{ \"location\": \"Rome\" }` |\n| \"how hot is it in Georgia, the country\" | `{ \"location\": \"Tbilisi, Georgia\" }` (a country → its capital) |\n| \"weather in Nassau\" | `{ \"location\": \"Nassau\" }` — the result names both, ask which |\n\nThe result is the place on the first line, then the weather now, then one line per day:\n\n```\nNassau, New Providence, Bahamas\nNow: 29°C / 84°F, Patchy rain nearby, feels like 33°C, humidity 71%, wind 21 km/h\n2026-09-16 (today): 29-29°C / 84-85°F, Partly Cloudy\n2026-09-17 (tomorrow): 28-29°C / 83-85°F, Moderate or heavy rain shower\n```\n\n## Rules\n\n1. **There is no default place.** If the user named none, do not call: ask which city. Never use a place from this file.\n2. **The location is exactly what the user wrote.** Keep a country or state they gave (`Nassau, Bahamas`, not `Nassau`). Never add one they did not give. A country → its capital (`Tbilisi`).\n3. **Name the place from the first line of the result, not the words the user used.** If they ask for Rome and the first line says `Lome, Maritime, Togo`, say it is Lome in Togo.\n4. **If the result is not a weather report, say what it says, in those words.** `No such place: \"Xyzzyville, Atlantis\"` → tell the user that place does not exist and ask for a real one. Do not look it up again under another name, and never state a temperature you did not receive.\n5. Forecasts stop at 3 days: for \"next week\" say so and give the 3 days you have.\n\nAnswer in one plain sentence with the temperature and the condition.\n",
77
77
  "word/SKILL.md": "---\nname: word\ndescription: Create, edit, or read Word (.docx) documents with python-docx — deliver documents as chat attachments, or read an attached one to summarize it or answer questions in the chat. Can embed images generated in the chat. Opens in Pages and Google Docs too.\naliases: [docx, word-document, memo]\npreload_on_name: false\ntools: [exec(python)]\nplatform: [darwin, linux, win32]\nmetadata:\n {\n \"openclaw\":\n {\n \"setup\":\n {\n \"summary\": \"Runs python-docx in the in-process Python runtime, from packages that ship with the app. The first use waits for the runtime to start.\"\n }\n }\n }\n---\n\n# Word\n\nBuild, change, or read `.docx` documents. This file holds no Python and no\nrecipe: it only says which reference file to load. Load exactly one with the\n`skill` tool, then do what that file says.\n\n## Which File to Load\n\nPick the row by **what the user wants done**, then make that exact `skill`\ncall. \"Edit\", \"update\", \"modify\", \"change\", \"replace\", \"rewrite\" and \"fix\" all\nmean the same thing here — the verb never picks the row, the change does.\n\n| The user wants | The `skill` call |\n| ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------- |\n| A new document — \"write a report\", \"make a doc with 30 fun facts about cats\", \"draft a letter\" | `{\"name\": \"word\", \"file\": \"references/create.md\"}` |\n| Some paragraphs of an existing document changed — \"replace the first 10 facts with dog facts\", \"change fact 3\", \"reword paragraph 7\", \"swap these bullets for those\" | `{\"name\": \"word\", \"file\": \"references/paragraphs.md\"}` |\n| Anything else done to an existing document — add a section, remove or rewrite a whole section, make the text bigger, put an image in it | `{\"name\": \"word\", \"file\": \"references/rework.md\"}` |\n| An answer in the chat from an attached document — \"summarize this\", \"what does it say about X\" | `{\"name\": \"word\", \"file\": \"references/read.md\"}` |\n\n- A document that already exists in this chat is never rebuilt with\n `create.md` — that throws away everything the user has. Its `attachmentId`\n is in the `exec` result that produced it or on the `[Attached file …]` line.\n- A summary delivered as a file is `read.md` first, then `create.md`.\n- `paragraphs.md` runs two scripts bundled with this skill and contains no\n Python. `rework.md` and `create.md` carry the python-docx recipes to copy.\n\nEach load is a real `skill` tool call — printing the call as JSON or text in\nyour reply loads nothing. Never write the Python from memory: the recipes carry\nrules (exact version pins, attachment staging, the only working removal idiom)\nthat fail in non-obvious ways when improvised, and loading the file is one\ncheap read-only call.\n\n## When to Use\n\n- The user asks for a document, report, letter, memo, `.docx`, or Word file.\n- The user attaches a `.docx` and wants its content changed, replaced in part,\n extended, trimmed, or reworked.\n- The user attaches a `.docx` and asks what it says — a summary, a question\n answered, or content pulled out into the chat.\n- The user wants a document that embeds images generated in this chat.\n\n## When NOT to Use\n\n- The user wants text in the chat and no document is involved — just write it.\n Summarizing or answering from an attached `.docx` **is** this skill: load\n `references/read.md`.\n- The user wants slides or a deck — that is the presentations skill.\n- The user wants a spreadsheet or a PDF — python-docx writes only `.docx`.\n\n## What This Skill Cannot Do\n\nSay so instead of faking these; a fake is worse than a clear \"not supported\":\n\n- **No table of contents.** A real TOC is a Word field that Word itself computes;\n python-docx cannot insert one. Do not fake a TOC by typing headings and page\n numbers — the page numbers would be wrong. Offer headings (`Heading 1..9`)\n instead; Word can generate a TOC from them later.\n- **No tracked changes or comments.** There is no revisions API. Edits land as\n plain content; say that when the user asks for a redline.\n- **No legacy `.doc`.** Only `.docx`. A `.doc` output name is rejected — name it\n `.docx`.\n- **No PDF export and no rendering.** The runtime cannot convert or preview the\n document; it can only write the file.\n\n## Rules for Every Job\n\n**You build it, not the user.** Deliver the document, never the recipe. Do NOT\nprint the python source in chat, do NOT tell the user to install python-docx,\nrun a script, or open a terminal — they have no terminal in this chat and the\ncode would not run there. The document exists only if an `exec` call with\n`outputs` succeeds and returns the attachment; falling back to \"here is the\nscript, run it yourself\" is a failed turn.\n\n**Success = stop.** When `exitCode` is `0` and the result's `attachments`\nlists the `.docx`, the document is done. Do not call `exec` again for the same\nrequest — not to \"confirm\", not to \"improve\", not to \"add the image\" after the\nfact. Exactly one successful _build_ `exec` per document request — a\nno-`outputs` read that precedes a build delivers nothing and is not one of\nthem, but it belongs before the build, never after it. Reply with a single\nline: file name + the count line from stdout. If the result has\n`missingOutputs` instead, the file was never written: read stderr first — an\n`AssertionError` there means a guard stopped the save on purpose (see the\nrework recipe); only when stderr is clean check the `save()` name matches the\ndeclared output and rerun once.\n\n**Failures are fixed in the code, not around it.** An error in your code is\nnever a fault in python-docx or in the runtime; fix the Python against the\nloaded reference file's recipes and Errors and call `exec` again. A bundled\nscript that stops with a message is fixed by correcting its arguments and\nrerunning the same script — never by writing Python in its place. If two\nconsecutive calls fail with the same error, re-read the traceback\nline-by-line before a third — retrying the identical `command`, or a version\nwith only cosmetic changes, is a loop, not a fix. Do not switch package pins\n(keep `python-docx==1.2.0`), do not wrap source in `python -c` / `pip` /\nshell, do not \"debug\" with `os.listdir` or no-op scripts while `outputs`\nstill lists the document, and do not write the document as markdown/chat text\ninstead of a `.docx`. Never search the web about an error; the answer is\nalways in the `exec` result you already have.\n\n**The runtime is sealed.** There is no shell — `ls`, `cat`, and `file` raise\n`SyntaxError` because `command` is Python source — and no network:\n`requests`, `urllib`, and `socket` all fail. The working directory starts\nempty on every call: a file from an earlier call is gone unless staged again,\nand a file you write but do not declare in `outputs` is discarded. The `exec`\nresult is the only account of what happened — there is no filesystem to check\nand no shell to check it with.\n\n**Never overwrite a staged input.** Changes always save a new output name,\nderived from the document changed — `report.docx` becomes `report_revised.docx`,\nnever a fresh name taken from the new content.\n\n**A change happens inside the document.** `add_paragraph` and `add_heading`\nappend at the end and nowhere else, so replacing content that is already there\nmeans rewriting those paragraphs, not adding new ones. Delivering the original\nwith the new version appended, or a fresh document holding only the new\ncontent, is a failed turn.\n",
78
78
  "word/references/create.md": "# Creating a Word Document (python-docx)\n\nCreate a new `.docx` from scratch by running Python through the `exec` tool.\nA new document needs **no** `inputs` — do not invent attachment ids — unless\nit embeds an image (see Embedding Images). **Exactly one** `exec` call per\nuser request when that call succeeds.\n\n**A document that already exists in this chat is never rebuilt here.** \"Replace\nthe first 10 facts\", \"reword this\", \"add a section\" — any request that starts\nfrom an existing `.docx` is a change to that document: some of its paragraphs\nis `references/paragraphs.md`, anything else is `references/rework.md`, and\neither one stages the document by its `attachmentId`. Building a fresh\ndocument for such a request throws away everything the user already has.\n\n## The exec call\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-docx==1.2.0\"],\n \"outputs\": [\"report.docx\"],\n \"command\": \"...\"\n}\n```\n\n- `language` — always `\"python\"`.\n- `packages` — `[\"python-docx==1.2.0\"]` on every call. The PyPI package is\n `python-docx` but the import is `docx`; never list `docx` as the package —\n that resolves a different, abandoned library. Pin the version; an unpinned\n install resolves a potentially different library version. This exact version\n ships with the app and installs with no network; any other version has to be\n downloaded, which fails on a device that is offline.\n- `outputs` — `[\"report.docx\"]`. `save(\"report.docx\")` must match the declared\n output name. A file you write but do not declare here is discarded. A `.doc`\n output name is rejected — name it `.docx`.\n- `command` — the multi-line Python source, with real newline characters.\n Never collapse it to one line joined by `;` — a `for`/`if`/`with` after a\n semicolon is a `SyntaxError`. Its first line is the first line of Python\n that runs: there is no shell and no interpreter to invoke, and no\n installer — packages are declared in `packages`.\n\n## Embedding Images\n\nTwo kinds of image input, told apart by where the file came from:\n\n**Tool-produced images** (`generate_image` output): stage them with the exact\n`attachmentId` from the tool result — never placeholders like `att_image` or\nany id you made up.\n\n**Images the user uploaded** (\"use this photo\"): there is no id to copy — an\nuploaded image never shows one. Stage it with `path` only and **no\n`attachmentId` key**; the first id-less entry is the first image of the user's\nlatest message, the second is its second image, and so on. Id-less entries\nresolve _images only_.\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-docx==1.2.0\"],\n \"inputs\": [{ \"path\": \"photo.png\" }],\n \"outputs\": [\"report.docx\"],\n \"command\": \"...\"\n}\n```\n\nStaged files land in the working directory under the bare `path` names —\nreference `doc.add_picture(\"photo.png\", …)` by that name only. Paths must be\nunique bare filenames. `attachment … not found in this chat` means you\ninvented an id or the file is not attached: re-copy the exact id from the tool\nresult, or for a document with no image drop `inputs` entirely.\n\nIf the image was staged in `inputs`, embed it in **that** single build with\n`doc.add_picture` — never deliver a document and then rebuild to add the\nimage. Soft-failing (`try`/`except` around the picture) and saving without it\nis a failed turn, not a success.\n\n**Image URLs do not work — never download.** Your Python code has **no\nnetwork access**: `requests`, `urllib`, and `socket` all fail with a network\nerror, and `http_request` returns truncated text, never image bytes. When the\nuser gives an image URL, do not try to fetch it from Python and do not retry\nthrough other tools — that is a dead end. Say the link cannot be downloaded\nand ask the user to attach the image itself, or offer `generate_image` for a\nsimilar visual. Then build the document with the staged attachment as above.\n\n## Which Shape\n\n| The user asks for | Shape |\n| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| \"30 fun facts about cats\", \"10 tips for …\", \"a list of …\", any number of items or points | **List** — a title, then exactly N `List Bullet` paragraphs and nothing else: no intro sentence, no section headings, no numbers typed into the text |\n| a report, memo, letter, plan — anything with sections | **Report** — the recipe under The Recipe below |\n\n### The list shape\n\n```python\nfrom docx import Document\n\ndoc = Document()\ndoc.add_heading(\"30 Fun Facts About Cats\", level=0)\nfacts = [\n \"Cats sleep for about 70 percent of their lives.\",\n \"A group of cats is called a clowder.\",\n \"A cat's nose print is unique, like a fingerprint.\",\n] # one plain string per item — write all N here\nfor fact in facts:\n doc.add_paragraph(fact, style=\"List Bullet\")\ndoc.save(\"cat_facts.docx\") # must match the declared output exactly\nprint(f\"{len(facts)} items, {len(doc.paragraphs)} paragraphs, {len(doc.tables)} table(s)\")\n```\n\nOne string per item, as many as the user asked for. No headings between\ngroups of items and no introductory sentence: each of those is a paragraph the\nuser did not ask for, and a later \"change the first 10 items\" then lands on the\nwrong lines. The count line it prints is the reply — a delivered list is done,\nwhatever the count says; never rebuild it to fix the number.\n\n## The Recipe\n\nStart from this for a report. It is a complete, working document — a title, headings,\nparagraphs with bold and italic runs, a bulleted list, and a table — saved\nunder the declared output name. Copy it and change the content; do not\nassemble a document from memory.\n\n**Keep the source multi-line.** A `for`/`if`/`with` after a semicolon is a\n`SyntaxError` — paste the block with real newlines, not `stmt; for x in y: …`.\n\n**Hold content in plain lists of strings, and walk them.** Every list of bullets\nis a flat `[\"…\", \"…\"]`, and every table is a list of row lists. Do not reach for\na dict, a tuple of mixed widths, or a nested comprehension to hold document\ncontent — those are where a `SyntaxError` or a\n`ValueError: too many values to unpack` comes from, and they buy nothing here.\n\n**Keep every underscore in API names.** `add_heading`, `add_paragraph`,\n`add_run`, `add_table`, `add_row`, `add_picture`, `add_page_break` — stripping\nthem to `addheading` / `addparagraph` fails. Copy identifiers exactly as written\nbelow:\n\n```python\nfrom docx import Document\nfrom docx.shared import Inches, Pt, RGBColor # one import line covers sizes, widths, colors\n\ndoc = Document()\n\ndoc.add_heading(\"Quarterly Report\", level=0)\ndoc.add_paragraph(\"Prepared by the finance team.\")\n\ndoc.add_heading(\"Summary\", level=1)\np = doc.add_paragraph(\"Revenue grew \")\nstrong = p.add_run(\"18 percent\")\nstrong.bold = True\np.add_run(\" against a \")\nemphasis = p.add_run(\"flat\")\nemphasis.italic = True\np.add_run(\" cost base.\")\n\ndoc.add_heading(\"Highlights\", level=1)\nfor point in [\n \"New retail partners in two regions\",\n \"Churn down for the third quarter\",\n \"Support backlog cleared\",\n]:\n doc.add_paragraph(point, style=\"List Bullet\")\n\ndoc.add_heading(\"Key Figures\", level=1)\nfigures = [\n [\"Metric\", \"Q3\", \"Q4\"], # first list is the header row\n [\"Revenue\", \"$1.2M\", \"$1.4M\"],\n [\"Costs\", \"$0.9M\", \"$0.9M\"],\n]\ntable = doc.add_table(rows=1, cols=len(figures[0]))\ntable.style = \"Table Grid\"\nfor index, cells in enumerate(figures):\n row = table.rows[0].cells if index == 0 else table.add_row().cells\n for column, value in enumerate(cells):\n row[column].text = value\n\ndoc.save(\"report.docx\") # must match the declared output exactly\nprint(f\"{len(doc.paragraphs)} paragraphs, {len(doc.tables)} table(s)\")\n```\n\n## Write a document, not markdown\n\nA `.docx` carries real styles, so the structure is the style — never the\npunctuation. Markdown written into text stays there verbatim and reads as a\ntypo in the finished document:\n\n- **No markdown characters in any string.** `#`, `##`, `-`, `*`, `1.`, `**bold**`\n and backticks all render literally. `add_heading(\"Security\", level=2)` — never\n `add_heading(\"- Security\", level=2)` or `\"## Security\"`. A numbered list is\n `style=\"List Number\"`, which numbers itself; a typed `\"1. \"` prefix double-numbers.\n- **No typed rules or line breaks.** A row of dashes or underscores as a section\n divider is just those characters on the page, and a leading `\"\\n\"` is a blank\n line inside the paragraph. Headings already separate sections.\n- **Every section title is a heading.** A first section called \"Introduction\" or\n \"Overview\" goes through `add_heading(..., level=1)` like every other one; as a\n plain `add_paragraph` it renders as body text and the document looks unstructured.\n- **No blank paragraphs for spacing.** `add_paragraph(\"\")` leaves a visible gap —\n the heading and body styles already carry their own space before and after.\n- **Bold is for a few words, not a sentence.** A fully bold paragraph reads as a\n formatting mistake; bold the term, then continue in a normal run.\n\n## One paragraph, one string\n\n`add_paragraph` takes a single text string, optionally with `style=` — nothing\nelse. Several sentences passed positionally raise\n`TypeError: Document.add_paragraph() takes from 1 to 3 positional arguments but 4\nwere given`. Join them into one string, or open the paragraph with the first\npiece and add the rest as runs:\n\n```python\np = doc.add_paragraph(\"As of 2026, Bitcoin is widely held. \")\np.add_run(\"Adoption keeps growing.\")\n```\n\n**The text you pass to `add_paragraph` is already the paragraph's first run.** A\nrun added afterwards _appends_ — repeating any of those words writes them twice\ninto the document (`\"…finite supplyfinite supply\"`). Each run carries the next\nwords and only those, so give a mixed-format paragraph an empty start and add\nevery piece as its own run:\n\n```python\np = doc.add_paragraph()\np.add_run(\"Digital scarcity \")\ntail = p.add_run(\"and a finite supply\")\ntail.italic = True\n```\n\n## Bold and italic live on runs, never on paragraphs\n\n`paragraph.bold = True` raises no error and changes **nothing** in the file — a\nparagraph has no bold; the assignment lands on the Python object and is silently\ndiscarded on save. Formatting belongs to runs:\n\n```python\np = doc.add_paragraph(\"normal, then \")\nstrong = p.add_run(\"bold\")\nstrong.bold = True\np.add_run(\" and \")\nemphasis = p.add_run(\"italic\")\nemphasis.italic = True\n```\n\nTwo rules make that shape the only one to write:\n\n- **`add_run` takes the text and nothing else.** `p.add_run(\"x\", bold=True)`\n raises `TypeError: Paragraph.add_run() got an unexpected keyword argument\n'bold'` — create the run, then set the attribute.\n- **Never chain an attribute onto the `add_run(...)` call.** Name the run on one\n line and format it on the next, as above. A run that needs no formatting is a\n bare `p.add_run(\"plain text\")` and the line ends there — a trailing `.` left\n over from a half-written chain is `SyntaxError: invalid syntax`.\n- **Runs join with no gap between them.** The next run starts exactly where the\n last one ended, so the separating space belongs inside one of the strings —\n `\"…without intermediaries. \"` then `\"It was invented\"`, never\n `\"…intermediaries.\"` followed by `\"It was invented\"`.\n\n**`add_run` belongs to the paragraph, not to a run.** Keep the paragraph in a\nvariable and call `p.add_run(...)` for every run in it — chaining a second run off\nthe first raises `AttributeError: 'Run' object has no attribute 'add_run'`. A run\nowns `.text`, `.bold`, `.italic` and `.font`, and nothing else: it has no\n`add_run`, no `add_paragraph`, and no `.style`.\n\nA run is also not a string: `p.add_run(\" \") * 2` raises\n`TypeError: unsupported operand type(s) for *: 'Run' and 'int'`. Put any repeated\ntext inside the string itself — and reach for neither, since spacing is the\nstyle's job, not padding you type.\n\nCharacter detail goes through `run.font` — size, color:\n\n```python\nfrom docx.shared import Pt, RGBColor\n\np = doc.add_paragraph()\nrun = p.add_run(\"Key finding\")\nrun.font.size = Pt(14)\nrun.font.color.rgb = RGBColor(0x1A, 0x73, 0xE8) # RGB in all caps\n```\n\n`Pt`, `Inches`, and `RGBColor` all import from `docx.shared` — there is no\n`docx.util` and no `docx.dml.color`; those are python-pptx paths and fail here.\n\n## Styles must exist in the document\n\n`style=\"List Bullet\"` names a style **inside the document**. A missing name\nraises `KeyError: \"no style with name 'List Bullet'\"` at `add_paragraph` time.\n\nA **new** `Document()` ships these styles — safe to use without checking:\n`Title`, `Heading 1` … `Heading 9`, `Normal`, `List Bullet` (+ ` 2`, ` 3`),\n`List Number` (+ ` 2`, ` 3`), `Intense Quote`, and the table style `Table Grid`.\nDo not invent other names for a new document. (An uploaded document carries\nonly its own styles — when editing one, load `references/rework.md` for the\nguard.)\n\n## Headings and lists\n\n- `doc.add_heading(text, level=N)` — level `0` is the document title style,\n `1`–`9` map to `Heading 1`–`Heading 9`. Any other level raises\n `ValueError: level must be in range 0-9`.\n- Bullets: one `add_paragraph(point, style=\"List Bullet\")` per point, over a flat\n list of plain strings. Never pack several points into one paragraph with `\\n` —\n a `\\n` is a soft line break inside the same list item, not a new bullet. A\n bullet that needs a label and a detail is one string (`\"Limited supply — 21\nmillion coins\"`), never a dict entry or a tuple.\n- Numbered lists: `style=\"List Number\"`. Indent a level with `List Bullet 2` /\n `List Number 2`.\n\n## Tables\n\nWrite the whole table as a list of row lists — header first — then let the code\nabove derive everything from it. **Always `rows=1` and `cols=len(rows[0])`**:\n\n```python\nrows = [\n [\"Item\", \"Status\"], # header\n [\"Search\", \"Shipped\"],\n [\"Export\", \"In review\"],\n]\ntable = doc.add_table(rows=1, cols=len(rows[0]))\ntable.style = \"Table Grid\" # borders; omit for invisible grid\nfor index, cells in enumerate(rows):\n row = table.rows[0].cells if index == 0 else table.add_row().cells\n for column, value in enumerate(cells):\n row[column].text = value\n```\n\nThat shape exists because the two hand-written alternatives both fail:\n\n- **`rows=` is a count of blank rows created immediately, not a maximum.**\n `add_table(rows=4, …)` followed by `add_row()` per entry leaves three empty\n rows sitting between the header and the data, plainly visible in the finished\n document. `rows=1` is the header; every other row comes from `add_row()`.\n- **Unpacking a row into fixed names breaks the moment a row is a different\n width.** `for name, q3, q4 in data:` raises\n `ValueError: too many values to unpack (expected 3, got 4)`, and hand-counting\n `cols=` against the data is the same mistake one step earlier. Index the cells\n instead, and take the column count from the header.\n\nAddress cells as `table.cell(row, col)` or `table.rows[r].cells[c]` — they are\nthe same cell. Rows only grow at the bottom: there is no insert-at.\n`table.rows[9]` on a 4-row table raises `IndexError`. Write text with\n`cell.text = \"…\"`; for formatting inside a cell go through `cell.paragraphs[0]`\nand its runs like any other paragraph.\n\n## Images and page breaks\n\n`doc.add_picture(name, width=…)` appends the image in its own paragraph. Pass\nonly one of `width`/`height`; passing both distorts the picture.\n\n```python\nfrom docx.shared import Inches\n\ndoc.add_picture(\"figure1.png\", width=Inches(5.5))\ndoc.add_page_break()\n```\n\n**Do not soft-fail images or imports.** Never wrap `add_picture` or an import in\n`try`/`except` that prints a warning and continues. A missing file must raise so\nyou fix it and rerun — a document saved without the requested image is a failed\nturn, not a success.\n\n## Errors\n\n- `ModuleNotFoundError: No module named 'docx'` means `packages` was missing or\n wrong — add `[\"python-docx==1.2.0\"]` and rerun. Never try to install it, and\n never \"fix\" it by importing `python_docx`; the import stays `docx`.\n- `TypeError: 'Table' object is not subscriptable` — a table was indexed\n directly (`table[0]`). Cells are reached through `table.rows[r].cells[c]` or\n `table.cell(r, c)`; a whole row of cells is `table.add_row().cells`.\n- `KeyError: \"no style with name '…'\"` — the style is not in this document. For\n a new document use only the names listed under Styles.\n- `NameError: name 'RGBColor' is not defined` (or `Pt`, `Inches`) — the import\n line is missing that name. Keep the sample's single\n `from docx.shared import Inches, Pt, RGBColor` rather than importing one at a time.\n- `SyntaxError: invalid syntax` on a one-line `for`/`if` means the source was\n collapsed — restore multi-line newlines from the sample and rerun. Underscores\n in names (`add_paragraph`, not `addparagraph`) must stay. Do not switch to\n `python -c` or change the package pin.\n- On an `AttributeError` from python-docx the API name is wrong; on a `TypeError`\n about positional arguments the call passes the wrong number of them — usually\n several strings where one is allowed. Fix either against this file's examples,\n reading the line number in the traceback. Do not retry the same call, and do\n not switch to a shell.\n- `attachment … not found in this chat` means `inputs` listed an id that is not\n in this chat (often a copied placeholder like `att_doc`). For a new document,\n omit `inputs` entirely and rerun. Only stage real ids from prior tool results.\n- Never print the document's bytes or base64 — stdout is capped and the file\n travels through `outputs`. A build call prints exactly one line (e.g. `9\nparagraphs, 1 table(s)`).\n- Never pass an absolute path to `save()`.\n\n## Finish\n\nWhen `exitCode` is `0` and `attachments` lists the `.docx`, the document is\ndone — the `exec` result carries\n`attachments: [{ attachmentId, fileName, byteLength }]` and the file is already\nattached to the chat for the user to open or save, exactly like a\n`generate_image` result. Stop tool use and reply with a single line: file name\n\n- the count line from stdout. Exactly one successful `exec` per request. If\n the result has `missingOutputs` instead, the file was never written: check the\n `save()` name matches the declared output and rerun once.\n",
79
79
  "word/references/paragraphs.md": "# Changing Some Paragraphs of a Document (bundled scripts)\n\n\"Replace the first 10 facts\", \"change fact 3\", \"swap these bullets for those\",\n\"reword paragraph 7\": two `exec` calls, both running a script bundled with this\nskill. **Write no Python.** There is no `command` in this job — a call with\n`command` is the wrong call. Pass `skill`, `script`, and `scriptArgs` exactly as\nshown, with `inputs` staging the document by its `attachmentId` (from the\nearlier `exec` result or the `[Attached file …]` line — copy it verbatim, never\ninvent one).\n\n| Step | The `exec` call |\n| --------------------------------------- | ---------------------------------------------------------------- |\n| 1. see the paragraphs and their indexes | `scripts/list_paragraphs.py`, `inputs` staged, no `outputs` |\n| 2. replace exactly the chosen indexes | `scripts/replace_paragraphs.py`, `inputs` staged, one `outputs` |\n\n## Step 0 — find the document's `attachmentId`\n\nThe id is in the chat already, never invented: a document built earlier in\nthis chat has it in the `attachments` of the `exec` result that produced it —\n`{\"attachmentId\":\"922bd4e17517b90593be1c5ae4f12fbd\",\"fileName\":\"cat_facts.docx\"}`\n— and a document the user uploaded has it on the `[Attached file …]` line of\ntheir message. Copy that exact id into `inputs`. An `inputs` entry with a\n`path` and no `attachmentId` is an _image_ upload and is refused for a\ndocument:\n\n```json\n{ \"inputs\": [{ \"path\": \"existing.docx\" }] }\n```\n\n## Step 1 — list the paragraphs (no `outputs`)\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-docx==1.2.0\"],\n \"inputs\": [{ \"attachmentId\": \"<real id>\", \"path\": \"existing.docx\" }],\n \"skill\": \"word\",\n \"script\": \"scripts/list_paragraphs.py\",\n \"scriptArgs\": [\"existing.docx\"]\n}\n```\n\nEvery key above is required — `inputs` with the document's real\n`attachmentId`, `skill`, `script`, `scriptArgs`. A call missing `skill` or\n`inputs` is refused.\n\nIt prints one line per paragraph — `index`, style, text — then a count line.\nPick the indexes to replace from that list:\n\n- Only body paragraphs (`Normal`, `List Bullet`, `List Number`) are facts,\n points, or bullets. `Title`, `Heading N`, and an intro sentence are never\n counted as one.\n- \"The first 10 facts\" = the first 10 body-paragraph indexes after the heading\n or sentence that introduces them — not indexes 0–9.\n- Fewer facts in the document than asked for: replace the ones that exist and\n say so in the reply.\n\n## Step 2 — replace exactly those paragraphs (one `outputs` entry)\n\n`scriptArgs` is: input name, output name, then `index, new text` pairs — one\npair per replaced paragraph, as many pairs as facts requested. The output name\nkeeps the input's stem plus `_revised`.\n\nCount the pairs before sending: \"the first 10 facts\" is 10 pairs — 20 strings\nafter the two file names, 10 different sentences, the last index being\nstart + 9.\n\n```json\n{\n \"language\": \"python\",\n \"packages\": [\"python-docx==1.2.0\"],\n \"inputs\": [{ \"attachmentId\": \"<real id>\", \"path\": \"existing.docx\" }],\n \"outputs\": [\"existing_revised.docx\"],\n \"skill\": \"word\",\n \"script\": \"scripts/replace_paragraphs.py\",\n \"scriptArgs\": [\n \"existing.docx\", \"existing_revised.docx\",\n \"3\", \"Dogs have about 1,700 taste buds.\",\n \"4\", \"A dog's nose print is unique, like a fingerprint.\"\n ]\n}\n```\n\nWrong, for this job — a `command` instead of a `script`:\n\n```json\n{ \"command\": \"from docx import Document\\ndoc = Document(\\\"existing.docx\\\")\\nfor i in range(1, 11): ...\" }\n```\n\nEach new text is one complete plain sentence, no markdown, each different. The\nscript keeps each paragraph's paragraph style, refuses a heading index,\nrefuses text that already reads the same, and prints\n`K of N paragraphs replaced`.\n\n## Finish\n\n`exitCode 0` plus an attachment = done. Reply with one line: the file name and\nthe printed count line. Do not call `exec` again for this request.\n\n## Errors\n\nThe script stops with a message that names the fix; correct the arguments and\nrerun the **same script** — never switch to writing Python.\n\n- `usage: replace_paragraphs.py …` — the pairs are incomplete: after the two\n file names, arguments alternate `index`, `text`.\n- `scriptArgs name \"existing_revised.docx\" but the working directory starts\n empty` — the call has no `outputs`; add `\"outputs\": [\"existing_revised.docx\"]`\n (the same name as in `scriptArgs`) and rerun the same script.\n- `script runs need the owning skill name in skill` — add `\"skill\": \"word\"`.\n- `index N is the heading '…'` — that paragraph is a heading, not a fact. Pick\n body indexes from the Step 1 list.\n- `index N is outside the document's M paragraphs` — re-read the Step 1 list;\n indexes run from 0 to M-1.\n- `index N already reads exactly that` — the new text equals the old one; write\n a different sentence.\n- `output … must be a new name` — the output name equals the input's; use\n `existing_revised.docx`.\n- `an id-less input stages an uploaded image` — the `inputs` entry has no\n `attachmentId`; add the document's id from Step 0 and rerun the same script.\n- `usage: list_paragraphs.py <input.docx>` — `scriptArgs` was left out; pass\n the staged path, `[\"existing.docx\"]`.\n- `PackageNotFoundError` / `attachment … not found` / `does not exist in the\n working directory` — `inputs` is missing or carries an invented id; stage the\n document by its real `attachmentId`.\n",