跳到主要内容

google-workspace 精选

Read this before the first Google Drive, Docs, Sheets or Slides connector call whenever the task creates or changes a Google file. Use this skill whenever the user wants to create or change a Google Doc, Sheet or Slides file in their Google Drive. Triggers include: a request that names Google Docs, Sheets, Slides or Drive and asks to make, edit, format, copy or rename a file; a docs.google.com link with a request to change that file, even a one-line fix or suggested edits; and any follow-up change to a Google file from earlier in the chat, even \"change it\" or \"add a tab\". Includes helper scripts for document positions, cell ranges and slide layout. However, if the user asks for a doc, deck or spreadsheet without naming Google, or gives a Google file only as source material for something new, use Claude's own output type instead. Do NOT use for read-only questions about a Google file, or for Word, Excel, PowerPoint or PDF files.

在 GitHub 打开

安装方式

cp -r Anthropic/claude-code/skills/google-workspace ~/.claude/skills/google-workspace

把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/

整仓一次性获取:git clone --depth 1 https://github.com/asgeirtj/system_prompts_leaks.git

依赖与权限

  • 无需 API Key
  • 无需联网
  • 依赖外部命令:python go make convert
  • 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
触发场景
change a Google DocSheet

SKILL.md 正文

来源 asgeirtj/system_prompts_leaks@a09e0e7 · 许可 CC0-1.0 · 内容未修改

Google Docs, Sheets, and Slides

The Google connectors are thin wrappers over Google's raw APIs, with almost no guidance of their own. This skill supplies that guidance: which connector does what, the rules that keep edits in the user's file, and, in one reference file per app, how each API really behaves. Most of the app-specific rules in the references were tested against Google's Docs, Sheets and Slides APIs; the rest were seen through the connectors, and a few have not been checked yet.

Read the reference before you touch the file

Working onRead firstWhy it matters
A Google Docreferences/docs.mdDocs edits address UTF-16 positions that shift after every insert and go stale after every write. Tabs and pending suggestions change the positions too.
A Google Sheetreferences/sheets.mdBoth write tools parse input like the Sheets UI, so text can silently become numbers or dates. Formatting needs numeric sheet IDs, 0-based ranges, and field masks without parentheses.
A Google Slides deckreferences/slides.mdPositions are in EMU, an element's real size is its size times its scale, and an unmasked read can exceed 150 KB for three slides. Slides never shrinks text to fit.

Read the reference for every app the task touches before the first edit. Embedding a Sheets chart in a deck means reading both. The references are short, and skipping one is how edits land in the wrong place.

1. Check the connectors before you start

ConnectorWhat it can do
Google DriveCreate files, upload and convert content, rename, read a file as text, export (PDF and other formats), search, trash
Google DocsRead a doc's full structure and edit it in place, directly or as suggestions
Google SheetsRead values and structure, write values and formulas, format, add tabs and charts
Google SlidesRead a deck, add and edit slides, shapes, text, tables, and linked charts

Drive can create all three file types. It can't edit a file after that. Without the matching editor connector, every change means a new file and a new link, and the user loses the link they already have.

  1. Check which Google tools are available in this conversation. On surfaces where tools are deferred, search for and load the tools you need first, such as "google sheets update". Tool names differ by surface, so use the names your surface lists. If a search returns nothing, list all available tools before deciding the connector is missing, because the tool may exist under a different name.
  2. If the editor tools are missing, tell the user. When you can list the conversation's connectors, say which case it is: a connector that is set up but turned off in this chat (ask them to turn it on in the chat's connector settings, then continue), or one that isn't connected at all (tell them which connector to add and what it enables).
  3. With an editor connector missing, a request to create a new file continues with Drive. A change to an existing file stops and asks. See the missing-connector rule in section 2.
  4. If the user asks only for a new file, create it with Drive. If the editor connector is off, add one line saying edits will need it.

Example: "I can create the sheet now. If you want changes later, turn on the Google Sheets connector in this chat first. Then I can edit this file, and the link will stay the same."

2. Rules for every file

  • A change goes in the same file. "Change", "update", "fix", "add", and "switch it to" all mean the user wants the same file and link. Do not recreate the file to skip an edit.
  • A missing editor connector is a choice for the user, not a workaround for you. When the user asks for a change to an existing file and the editor connector is missing, your whole reply is a short question, not a deliverable. Building the next-best thing feels helpful, but the user's file is still untouched and now there are two artifacts, which is the exact failure this skill exists to prevent. Lead with the fix: name the connector and say that with it on, the edit lands in their existing file and the link stays the same. You may offer an alternative, such as drafted text to paste or a file to import by hand, but only as a named option, and build it only after the user picks it. Example reply, in full: "To add the slide to your deck directly, turn on the Google Slides connector in this chat and I'll do it. Same deck, same link. Or I can draft the slide as a file you'd import by hand. Which do you prefer?"
  • Never trash a file the user didn't ask you to delete. Drive can trash a file, but it can't restore one. The Docs, Sheets, and Slides connectors can't open a trashed file.
  • Read before you edit, and guard the write. Send every Docs and Slides batch with writeControl.requiredRevisionId set to the revisionId from a read taken after your last write, including batches built on IDs or positions from your own earlier writes. The only exception is a batch made entirely of replaceAllText requests, even one limited to some tabs or slides. If the file changed since that read, whether from your own write or someone else's, Google rejects the whole batch instead of applying it at stale positions or IDs. Read again before each guarded batch, and don't reuse a revision ID from a write reply. On a rejection, read again and rebuild; never drop the guard. read_doc and read_presentation (the mask in references/slides.md includes it) return the ID. read_slide_page returns it only if its mask includes revisionId; read_slide_page_thumbnail and Drive read_file_content never do. For a saved read, the first line of docs_index.py outline or slides_helper.py outline shows it; if that line says None, read again with read_doc or read_presentation. get_spreadsheet returns a revisionId even with a field mask, but don't send it: send Sheets writes without writeControl, and read again right before a write that depends on positions.
  • Put everything for one step in one batch. Batch requests run in order and atomically: if one is invalid, none apply. One call per logical step is faster and leaves no half-finished state.
  • Sheets field masks. Write each path in full, with no parentheses: one path per item in get_spreadsheet's fields list (["spreadsheetId", "sheets.properties"]), and comma-separated in a batch update request's fields string ("userEnteredFormat.numberFormat,userEnteredFormat.textFormat.bold").
  • Verify the result. Read the file again after each edit and check the result before you report it. A tool accepting the call does not mean the content is correct. Each reference has a Verify section.
  • Rename with Drive update_file. A rename keeps the same link.
  • Link every file you name. When you name a Google file you created, copied, found, or edited, make its title a link, inside the sentence that says what you did: "I added the row to [Team roster](its link)." Don't set the file apart after a colon or on a line of its own ("I've created a file for you: Team roster"). If a Drive result says the user can already see or open a file from the chat, leave that file's link out unless they ask. Always give the link when the user asks for it, wants to send it to someone, or says they can't see or open the file, even if a result said they could. Don't tell the user to use a card or preview unless a result said one is shown. After an edit, say that the link stays the same.

3. Drive, for all three apps

  • Find a file: use Drive search when the user names a file without a link. Confirm the match with the user if more than one file fits.
  • Create: create_file with contentMimeType set to application/vnd.google-apps.document, .spreadsheet, or .presentation creates an empty file. Uploading content with a source type (HTML, CSV, .xlsx, .pptx) converts it into the matching Google type. Each reference says which route fits that app.
  • Read as text: read_file_content returns a compact text rendering: Markdown for a Doc. It is a few KB where the editor connector's full read can be over 100 KB, so use it to understand content, then use the editor read when you need positions.
  • Export: download_file_content with exportMimeType: "application/pdf" returns the rendered file as base64. It is large (about 65 KB of text for a four-slide deck), so export only for a visual check, and only where you can run code.

4. Helper scripts

The scripts/ folder next to this file holds tested helpers. They turn the APIs' raw JSON into short readable summaries, and turn simple specs into correct request batches, so the error-prone arithmetic never happens by hand. Use them wherever you can run Python. Run them by their full path inside this skill's folder; the references write that folder as <skill>.

ScriptCommandsUsed for
docs_index.pyoutline, find, new-table, fill-tableDocs positions, text search with bold and suggestion state, adding a filled table in one call, filling an existing table
sheets_helper.pyrange, format, cellsA1 ranges to grid ranges, formatting batches from a short spec, reading formulas and error cells
slides_helper.pyoutline, buildReal slide geometry with overflow and overlap warnings, building slides from an inch-based spec
render_export.pyone commandDecoding a PDF export into page images to look at

Getting JSON to a script. Large tool results are often saved to a file by the app, and the result tells you the path. Point the script at that path; the scripts read the file as the app saved it. When a result comes back in context and is small (a few KB, such as a masked read or sheet metadata), write it to a file and run the script on it. Don't re-type a large result into a file: that doubles the cost and invites copying errors. If a large result was cut off and not saved, read a smaller slice instead (a field mask, a range, or one tab) rather than guessing.

Every script prints --help with its full usage. Each reference shows the commands in context.

5. Common failures across apps

SymptomCauseFix
"No such tool available"The tool is deferred, or the name is different on this surfaceSearch for and load the tool. Use the exact name your surface lists.
Permission denied on a file you createdThe file is in the trashAsk the user to restore it from Drive's trash. You can't restore it with the connectors.
400: required revision ID does not matchThe file changed after your read: your own previous write, or someone else editingRead again, rebuild the requests from the new read, and send them with the new revision. For Sheets, send them without writeControl.
A whole batch failed on one bad requestBatches are atomicFix the named request and resend the full batch. Nothing from the failed call was applied.
A read is too large or cut offUnmasked editor reads include everythingUse Drive read_file_content, a field mask, a range, or a single tab. Run the helper on a saved result.
Two files where the user expected oneAn edit was done by creating a new fileMake changes in place with the editor connector. Tell the user about the extra file; don't trash it without asking.

Each reference ends with the failures specific to that app.

6. What the connectors can't do

When a request runs into one of these, say so plainly and do the alternative. Reported: seen through the connectors or in their tool schemas. Untested: not yet checked.

  • Claude can't see the user's screen. No connector shows what the user has selected, or which file, tab or slide they have open. If "this" or "here" isn't clear from the chat, ask which file, heading, slide number or cell range they mean. Reported.
  • Comments: read_doc has returned no comments even with commentsIncluded: true. To read comments, use Drive read_file_content with includeComments: true, or ask the user to paste them. update_doc has accepted insertComment in one report, although its description is cut before listing it; if that request fails, say you can't add comments and offer to list your notes in the reply. Reported.
  • Suggestion mode can be refused with "Unsupported WriteControl mode". Never make direct edits in its place: offer to list the proposed changes or to edit directly (see references/docs.md). Reported.
  • Request lists are cut short. The update_doc, update_spreadsheet and update_presentation descriptions stop partway through their request lists. Requests missing from the description, such as addDocumentTab and addChart, have still worked, so try one before deciding it isn't supported. Reported.
  • Uploads travel inside the call. create_file takes the whole file as text or base64, so an .xlsx or .pptx upload is slow and often fails. Build in the file with the editor connectors where you can, and keep uploads small. Reported.
  • Images need a public URL. Slides createImage and Docs insertInlineImage fetch the image from a URL Google can reach; a file from the chat can't be inserted this way. For a deck, offer the .pptx route; otherwise ask the user to insert the image. Untested.
  • A Slides chart must already exist in a Sheet. Create it there with addChart, then embed it with createSheetsChart. Reported.
  • Drive search uses title, not name. name contains '…' fails with "Unsupported query field: name"; write title contains '…', and put the file type in a mimeType clause. Reported.
  • Slides edits may not show in an open deck right away. If the user doesn't see a change, ask them to reload the deck before you change anything again. Reported; may be fixed.

质量与来源

所属仓库
asgeirtj/system_prompts_leaks
仓库星标
6.9 万
最近更新
今天
采集时间
今天
commit
a09e0e708710
内容指纹
sha256:014e36f6ac86663
文件路径
Anthropic/claude-code/skills/google-workspace/SKILL.md

同仓库其它 Skill

查看全部 48 个
dashboard
Use this for a dashboard, metrics page, KPI tracker, scorecard, data visualization or recurring report: a page or scroll story of charts, numbers and tables of data, whatever the data and wherever it comes from. Read it when creating, filling, refreshing or revising one. You write datasets (a live query on a connector, or an attached CSV/TSV/JSON file), then the page as plain HTML, in the dashboard's own store.
精选 asgeirtj/system_prompts_leaks 6.9 万 原文
Claude CodeCodex CLICursor
design-system
How to create and revise a design system made from the Design System appifact type: its files under project/, the exact shapes and size caps, the order to write in, how to change one later, and the checklist.
精选 asgeirtj/system_prompts_leaks 6.9 万 原文
Claude CodeCodex CLICursor
design
How to fill and revise a canvas made from the Design (canvas) appifact type.
精选 asgeirtj/system_prompts_leaks 6.9 万 原文
Claude CodeCodex CLICursor
pages
The shared Claude Docs viewer — an artifact TYPE. An artifact made from it is a doc: a live document that people and Claude read and edit together (people may also call it a page). The doc's content does not live in this artifact's files at all — it lives in the Claude Docs service and is read and written ONLY through the Claude Docs connector (its create, batch, read and update tools). Read this before touching such an artifact: it says what the files are, that an instance owns none of its own, how to change what the doc says (the connector, never a publish), and where a comment on the doc — including one sent to you from it — is read and answered (the connector's comment verbs; never these files, never the artifact's comment relay).
精选 asgeirtj/system_prompts_leaks 6.9 万 原文
Claude CodeCodex CLICursor
slides
How to fill and revise a deck made from the Slides appifact type.
精选 asgeirtj/system_prompts_leaks 6.9 万 原文
Claude CodeCodex CLICursor
deep-research
Use this skill when the user's prompt requires (1) researching a topic across multiple sources, comparing options or alternatives, analyzing trends or history, understanding markets or industries, or reviewing literature or studies and (2) synthesizing that research into a comprehensive, narrative report. If you're planning to search the web or internal knowledge bases, consider using this skill. This skill coordinates research subagents, so use it only when you have a tool for spawning subagents (the Agent or Task tool); otherwise, research the question directly.
精选 asgeirtj/system_prompts_leaks 6.9 万 原文
Claude CodeCodex CLICursor

相似 Skill

更多「编码」
access
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how do I set this up" or "who can reach me," or wants to check channel status.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
access
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the iMessage channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Check iMessage channel setup and review access policy. Use when the user asks to configure iMessage, asks "how do I set this up" or "who can reach me," or wants to know why texts aren't reaching the assistant.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
access
Manage Telegram channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Telegram channel.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端
configure
Set up the Telegram channel — save the bot token and review access policy. Use when the user pastes a Telegram bot token, asks to configure Telegram, asks "how do I set this up" or "who can reach me," or wants to check channel status.
精选 anthropics/claude-plugins-official 3.8 万 原文
Claude CodeMCP 客户端