Agent skill
google-docs-md
Export Google Docs as clean markdown via native URL parameter. No auth needed for public docs. Use when fetching Google Doc content for vault ingestion, runbook building, or any doc-to-markdown pipeline.
Install this agent skill to your Project
npx add-skill https://github.com/joelhooks/joelclaw/tree/main/skills/google-docs-md
SKILL.md
Google Docs Markdown Export
Google Docs natively supports markdown export via a URL parameter. This is the most reliable way to get markdown from a Google Doc — better than defuddle, jina, or any scraping tool.
URL Pattern
For any Google Doc URL like:
https://docs.google.com/document/d/{DOC_ID}/edit?tab=t.0
Replace everything after the document ID with export?format=md:
https://docs.google.com/document/d/{DOC_ID}/export?format=md
Extracting the Document ID
The DOC_ID is the long alphanumeric string between /d/ and the next /:
# From any Google Docs URL, extract the ID:
echo "https://docs.google.com/document/d/1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI/edit?tab=t.0" \
| grep -oP '(?<=/d/)[^/]+'
# → 1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI
Fetching
# Public docs — no auth needed, follow the 307 redirect:
curl -L "https://docs.google.com/document/d/${DOC_ID}/export?format=md" -o output.md
# Private docs — needs OAuth bearer token:
curl -L "https://docs.google.com/document/d/${DOC_ID}/export?format=md" \
-H "Authorization: Bearer ${TOKEN}" -o output.md
Important: The endpoint returns a 307 redirect. Always use curl -L (follow redirects) or equivalent.
Other Export Formats
The same pattern works for other formats:
export?format=pdf— PDFexport?format=docx— Wordexport?format=txt— Plain textexport?format=html— HTMLexport?format=epub— ePub
Batch Pattern
When you have a list of Google Doc URLs (e.g. extracted from Front emails):
# Extract doc IDs from a file of URLs
grep -oP '(?<=/d/)[^/]+' urls.txt | sort -u | while read id; do
echo "Fetching $id..."
curl -sL "https://docs.google.com/document/d/${id}/export?format=md" \
-o "docs/${id}.md"
sleep 1 # Be polite
done
When to Use
- Always prefer this over defuddle/scraping for Google Docs
- Works for public docs without any authentication
- Native markdown quality is superior to any HTML→markdown conversion
- Handles tables, formatting, links, images (as URLs) correctly
Limitations
- Private docs require a valid OAuth token (use
gogwhen available) - Very large docs may take a few seconds
- Images are referenced as URLs, not embedded
- Comments and suggestions are not included in the export
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
skill-review
Audit and maintain the joelclaw skill inventory. Use when checking skill health, fixing broken symlinks, finding stale skills, or running the skill garden. Triggers: 'skill audit', 'check skills', 'stale skills', 'skill health', 'skill garden', 'broken skill', 'skill review', 'fix skills', 'garden skills', or any task involving skill inventory maintenance.
cli-design
Design and build agent-first CLIs with HATEOAS JSON responses, context-protecting output, and self-documenting command trees. Use when creating new CLI tools, adding commands to existing CLIs (joelclaw, slog), or reviewing CLI design for agent-friendliness. Triggers on 'build a CLI', 'add a command', 'CLI design', 'agent-friendly output', or any task involving command-line tool creation.
daily-summary
Generate a daily system activity summary across all joelclaw subsystems. Triggers on 'daily summary', 'what happened today', 'system report', 'today's tally', 'activity summary', 'what did we do', 'daily report'.
inngest-durable-functions
Create and configure Inngest durable functions. Covers triggers (events, cron, invoke), step execution and memoization, idempotency, cancellation, error handling, retries, logging, and observability.
recall
Fan-out search across all memory sources when context is unclear or vaguely referenced. Triggers on: 'from earlier', 'remember when', 'what we discussed', 'that thing with', 'the conversation about', 'did we ever', 'what happened with', 'you mentioned', 'we talked about', 'earlier today', 'last session', 'the other day', or any vague reference to past context that needs resolution before the agent can act.
inngest-local
Set up self-hosted Inngest on macOS as a durable background task manager for AI agents. Interactive Q&A to match intent — from Docker one-liner to full k8s deployment with persistent state. Use when: 'set up inngest', 'background tasks', 'durable workflows', 'self-host inngest', 'event-driven functions', 'cron jobs', or any request for a local workflow engine.
Didn't find tool you were looking for?