skills/ops-doc-to-drive-pdf/SKILL.md
Turn a markdown operational document (runbook, checklist, SOP, playbook, host script) into a styled print-ready PDF and upload it to a specific Google Drive folder, idempotently — so you can edit the source and regenerate without breaking the Drive link. Use when a user wants a markdown doc rendered as a PDF in Drive, when they ask to "make this printable", "put this in the team folder", "update the PDF in Drive", or whenever an ops doc needs a physical/printable artifact with a stable shareable link. Composes the `latex-pdf` skill (LaTeX template) and the `google-drive` skill (gog CLI) — use this one instead of calling those directly, because it handles the storage convention, the Unicode gotchas, and the re-upload-without-breaking-the-link pattern that you will get wrong by default.
npx skillsauth add razbakov/skills ops-doc-to-drive-pdfInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Glue skill. Takes a markdown operational document from an org repo, renders a styled A4 PDF, and uploads it to a Google Drive folder so the shareable link stays stable across edits.
image-from-htmlimage-from-html or brand-posterlatex-pdf directly, skip the upload ceremony<media-path>/<slug>/build_<slug>.py — the source of truth for future rebuilds<slug>.tex and <slug>.pdf in the same directory (artifacts)fileId — captured so future re-uploads use --replace <fileId>~/Orgs/<Org>/domains/.../<doc>.md). This skill does not write the content.gog drive search "<folder name>" --json
Grab the id where mimeType contains folder. Never guess folder IDs.Artifacts live under a non-git media path, not in the org repo:
mkdir -p ~/Local/<org>/<project>/<slug>
The org's CLAUDE.md usually defines the media-path root (e.g. ~/Local/<org>/ for ikigai). The canonical markdown stays in the org repo (versioned content); the build script and compiled outputs live in media (ephemeral artifacts).
Invoke the latex-pdf skill for the Python + LaTeX template. It covers: Tectonic install check, Python preamble, esc() helper, subprocess compile step. Place the generated build_<slug>.py in the media directory.
On top of the latex-pdf template, you MUST add the fixes in the Gotchas section below before your first compile. These are not optional — they are the difference between a usable PDF and one with missing glyphs that looks fine on screen and breaks on paper.
Do not try to parse the markdown programmatically. Hand-translate section by section into the Python script's CONTENT list. This is deliberate: you keep control over page breaks, callouts, table formatting, checklists, and brand voice. A pandoc auto-conversion loses all of this and produces ugly defaults. The 20 extra minutes of hand-translation is what makes the PDF printable and professional.
cd ~/Local/<org>/<project>/<slug> && python3 build_<slug>.py
First compile is slow (~60s) because Tectonic downloads fonts and packages. Subsequent compiles are fast.
Verification checklist before moving on (this is the step new users skip and regret):
Unicode check — grep the build output:
warning.*could not represent
warning.*Missing character
Must return empty. A non-zero exit code from tectonic is NOT the success criterion — it will happily produce a PDF full of missing-glyph boxes with exit code 0.
Visual check — use the Read tool on the first 2-3 pages of the PDF. Look for:
\textbackslash{}ldots\{\})\u2019 text reading as "Ž019" (the raw-string trap — see gotchas)If anything is off, fix the script and rebuild. Never upload a broken PDF and fix later — it burns a Drive revision and confuses anyone who grabbed the file between uploads.
First upload:
gog drive upload ~/Local/<org>/<project>/<slug>/<slug>.pdf \
--parent <folderId> --json
Parse file.id from the response. Save this ID immediately — it's the idempotency key. Write it in the session notes, memory, or handoff message. Without it, the next "just update the PDF" request creates a duplicate instead of replacing.
All subsequent updates — same file ID, link unchanged, share permissions preserved:
gog drive upload ~/Local/<org>/<project>/<slug>/<slug>.pdf \
--replace <fileId> --json
Success looks like {"preservedFileId": true, "replaced": true}. The --replace flag is the entire reason this skill exists as a separate thing. Without it, every edit produces a new file, breaks existing share links, and forces the user to clean up duplicates.
End your response with a one-liner the user (or a future agent) can run unsupervised:
python3 ~/Local/<org>/<project>/<slug>/build_<slug>.py && \
gog drive upload ~/Local/<org>/<project>/<slug>/<slug>.pdf --replace <fileId>
This matters because the user will come back in three weeks, edit the markdown, and not remember the pipeline. The one-liner is the handoff.
Tectonic's default font (ec-lmr10) does not contain smart quotes, em-dashes, en-dashes, arrows, ellipsis, or non-breaking spaces. A PDF with these characters "compiles" (exit 0) but renders empty boxes. The fix is character substitution at three layers — miss any one layer and glyphs go missing.
esc(), before backslash escapingdef esc(text: str) -> str:
unicode_map = [
("\u2014", "---"), # em-dash
("\u2013", "--"), # en-dash
("\u201C", "``"), # left double quote
("\u201D", "''"), # right double quote
("\u2018", "`"), # left single quote
("\u2019", "'"), # right single quote / apostrophe
("\u2026", "..."), # ellipsis
]
for old, new in unicode_map:
text = text.replace(old, new)
# ... then the latex-pdf skill's standard backslash/&/%/$/#/_/{/}/~/^ escaping
esc()Wrong:
("\u2026", "\\ldots{}"), # DON'T — the later backslash escape pass mangles this
The \\ → \textbackslash{} pass that esc() runs turns \ldots{} into \textbackslash{}ldots\{\}, which renders as literal text. Rule: inside esc(), substitute Unicode to plain ASCII only (..., --, `). If you need a LaTeX command, do it in the final sweep (Gotcha 4).
\u trapWrong:
CONTENT.append(r"\subsection*{Nominated candidate\u2019s speech}")
The r prefix makes \u2019 six literal characters, not a Unicode escape. This renders as "candidateŽ019s" in the PDF — extremely confusing because the bug is invisible in the Python source.
Rule: when a string needs BOTH LaTeX backslashes AND a Unicode char, either drop the r prefix and double the backslashes, or use a plain ASCII apostrophe in raw strings. Never mix r"..." with \u.... escapes. One literal, one concern.
Unicode characters also sneak in via raw LaTeX you write directly — tables, callouts, titles, emergency-protocol rows. These never pass through esc(), so they escape Gotcha 1. Add a final sweep on the assembled TeX string right before writing to disk:
BODY = "\n\n".join(CONTENT)
TEX = PREAMBLE + r"\begin{document}" + "\n" + BODY + "\n" + r"\end{document}" + "\n"
_FINAL_SWEEP = [
("\u2014", "---"),
("\u2013", "--"),
("\u201C", "``"),
("\u201D", "''"),
("\u2018", "`"),
("\u2019", "'"),
("\u2026", "..."),
("\u2192", "$\\rightarrow$"), # OK here — nothing runs after this
]
for _old, _new in _FINAL_SWEEP:
TEX = TEX.replace(_old, _new)
In the final sweep you can safely substitute to LaTeX commands, because nothing else touches the string afterward. That's why → → $\rightarrow$ belongs here, not in esc().
esc() turns ~ into \textasciitilde{}, which renders as a tilde glyph. That's usually fine, but if you have "~50 seconds" meaning "approximately 50", the visual result is awkward. Normalize at the top of esc():
text = text.replace("~50", "approximately 50").replace("~3", "approximately 3")
Or fix at the source — either works.
| Thing | Location | Why |
|---|---|---|
| Canonical markdown source | Org repo (e.g. ~/Orgs/<Org>/domains/.../<doc>.md) | Content is versioned, reviewable, and the source of truth |
| Python build script | Media path (~/Local/<org>/<project>/<slug>/) | Tightly coupled to generated artifacts and specific fileId; not generic enough to belong in git |
| Generated .tex and .pdf | Media path | Artifacts — rebuilt from source on demand |
| Drive file ID | Session notes / memory / handoff message | Required for --replace; losing it forces a re-search or creates duplicates |
If you find yourself writing a build script that would work for many different docs (a true template), promote it into the org repo and parametrize it. That's a different pattern from this skill — this skill is "one doc, one script, one Drive file."
gog drive folder creation exists but the one-time browser step is simpler.--replace is for "the current version of this doc"; versioned archives are a different pattern.~/Local/<org>/<project>/<slug>/<slug>.tex directly — look at the exact line the error references. 90% of the time it's an unescaped character that got through all four gotchas.latex-pdf — invoke this for the LaTeX template, Python preamble, and Tectonic compile setup. This skill adds the Unicode fixes, the media-path storage convention, and the Drive upload layer on top.google-drive — the underlying gog CLI reference. This skill uses gog drive search, gog drive upload --parent, and gog drive upload --replace as its only Drive touchpoints; read that skill for anything beyond those three commands.development
Seed a new or empty Instagram account with a 9-post grid (3×3) so the profile looks established the moment a new visitor lands. Designed for festivals, new businesses, product launches, conferences, communities — any time an empty IG profile would hurt conversion from external traffic (QR scans, flyer drops, cross-promo). Generates assets via /image-from-gemini (per content-publishing rules — never HTML), writes captions with hashtag sets, and outputs a posting order + cadence plan. Trigger generously: phrases like '9 posts for instagram', 'fill my IG', 'starter grid', 'launch grid', 'instagram seed', '9-post grid', 'IG account not to look empty', 'first instagram posts', 'feed bootstrap', '3x3 grid', 'instagram launch content'. Even if the user mentions only one piece (just the images, just the captions, just the order), use this skill — the grid only works as an integrated bundle.
testing
Translate one English blog post into multiple target languages via parallel sub-agents, preserving frontmatter conventions, hero image, and brand voice. Use when the user shares a published English post URL or markdown path and says 'translate it', 'add other languages', 'publish in DE/ES/RU/UK', 'translate to 5 languages', or asks for localized versions of a specific post.
development
Build a complete press kit for an event, product launch, or campaign — in multiple languages — and publish it as a shareable Google Drive folder ready to send to journalists, partners, or a delegate. Produces press releases (typically DE/EN/ES, or configurable), uploads press photos and flyers, creates an Overview document for at-a-glance briefing, and creates a Handover document with pending tasks, contacts, risks, and decisions so press distribution can be delegated. Use when the user says 'I need a press release', 'create a press kit', 'press release in X languages', 'set up a Drive folder for press', 'handover doc for someone else to run press', or has an upcoming announcement that needs to be sent to media. Trigger generously: even partial requests (just a press release, just a flyer folder) typically evolve into the full kit.
development
Track ticket sales for a live event (concert, festival, conference, workshop) with daily snapshots, generate a burndown chart comparing actual sales to ideal-linear targets and tier-cumulative milestones, and report whether the event is on pace. Use when the user asks how sales are going, wants to know if their event will sell out, asks for a daily sales report, wants to set up sales tracking for an upcoming event, or asks about ticket pace / velocity / projection. Trigger generously: phrases like 'how is concert sales going', 'burndown for my event', 'are we going to sell out', 'sales velocity', 'daily ticket chart', 'how many tickets do we need to sell', or any case where the user has a ticketed event with a fixed sales window and wants visibility on pacing.