google-docs

google-docs is a skill for Codex from hxy91819/mason-skills. It costs 59 tokens per session (1,133 once invoked), scanned A, original, MIT.

A tool guide for reading and editing Google Drive files, including Google Docs documents, spreadsheets, presentations, and other files. It downloads current files for reading and uses authorized Google access for structured edits such as changing cells or document content.

In plain words
What is it for?
It is for fetching Google Drive links, reading documents and spreadsheet values, creating or updating sheets, and editing shared files when the account has permission. It can also download presentations and ordinary Drive files.
Why use it?
It avoids manually exporting and reformatting Drive files before an agent can use them. It also separates read-only access from actions that create, change, upload, or delete files.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: built for openclaw.

Good fit It is for fetching Google Drive links, reading documents and spreadsheet values, creating or updating sheets, and editing shared files when the account has permission. It can also download presentations and ordinary Drive files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hxy91819/mason-skills/google-docs
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hxy91819/mason-skills --skill google-docs
Clone the repo
git clone --depth 1 https://github.com/hxy91819/mason-skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for google-docs

README.md
[![agentmods](https://agentmods.dev/badge/skills/hxy91819/mason-skills/google-docs/github.svg)](https://agentmods.dev/skills/hxy91819/mason-skills/google-docs)
Your own site
<a href="https://agentmods.dev/skills/hxy91819/mason-skills/google-docs"><img src="https://agentmods.dev/badge/skills/hxy91819/mason-skills/google-docs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for google-docs

Your own site · 80×15
<a href="https://agentmods.dev/skills/hxy91819/mason-skills/google-docs"><img src="https://agentmods.dev/badge/skills/hxy91819/mason-skills/google-docs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,133 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.01133
Opus 5.5 $0.00024 $0.00453
Sonnet 5.5 $0.00012 $0.00227
Haiku 4.5 $0.00006 $0.00113

Measured 16d ago against content hash d835e9009e04, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

google-docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/gdoc_fetch.py, scripts/gog.sh, scripts/reauth.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

common-skills/google-docs/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Google Docs 读写

两个 rclone 远端共用同一个自建 OAuth client:

远端 权限 用途
gdrive: drive.readonly 读取(默认)。能看到分享给该账号的文件;失败时回退到公开导出链接
gdrive-rw: drive,documents,spreadsheets 新建、修改、上传、删除;也能写入别人分享且给了编辑权限的文件

下文 scripts/ 指本 Skill 根目录下的脚本。

读取

scripts/gdoc_fetch.py '<链接或文件ID>' [--out /tmp/gdoc]

依赖 rclone 和 uv。输出每行一个本地文件路径,位于 <out>/<文件ID>/:

  • 表格:<名>.xlsx 加每个页签一个 <名>__<页签>.csv(公式取计算值,整数不带 .0)。优先读 CSV。
  • 文档:<名>.md。
  • 幻灯片:<名>.pptx;普通 Drive 文件按原格式下载。

每次运行都重新拉取云端最新版本。读完即可删除下载目录。

失败时:

  • rclone 失败 且公开链接返回登录页:文件没分享给已授权账号,请用户让对方分享给自己,或设为「知道链接的人可查看」。
  • 未配置远端:按「配置」一节处理。

写入

单元格、文档正文等结构化编辑用 scripts/gog.sh <gog 子命令>:它用 gdrive-rw: 的 refresh token 现换 access token 后执行 gog,不需要 gog 自己登录(启动时提示 Using direct access token 属正常)。远端可用 GOG_RCLONE_REMOTE 覆盖。子命令用 gog <服务> --help 查。常用:

scripts/gog.sh sheets create '<标题>' -j                                  # 新建表格,返回 spreadsheetId
scripts/gog.sh sheets update <id> 'Sheet1!A1:B2' --values-json '[["name","qty"],["apple",3]]'
scripts/gog.sh sheets append <id> 'Sheet1!A:B' --values-json '[["pear",5]]'
scripts/gog.sh sheets get <id> 'Sheet1!A1:D20' -j
scripts/gog.sh docs create '<标题>' -j                                     # 新建文档
scripts/gog.sh docs write <id> --file note.md --markdown --replace        # 覆盖正文;--append 追加
scripts/gog.sh docs cat <id>
scripts/gog.sh drive ls -j / drive search '<关键词>' -j / drive delete <id> --force

整份文件上传用 rclone。把本地 csv/xlsx/docx 转成谷歌原生格式时,--drive-import-formats 和 --drive-export-formats 要给同一格式,否则报 can't convert ... different export filetype:

rclone copy report.xlsx gdrive-rw:<目录> --drive-import-formats xlsx --drive-export-formats xlsx

删除进回收站(gog drive delete、rclone delete 均如此),30 天内可在 Drive 网页恢复。

  • token 失效 / invalid_grant:按「重新授权」处理。

配置

Read the full file on GitHub · 74 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago First seen · 74 lines · 59 tokens per session scan A d835e9009e04

Subscribe to this mod's changes

google-docs is a skill published in the GitHub repository hxy91819/mason-skills (3 stars, last pushed yesterday), licensed MIT. It adds 59 tokens to every session and 1,133 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-09.