edit-gdoc
БесплатноБез исполняемых скриптовНе проверенEdit or create an unpublished OWID gdoc, or check or read any registered one (article, data insight, any gdoc type), as ArchieML text through the local or…
от owid★ 1 574 звезды на GitHubОб этом скилле
Edit, create and check gdocs as ArchieML
Three admin routes read and write a gdoc's ArchieML text. Writes need unpublished docs the service account can edit (Google permissions decide which); GET reads any registered doc. A write replaces the whole doc: Google comments and any styling the parser ignores are lost. The old version stays in the doc's revision history (File → Version history).
The doc id is the part of the URL after /document/d/.
Host
Default: the local admin of the checkout you are in. Worktrees use their own port, so run this from the checkout root to take it from
.env. Don'tReadthe.envitself, because it holds secrets.jq -Rr 'select(startswith("ADMIN_SERVER_PORT=")) | ltrimstr("ADMIN_SERVER_PORT=") | sub("\\s*(#.*)?$"; "")' .envIt prints the port without any inline comment, or nothing when
.envdoesn't set it (the port is then 3030).HOST=http://localhost:<port>.When the user names a branch:
HOST=http://staging-site-<branch>, with slashes in the branch name turned into hyphens and the branch part truncated to 28 characters.No auth headers. Localhost logs you in automatically; staging knows you through Tailscale.
$HOST, $ID, $REVISION_ID and $EMAIL in the commands below are placeholders. Shell variables don't persist between Bash calls, so write the literal values into every command.
Keep local files in your session scratchpad directory, and use their absolute paths in commands.
The routes are under $HOST/admin/api. Errors come back as { "error": { "message", "status" } }; the first line of message says what went wrong.
Read a doc
Works on any registered doc, published or not.
Get the doc and check the response for
.error(see Refusals):curl -s "$HOST/admin/api/gdocs/$ID/archieml" > doc.json jq '.error' doc.jsonOnly when that prints
null, save its text, exactly, to a local file:jq -j .text doc.json > doc.archieml jq -r .revisionId doc.jsonjq -jkeeps the text byte-exact (no added trailing newline).revisionIdisnullwhen the service account can only view the doc (e.g. most published docs): it can be read, not written.
Edit a doc
Change a local copy of the text with Edit, then send that file. Never retype the doc into a request — that is where content gets lost.
Read the doc (see "Read a doc") and keep its
revisionId. Ifjq .published doc.jsonprintstrue, orjq .revisionId doc.jsonprintsnull, stop: tell the user the doc can only be read (published, or the service account can only view it).Readdoc.archieml, then make the change withEdit. Touch only the lines that need to change.Send the file:
curl -s -X PUT "$HOST/admin/api/gdocs/$ID/archieml?revisionId=$REVISION_ID" \ -H "Content-Type: text/plain; charset=utf-8" \ --data-binary @doc.archieml | jq--data-binarysends the file as-is (-dwould strip newlines).Read the response (below). For another edit, use the new
revisionIdit returns, or GET again.If this is the first write to this doc in the session, give the user both links (see "Links").
Create a doc
Mirror a real doc of the same type. Field lists alone miss the structure (e.g. a data insight's text goes inside [+body] … []).
Find an exemplar of the type (
$TYPE, e.g.data-insight):curl -s "$HOST/admin/api/gdocs-reference/templates/$TYPE/exemplars.json" | jq -r '.exemplars[0].gdocId'If that prints
nullor an error, take any doc of the type, published first:curl -s "$HOST/admin/api/gdocs" | jq -r --arg t "$TYPE" '[.[] | select(.type == $t)] | (map(select(.published)) + .)[0].id'If that prints
nulltoo, there is no doc of the type: build from the fields in$HOST/admin/api/gdocs-reference/templates.json, and tell the user the structure is unverified.Read the exemplar as in "Read a doc" (
exemplar.json→exemplar.archieml), thenReadthe local file. It is usually published and always read-only: a PUT on it returns 403. Never send it.Writethe new doc to a local file, e.g.new.archieml. Mirror the exemplar's front matter and block layout; replace its content with yours. Prefix the front-mattertitlewith[TEST](e.g.title: [TEST] Life expectancy): the Drive name is taken from it, so test docs stand out in Drive and in the admin. For block syntax, see$HOST/admin/api/gdocs-reference/components.json.Share with the Claude session's account email (the user's email from your session context). If you don't know it, ask. Never guess.
Pick the Drive folder. If the user names one, add
&folderId=$FOLDER_IDto the URL in step 6, where$FOLDER_IDis the part of the folder's URL after/folders/. Otherwise leavefolderIdout, and the server uses the folder set in itsGDOCS_EDIT_GDOC_FOLDER_ID.If the
Установить edit-gdoc в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadEditWriteBash(curl:*)Bash(jq:*)FAQ
Что делает скилл edit-gdoc?
Edit or create an unpublished OWID gdoc, or check or read any registered one (article, data insight, any gdoc type), as ArchieML text through the local or staging admin API. Use when an engineer asks to change a test gdoc's content, create a new gdoc draft from ArchieML, or check a gdoc's errors and warnings — given a doc id or docs.google.com URL, on localhost or on staging-site-<branch>.
Как установить скилл edit-gdoc?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл edit-gdoc запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic