# Gdoc To Markdown

Internal fetcher module for Google Docs and Sheets.

- Repository: https://github.com/ccplugins/awesome-claude-code-plugins (991 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-08-12
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add ccplugins/awesome-claude-code-plugins --skill gdoc-to-markdown -g -a claude-code -y`
Codex: `npx skills add ccplugins/awesome-claude-code-plugins --skill gdoc-to-markdown -g -a codex -y`
Cursor: `npx skills add ccplugins/awesome-claude-code-plugins --skill gdoc-to-markdown -g -a cursor -y`
Gemini CLI: `npx skills add ccplugins/awesome-claude-code-plugins --skill gdoc-to-markdown -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add ccplugins/awesome-claude-code-plugins`

## Description

Internal fetcher module for Google Docs and Sheets. Fetches content via MCP (preferred, when available), Google API with bearer token or public URL export (fallback), or browser DOM extraction via Claude in Chrome (last resort) and returns Markdown. Used by /bedrock:teach and /bedrock:sync, not intended for direct user invocation.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Google Docs & Sheets Fetcher

Internal module, invoked by `/bedrock:teach` Phase 1 and `/bedrock:sync` Phase 2, not user-invocable.

Fetches a Google Docs document or Google Sheets spreadsheet and converts it to a local Markdown file.
Supports both document types with automatic detection. Three layers in fallback order:
**MCP (preferred) → API / Public Export → Browser DOM extraction.**

**Dependency:** Browser fallback (Layer 3) requires `scripts/extract.js` (relative to this skill directory).

---

## Step 1, Parse URL and Detect Type

Parse the URL. Accept these formats:

**Google Docs:**
- `https://docs.google.com/document/d/{docId}/edit`
- `https://docs.google.com/document/d/{docId}/edit#heading=...`
- `https://docs.google.com/document/d/{docId}/edit?tab=t.0`
- `https://docs.google.com/document/d/{docId}`
- Raw document ID (no URL), treat as Doc by default

**Google Sheets:**
- `https://docs.google.com/spreadsheets/d/{docId}/edit`
- `https://docs.google.com/spreadsheets/d/{docId}/edit#gid=0`
- `https://docs.google.com/spreadsheets/d/{docId}`
- Raw spreadsheet ID, only if the user explicitly mentions "sheet" or "spreadsheet"

**Detect type:**
- URL contains `/spreadsheets/d/` → **Sheet**
- URL contains `/document/d/` → **Doc**
- Raw ID with no URL → default to **Doc** unless user context indicates Sheet

Extract the `{docId}`, the string between `/d/` and the next `/` or end of path.

---

## Step 2, Layer 1: MCP (Google Docs)

The preferred layer. Checks if a Google Docs/Drive MCP server is installed and authenticated.

### 2.1 Check MCP availability

Use ToolSearch to check if any Google Docs or Google Drive MCP tools are available:

```
ToolSearch(query: "google docs drive document", max_results: 5)
```

Evaluate the result:

The rest: https://github.com/ccplugins/awesome-claude-code-plugins/blob/HEAD/plugins/bedrock/skills/gdoc-to-markdown/SKILL.md
