Agent skill · cursor
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.
What it needs
About 4k tokens when loaded.
What this skill does
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: findtext returns FRESH {start, end} ranges for exact text - the direct source of indexes for applytextstyle, applyparagraphstyle, deletecontent, and setparagraphformat. Locate, then edit, in back-to-back calls. createlist 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 createlist 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 readdocument 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: readdocument 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 createdocument makes a BLANK doc (its API ignores content), so plan: Content known up front: prefer google-drive googledrivecreatefile with Markdown (targetmimetype: ...document), which imports headings, lists, and tables in one call and can target a folder. Building incrementally: createdocument, then inserttext with index omitted to APPEND each paragraph; append mode reads the tail itself and is revision-guarded automatically. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills cursor/google-docs