跳到正文
Skillpedia
PDF、Word 与幻灯片15k · #11015

google-docs

它能做什么

该技能使用样式、列表和表格等格式创建和编辑 Google 文档。适合需要在 Google Drive 中保存精美文档的人。

适用场景

  • ✓当你要求智能体创建一份带格式的 Google 文档的时候。
  • ✓当你需要在现有 Google 文档中编辑文字,或添加列表、表格或图片的时候。
  • ✓当你希望为文档应用段落或字符样式的时候。

技能链接

https://github.com/cursor/plugins/blob/main/third_party/google-docs/skills/google-docs/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/cursor/plugins/blob/main/third_party/google-docs/skills/google-docs/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请根据我的会议记录创建一份带格式的 Google 文档,包含标题和一个带项目符号的待办列表。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会在文档中找到准确的文字,并将样式或列表应用到该范围。它会先读取文档结构,使编辑不会错位到其他段落。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Google Docs authoring

Locate text, never compute indexes (the #1 source of bugs)

Docs edits address zero-based UTF-16 index ranges within one tab, and every write SHIFTS later indexes. Guessed or stale indexes silently hit the wrong paragraphs - the classic symptom is two lists merging into one continued numbering. The tools remove the need for index math:

  • find_text returns FRESH {start, end} ranges for exact text - the direct source of indexes for apply_text_style, apply_paragraph_style, delete_content, and set_paragraph_format. Locate, then edit, in back-to-back calls.
  • create_list takes firstItemText/lastItemText anchors and resolves the range itself: name the first and last item paragraphs and no index ever touches your hands. Use one create_list per list with the right preset (BULLET_* for bullets, NUMBERED_* for numbers); never stretch one call across two visually separate lists.

When a range must come from structure instead of a phrase (styling a whole paragraph, addressing a table), read it from read_document elements: a paragraph's {start, end} is the range for paragraph-level tools. END IS EXCLUSIVE: one short misses the last character, one long styles the character after the phrase (the classic italic-or-link off-by-one).

When raw indexes are unavoidable: read_document first, compute ONE edit, pass requiredRevisionId, apply, and re-read before the next positional edit. Order multi-part positional work BACK-TO-FRONT (highest index first) when re-reading between steps is too expensive; earlier ranges stay valid.

Creating a document

create_document makes a BLANK doc (its API ignores content), so plan:

  • Content known up front: prefer google-drive google_drive_create_file with Markdown (target_mime_type: ...document), which imports headings, lists, and tables in one call and can target a folder.
  • Building incrementally: create_document, then insert_text with index omitted to APPEND each paragraph; append mode reads the tail itself and is revision-guarded automatically. paragraphStyle styles the new paragraphs and bold/italic style the inserted text in the same call, so a well-structured document is a sequence of appends with no styling pass.
  • Doc creates cannot set a parent folder. When placement matters, create and then google-drive google_drive_move_or_rename with destination_folder_id.

Structure is not optional

A document without hierarchy reads as a text dump. Default shape for any report/memo/notes request: a TITLE paragraph, an italic byline or date line, HEADING_2 per section, short body paragraphs with bold on the phrases that matter, and bulleted lists for enumerations. Use insert_text's paragraphStyle/bold/italic arguments as you write rather than styling afterwards.

Styling

  • Character styling (apply_text_style): bold/italic/underline/strike, fontSize, fontFamily, textColor/backgroundColor as #RRGGBB, linkUrl. Exclusive END index: to style one paragraph without its trailing newline, use end - 1 from the read.
  • Paragraph styling: apply_paragraph_style for named styles (TITLE/HEADING_1..6), set_paragraph_format for alignment, indents, and line spacing (percent, 100 = single).
  • Lists: create_list over the paragraphs' range; each newline-separated paragraph becomes one item. Insert the plain lines first, then bullet them.
  • The preset is part of correctness: enumerations get a BULLET_* preset by default; NUMBERED_* only when the content is ordered (steps, rankings) or the request says numbered.
  • Before bulleting, check the read for paragraphs that ALREADY show a leading bullet - text appended directly after a list inherits its membership, and create_list over such paragraphs restyles the ORIGINAL list, continuing its numbering (a second list showing 4, 5, 6). Strip first: create_list with remove: true over exactly the new paragraphs, then apply the wanted preset.

Tables and images

  • insert_table inserts an EMPTY grid. To fill it: re-read (cells appear with their own index ranges) and insert_text into cells from the LAST cell to the first, so earlier cell indexes stay valid.
  • Style a table AFTER filling it, addressing it by the table element's start from read_document: set_table_cell_shading the header row (pick the row's text color against that fill), merge_table_cells for a title cell spanning columns (top-left conten
常见问题

为什么列表有时会合并?

猜测的位置会在每次编辑后移动,因此该技能在设置样式之前会先找到新的文本范围。

它能添加图片和表格吗?

能。该技能涵盖表格、图片以及页眉和页脚。

它需要 Google 账户吗?

需要。它通过连接到你 Google 账户的 Google Docs 工具运行。

详情

作者的原始描述

Author and edit Google Docs with the google-docs tools - structured writing, character and paragraph styling, lists, tables, images, headers/footers. Use when creating a formatted document, editing document content, or applying styles.

repo: cursor/plugins

热度

GitHub 星标
15k
排名
#11015
许可证
—
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能