write-google-doc
Write a new Google Doc (design doc, spec, memo, RFC, meeting notes, report) or edit an existing one in place: create it from Markdown, then refine structure, formatting, tables, headers, links and comments with update_doc in read -> edit -> read-again loops, and check the rendered pages. Use whenever the deliverable is a Google Doc or the user asks for changes to one. Requires google-workspace-mcp.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 29
- Forks
- 156
01 前言 Front Matter
- name
- write-google-doc
- description
- Write a new Google Doc (design doc, spec, memo, RFC, meeting notes, report) or edit an existing one in place: create it from Markdown, then refine structure, formatting, tables, headers, links and comments with update_doc in read -> edit -> read-again loops, and check the rendered pages. Use whenever the deliverable is a Google Doc or the user asks for changes to one. Requires google-workspace-mcp.
03 SKILL.md 正文
Writing and editing Google Docs
New doc: draft in Markdown, convert once, then polish
- Agree the outline in one message for anything longer than a page: title, sections, who it is for. For a design doc the default shape is Summary, Context / Problem, Goals and Non-goals, Proposal (with a diagram or table where it helps), Alternatives considered, Risks, Rollout / Migration, Open questions. For meeting notes: Attendees, Decisions, Action items (owner, due), Notes.
- Create from Markdown:
create_file(name, content: <markdown>, type: "document", folderId?). Headings (#..######), bullets, numbered lists, bold/italic, links, code spans and pipe tables all convert. Give every code fence a language Docs recognises (python,sql). A fence with none, or withtext,plaintextormermaid, renders with a visibleNonelabel. The reply'sid/webViewLinkis the document for the rest of the task; every later change isupdate_docon it, never a secondcreate_file. - Read it back:
read_docreturns[start-end] STYLE: textper paragraph; confirm the heading levels and lists survived and note the indexes. - Polish with
update_doc(request shapes are in the tool description): table column widths and header shading,pinTableHeaderRows, a header/footer (createHeadertheninsertTextwithsegmentId: headerId), page setup (updateDocumentStyle), a title style,createParagraphBulletswhere the import left plain lines, a footnote or smart chips (insertPerson,insertRichLink,insertDate) where they add value. Keep one logical step per call. - Check the pages:
download_file(fileId, exportMimeType: "application/pdf")fromscripted_tools, written to disk; look at page count, orphaned headings, table overflow. - Deliver the link, and where the doc went. The MCP cannot share files: if the user named readers, remind them to share it in Drive.
Templates: to fill a template doc, copy_file it under the final name and either
replaceAllText for {{placeholders}} or replaceNamedRangeContent when the template has
named ranges. Office input: copy_file(fileId, type: "document") converts a .docx already in
Drive.
Editing an existing doc: loops of read -> edit -> read
read_docfirst, always, and re-read after eachupdate_doccall: indexes are UTF-16 offsets that shift with every insertion or deletion. Within one call, order edits from the highest index down.- Replace a passage:
deleteContentRangeon{startIndex, endIndex}theninsertTextatstartIndex(same call, delete first), orreplaceAllTextfor an exact phrase that is unique. Keep the paragraph's trailing\nout of the deleted range or the paragraph merges with the next. - Add a section:
insertTextwithendOfSegmentLocation: {}(text starting with\n), or at thestartIndexof the paragraph it should precede; thenupdateParagraphStylewithnamedStyleType: "HEADING_2"on the heading's range and bullets withcreateParagraphBullets. - Restyle without touching text:
updateTextStyle/updateParagraphStylewith afieldsmask naming only the properties being set, so the rest of the formatting survives. - Tables: find the table's start index in
read_doc; cells are addressed withtableCellLocation: {tableStartLocation: {index}, rowIndex, columnIndex}; insert text into a cell at the cell's paragraph index fromread_doc. Add rows withinsertTableRowbefore filling them. - Tabs:
read_docnames the tab (tabId); pass the sametabIdin every range and location when the doc has more than one tab. - Suggestions and comments:
read_docshows pending suggestions as{+added+}/[-removed-]; a review pass followsreview-google-files. When a doc has open comments addressed to the user, read them (list_comments) before rewriting the passages they are on. - On a doc Devin did not create, say before the first large rewrite that the change lands in
the live file (undo via File -> Version history) and offer a
copy_filebackup.
Style defaults
- Plain, literal language; one idea per paragraph; headings that say what the section decides, not just its topic. Tables for comparisons, numbered lists for sequences, bullets only for parallel items.
- Every number has a unit and a source; every open question has an owner where known.
- No placeholder text in a delivered doc ("TBD" only where the user said something is undecided).
- Match the existing doc's heading levels, fonts and terminology when editing; do not restyle a doc the user did not ask to restyle.
Gotchas seen live
- Inserting at the document's final end index fails ("insertion index must be inside the bounds
of an existing paragraph"): use
endOfSegmentLocationorendIndex - 1. - A heading created by inserting text takes the style of the paragraph it was inserted into;
set
namedStyleTypeexplicitly. replaceAllTextis document-wide and case-sensitive only withmatchCase: true; check the phrase is unique inread_docfirst.- Images need a URL Google can fetch (
insertInlineImage: {uri}); there is no upload path for a local PNG, so charts and diagrams are either rebuilt as tables/text, hosted somewhere fetchable, or handed to the user as files to insert.
04 同仓库更多 Skills
business-data
暂无简介
workflow
Creates durable, resumable workflows using Vercel's Workflow SDK. Use when building workflows that need to survive restarts, pause for external events, retry on failure, or coordinate multi-step operations over time. Triggers on mentions of "workflow", "durable functions", "resumable", "workflow sdk", "queue", "event", "push", "subscribe", or step-based orchestration.
workflow
Vercel Workflow SDK expert guidance. Use when building durable workflows, long-running tasks, API routes or agents that need pause/resume, retries, step-based execution, or crash-safe orchestration with Vercel Workflow.
verification
Full-story verification — infers what the user is building, then verifies the complete flow end-to-end: browser → API → data → response. Triggers on dev server start and 'why isn't this working' signals.
vercel-storage
Vercel storage expert guidance — Blob, Global Config (formerly Edge Config), and Marketplace storage (Neon Postgres, Upstash Redis). Use when choosing, configuring, or using data storage with Vercel applications.
vercel-services
Configure and troubleshoot Vercel Services for multiple frontends and backends in one project. Use when composing a polyglot or multi-service application on one Vercel deployment; defining the `services` key, service-targeted rewrites, or service bindings in `vercel.json`; or running all services with `vercel dev`.