wadackel/dotfiles/gdocs-to-md

Claude Code and agent skill by wadackel/dotfiles

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Convert a Google Docs document to GitHub Flavored Markdown via Docs API. Fetches document structure as JSON via gws docs, then converts with a Bun script. Use when asked to "convert Google Docs to Markdown", "Google DocsをMarkdownに変換して", "docsをmdにして", "MarkdownにExportして", or when a Google Docs URL is provided with intent to produce a .md file.

Install

npx vskill@latest install wadackel/dotfiles/gdocs-to-md

SKILL.md

The same SKILL.md was published earlier as wadackel/dotfiles/gdocs-to-md.

Google Docs to Markdown

Convert a Google Docs document to GitHub Flavored Markdown. Fetches the document via gws docs documents get (Google Docs API), then converts the JSON structure to GFM using a Bun script.

Prerequisites

  • gws CLI — for Google Docs API access. See the gws-shared skill for auth setup.
  • jq — for JSON parsing.
  • Bun — for running the conversion script.
  • Google Docs API must be enabled for your GCP project.

Quick Start

/gdocs-to-md https://docs.google.com/document/d/<ID>/edit
/gdocs-to-md <document-ID>

Accepts either a full Google Docs URL or a raw document ID. If called with no argument, you will be prompted.

Output is written to the current working directory.

Workflow

Step 0 — Confirm output location

Display the current working directory to the user before writing any files:

Output will be written to: <cwd>
Step 1 — Parse $ARGUMENTS
  • Full URL: extract the document ID using the pattern /d/([a-zA-Z0-9_-]+)/
  • Raw ID: use as-is (alphanumeric string, typically 30+ characters)
  • No argument: ask through the current agent's user-confirmation mechanism for the URL or document ID; in text-only runtimes, ask the question, end the turn, and wait for the user's next response before continuing
Step 2 — Create isolated temp file
bash
TMP_JSON=$(mktemp -t gdoc-XXXXXX.json)
Step 3 — Fetch document JSON
bash
gws docs documents get --params '{"documentId":"<ID>"}' > "$TMP_JSON"

Validate after fetch:

  • Check jq -e '.body' "$TMP_JSON" > /dev/null passes — confirms a valid document response
  • Extract title: TITLE=$(jq -r '.title' "$TMP_JSON")
  • Check $TITLE is non-empty

If validation fails: print the raw content of $TMP_JSON and "temp file preserved at: $TMP_JSON", then stop.

On gws failure: print the error and "temp file at: $TMP_JSON". If the error is an auth/permission issue, suggest running gws auth login. If the error mentions Docs API not enabled, direct user to enable it in GCP Console. Do not proceed to conversion.

Step 4 — Convert with the Bun script
bash
OUTPUT_STEM=$(echo "$TITLE" | tr '/' '-')
~/.claude/skills/gdocs-to-md/gdoc-json-to-md.ts < "$TMP_JSON" > "${OUTPUT_STEM}.md"

On conversion failure: print the error and "JSON preserved at: $TMP_JSON", then stop.

Step 5 — Cleanup (success only)
bash
rm -f "$TMP_JSON"

Only clean up after successful conversion. On failure, preserve $TMP_JSON for debugging.

Step 6 — Report result

Verify the output file exists, then report absolute paths. Do not read the full file content into context.

✓ Conversion complete
Markdown : /absolute/path/to/${OUTPUT_STEM}.md

Output

FileDescription
<title>.mdGitHub Flavored Markdown, no hard line-wrapping

Written to the current working directory.

Additional Resources

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/wadackel/dotfiles/gdocs-to-md/badge)](https://verified-skill.com/skills/wadackel/dotfiles/gdocs-to-md)

Something wrong with this skill or its page? Tell us.