google-docs

Inspect and edit Google Docs documents with index-aware batch updates. Use when the user wants to read document text or structure, find paragraph indexes, rewrite sections in place, edit tables, or apply style-aware document changes with Google Docs tools.

685 stars

Best use case

google-docs is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Inspect and edit Google Docs documents with index-aware batch updates. Use when the user wants to read document text or structure, find paragraph indexes, rewrite sections in place, edit tables, or apply style-aware document changes with Google Docs tools.

Teams using google-docs should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/google-docs/SKILL.md --create-dirs "https://raw.githubusercontent.com/openai/plugins/main/plugins/google-drive/skills/google-docs/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/google-docs/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How google-docs Compares

Feature / Agentgoogle-docsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Inspect and edit Google Docs documents with index-aware batch updates. Use when the user wants to read document text or structure, find paragraph indexes, rewrite sections in place, edit tables, or apply style-aware document changes with Google Docs tools.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Google Docs

Use this guide for precise Google Docs reading, editing, and creation.

## Read Path

- If you only know the doc title or title keywords, use `search` first instead of asking for a URL.
- Prefer `get_document_text` when you need paragraph text and indexes.
- Use `get_document` when you need the full document structure, styles, or non-text elements.
- Prefer `find_document_text_range` over hand-picked indexes when you can anchor on exact text.
- Use `get_paragraph_range` when you have an index inside a paragraph and need its full boundaries.
- Use `get_tables` before editing or rebuilding table content.
- If the doc has tabs, use `get_document` to identify the right tab and carry `tab_id` through follow-up reads.
- Re-read after substantial edits so later writes use live indexes.

## Workflow

1. Read before writing.
- Identify the exact section, heading structure, paragraph boundaries, table locations, and current formatting.
- If the target is ambiguous, summarize the candidate section first and make the scope explicit in the response.

2. Find live indexes.
- Use `get_document_text` to get all paragraphs along with their indices.
- Use `find_document_text_range` when you can anchor on exact text.
- Use `get_document_paragraph_range` when you need a single paragraph's range around an index.
- Do not guess offsets after prior writes.
- After many edits, call `get_document` or `get_document_text` again before the next batch.

3. Build a `batch_update_document`.
- All document changes go through `batch_update_document`.
- IMPORTANT: `batch_update_document.requests` must be an array of structured request objects. Do not JSON-stringify Docs API requests.
- `batch_update_document.write_control` must also be an object, and not a JSON-stringified string.
- Requests execute in order, so sequence dependent edits deliberately.
- For concurrency-sensitive writes, prefer `write_control` with the latest `revisionId`. Set either `requiredRevisionId` or `targetRevisionId`, never both.

4. Preserve Docs-native formatting.
- Use heading levels and paragraph styles to organize the document.
- Build lists with inserted text plus Docs list or paragraph styling. Do not fake bullets or numbering with literal `-`, `*`, or `1.` characters alone.
- Do not add blank paragraphs for spacing. Use styles instead.
- Do not leave the document unformatted unless the user explicitly asks.

5. Verify the write.
- After finishing all edits, call `get_document_text` one more time.
- Confirm the text landed in the intended place and indexes still line up before ending.

## Allowed `batch_update_document` Request Types

- Text: `replaceAllText`, `insertText`, `deleteContentRange`, `replaceNamedRangeContent`
- Text and paragraph formatting: `updateTextStyle`, `updateParagraphStyle`, `createParagraphBullets`, `deleteParagraphBullets`
- Named ranges: `createNamedRange`, `deleteNamedRange`
- Images and embedded objects: `insertInlineImage`, `replaceImage`, `deletePositionedObject`
- Tables: `insertTable`, `insertTableRow`, `insertTableColumn`, `deleteTableRow`, `deleteTableColumn`, `updateTableColumnProperties`, `updateTableCellStyle`, `updateTableRowStyle`, `mergeTableCells`, `unmergeTableCells`, `pinTableHeaderRows`
- Document layout and structure: `updateDocumentStyle`, `updateSectionStyle`, `insertPageBreak`, `insertSectionBreak`
- Headers, footers, and notes: `createHeader`, `deleteHeader`, `createFooter`, `deleteFooter`, `createFootnote`
- Tabs: `addDocumentTab`, `deleteTab`, `updateDocumentTabProperties`
- People: `insertPerson`

## Write Rules

- Preserve existing headings, styles, links, dates, and table structure when editing unless the user asks to change them.
- Use multiple heading levels to organize a doc unless the user instructs otherwise.
- Treat large rewrites, deletions, tab changes, layout changes, and table restructuring as explicit actions.
- When similar headings or repeated text exist, identify the exact target section before editing.

## Fallback

If document content or write tools are unavailable, say that Google Docs access or tooling is missing and ask the user to reconnect or clarify the target document.

Related Skills

geistdocs

685
from openai/plugins

Expert guidance for Geistdocs, Vercel's documentation template built with Next.js and Fumadocs — MDX authoring, configuration, AI chat, i18n, feedback, deployment. Use when creating documentation sites, configuring geistdocs, writing MDX content, or setting up docs infrastructure.

sharepoint-word-docs

685
from openai/plugins

Edit SharePoint-hosted Word `.docx` files while preserving document structure and styling. Use when the user wants to update a real Word document in SharePoint rather than summarize it as plain text.

google-slides

685
from openai/plugins

Inspect, create, import, summarize, and update Google Slides presentations through connected Google Slides data. Use when the user wants to find a deck, read slide structure, summarize a presentation or specific slide, understand charts, graphs, or other slide visuals by combining slide text with thumbnail-based image understanding, create a new presentation, import a `.ppt`, `.pptx`, or `.odp`, or make general content edits in Google Slides. For visual polish on an existing deck, such as formatting cleanup, alignment fixes, overflow cleanup, or slide-by-slide deck cleanup, prefer `google-slides-visual-iteration`.

google-slides-visual-iteration

685
from openai/plugins

Iteratively inspect and polish existing connected Google Slides presentations in Codex using slide thumbnails plus raw Slides edits. Use when a user asks to fix a slide visually, clean up formatting, improve slide quality, make a deck look better, fix alignment, spacing, overlap, overflow, crowding, awkward whitespace, or deck-wide visual consistency in an existing Google Slides deck or shared Slides link, especially when the work should follow a thumbnail -> diagnose -> batch_update -> re-thumbnail verification loop.

google-slides-template-surgery

685
from openai/plugins

Perform structural rework in connected Google Slides decks. Use when local visual cleanup is not enough and repeated layout defects require batch_update structure edits plus strict verification.

google-slides-template-migration

685
from openai/plugins

Migrate a Google Slides deck onto a target template. Use when the user wants to preserve source content while rebuilding slides from a branded template structure instead of making incremental in-place edits.

google-slides-import-presentation

685
from openai/plugins

Import a local `.ppt`, `.pptx`, or `.odp` file into Google Slides, verify the resulting native deck, and hand it off to the right follow-on workflow. Use when the user wants to convert a presentation file into a native Google Slides deck before follow-on work.

google-sheets

685
from openai/plugins

Analyze and edit connected Google Sheets with range precision. Use when the user wants to find a spreadsheet, inspect tabs or ranges, search rows, plan formulas, clean or restructure tables, write concise summaries, or make explicit cell-range updates.

google-sheets-formula-builder

685
from openai/plugins

Design, repair, and roll out Google Sheets formulas with better syntax recall and validation discipline. Use when the user wants to add a formula column, fix a broken formula, choose between a row formula and a spill formula, build a lookup or filter formula, or turn repeated logic into a reusable named function.

google-sheets-chart-builder

685
from openai/plugins

Design, create, and revise Google Sheets charts with better chart-spec recall and editing discipline. Use when the user wants to add a chart to a sheet, choose the right chart type for existing data, repair a broken chart, update a chart's data series, or reposition or resize a chart after creating it.

google-drive

685
from openai/plugins

Use connected Google Drive as the single entrypoint for Drive, Docs, Sheets, and Slides work. Use when the user wants to find, fetch, organize, share, export, copy, or delete Drive files, or summarize and edit Google Docs, Google Sheets, and Google Slides through one unified Google Drive plugin.

google-calendar

685
from openai/plugins

Manage scheduling and conflicts in connected Google Calendar data. Use when the user wants to inspect calendars, compare availability, review conflicts, find a meeting room, review event notes or attachments, or draft exact create, update, reschedule, or cancel changes with timezone-aware details.