Stop Passive AI Rewrites: Agentic Coaching in Google Docs with gdocumentor

Gists

A Go CLI and MCP server that turns Gemini and any AI agent into a Socratic writing and code review coach

Figure 1. Overview of the gdocumentor architecture and its four core pillars. Figure 1. Overview of the gdocumentor architecture and its four core pillars.

In my previous two articles—Building a Multimodal, Suggestion-Based AI Writing Coach with Gemini and Google Docs (Ref) and Beyond Passive AI Rewrites and Vibe Coding in Google Docs (Ref)—I introduced the Google Apps Script add-on DocuMentor AI (Ref). Those earlier articles explain the foundational inspiration behind the project, how programmatic Google Docs API (v1) suggestions and comments (Ref) can replace passive AI ghostwriting with active learning, and how a single Google Docs container-bound or Marketplace script can serve both individuals and school/enterprise domains. For background on those foundational concepts and the Google Apps Script implementation, please refer to those two published articles (Ref, Ref).

In this third installment, I introduce gdocumentor (Ref)—a high-performance Golang CLI tool, Global Model Context Protocol (MCP) Server (gdocumentor mcp), and Google Antigravity Agent Skill / Plugin (with support for 7 major AI agent environments) that liberates DocuMentor AI from the confines of a single open browser tab and transforms it into a 1-to-N scriptable, terminal-native, and autonomous AI-agent-driven coaching and document automation platform.

The 4 Core Pillars (Figure 1)


1. Defining the Problem & Why Move Beyond a Browser Add-on

Why Passive AI Rewrites Fail

Instead of silently overwriting text, gdocumentor enforces active human judgment:

Two Limits of a Browser Add-on

Figure 2. Paradigm shift from a 1-to-1 browser add-on to 1-to-N autonomous agentic coaching across classrooms, engineering teams, and research labs. Figure 2. Paradigm shift from a 1-to-1 browser add-on to 1-to-N autonomous agentic coaching across classrooms, engineering teams, and research labs.

What gdocumentor Unlocks (Figure 2)

Dimension GAS Add-on (DocuMentor AI) Go CLI & MCP Server (gdocumentor)
Execution 1-to-1 browser sidebar 1-to-N terminal, CI/CD, and MCP AI agents
Inputs Current open Google Doc only .md, .docx, .pdf, .txt, source code, stdin, Web/GitHub URLs, Google Docs (-d)
Code Context Single document tab Cross-file dependency resolver (--auto-deps)
AI Engine Internal GEMINI_API_KEY CLI: GEMINI_API_KEY | MCP (gdocumentor mcp): Client Host AI (0 GEMINI_API_KEY)
Direct Editing N/A 0-Token edit command/tool (Markdown, tables, image insert/resize)

2. Architecture: 4-Stage Pipeline & Dual-Engine MCP

A. The 4-Stage Processing Pipeline

Figure 3. End-to-end workflow and 4-stage processing pipeline of gdocumentor. Figure 3. End-to-end workflow and 4-stage processing pipeline of gdocumentor.

B. Standalone CLI vs. MCP Server

Figure 4. Agentic ecosystem and dual-engine MCP architecture connecting AI orchestrators to Google Workspace and local filesystems. Figure 4. Agentic ecosystem and dual-engine MCP architecture connecting AI orchestrators to Google Workspace and local filesystems.

Feature 💻 Standalone CLI (gdocumentor) 🤖 MCP Server (gdocumentor mcp)
Reasoning Brain Built-in Gemini API (gemini-3.8-flash / gemini-4-argon) Client AI Agent’s LLM (model: "agent-ai")
GEMINI_API_KEY Required Not Required
Execution Flow 1-command self-contained pipeline 1-step (aiResult) or 2-step (prepareOnly ➔ skipDocInsert: true)
Best For Terminal one-liners, shell loops, CI/CD gates Conversational coaching in agy, Claude Desktop, Cursor, VS Code

C. 10 Standout Capabilities of gdocumentor

D. Why Build gdocumentor in Go (Golang)?

E. Why Self-Provisioning (gdocumentor setup) & WSL2 ↔ Windows Cross-OS Bridging Are Unique


3. Quick Setup: Isolated Test Workspace (./gdocumentor_test)

Pre-compiled static binaries (CGO_ENABLED=0) for macOS, Linux, and Windows (amd64 / arm64) are available on GitHub Releases.

# 1. Install binary (Linux amd64 example; or use go install github.com/tanaikech/gdocumentor@latest)
curl -L https://github.com/tanaikech/gdocumentor/releases/latest/download/gdocumentor_linux_amd64 -o gdocumentor
chmod +x gdocumentor && sudo mv gdocumentor /usr/local/bin/

# 2. Install as an Antigravity CLI Plugin (or run: gdocumentor setup --all)
agy plugin install https://github.com/tanaikech/gdocumentor

# 3. Set Gemini API Key (Required for Part 1 CLI commands; NOT needed for Part 2 MCP prompts)
export GEMINI_API_KEY="your-gemini-api-key"

# 4. Create an isolated test workspace and copy sample files
mkdir -p gdocumentor_test && cd gdocumentor_test
git clone --depth 1 https://github.com/tanaikech/gdocumentor.git _repo
cp -r _repo/sample . && cp "$(command -v gdocumentor)" ./gdocumentor && rm -rf _repo

4. Part 1: 6 Foundational CLI Commands

Command 1: Zero-Auth Local Mode (--no-auth)

./gdocumentor --no-auth -i ./sample/sample_article.md -o ./my_first_review.md

Figure 5. Terminal execution result of Command 1 in Zero-Auth local mode (–no-auth). Figure 5. Terminal execution result of Command 1 in Zero-Auth local mode (--no-auth).


Command 2: Interactive Pageless Google Docs + Summary Tab (--summary-tab)

./gdocumentor -i ./sample/sample_article.md \
  -o ./interactive_coach_report.md \
  --title "My Interactive Writing Coach Demo" \
  --summary-tab

Figure 6. Terminal execution result of Command 2 creating a Pageless Google Document and a dedicated Summary Tab. Figure 6. Terminal execution result of Command 2 creating a Pageless Google Document and a dedicated Summary Tab.

Figure 7. Pageless Google Document created by Command 2 with native inline Suggested Edits and educational rationale replies. Figure 7. Pageless Google Document created by Command 2 with native inline Suggested Edits and educational rationale replies.


Command 3: Socratic Hint-Only Mode (--hint) + Persona + RAG Rubric

./gdocumentor -i ./sample/sample_article.md \
  --hint \
  --persona "You are a supportive university writing professor. Encourage critical thinking and explain structural weaknesses clearly without giving away the rewritten sentence." \
  -r ./sample/rules/writing_guidelines.md \
  --summary-tab \
  -o ./socratic_hints_report.md \
  --title "Student Essay - Socratic Hint Coaching"

Figure 8. Terminal execution result of Command 3 in Socratic Hint-Only Mode (–hint) with a custom professor persona and RAG writing guidelines. Figure 8. Terminal execution result of Command 3 in Socratic Hint-Only Mode (--hint) with a custom professor persona and RAG writing guidelines.

Figure 9. Google Document created by Command 3 showing anchored Socratic coaching hints without forced text rewrites. Figure 9. Google Document created by Command 3 showing anchored Socratic coaching hints without forced text rewrites.


Command 4: Scoped GitHub Code Review (#L1-L35) + Auto-Dependencies (--auto-deps)

./gdocumentor \
  -t "https://github.com/tanaikech/DocuMentorAI/blob/main/src/code.js#L1-L35" \
  --auto-deps \
  -p "Focus on readability, maintainability, and modern JavaScript / Google Apps Script best practices." \
  -o ./github_code_review.md \
  --title "GitHub Scoped Code Review (#L1-L35)"

Figure 10. Terminal execution result of Command 4 performing a scoped GitHub code review (#L1-L35) with automatic dependency resolution (–auto-deps). Figure 10. Terminal execution result of Command 4 performing a scoped GitHub code review (#L1-L35) with automatic dependency resolution (--auto-deps).

Figure 11. Google Document created by Command 4 with line-by-line inline code suggestions and V8 best-practice rationales. Figure 11. Google Document created by Command 4 with line-by-line inline code suggestions and V8 best-practice rationales.


Command 5: Structural Inspection, Decision Record & Learning from AI + Human Reviews (inspect, manage, & summary)

# 1. Inspect paragraph coordinates (@start:end), visual/table IDs, and pending AI/Human suggestions (0 LLM tokens)
./gdocumentor inspect -d "<YOUR_GOOGLE_DOC_ID>"

# 2. Analyze existing suggestions & comments (from BOTH AI and human reviewers, including resolved history) to get learning advice
./gdocumentor summary -d "<YOUR_GOOGLE_DOC_ID>" --include-resolved --summary-tab

# 3. Accept all pending suggestions and update the Coach Impact & Decision Record (0 LLM tokens)
./gdocumentor manage -d "<YOUR_GOOGLE_DOC_ID>" --accept-all

Command 6: Zero-Token Direct Google Docs, Markdown & Image Editing (edit)

# 1. Create a new Google Document and insert initial paragraphs
DOC_ID=$(./gdocumentor edit --create-doc --title "Live Release Notes" --json | jq -r '.documentId')
printf "Paragraph 1: Introduction\nParagraph 2: Conclusion" | ./gdocumentor edit -d "$DOC_ID"

# 2. Convert and insert rich Markdown (with a native table & local image) right before Paragraph 2
./gdocumentor edit -d "$DOC_ID" --before-paragraph 2 --markdown << 'EOF'
## Key Highlights (Inserted from Markdown)
This section includes **bold**, *italic*, `inline_code_var`, and a [Google Docs API](https://developers.google.com/docs/api) link.
- Automated Coaching Pipeline
  - Supports Socratic `--hint` mode
- [x] Direct Markdown & Image Insertion

| Feature | Status |
| :--- | :---: |
| Native Markdown Conversion | **Ready** |
| Image Insert / Replace / Delete | `Active` |

![Architecture Diagram](./sample/sample_figure.png)
EOF

# 3. Replace the first image (VISUAL_1) with a resized 320pt width version
./gdocumentor edit -d "$DOC_ID" --replace-image VISUAL_1 --with-image ./sample/sample_figure.png --image-width 320

Figure 12. Terminal execution result of Command 6 executing deterministic 0-token Google Docs creation, rich Markdown insertion, and image resizing via gdocumentor edit. Figure 12. Terminal execution result of Command 6 executing deterministic 0-token Google Docs creation, rich Markdown insertion, and image resizing via gdocumentor edit.

Figure 13. Google Document created by Command 6 showing converted rich Markdown, a native 2x2 table, and a 320pt resized diagram placed between the introduction and conclusion. Figure 13. Google Document created by Command 6 showing converted rich Markdown, a native 2×2 table, and a 320pt resized diagram placed between the introduction and conclusion.


5. Part 2: 6 Autonomous AI Agent Prompts (Zero GEMINI_API_KEY via Host-AI MCP)

How Multi-Client AI Agents Work Without GEMINI_API_KEY

Figure 14. 3-stage visual workflow of the gdocumentor MCP Server in Zero-GEMINI_API_KEY Host-AI Mode across multi-client AI agents, showing Stage 1 (Your AI Client / Host AI), Stage 2 (gdocumentor MCP Engine), and Stage 3 (Mode A: Without Google Docs vs. Mode B: With Google Docs). Figure 14. 3-stage visual workflow of the gdocumentor MCP Server in Zero-GEMINI_API_KEY Host-AI Mode across multi-client AI agents, showing Stage 1 (Your AI Client / Host AI), Stage 2 (gdocumentor MCP Engine), and Stage 3 (Mode A: Without Google Docs vs. Mode B: With Google Docs).

# View detailed setup help & cross-platform (WSL2 <-> Windows 11) guide:
gdocumentor setup --help

# Install & configure ALL supported AI clients on Linux / macOS / WSL2:
gdocumentor setup --all

# Inside WSL2, configure Windows 11 GUI apps (Claude Desktop, Cursor, VS Code, Windsurf) via wsl.exe bridge:
gdocumentor setup --all --wsl-host

Prompt 1: Zero-Auth Local Proofreading in ./

Use gdocumentor without a Google OAuth access token (--no-auth) to proofread ./sample/sample_article.md (including its table and diagram) and save the coaching report to ./article_coaching.md in the current working directory. Then summarize the top 3 writing improvements and habits it found.

Figure 15. Execution result of Prompt 1 in Antigravity CLI (agy) performing Zero-Auth local proofreading via Host-AI MCP and summarizing top writing habits. Figure 15. Execution result of Prompt 1 in Antigravity CLI (agy) performing Zero-Auth local proofreading via Host-AI MCP and summarizing top writing habits.


Prompt 2: Socratic Hint-Only Mode + Summary Tab for Educators

I am a university writing instructor. Please use gdocumentor in Socratic Hint-Only mode (--hint) to review ./sample/sample_article.md into a new Google Document titled 'Student Draft - Socratic Coaching', generate the 🎓 DocuMentor AI Summary tab (--summary-tab), and also save a local copy of the hint report to ./student_socratic_hints.md in the current directory. Use a supportive professor persona so the student gets hints on how to improve their writing without being handed the rewritten answers. Give me the Google Docs link when finished.

Figure 16. Execution result of Prompt 2 in Antigravity CLI (agy) orchestrating Socratic Hint-Only coaching with a supportive professor persona. Figure 16. Execution result of Prompt 2 in Antigravity CLI (agy) orchestrating Socratic Hint-Only coaching with a supportive professor persona.

Figure 17. Google Document created by Prompt 2 with anchored Socratic reflection hints from the professor persona. Figure 17. Google Document created by Prompt 2 with anchored Socratic reflection hints from the professor persona.


Prompt 3: Scoped Live Web Page Proofreading (@0:2500)

Use gdocumentor to proofread the web page https://go.dev/doc/effective_go (only character range @0:2500) into a new Google Document with inline Suggested Edits, and also save the local report to ./effective_go_review.md in the current working directory. Tell me the main stylistic takeaways.

Figure 18. Execution result of Prompt 3 in Antigravity CLI (agy) proofreading a live web page (Effective Go character range @0:2500). Figure 18. Execution result of Prompt 3 in Antigravity CLI (agy) proofreading a live web page (Effective Go character range @0:2500).

Figure 19. Google Document created by Prompt 3 showing inline typography and style suggestions on the imported Effective Go web text. Figure 19. Google Document created by Prompt 3 showing inline typography and style suggestions on the imported Effective Go web text.


Prompt 4: Scoped Code Review with RAG Coding Standards

Create a small JavaScript file named ./demo_script.js in the current working directory containing a 20-line function that fetches data from an API without error handling or const/let best practices. Then use gdocumentor to review lines 1 to 20 of ./demo_script.js applying ./sample/rules/coding_standards.md, create a Google Document with inline Suggested Edits, save a local report to ./code_review_report.md in the current directory, and summarize the issues found.

Figure 20. Execution result of Prompt 4 in Antigravity CLI (agy) generating ./demo_script.js and reviewing lines 1-20 against RAG coding standards. Figure 20. Execution result of Prompt 4 in Antigravity CLI (agy) generating ./demo_script.js and reviewing lines 1–20 against RAG coding standards.

Figure 21. Google Document created by Prompt 4 showing inline JavaScript code suggestions explicitly referencing sections of coding_standards.md. Figure 21. Google Document created by Prompt 4 showing inline JavaScript code suggestions explicitly referencing sections of coding_standards.md.


Prompt 5: Zero-Token Direct Markdown & Image Editing via MCP (edit & inspect)

Using gdocumentor's edit and inspect tools (without calling Gemini proofreading), create a new Google Document titled 'Project Status Report', write an introductory paragraph and a conclusion paragraph, and then insert the contents of ./sample/sample_article.md as converted rich Markdown (including its table and ./sample/sample_figure.png) right between the introduction and the conclusion. Finally, resize the inserted image VISUAL_1 to a width of 300pt and give me the Google Document URL.

Figure 22. Execution result of Prompt 5 in Antigravity CLI (agy) orchestrating 0-token document creation, Markdown insertion, and in-place image resizing via MCP tools. Figure 22. Execution result of Prompt 5 in Antigravity CLI (agy) orchestrating 0-token document creation, Markdown insertion, and in-place image resizing via MCP tools.

Figure 23. Google Document created by Prompt 5 showing the composite Project Status Report with converted Markdown, table, and 300pt figure between the introduction and conclusion. Figure 23. Google Document created by Prompt 5 showing the composite Project Status Report with converted Markdown, table, and 300pt figure between the introduction and conclusion.


Prompt 6: Parallel Multi-Document Batch Processing (3 Google Docs Concurrently)

I want to test parallel batch processing using gdocumentor's MCP server. Please perform the following steps:

1. Use the gdocumentor_edit MCP tool to create 3 separate Google Documents on Google Drive with different titles and short sample texts containing intentional typos or stylistic flaws:
   - Document 1: Title 'Essay Draft - Climate Action', Content: A short 3-paragraph draft about renewable energy with repetitive sentences and informal phrasing.
   - Document 2: Title 'Tech Memo - Microservices Architecture', Content: A short technical proposal with vague performance claims and passive voice.
   - Document 3: Title 'Client Support - Inquiry Reply', Content: A customer support reply with overly blunt phrasing and missing greeting structure.

2. Once the 3 Google Documents are created, process all 3 documents in parallel (concurrent sub-tasks or simultaneous tool calls) using the gdocumentor_proofread MCP tool:
   - Proofread Document 1 with mode: 'suggest' and create a dedicated summary tab (summaryTab: true).
   - Proofread Document 2 in Socratic Hint-Only mode (mode: 'hint') with persona: 'Senior Software Architect'.
   - Proofread Document 3 with mode: 'suggest' focusing on polite business tone and client clarity.
   - For each document, also save a local Markdown report (./essay_review.md, ./tech_memo_review.md, ./client_reply_review.md) strictly in the current working directory (workDir: '.').

3. When parallel execution completes, provide a Markdown comparison table displaying:
   - Document Title
   - Google Docs Link (URL)
   - Review Mode applied (Suggest vs. Socratic Hint)
   - Top 2 key improvement highlights for each document.

Figure 24. Execution result of Prompt 6 in Antigravity CLI (agy) creating and coaching 3 distinct Google Documents concurrently in parallel via the MCP server. Figure 24. Execution result of Prompt 6 in Antigravity CLI (agy) creating and coaching 3 distinct Google Documents concurrently in parallel via the MCP server.


Cross-Platform Proof: Windows 11 Claude Desktop ↔ WSL2 gdocumentor MCP

Configured via gdocumentor setup --wsl-host --agent claude-desktop,claude-code. No GEMINI_API_KEY is used—Windows 11 Claude Desktop (Sonnet 5.5) performs all reasoning and calls WSL2 gdocumentor over wsl.exe.

Pattern 1-A: Zero-Auth Mode in Claude Desktop (noAuth: true)

Please use the gdocumentor_proofread MCP tool without a Google OAuth access token (noAuth: true) to proofread the following short draft. Do not call any external Gemini API; use your own Host AI to generate the structured coaching feedback (`aiResult`). After running the tool, display the complete proofreading results directly here in the chat—including a table of Original Text vs. Suggested Revision, the Reason for each edit, the Learning Point, and the Writing Coach & Learning Summary (Executive Feedback, Observed Habits, and Actionable Tips):

"Google Apps Script is basically a coding platform that is provided by Google. You totally do not need to install any special softwares on your computer at all. The most biggest advantage of using GAS is because it can easily connect and integrate with many various Google services to automate routine works every single day."

Pattern 2-A: Google Docs + Summary Tab in Claude Desktop (summaryTab: true)

Please use the gdocumentor_proofread MCP tool (with Google Docs authentication enabled and summaryTab: true) to proofread the following draft into a new Google Document titled "Claude Desktop WSL2 Test - Coaching Review". After applying the inline Suggested Edits to the Google Document, please show me directly here in the chat:
1. The clickable URL to the created Google Document and its Summary Tab
2. A Markdown table summarizing each inline suggestion applied (Original Text, Suggested Edit, Category, Reason, and Learning Point)
3. The Writing Coach & Learning Summary (Executive Feedback, Observed Habits, and Actionable Tips)

Draft to proofread:
"Google Apps Script is basically a coding platform that is provided by Google. You totally do not need to install any special softwares on your computer at all. The most biggest advantage of using GAS is because it can easily connect and integrate with many various Google services to automate routine works every single day."

Figure 25. Tab 1 of the Google Document created by Windows 11 Claude Desktop via the WSL2 gdocumentor MCP server (Pattern 2-A), showing 7 inline Suggested Edits and anchored coaching replies. Figure 25. Tab 1 of the Google Document created by Windows 11 Claude Desktop via the WSL2 gdocumentor MCP server (Pattern 2-A), showing 7 inline Suggested Edits and anchored coaching replies.

Figure 26. The dedicated 🎓 DocuMentor AI Summary tab created in Google Docs by Windows 11 Claude Desktop via the WSL2 gdocumentor MCP server (Pattern 2-A, Model: agent-ai). Figure 26. The dedicated 🎓 DocuMentor AI Summary tab created in Google Docs by Windows 11 Claude Desktop via the WSL2 gdocumentor MCP server (Pattern 2-A, Model: agent-ai).


6. One-Step Workspace Cleanup

# Optional: Delete test Google Docs created on Google Drive
./gdocumentor edit -d "<YOUR_GOOGLE_DOC_ID>" --delete-doc

# Remove the isolated local test workspace
cd .. && rm -rf gdocumentor_test

7. Industry Context & 6 Advanced Workflows

Figure 27. Six advanced applications and next-generation workflows unlocked by gdocumentor across software engineering, education, and research. Figure 27. Six advanced applications and next-generation workflows unlocked by gdocumentor across software engineering, education, and research.

6 Advanced Workflows Unlocked by gdocumentor (Figure 27)


Resources

 Share!