Claude-skill-registry google-docs-formatter
Format Google Docs with proper native formatting (headings, bold, tables) instead of markdown. Google Docs does NOT render markdown - you must use the formatting API.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/google-docs-formatter" ~/.claude/skills/majiayu000-claude-skill-registry-google-docs-formatter && rm -rf "$T"
skills/data/google-docs-formatter/SKILL.mdGoogle Docs Formatter
Google Docs does NOT render markdown. Text like
# Header or **bold** appears as literal characters. Use native Google Docs formatting via the MCP gdrive tools.
Document Location
IMPORTANT: Before using this skill to format documents, ensure the document was created using the /gdrive-manager skill, which enforces the
claude-code/ folder structure. All research documents should be in:
- Experiment documentationclaude-code/experiments/
- Daily logsclaude-code/logs/
- Weekly updatesclaude-code/updates/
- Presentationsclaude-code/slides/
See
.claude/skills/gdrive-manager/references/folder-ids.md for folder IDs.
Key Principle
Always get document content first to find text indices, then apply formatting to those ranges.
Workflow
Step 1: Get Document Content with Indices
mcp__gdrive__getGoogleDocContent(documentId: "your-doc-id")
Returns content with index ranges like:
[1-55] Code vs NL Representation: Mutual Information Analysis [57-62] TL;DR [63-189] Code representations consistently encode MORE...
The indices are 1-based and required for all formatting operations.
Step 2: Apply Paragraph Styles (Headings)
mcp__gdrive__formatGoogleDocParagraph( documentId: "...", startIndex: 1, endIndex: 55, namedStyleType: "TITLE" // or HEADING_1, HEADING_2, etc. )
Available styles:
| Style | Use Case |
|---|---|
| TITLE | Document title (largest) |
| HEADING_1 | Major sections |
| HEADING_2 | Subsections |
| HEADING_3 | Sub-subsections |
| HEADING_4-6 | Deeper nesting |
| NORMAL_TEXT | Regular paragraphs |
Alignment options: START, CENTER, END, JUSTIFIED
Step 3: Apply Text Formatting (Bold, Italic, etc.)
mcp__gdrive__formatGoogleDocText( documentId: "...", startIndex: 191, endIndex: 204, bold: true )
Available options:
: true/falsebold
: true/falseitalic
: true/falseunderline
: true/falsestrikethrough
: number (in points)fontSize
: { red: 0-1, green: 0-1, blue: 0-1 }foregroundColor
Document Structure
Required: TL;DR Section
Every document MUST start with a TL;DR section immediately after the title. This provides readers with a quick summary before diving into details.
Format:
[Document Title] TL;DR • Key finding/point 1 • Key finding/point 2 • Key finding/point 3 [Rest of document...]
Formatting for TL;DR:
- Apply HEADING_2 style to "TL;DR"
- Keep it to 2-4 bullet points
- Each bullet should be one concise sentence
- Bold the most critical terms/numbers within the TL;DR
Example TL;DR content:
TL;DR • Code representations encode 1.2 bits MORE mutual information than NL on average • Effect is consistent across all 6 tested models (p < 0.01) • Larger models show bigger code vs NL gap
Content Best Practices
Instead of Markdown, Use:
| Markdown | Google Docs Equivalent |
|---|---|
| Apply TITLE or HEADING_1 style |
| Apply HEADING_2 style |
| Apply bold: true to text range |
| Use bullet character: • |
| Use actual numbers: 1. 2. 3. |
| Use tab-separated text or create Google Sheet |
Bullet Points
Use the bullet character directly in content:
• First item • Second item • Third item
Tables
Google Docs API has limited table support. Options:
- Tab-separated text - Simple but no borders
- Google Sheets - Better for real tables, then link/embed
Tab-separated example:
Model Code MI NL MI Diff claude-haiku 2.10 0.93 1.17 gpt-4o-mini 1.23 0.35 0.87
Common Formatting Patterns
Format a Research Document
- Get content indices
- Apply TITLE to document title
- Apply HEADING_2 to "TL;DR" section (required, immediately after title)
- Bold key findings/numbers in the TL;DR bullets
- Apply HEADING_1 to section headers (Introduction, Methods, Results, etc.)
- Apply HEADING_2 to subsections
- Bold key terms and important findings
- Use bullet points (•) for lists
Bold Key Labels
For configuration sections like:
• Model: Claude Haiku 4.5 • Backend: OpenRouter
Bold "Model:" and "Backend:" by finding their indices and applying
bold: true.
Document Search
Find documents by name:
mcp__gdrive__search(query: "Document Name")
Then get the document ID from results to use with formatting tools.
Example: Full Formatting Flow
# 1. Search for document search_result = mcp__gdrive__search(query="My Research Doc") doc_id = "extracted-from-search" # 2. Get content with indices content = mcp__gdrive__getGoogleDocContent(documentId=doc_id) # Returns: [1-30] My Research Title\n[32-37] TL;DR\n[39-120] • Key finding...\n[122-135] Introduction... # 3. Apply title style mcp__gdrive__formatGoogleDocParagraph( documentId=doc_id, startIndex=1, endIndex=30, namedStyleType="TITLE" ) # 4. Apply HEADING_2 to TL;DR (REQUIRED - always include this) mcp__gdrive__formatGoogleDocParagraph( documentId=doc_id, startIndex=32, endIndex=37, namedStyleType="HEADING_2" ) # 5. Bold key numbers/findings in TL;DR mcp__gdrive__formatGoogleDocText( documentId=doc_id, startIndex=50, # "1.2 bits" within the TL;DR endIndex=58, bold=True ) # 6. Apply heading to main sections mcp__gdrive__formatGoogleDocParagraph( documentId=doc_id, startIndex=122, endIndex=135, namedStyleType="HEADING_1" )
Gotchas
- Indices change after edits - Always re-fetch content after updating text
- Indices are 1-based - First character is index 1, not 0
- Newlines count - Each
is one character in the index\n - Formatting is additive - Multiple calls can layer formatting
- No markdown rendering - Symbols like # * | appear literally
Integration with Research Executor
The research-executor agent MUST use this skill for all Google Docs documentation at checkpoints.
Research Executor Checkpoint Structure:
- Experiment: {name} → HEADING_1
- Phase: {phase} → HEADING_2
- Timestamp → Italic normal text
- Sections (Hypothesis, Progress, Results, etc.) → HEADING_2
- Key findings/numbers → Bold
Workflow:
- Write checkpoint content to Google Doc
- Get document content with indices
- Apply paragraph styles to headers
- Bold key metrics and findings
Related Skills and Agents
- /gdrive-manager - Use BEFORE this skill to create documents in correct folder
- research-executor agent - Primary user for experiment documentation
- weekly-update-writer agent - Creates weekly updates
- research-slides-architect agent - Creates presentations
- /using-git-worktrees - Creates worktrees for experiments
- /finish-branch - Cleans up after PR is merged