Install
openclaw skills install google-docs-formatterInstruction-only workflow for formatting, editing, and creating Google Docs using the existing gog skill/CLI. Use when a user asks to format a Google Doc, convert Markdown into a Google Doc, update sections, preserve structure, or fix Google Docs formatting. Relies on gog for all Google Docs/Drive API operations; contains no scripts or direct API clients.
openclaw skills install google-docs-formatterUse this skill to format or update Google Docs through the existing gog skill/CLI. This skill is instruction-only: do not introduce new API clients, scripts, dependencies, or credential flows.
Rely on gog for all Google Docs and Drive operations. If the gog skill is not loaded and command details are needed, load the gog skill first.
Prefer Google Docs-native workflows over DOCX conversion. Avoid third-party proxy services unless the user explicitly requests them.
Before any write operation, state the target document and intended change, then get explicit user approval unless the user has already clearly approved that exact change.
Always ask before:
gog docs clearSafe to do without extra approval when already working on the user-approved doc:
Identify the target doc.
https://docs.google.com/document/d/<DOC_ID>/....Inspect before editing.
gog docs info <DOC_ID> --json
gog docs structure <DOC_ID>
gog docs export <DOC_ID> --format md --out /tmp/doc.md
Decide the edit strategy.
gog docs create --file.gog docs find-replace --format markdown.gog docs edit or gog docs sed.gog docs write --append or gog docs insert.Prepare content as Markdown.
gog docs create / find-replace --format markdown supports the source.Apply the change with gog.
Verify after editing.
gog docs structure <DOC_ID>
gog docs export <DOC_ID> --format md --out /tmp/doc-after.md
Compare the exported Markdown or structure against the intended result.
Report concisely.
Prepare a local Markdown file, then:
gog docs create "Document title" --file /path/to/content.md
Use this instead of Markdown → DOCX → Drive upload unless the user specifically needs DOCX behavior.
Best when the document contains a marker such as {{SECTION_DRAFT}}.
gog docs find-replace <DOC_ID> '{{SECTION_DRAFT}}' --content-file /path/to/section.md --format markdown --first
Prefer --first when replacing a unique placeholder to avoid accidental repeated changes.
If possible, first ask the user to add or approve stable markers around the section:
<!-- START: SECTION_NAME -->
old content
<!-- END: SECTION_NAME -->
Then replace the bounded content with gog docs find-replace --format markdown using a prepared Markdown file.
If there are no stable markers, use gog docs structure to identify paragraphs and proceed carefully. Do not guess destructive ranges.
gog docs edit <DOC_ID> "old text" "new text" --match-case
For regex-style replacements:
gog docs sed <DOC_ID> 's/old pattern/new text/g'
Use regex edits only when the match is unambiguous.
gog docs write <DOC_ID> --file /path/to/content.md --append
If Markdown formatting is required, prefer placeholder replacement with --format markdown when available.
Only after explicit approval. Prefer making a copy first:
gog docs copy <DOC_ID> "Backup before rewrite"
gog docs clear <DOC_ID>
gog docs write <DOC_ID> --file /path/to/content.md
Tell the user if the write path preserves only text rather than rich Markdown formatting; use create --file or find-replace --format markdown for rich Markdown conversion.
Use simple, robust Markdown:
# Title
## Section
Short paragraph.
- Bullet one
- Bullet two
| Column A | Column B |
| --- | --- |
| Value A | Value B |
**Bold** and *italic* text.
Avoid fragile formatting unless tested:
For advanced visual formatting not supported by gog, explain the limitation and propose the nearest gog-supported alternative.
Ask the user before proceeding if:
goggog reports auth/scope errorsDo not install other Google Docs skills just to complete formatting. This skill is meant to compose with gog, not replace it.