Skip to content
Back to skills

Gdoc Comment

ASecurity

Post anchored comments on a native Google Doc by driving the real editor with Playwright. Use when a comment must attach to specific text and survive, because Drive API comments always orphan as "Original content deleted". Also verifies each posted comment carries a real kix anchor.

  • 33 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 23, 2026
ai-agentspythongobashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 23, 2026

npx -y skills add BrianArfi/ai-second-brain --skill gdoc-comment --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gdoc Comment?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gdoc Comment
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/brianarfi-gdoc-comment/badge)](https://www.skillsdirectory.com/skills/brianarfi-gdoc-comment)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gdoc-comment
description: Post anchored comments on a native Google Doc by driving the real editor with Playwright. Use when a comment must attach to specific text and survive, because Drive API comments always orphan as "Original content deleted". Also verifies each posted comment carries a real kix anchor.
---

# gdoc-comment

Creates **anchored** comments on a Google Doc.

## Why it exists

The Drive and Docs APIs cannot mint the internal `kix.*` anchor that Google Docs
uses to attach a comment to a range of text. A comment created through the API
therefore orphans immediately and shows as "Original content deleted". Driving
the real editor mints a true anchor every time.

The script types through the editor: Find, select, `Ctrl+Alt+M`, type, post.

## Auth

A persistent Chromium profile per account, at `profile/<account>/`. Sign in once
per account and the session persists.

```bash
python3 .agent/skills/gdoc-comment/gdoc_comment.py login --account work
```

This opens a real window (WSLg on WSL). Accounts today: `work`, `personal`. It
reads the matching Drive token from `work-drive-connector` or
`personal-drive-connector` for the read-back check.

## Posting comments

`--items` takes a JSON list of `{"anchor": "<unique text in the doc>", "text": "<the comment>"}`.
The anchor must appear exactly once in the document.

```bash
python3 .agent/skills/gdoc-comment/gdoc_comment.py comment \
    --doc <DOC_ID> --account work --items items.json
```

Read the items from stdin with `--items -`. Add `--headed` to watch the browser
when something fails.

## Verification

After posting, it reads each comment back through the Drive API and confirms the
comment carries a `kix.*` anchor and the matching `quotedFileContent`. An anchor
of `None` means the comment orphaned, and the run reports that as a failure.

## Gates

The comment text is a message a named human reads, so it passes the no-ai-slop
gate first. `.claude/hooks/send_slop_guard.py` checks the `text` fields inside
`--items` on the way out: an em-dash blocks the send.

Files in this skill

  • SKILL.md2 KB
  • gdoc_comment.py12.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.