Publish To Google Docs logo

Publish To Google Docs

Community
ericmjl
publish-to-google-docs

Quickly publish markdown notes to styled Google Docs using pandoc and a Word template. Use when creating Google Docs from markdown, applying branding to documents, or pushing content to Drive for sharing.

Overview

Publisherericmjl
Repositoryskills
Skill namepublish-to-google-docs
Stars
41
Forks
5
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ericmjl on GitHub. Read the source before you install it.

Installation

Install the Publish To Google Docs AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ericmjl/skills/tree/main/skills/publish-to-google-docs
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ericmjl/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/publish-to-google-docs .claude/skills/publish-to-google-docs
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Publish To Google Docs in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Publish To Google Docs on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Publish To Google Docs is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Publish Markdown to Google Docs

Quickly publish markdown notes to styled Google Docs using pandoc and a Word template.

When to use

  • User wants to publish a markdown note to Google Docs
  • User says "publish to Google Docs", "create a Google Doc from markdown", or "push this to Drive"
  • User wants to apply consistent branding/styling to documents before sharing

Prerequisites

  1. pandoc - Must be installed (see self-healing below)
  2. A Word template (.docx) with desired styles
  3. OAuth credentials for Google Drive (one-time setup)

Consent boundary and the local-generation fallback

The Google Drive OAuth flow (upload_to_drive.py) opens a browser for Google login on FIRST run and is a consent boundary the agent cannot cross autonomously (see the consent-gated-verification skill). Before starting the full convert-then-upload workflow, verify both blockers:

  1. pandoc installed? which pandoc — if missing, pixi global install pandoc (preferred per AGENTS.md) or another option from the self-healing table.
  2. Google OAuth creds present? echo ${GOOGLE_CLIENT_ID:+set} / echo ${GOOGLE_CLIENT_SECRET:+set} — if either is empty, the upload step will fail.

If BOTH are satisfied → run the full workflow (convert + upload).

If OAuth creds are MISSING (the common case for a first attempt on a new project/machine) → offer the local-generation fallback FIRST rather than asking the user to do Google Cloud Console setup:

Fallback: generate .docx locally, user uploads manually

  1. Convert markdown to .docx with pandoc (Step 2 of the main workflow).
  2. Report the local path of the generated .docx to the user.
  3. Let the user drag-and-drop the file into Google Docs / Drive themselves.

This sidesteps the OAuth consent boundary entirely and is usually what the user wants for a one-off document (setting up OAuth credentials for a single doc is rarely worth the Google Cloud Console work). Verified 2026-07-18 in the brain42 project: user chose the local-generation path over OAuth setup for a letter-of-support .docx.

Only set up OAuth (Google Cloud Console OAuth client + env vars) if the user will publish to Google Docs REPEATEDLY and wants the automated upload path.

Self-healing: Installing pandoc

If pandoc is not installed, ask the user how they would like to install it:

Preferred option (pixi):

bash
pixi global install pandoc

Alternative options by platform:

PlatformCommand
macOS (Homebrew)brew install pandoc
macOS (MacPorts)port install pandoc
Windows (Chocolatey)choco install pandoc
Windows (winget)winget install --source winget --exact --id JohnMacFarlane.Pandoc
Linux (Conda)conda install -c conda-forge pandoc
Any (download)Download from https://github.com/jgm/pandoc/releases/latest

Use the question tool to present these options if pandoc is missing.

Workflow

Step 1: Check pandoc availability

bash
which pandoc && pandoc --version

If not found, prompt user to install (see self-healing above).

Step 2: Convert markdown to docx with pandoc

bash
pandoc INPUT.md --from markdown --to docx --reference-doc=TEMPLATE.docx --output=OUTPUT.docx

The --reference-doc flag applies the template's styles (fonts, headings, margins) to the output.

Step 3: Upload to Google Drive

bash
uv run scripts/upload_to_drive.py --input OUTPUT.docx --title "Document Title"

Returns a shareable Google Docs link.

Example

bash
# Convert and upload
pandoc "proposal.md" --from markdown --to docx --reference-doc="template.docx" --output="proposal.docx"
uv run scripts/upload_to_drive.py --input "proposal.docx" --title "My Proposal"

Scripts

upload_to_drive.py

Uploads a docx file to Google Drive using OAuth2 user authentication.

Usage:

bash
uv run scripts/upload_to_drive.py --input /path/to/file.docx --title "Document Title"

Setup (one-time):

  1. Go to https://console.cloud.google.com/apis/credentials
  2. Create an OAuth 2.0 Client ID (Desktop app)
  3. Set environment variables:
bash
export GOOGLE_CLIENT_ID='your-client-id.apps.googleusercontent.com'
export GOOGLE_CLIENT_SECRET='your-client-secret'

Features:

  • Opens browser for Google login on first run
  • Saves credentials locally for future use
  • Use --logout to remove saved credentials
  • Use --no-share to keep document private

Template Style Requirements

For best results, your template should have these styles defined:

StyleUsage
TitleDocument title (# heading)
Heading 1Major sections (## heading)
Heading 2Subsections (### heading)
Heading 3Sub-subsections (#### heading)
NormalBody paragraphs

Notes

  • Pandoc handles all markdown correctly: lists, bold, italic, tables, code blocks, links
  • The template's fonts, colors, and margins are preserved via --reference-doc
  • Images from the template are not copied - this only applies styles

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Publish To Google Docs AI skill do?

Quickly publish markdown notes to styled Google Docs using pandoc and a Word template. Use when creating Google Docs from markdown, applying branding to documents, or pushing content to Drive for sharing.

Why use Publish To Google Docs on TypingMind?

Because you install it once and use it with any model. Publish To Google Docs is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Publish To Google Docs in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ericmjl/skills/tree/main/skills/publish-to-google-docs. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Publish To Google Docs?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Publish To Google Docs?

As many as you like. As long as a model supports skills, you can use Publish To Google Docs with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Publish To Google Docs AI skill free?

Yes. It is published on GitHub by ericmjl under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇