| name | write_google_docs |
| description | Skill for writing arbitrary Google Docs |
Write Google Docs Skill
Use this skill to create new Google Docs documents, populate them with content, and write to specific tabs.
When to Use
Use this skill when you need to:
- Create product briefs, reports, or analysis documents
- Write competitive analysis summaries
- Generate deliverables that need to be shared via Google Docs
- Create structured documents for team review
- Write content to a specific tab in a new or existing document
Do NOT use this skill when:
- The user just wants text output in the conversation
- The content is short and doesn't need to be a document
How to Use
Basic Usage
Run the script from the skills/write_google_docs/ directory:
python skills/write_google_docs/write_google_doc.py --title "Document Title" --content "Your content here"
Writing to Tabs
- Create a new document with a named tab:
python skills/write_google_docs/write_google_doc.py --title "Weekly Report" --tab "Week 9" --content "Week 9 analysis..."
- Write to a tab in an existing document (creates the tab if it doesn't exist):
python skills/write_google_docs/write_google_doc.py --document-id DOCUMENT_ID --tab "Week 10" --content "Week 10 analysis..."
- Write to an existing tab (if tab title matches, writes to it; otherwise creates a new tab):
python skills/write_google_docs/write_google_doc.py --document-id DOCUMENT_ID --tab "Summary" --content-file summary.txt
When using --document-id, the --tab flag is required. When creating a new document with --title, --tab is optional — if omitted, content goes to the default first tab.
Placing Documents in a Drive Folder
Use --folder-id to create the document inside a specific Google Drive folder:
python skills/write_google_docs/write_google_doc.py --title "Report" --folder-id FOLDER_ID --content "Content..."
The folder ID is the last segment of a Drive folder URL (e.g. YOUR_GOOGLE_DRIVE_FOLDER_ID from https://drive.google.com/drive/folders/YOUR_GOOGLE_DRIVE_FOLDER_ID). This option can be combined with --tab.
Content Options
- Inline content (for shorter text):
python skills/write_google_docs/write_google_doc.py --title "Brief Title" --content "Brief content goes here"
- From a file (for longer content):
python skills/write_google_docs/write_google_doc.py --title "Report Title" --content-file /path/to/content.txt
- From stdin (for piping content):
echo "Content here" | python skills/write_google_docs/write_google_doc.py --title "Document Title" --stdin
JSON Output
For programmatic use, add the --json flag:
python skills/write_google_docs/write_google_doc.py --title "Title" --content "Content" --json
This returns JSON with documentId, webViewLink, title, and optionally tabId.
Output
The script outputs:
- Document title
- Document ID
- Tab ID (when using
--tab)
- Web link to the document (shareable)
Content Formatting
Markdown in the content is automatically converted to native Google Docs formatting:
# Heading through ###### Heading → Google Docs headings (H1-H6)
**bold** or __bold__ → bold text
*italic* or _italic_ → italic text
- item or * item → bullet lists
1. item → numbered lists
[text](url) → plain text (link removed)
`code` → plain text (backticks removed)
For best results:
- Use newlines to separate paragraphs
- Structure content with markdown headings
- The document title becomes the Google Doc title
After Creating a Document
After creating a document, you can:
- Share the link with the user
- Use the
post_to_slack skill to share the link to Slack
- Return the link for the user to access
Example Workflows
Single document
python skills/write_google_docs/write_google_doc.py --title "Competitive Analysis - January 2026" --content "Your analysis content..."
Multi-tab weekly report
Create the document with the first week's tab:
python skills/write_google_docs/write_google_doc.py --title "Weekly Reports - Q1 2026" --tab "Week 1" --content "Week 1 content..." --json
Then add subsequent weeks to the same document using the returned document ID:
python skills/write_google_docs/write_google_doc.py --document-id DOC_ID --tab "Week 2" --content "Week 2 content..."
python skills/write_google_docs/write_google_doc.py --document-id DOC_ID --tab "Week 3" --content "Week 3 content..."
Prerequisites
- Google OAuth credentials must be configured (same as summarize_google_docs)
- Credentials with write permissions to Google Docs and Drive
- If authentication fails, delete
token.json in the project root and re-authenticate
Error Handling
If you encounter authentication errors:
- The OAuth scopes may need to be updated
- Delete
token.json and run again to re-authenticate with new scopes
- The user will need to authorize the app in their browser