Expert in Google Docs management. Use when creating, reading, updating, formatting, or managing Google Docs with markdown support, advanced formatting, tables with full manipulation, images with styling, lists, headers/footers, and table of contents.
Expert in managing and editing Google Docs with comprehensive read/write/update operations, advanced formatting, styling, table of contents, images, and tables.
Use this skill when users request:
**IMPORTANT:** When creating new documents, always use the `copy` command to duplicate from "Template v2" rather than creating blank documents.
**Template v2 Document ID:** `1lcUWzmqtj-h0OMdM_NcvDN_qa4EyAfwCgE-IZUAlLPc`
**Workflow:**
1. **Copy Template v2:** Use `copy` command with Template v2 ID, new title, and target folder
2. **Populate Content:** Use `set-markdown` or `update-section` to add content
**Example:**
```bash
google-docs-manager copy 1lcUWzmqtj-h0OMdM_NcvDN_qa4EyAfwCgE-IZUAlLPc "My New Article" --folder <FOLDER_ID>
google-docs-manager set-markdown <NEW_DOC_ID> content.md
```
**Why use Template v2?**
**Location:** `~/.claude/skills/google-docs-manager/scripts/google-docs-manager`
**Type:** Standalone Go binary (no Python dependencies required)
**Source Code:** `~/projects/new/google-docs-manager/`
**Usage:**
**Basic Document Operations:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager create <title> --folder <folder_id>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager copy <source_document_id> <new_title> --folder <folder_id>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager read <document_id>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager get-structure <document_id>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager set-markdown <document_id> <markdown_file>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager update-section <document_id> <heading_text> <markdown_file>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-after <document_id> <heading_text> <markdown_file>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager info <document_id>
```
**Text Operations:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager delete-text <document_id> <start_index> <end_index>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager format-text <document_id> <start_index> <end_index> \
[--bold] [--italic] [--underline] [--strikethrough] \
[--color "R,G,B"] [--font-size N]
#
#
#
~/.claude/skills/google-docs-manager/scripts/google-docs-manager format-text DOC_ID 100 115 --color "191,144,0"
#
~/.claude/skills/google-docs-manager/scripts/google-docs-manager format-text DOC_ID 200 210 --bold --color "56,118,29"
#
~/.claude/skills/google-docs-manager/scripts/google-docs-manager format-text DOC_ID 300 315 --color "0,0,0"
~/.claude/skills/google-docs-manager/scripts/google-docs-manager align-paragraph <document_id> <start_index> <end_index> <ALIGNMENT>
```
**List Operations:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager create-bullets <document_id> <start_index> <end_index> [--style STYLE]
~/.claude/skills/google-docs-manager/scripts/google-docs-manager create-numbered <document_id> <start_index> <end_index>
~/.claude/skills/google-docs-manager/scripts/google-docs-manager remove-bullets <document_id> <start_index> <end_index>
```
**Table Operations:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-table <document_id> <csv_file> [--legend LEGEND] [--index INDEX]
~/.claude/skills/google-docs-manager/scripts/google-docs-manager update-table-cell <document_id> <table_index> <row_index> <column_index> "text"
~/.claude/skills/google-docs-manager/scripts/google-docs-manager style-table-cell <document_id> <table_index> <row_index> <column_index> \
[--bg-color "R,G,B"]
```
**Image Operations:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-image <document_id> <image_url> [--legend LEGEND] [--index INDEX]
```
**Headers & Footers:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager add-header <document_id> <text> [--page-number]
~/.claude/skills/google-docs-manager/scripts/google-docs-manager add-footer <document_id> <text> [--page-number]
```
**Examples:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager create "Q4 Report" 1folderabc123
~/.claude/skills/google-docs-manager/scripts/google-docs-manager read 1docabc123xyz
~/.claude/skills/google-docs-manager/scripts/google-docs-manager get-structure 1docabc123xyz
~/.claude/skills/google-docs-manager/scripts/google-docs-manager set-markdown 1docabc123xyz content.md
~/.claude/skills/google-docs-manager/scripts/google-docs-manager update-section 1docabc123xyz "Methodology" methodology.md
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-table 1docabc123xyz data.csv --legend "Table 1: Sales Data Q4 2024"
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-image 1docabc123xyz "https://example.com/chart.png" --legend "Figure 1: Revenue Trends"
~/.claude/skills/google-docs-manager/scripts/google-docs-manager format-text 1docabc123xyz 100 115 --color "191,144,0"
~/.claude/skills/google-docs-manager/scripts/google-docs-manager format-text 1docabc123xyz 200 215 --bold --color "56,118,29"
```
**How It Works:**
The binary is a standalone Go executable that:
Documents created with the `create` command use standard Google Docs styles:
| Markdown | Google Docs Style |
|----------|------------------|
| `# title` | Title |
| `## Chapter` | Heading 1 |
| `### Sub Chapter` | Heading 2 |
| `#### Sub Sub Chapter` | Heading 3 |
| `##### Sub Sub Sub Chapter` | Heading 4 |
| `###### Sub Sub Sub Sub Chapter` | Heading 5 |
| Regular text | Normal Text |
| `**bold**` | Bold text |
| `*italic*` or `_italic_` | Italic text |
| Tables | Google Docs tables with italic legend above |
| Images | Inline images with italic legend below (left-aligned) |
**Note:** Italic formatting supports both asterisk (`*text*`) and underscore (`_text_`) syntax. This is particularly useful for scientific names and technical terms that conventionally use underscores in markdown (e.g., `_Chlamydophila pneumoniae_`).
Creates a new blank Google Doc with standard styles.
**Process:**
1. Create new document in specified folder
2. Apply standard Google Docs styles
3. Return new document ID
Extract document content as markdown or plain text.
**Full Read:**
**Section Read:**
Returns hierarchical structure of document headings.
**Output:**
```json
{
"headings": [
{
"level": 1,
"text": "Introduction",
"index": 15,
"style": "HEADING_1"
},
{
"level": 2,
"text": "Background",
"index": 45,
"style": "HEADING_2"
}
]
}
```
**This is a utility function for markdown conversion. The primary focus of this skill is document editing.**
Replaces entire document content with markdown-formatted content.
**Markdown Conversion Process:**
1. Clear existing content
2. Parse markdown and convert to Google Docs API requests
3. Apply proper styles based on heading levels:
- `# text` → Title style
- `## text` → Heading 1 style
- `### text` → Heading 2 style
- `#### text` → Heading 3 style
- `##### text` → Heading 4 style
- `###### text` → Heading 5 style
- Regular text → Normal Text style
- `**bold**` → Bold formatting
- `*italic*` or `_italic_` → Italic formatting (both syntaxes supported)
- `- item` → Bullet point (Normal Text with dash)
4. Split requests into batches of 400 (Google Docs API limit)
5. Execute batch updates sequentially
**Important Notes:**
Updates content under a specific heading.
**Process:**
1. Find heading in document structure
2. Determine section boundaries
3. Replace section content with new markdown
4. Preserve surrounding content
5. Update table of contents
Inserts a formatted table with optional legend.
**Format:**
```
Table 1: Sales Data Q4 2024 (italic, above table)
┌────────────┬──────────┬──────────┐
│ Month │ Sales │ Growth │
├────────────┼──────────┼──────────┤
│ October │ $125k │ +5% │
│ November │ $142k │ +13% │
│ December │ $198k │ +39% │
└────────────┴──────────┴──────────┘
```
**Input:** CSV file or JSON data
**Output:** Google Docs table with legend
Inserts an image into the document with optional legend.
**CRITICAL LIMITATION - Google Docs API Requirements:**
Google Docs API ONLY accepts images via publicly accessible HTTP/HTTPS URLs. Local files CANNOT be inserted directly.
**Required Workflow for Local Images:**
1. **Upload to Google Drive:** Local image files must first be uploaded to Google Drive
2. **Make Publicly Accessible:** Set Drive file permissions to `type: anyone, role: reader`
3. **Get Drive URL:** Use format `https://drive.google.com/uc?export=view&id=FILE_ID`
4. **Insert into Document:** Use the Drive URL with insert-image command
**Alternative Approaches (NOT supported by API):**
**Recommended Practice:**
**Format:**
```
[Image]
Figure 1: Revenue Trends (italic, below image, left-aligned)
[blank line automatically added after legend for spacing]
```
**Input:** Publicly accessible HTTP/HTTPS URL (typically from Google Drive)
**Output:** Inline image with legend and blank line after for proper spacing
**Example Workflow:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-image DOC_ID \
"https://drive.google.com/uc?export=view&id=FILE_ID" \
--legend "Figure 1: Description"
```
Inserts "Table of content" heading placeholder at document start.
**IMPORTANT LIMITATION:**
Google Docs API v1 does NOT support programmatic TOC insertion. This command only inserts the heading.
**Process:**
1. Check if "Table of content" heading already exists at document start
2. If not, insert "Table of content" heading (Heading 1 style) at position 1
3. Provide instructions for manual TOC insertion
**Manual Steps Required:**
After running this command, you must manually complete the TOC insertion:
1. Open the document in Google Docs UI
2. Place cursor after the "Table of content" heading
3. Click Insert > Table of contents > Choose style (with page numbers or links)
**Notes:**
1. **Enable Required APIs:**
```bash
gcloud services enable docs.googleapis.com
gcloud services enable drive.googleapis.com
```
2. **Create OAuth Credentials:**
- Go to Google Cloud Console (https://console.cloud.google.com/)
- Navigate to APIs & Services > Credentials
- Create OAuth 2.0 Client ID (Desktop application type)
- Download credentials as JSON file
- Save to `~/.credentials/google_credentials.json`
3. **First-time Authentication:**
```bash
# Create credentials directory
mkdir -p ~/.credentials
# Copy downloaded credentials
cp ~/Downloads/client_secret_*.json ~/.credentials/google_credentials.json
# Run any command - will open browser for OAuth consent
~/.claude/skills/google-docs-manager/scripts/google-docs-manager info <document_id>
# Token saved to ~/.credentials/google_token.json for future use
```
4. **Subsequent Runs:**
- Token automatically refreshed when expired
- No browser interaction needed
- Seamless authentication
**No installation required!** The binary is pre-compiled and ready to use:
```bash
DOC_ID=$(~/.claude/skills/google-docs-manager/scripts/google-docs-manager create "Q4 Sales Report" 1folderabc123 | grep "Document ID:" | cut -d' ' -f3)
~/.claude/skills/google-docs-manager/scripts/google-docs-manager set-markdown $DOC_ID report.md
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-table $DOC_ID sales_data.csv --legend "Table 1: Quarterly Sales"
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-image $DOC_ID "https://charts.example.com/q4.png" --legend "Figure 1: Sales Trends"
```
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager get-structure 1docabc123
~/.claude/skills/google-docs-manager/scripts/google-docs-manager update-section 1docabc123 "Methodology" methodology.md
```
```bash
DOC_ID=$(~/.claude/skills/google-docs-manager/scripts/google-docs-manager create "Analysis Report" 1folder123 | grep "Document ID:" | cut -d' ' -f3)
python generate_report.py --output report.md
~/.claude/skills/google-docs-manager/scripts/google-docs-manager set-markdown $DOC_ID report.md
for table in results/*.csv; do
legend=$(basename "$table" .csv | sed 's/_/ /g')
~/.claude/skills/google-docs-manager/scripts/google-docs-manager insert-table $DOC_ID "$table" --legend "Table: $legend"
done
```
When users request Docs operations:
1. **Identify the operation:**
- Create, read, update, insert table/image, update TOC
2. **Gather required parameters:**
- Document ID (from user or search)
- Content/markdown file
- Section headings
- Table/image data
3. **Run the appropriate command:**
- Execute script with proper arguments
- Monitor output for progress and errors
- Report results to user
4. **Handle document structure:**
- Use `get-structure` to understand organization
- Find section boundaries for updates
- Verify heading names exist
5. **Handle errors:**
- Check authentication if OAuth errors occur
- Verify document IDs if not found
- Confirm API access if permission errors occur
**User:** "Create a new Google Doc for the Q4 report and add this markdown content"
**Response:**
```
I'll create a new Google Doc and add your content.
Creating document...
```
**Execute:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager create "Q4 Report" 1folderabc123
```
**Then:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager set-markdown 1newdoc123 content.md
```
**Final response:**
```
Created document "Q4 Report"
Added content from markdown
Document link: https://docs.google.com/document/d/1newdoc123/edit
```
**User:** "Update the 'Conclusion' section in this document with new content"
**Response:**
```
I'll update the Conclusion section with your new content.
First, let me check the document structure...
```
**Execute:**
```bash
~/.claude/skills/google-docs-manager/scripts/google-docs-manager get-structure 1docabc123
~/.claude/skills/google-docs-manager/scripts/google-docs-manager update-section 1docabc123 "Conclusion" new_conclusion.md
```
**Final response:**
```
Updated 'Conclusion' section
The Conclusion section has been updated while preserving all other content.
```
```bash
mkdir -p ~/.credentials
```
```bash
gcloud services enable docs.googleapis.com drive.googleapis.com
```
```bash
rm ~/.credentials/google_token.json
```
**None!** The binary is self-contained with all dependencies compiled in:
To accomplish Docs management tasks:
1. Identify the specific operation requested
2. Gather required parameters (document ID, content, sections)
3. Check document structure if needed (get-structure)
4. Execute the appropriate binary command
5. Monitor output for progress and errors
6. Report results with document link
7. Handle errors with appropriate troubleshooting steps
To rebuild the binary after making changes:
```bash
cd ~/projects/new/google-docs-manager/
make
cp google-docs-manager ~/.claude/skills/google-docs-manager/scripts/
```
The binary will be compiled with all dependencies included.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/google-docs-manager/raw