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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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_textreturns FRESH{start, end}ranges for exact text - the direct source of indexes forapply_text_style,apply_paragraph_style,delete_content, andset_paragraph_format. Locate, then edit, in back-to-back calls.create_listtakesfirstItemText/lastItemTextanchors and resolves the range itself: name the first and last item paragraphs and no index ever touches your hands. Use onecreate_listper 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_filewith Markdown (target_mime_type: ...document), which imports headings, lists, and tables in one call and can target a folder. - Building incrementally:
create_document, theninsert_textwithindexomitted to APPEND each paragraph; append mode reads the tail itself and is revision-guarded automatically.paragraphStylestyles the new paragraphs andbold/italicstyle 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_renamewithdestination_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, useend - 1from the read. - Paragraph styling:
apply_paragraph_stylefor named styles (TITLE/HEADING_1..6),set_paragraph_formatfor alignment, indents, and line spacing (percent, 100 = single). - Lists:
create_listover 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_listover such paragraphs restyles the ORIGINAL list, continuing its numbering (a second list showing 4, 5, 6). Strip first:create_listwithremove: trueover exactly the new paragraphs, then apply the wanted preset.
Tables and images
insert_tableinserts an EMPTY grid. To fill it: re-read (cells appear with their own index ranges) andinsert_textinto 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
startfromread_document:set_table_cell_shadingthe header row (pick the row's text color against that fill),merge_table_cellsfor 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
评论
- …
同一仓库的更多技能
advisor
15k如果你开启该功能,让你的智能体在关键节点咨询一个更强的第二模型,例如在重大决定之前,或在错误上卡住时。
check-agent-compatibility
15k全面检查 AI 编程智能体能否启动、验证和记录某个代码仓库,并返回一个兼容性评分以及主要问题。
cli-for-agents
15k教你的智能体设计或审查命令行工具,使 AI 智能体无需提示即可运行,并提供清晰的帮助文字和示例。
continual-learning
15k通过把回顾过往对话的工作交给专门的记忆更新程序,使你的 AGENTS.md 笔记保持最新。