Skip to content
Back to search

rachael-quisel-skills

MarketplaceWorks with Claude CodeGitHub

Private, maintained agent plugins from Rachael Quisel.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rachaelquisel--skills-library/badge.svg)](/listings/rachaelquisel--skills-library)

HTML

<a href="/listings/rachaelquisel--skills-library"><img src="/api/listings/rachaelquisel--skills-library/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

This repo is cloned to `~/.claude/skills/`. Claude Code discovers skills automatically from that location and exposes them as slash commands (e.g. `/review`, `/qa`).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 224 lines
  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "rachael-quisel-skills",
  4. "description": "Private, maintained agent plugins from Rachael Quisel.",
  5. "owner": {
  6. "name": "Rachael Quisel"
  7. },
  8. "plugins": [
  9. {
  10. "name": "skillkeeper",
  11. "description": "Maintain your agent skills with named owners, repeatable tests, compatibility evidence, update and rollback records, and verified failure alerts.",
  12. "source": "./plugins/skillkeeper",
  13. "category": "development",
  14. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/skillkeeper",
  15. "version": "1.0.6"
  16. },
  17. {
  18. "name": "automation-briefing",
  19. "description": "Get a short, plain-English brief on automation tools and leading AI models. See what changed, why it matters, and what to test, change, or watch.",
  20. "source": "./plugins/automation-briefing",
  21. "category": "productivity",
  22. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/automation-briefing",
  23. "version": "1.0.5"
  24. },
  25. {
  26. "name": "zite-prompt",
  27. "description": "Write short, paste-ready Zite prompts. Resolve facts outside Zite, use known IDs, and focus each prompt on the next build step.",
  28. "source": "./plugins/zite-prompt",
  29. "category": "development",
  30. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/zite-prompt",
  31. "version": "1.0.5"
  32. },
  33. {
  34. "name": "automation-catalog",
  35. "description": "Creates a name, guide, run location, and tags for each automation.",
  36. "source": "./plugins/automation-catalog",
  37. "category": "productivity",
  38. "version": "1.0.5"
  39. },
  40. {
  41. "name": "automation-catalog-failure-check",
  42. "description": "Check for missing automation catalog reports. Send known failures and blockers to an approved channel.",
  43. "source": "./plugins/automation-catalog-failure-check",
  44. "category": "productivity",
  45. "version": "1.0.5"
  46. },
  47. {
  48. "name": "client-docs",
  49. "description": "Write, diagram, and publish the canonical documents for an XRAY client build, plus the how-it-works, education, KPI, business case, SOAP, and branded-doc skills around it, the five-signals PRD, and the build plan, plus task fetching and meeting transcript review. 26 skills.",
  50. "source": "./plugins/client-docs",
  51. "category": "productivity",
  52. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/client-docs",
  53. "version": "1.4.6"
  54. },
  55. {
  56. "name": "humanize-output",
  57. "description": "Improve existing copy through a short conversation. Choose the reader, tone, and editing depth. Review suggestions before applying changes.",
  58. "source": "./plugins/humanize-output",
  59. "category": "productivity",
  60. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/humanize-output",
  61. "version": "1.0.4"
  62. },
  63. {
  64. "name": "adhd-task-helper",
  65. "description": "ADHD-friendly support for clearer replies, starting a task, sorting a brain dump, and resuming interrupted work.",
  66. "source": "./plugins/adhd-task-helper",
  67. "category": "productivity",
  68. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/adhd-task-helper",
  69. "version": "1.0.5"
  70. },
  71. {
  72. "name": "airtable-interface-craft",
  73. "description": "Create distinctive Airtable interfaces with verified data, reliable interactions and an exact source return.",
  74. "source": "./plugins/airtable-interface-craft",
  75. "category": "productivity",
  76. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/airtable-interface-craft",
  77. "version": "1.0.6"
  78. },
  79. {
  80. "name": "workflow-diagram-builder",
  81. "description": "Explain a workflow with a Mermaid diagram. Answer a few questions, see who does each step, and revise the diagram through conversation.",
  82. "source": "./plugins/workflow-diagram-builder",
  83. "category": "productivity",
  84. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/workflow-diagram-builder",
  85. "version": "1.1.4"
  86. },
  87. {
  88. "name": "automate-notification-to-teams",
  89. "description": "Set up Microsoft Teams notifications through a few questions.",
  90. "source": "./plugins/automate-notification-to-teams",
  91. "category": "productivity",
  92. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/automate-notification-to-teams",
  93. "version": "2.0.5"
  94. },
  95. {
  96. "name": "automation-message-writer",
  97. "description": "Interactively turn automation results into finished interface messages that nontechnical clients understand.",
  98. "source": "./plugins/automation-message-writer",
  99. "category": "productivity",
  100. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/automation-message-writer",
  101. "version": "1.0.5"
  102. },
  103. {
  104. "name": "find-automatable-workflows",
  105. "description": "Ask a few questions to find work worth automating. Review selected sources and turn a chosen recommendation into a specification with outcome checks.",
  106. "source": "./plugins/find-automatable-workflows",
  107. "category": "productivity",
  108. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/find-automatable-workflows",
  109. "version": "1.0.5"
  110. },
  111. {
  112. "name": "generate-financial-dummy-data",
  113. "description": "Create test grants through a conversation. Answer a few questions about your destination and test scenario. Receive verified records or an import file.",
  114. "source": "./plugins/generate-financial-dummy-data",
  115. "category": "productivity",
  116. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/generate-financial-dummy-data",
  117. "version": "1.1.4"
  118. },
  119. {
  120. "name": "ghibli-icon-maker",
  121. "description": "Give your ideas a softer look. Draws hand-made charcoal line icons on washed pastel tiles, so a set of plugins, apps, or brand marks reads as one family instead of a pile of clip art.",
  122. "source": "./plugins/ghibli-icon-maker",
  123. "category": "productivity",
  124. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/ghibli-icon-maker",
  125. "version": "1.0.5"
  126. },
  127. {
  128. "name": "plain-english-editor",
  129. "description": "Rewrite or review content in concise, plain English, including automation and process explanations.",
  130. "source": "./plugins/plain-english-editor",
  131. "category": "productivity",
  132. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/plain-english-editor",
  133. "version": "4.1.4"
  134. },
  135. {
  136. "name": "publish-a-plugin",
  137. "description": "Prepare Claude Code plugins for directory review.",
  138. "source": "./plugins/publish-a-plugin",
  139. "category": "development",
  140. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/publish-a-plugin",
  141. "version": "1.1.4"
  142. },
  143. {
  144. "name": "questions-worth-asking",
  145. "description": "Turn meeting notes into useful follow-up. Find missed questions, clarify what changed, and get a prioritized checklist with messages ready to use.",
  146. "source": "./plugins/questions-worth-asking",
  147. "category": "productivity",
  148. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/questions-worth-asking",
  149. "version": "1.2.5"
  150. },
  151. {
  152. "name": "skill-and-plugin-namer",
  153. "description": "Name a skill or plugin through a few questions. Receive a clear name, tagline, description, feature bullets, and usage steps.",
  154. "source": "./plugins/skill-and-plugin-namer",
  155. "category": "productivity",
  156. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/skill-and-plugin-namer",
  157. "version": "3.1.4"
  158. },
  159. {
  160. "name": "turn-off-ai-data-sharing",
  161. "description": "Find out what your AI accounts are actually sharing, then shut off the parts you never agreed to. Reads the settings pages in your own browser, checks each one against what the vendor documents, and hands you the exact click path to fix it.",
  162. "source": "./plugins/turn-off-ai-data-sharing",
  163. "category": "productivity",
  164. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/turn-off-ai-data-sharing",
  165. "version": "1.0.4"
  166. },
  167. {
  168. "name": "week-in-rewind",
  169. "description": "Create a short recap of opted-in Computer History. Choose the dates, tone, and focus. Optional scheduling supports delivery to your own Slack direct message.",
  170. "source": "./plugins/week-in-rewind",
  171. "category": "productivity",
  172. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/week-in-rewind",
  173. "version": "3.1.5"
  174. },
  175. {
  176. "name": "worth-asking",
  177. "description": "Surface high-leverage questions missed in client conversations.",
  178. "source": "./plugins/worth-asking",
  179. "category": "productivity",
  180. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/worth-asking",
  181. "version": "1.0.4"
  182. },
  183. {
  184. "name": "airbnb-hosting-expert",
  185. "description": "Practical Airbnb hosting guidance, listing reviews, and guest-message drafts based on the host's confirmed details.",
  186. "source": "./plugins/airbnb-hosting-expert",
  187. "category": "productivity",
  188. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/airbnb-hosting-expert",
  189. "version": "2.3.4"
  190. },
  191. {
  192. "name": "github-portfolio-builder",
  193. "description": "Build a stronger GitHub portfolio. Highlight your best work, explain your contributions, and get a prioritized plan for what to improve.",
  194. "source": "./plugins/github-portfolio-builder",
  195. "category": "productivity",
  196. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/github-portfolio-builder",
  197. "version": "1.1.9"
  198. },
  199. {
  200. "name": "github-portfolio-review",
  201. "description": "Review GitHub projects as credible professional portfolio evidence.",
  202. "source": "./plugins/github-portfolio-review",
  203. "category": "productivity",
  204. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/github-portfolio-review",
  205. "version": "1.0.4"
  206. },
  207. {
  208. "name": "contact-follow-up-tracker",
  209. "description": "Save contacts, encounters, and confirmed promises in a Google Drive log. Check who owes what to whom and when. Enable Cowork reminders when you choose.",
  210. "source": "./plugins/contact-follow-up-tracker",
  211. "category": "productivity",
  212. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/contact-follow-up-tracker",
  213. "version": "1.0.4"
  214. },
  215. {
  216. "name": "cited-research-assistant",
  217. "description": "Research questions and check drafts with retrieved evidence. Cite each supported claim. Identify evidence gaps. Check the final reply against the cited brief.",
  218. "source": "./plugins/cited-research-assistant",
  219. "category": "productivity",
  220. "homepage": "https://github.com/RachaelQuisel/Skills/tree/main/plugins/cited-research-assistant",
  221. "version": "1.0.4"
  222. }
  223. ]
  224. }
README.md · README · 167 lines
  1. # Skills
  2. A library of **AI agent skills** for Claude Code — modular, self-contained instruction bundles that extend agent capabilities across planning, development, client work, and operations.
  3. Each skill lives in its own folder and contains a `SKILL.md` plus optional `references/`, `scripts/`, and `assets/`.
  4. ## Skillkeeper plugin
  5. [Skillkeeper](plugins/skillkeeper/README.md) packages the maintained-skills routine as a private Claude Code plugin. It inventories skill ownership and versions, preserves sanitized regression cases, separates offline checks from live compatibility evidence, prepares controlled updates and rollbacks, and explains failures without guessing their cause.
  6. ```text
  7. claude plugin marketplace add RachaelQuisel/Skills
  8. claude plugin install skillkeeper@rachael-quisel-skills
  9. ```
  10. The plugin is instruction-only. The repository workflow and ChatGPT alert task remain separate services and must be verified independently.
  11. ## Zite Prompt plugin
  12. [Zite Prompt](plugins/zite-prompt/README.md) creates lean, paste-ready prompts using verified facts and known IDs. It includes examples for interface builds, prompt shortening, and missing decisions.
  13. ```text
  14. claude plugin install zite-prompt@rachael-quisel-skills
  15. ```
  16. ## Skills in this repo
  17. ### Planning & Design
  18. | Skill | Purpose |
  19. |-------|---------|
  20. | **write-a-prd** | Create a PRD through user interview + codebase exploration, filed as a GitHub issue |
  21. | **prd-to-plan** | Turn a PRD into a phased implementation plan using tracer-bullet vertical slices |
  22. | **prd-to-issues** | Break a PRD into independently-grabbable GitHub issues |
  23. | **grill-me** | Stress-test a plan or design by interviewing relentlessly |
  24. | **request-refactor-plan** | Plan a refactor with tiny commits, filed as a GitHub issue |
  25. | **ubiquitous-language** | Extract a DDD-style glossary from conversation, saved to UBIQUITOUS_LANGUAGE.md |
  26. | **business-case** | Discovery call transcript to XRAY-branded business case (.docx) |
  27. | **business-requirements** | Elicit and capture business requirements (Vision & Scope) |
  28. ### Development
  29. | Skill | Purpose |
  30. |-------|---------|
  31. | **explore-first** | Understand codebase and requirements before implementing |
  32. | **create-plan** | Produce a markdown execution plan with status tracking |
  33. | **zite-prompt** | Create compact, implementation-focused prompts for Zite while keeping research and decision-making outside Zite |
  34. | **execute** | Implement the plan step by step |
  35. | **workflow-orchestration** | Plan-first, verification, lessons, subagents for non-trivial tasks |
  36. | **review** | Code review checklist and output format |
  37. | **create-issue** | Fast capture of bugs/features mid-development |
  38. | **triage-issue** | Investigate a bug, find root cause, file a GitHub issue with TDD fix plan |
  39. | **qa** | Interactive QA session — report bugs conversationally, agent files GitHub issues |
  40. | **explain-code** | Explain code with visual diagrams and analogies |
  41. | **peer-review** | Cross-model review (Codex/Gemini reviews Claude's work) |
  42. | **research** | Research using subagents (APIs, data, debugging, comparisons) |
  43. | **tech-docs-bootstrap** | Bootstrap technical documentation for a project |
  44. ### Security
  45. | Skill | Purpose |
  46. |-------|---------|
  47. | **vibe-safe** | Secure API development (RAILGUARD, validation, auth, errors) |
  48. | **vibe-safe-auth** | Secure authentication patterns (login, sessions, CSRF) |
  49. | **vibe-safe-errors** | Secure error handling (no info leaks) |
  50. | **vibe-safe-upload** | Secure file upload handling (MIME validation, size limits) |
  51. | **git-guardrails-claude-code** | Block dangerous git commands via Claude Code hooks |
  52. ### Client & Operations (XRAY)
  53. | Skill | Purpose |
  54. |-------|---------|
  55. | **micro-case-study** | Mine transcripts for atomic client wins, produce structured MCS records |
  56. | **kpi-report** | Generate KPI reference doc from discovery transcript |
  57. | **post-to-huddle** | Post updates to client Slack huddle channels |
  58. | **humanizing** | Rewrite text in Rachael's voice |
  59. | **insidery** | Rewrite text in XRAY engineering team voice |
  60. | **internal-comms** | Internal comms (status reports, newsletters, FAQs) |
  61. | **xray-brand** | Apply XRAY 2026 brand identity to any output |
  62. | **xray-tasks** | Interact with the XRAY Task Inbox |
  63. | **task-check** | List active tasks from tasks.xray.tech |
  64. | **new-account** | Log signups/subscriptions to Airtable |
  65. | **omni-prompt** | Generate Airtable Omni AI prompts for interfaces |
  66. ### Documents & Output
  67. | Skill | Purpose |
  68. |-------|---------|
  69. | **docx** | Create, read, edit Word documents |
  70. | **pdf-builder** | Build production PDF documents with ReportLab |
  71. | **markdown-to-xr-gdoc** | Convert Markdown to branded XRAY Google Docs |
  72. | **frontend-design** | Production-grade frontend interfaces |
  73. | **slack-gif-creator** | Animated GIFs optimized for Slack |
  74. | **puzzle-prompt-builder** | Convert SOPs/workflows into Puzzle.io Nova prompts |
  75. ### Travel
  76. | Skill | Purpose |
  77. |-------|---------|
  78. | **travel-brief** | Comprehensive travel briefing with logistics |
  79. | **travel-packing-list** | Personalized packing lists |
  80. ### Meta
  81. | Skill | Purpose |
  82. |-------|---------|
  83. | **skill-creator** | Create and package new skills |
  84. | **token-check** | Estimate token usage of a skill |
  85. | **context-awareness** | Monitor context window, create session handoff documents |
  86. | **gem-miner** | Mine conversations for gems (daily) |
  87. | **mcp-troubleshooting** | Diagnose MCP server auth failures |
  88. ## Audit log pilot
  89. The audit log keeps a diary of everything the Execute skill does when it carries out a written plan. There is no schedule. It runs whenever someone asks Execute to work.
  90. As Execute goes, it writes a short dated note at each key moment: when it starts, when it begins a step, which files it changed, what test it ran and whether it passed, when it finishes a step, and when it stops to flag a problem. If a step has no named test, it writes "review" plus the step's name. That counts as weaker proof, because Execute is vouching for itself.
  91. The input is the plan file (a to-do list whose steps are marked red, yellow, or green) plus those notes. The output is the diary, one line per event, and the report from the automation run verifier. The automation run verifier reads the diary and gives one of three answers:
  92. - **Verified.** Every main step is green, each one had a passing test after its last file change and before it was marked done, the percentage matches the share of finished steps, and the only files touched were ones the plan named, ones explicitly approved when Execute flagged a problem, or the plan file itself.
  93. - **Not achieved.** Something clearly went wrong: a step is still open, a test failed in that window, the percentage does not add up, or a file changed that was not in the plan and was not approved.
  94. - **Unknown.** Some proof is missing, or a test result sits outside that window, so the automation run verifier will not call the job finished.
  95. The diary is a plain text file, `execute/.audit/events.jsonl`, in a hidden folder inside the Execute skill on the computer that ran it. That folder stays out of the GitHub repo, so the diary is not online yet. A database version is planned later.
  96. If a step was marked done without proof, the separate correction tool (`audit-log-plugin/scripts/reopen_task.py`), not the automation run verifier, reopens it. That tool flips the step back from green, updates the percentage, and writes a note. It never touches the actual work or the code.
  97. ## Structure of a skill
  98. ```text
  99. skill-name/
  100. ├── SKILL.md # Required: YAML frontmatter (name, description) + body
  101. ├── references/ # Optional: loaded when the skill says to read them
  102. ├── scripts/ # Optional: runnable helpers
  103. └── assets/ # Optional: templates, images
  104. ```
  105. ## Installation
  106. This repo is cloned to `~/.claude/skills/`. Claude Code discovers skills automatically from that location and exposes them as slash commands (e.g. `/review`, `/qa`).
  107. ## Creating new skills
  108. ```bash
  109. python3 skill-creator/scripts/init_skill.py <name> --path ~/.claude/skills/
  110. ```
  111. ## Maintained collection
  112. Each of the 161 registered skill paths has a maintenance README. This inventory includes standalone skills and nested plugin copies in this repository. The combined Skill checks workflow checks release versions, inventory, and registered tests on changes and every Monday at 15:30 UTC. The existing hourly task reports each unresolved problem once and sends one verified recovery notice. Its saved alert record prevents repeated messages for the same problem. These routines run without a personal computer.
  113. Read [how the maintenance routine works](maintenance/Skills-HowItWorks-2026-10-11-maintenance.md) for the trigger, inputs, steps, and outputs. The [maintenance guide](maintenance/README.md) explains tests, support, update approval, and returning to an earlier version. Live integration and agent compatibility remain unverified until separately tested. Installed skills are not updated automatically.
  114. ## Automation catalog plugins
  115. | Plugin | Purpose |
  116. | --- | --- |
  117. | [Automation Metadata Maker](plugins/automation-catalog/README.md) | Find accessible automations and update their guides, categories, tags and approved Slack messages. |
  118. | [Automation Catalog Failure Check](plugins/automation-catalog-failure-check/README.md) | Check for missing catalog reports and send known failures or blockers to an approved channel. |
  119. Both have matching Soft Index icons and plain-English instructions. The repository marketplace lists both packages. They are private review versions, not approved Anthropic directory listings. See the [marketplace review](deployments/automation-catalog/marketplace-review.md) for validation results and remaining Claude checks.
  120. The [configured cloud routines](deployments/automation-catalog/README.md) run on Mondays at 5 AM and 6 AM Pacific. Generic plugin installation does not create these schedules. Package tests run separately from the top-level maintained-skills collection.
markdown-to-xr-gdoc/scripts/convert_to_gdoc.py · Bundled script · 219 lines · 2 findings marked
  1. import sys
  2. import os
  3. import base64
  4. import re
  5. import requests
  6. import json
  7. import subprocess
  8. import tempfile
  9. import html
  10. try:
  11. import markdown
  12. except ImportError:
  13. print("Error: The 'markdown' library is required. Please install it with 'pip install markdown'.")
  14. sys.exit(1)
  15. def render_mermaid_blocks(html_content):
  16. """Finds mermaid code blocks in the generated HTML and replaces them with base64 img tags."""
  17. # Pattern to match <pre><code class="language-mermaid">...</code></pre>
  18. mermaid_pattern = re.compile(r'<pre><code class="language-mermaid">(.*?)</code></pre>', re.DOTALL)
  19. # Path to the styles (self-contained within skill assets)
  20. script_dir = os.path.dirname(os.path.abspath(__file__))
  21. css_path = os.path.join(os.path.dirname(script_dir), 'assets', 'mermaid_styles.css')
  22. # Ensure mmdc is available
  23. try:
  24. subprocess.run(['mmdc', '--version'], capture_output=True, check=True)
  25. except (subprocess.CalledProcessError, FileNotFoundError):
  26. print("Warning: mmdc (Mermaid CLI) not found. Mermaid diagrams will not be rendered.")
  27. return html_content
  28. def replace_with_png(match):
  29. # Unescape HTML entities that might have been added by the markdown parser
  30. mermaid_code = html.unescape(match.group(1)).strip()
  31. with tempfile.TemporaryDirectory() as tmp_dir:
  32. input_mmd = os.path.join(tmp_dir, 'diagram.mmd')
  33. output_png = os.path.join(tmp_dir, 'diagram.png')
  34. with open(input_mmd, 'w') as f:
  35. f.write(mermaid_code)
  36. # Command to render mermaid as PNG
  37. cmd = [
  38. 'mmdc',
  39. '-i', input_mmd,
  40. '-o', output_png,
  41. '-t', 'neutral',
  42. '-b', 'transparent',
  43. '--scale', '1.0'
  44. ]
  45. # Add CSS if it exists
  46. if os.path.exists(css_path):
  47. cmd.extend(['-C', css_path])
  48. try:
  49. subprocess.run(cmd, capture_output=True, check=True)
  50. with open(output_png, 'rb') as f:
  51. png_data = f.read()
  52. encoded_png = base64.b64encode(png_data).decode('utf-8')
  53. # Return a styled div to center the image and add padding
  54. return f'<p style="text-align: center; margin-top: 32pt; margin-bottom: 32pt; padding: 20pt; background-color: #ffffff; border: 1pt solid #e1ded8; border-radius: 18pt;"><img src="data:image/png;base64,{encoded_png}" alt="Mermaid Diagram" style="max-width: 100%;"></p>'
  55. except subprocess.CalledProcessError as e:
  56. print(f"Error rendering mermaid diagram: {e.stderr.decode()}")
  57. return match.group(0)
  58. return mermaid_pattern.sub(replace_with_png, html_content)
  59. def embed_images_as_base64(html_content, base_dir):
  60. """Finds image tags and replaces their src with base64 data URIs."""
  61. # Regex to find <img src="..."> tags
  62. img_tag_pattern = re.compile(r'<img\s+[^>]*src="([^"]+)"[^>]*>')
  63. def replace_with_base64(match):
  64. img_src = match.group(1)
  65. # Skip absolute URLs
  66. if img_src.startswith('http') or img_src.startswith('data:'):
  67. return match.group(0)
  68. # Try relative to MD file
  69. img_path = os.path.normpath(os.path.join(base_dir, img_src))
  70. # If not found, try relative to project root (current working directory)
  71. if not os.path.exists(img_path):
  72. img_path = os.path.normpath(os.path.join(os.getcwd(), img_src))
  73. if os.path.exists(img_path) and os.path.isfile(img_path):
  74. ext = os.path.splitext(img_path)[1].lower().replace('.', '')
  75. if ext in ['png', 'jpg', 'jpeg', 'gif', 'svg']:
  76. with open(img_path, 'rb') as f:
  77. encoded_string = base64.b64encode(f.read()).decode('utf-8')
  78. mime_type = f'image/{ext}' if ext != 'svg' else 'image/svg+xml'
  79. return match.group(0).replace(img_src, f'data:{mime_type};base64,{encoded_string}')
  80. return match.group(0)
  81. return img_tag_pattern.sub(replace_with_base64, html_content)
  82. def inline_styles(html_content):
  83. """Injects inline styles for elements to ensure branding survives GDoc import."""
  84. # Definitions
  85. fonts_header = "'Urbanist', sans-serif"
  86. fonts_body = "'Figtree', sans-serif"
  87. gray_900 = "#0e1c2d"
  88. gray_600 = "#686f76"
  89. blue_500 = "#1566b9"
  90. style_map = {
  91. r'<h1>': f'<h1 style="font-family: {fonts_header}; font-size: 42pt; line-height: 1.15; color: {gray_900}; font-weight: 700; letter-spacing: -1pt; margin-top: 36pt; margin-bottom: 24pt;">',
  92. r'<h2>': f'<h2 style="font-family: {fonts_header}; font-size: 30pt; line-height: 1.2; color: {gray_900}; font-weight: 700; letter-spacing: -1pt; margin-top: 32pt; margin-bottom: 18pt;">',
  93. r'<h3>': f'<h3 style="font-family: {fonts_header}; font-size: 24pt; line-height: 1.2; color: {gray_900}; font-weight: 700; letter-spacing: -1pt; margin-top: 24pt; margin-bottom: 12pt;">',
  94. r'<h4>': f'<h4 style="font-family: {fonts_header}; font-size: 18pt; line-height: 1.2; color: {gray_900}; font-weight: 700; letter-spacing: -0.5pt; margin-top: 18pt; margin-bottom: 12pt;">',
  95. r'<h5>': f'<h5 style="font-family: {fonts_header}; font-size: 14pt; line-height: 1.2; color: {gray_900}; font-weight: 700; letter-spacing: -0.5pt; margin-top: 16pt; margin-bottom: 12pt;">',
  96. r'<p>': f'<p style="font-family: {fonts_body}; font-size: 12pt; line-height: 1.5; color: {gray_600}; letter-spacing: -0.5pt; margin-bottom: 16pt;">',
  97. r'<ul>': f'<ul style="font-family: {fonts_body}; color: {gray_600}; margin-bottom: 16pt; padding-left: 24pt;">',
  98. r'<ol>': f'<ol style="font-family: {fonts_body}; color: {gray_600}; margin-bottom: 16pt; padding-left: 24pt;">',
  99. r'<li>': f'<li style="margin-bottom: 8pt; font-size: 12pt;">',
  100. r'<a>': f'<a style="color: {blue_500}; text-decoration: none;">',
  101. r'<blockquote>': f'<blockquote style="border-left: 4pt solid {blue_500}; padding-left: 18pt; margin: 24pt 0; font-style: italic; color: {gray_900};">',
  102. r'<table>': f'<table style="width: 100%; border-collapse: collapse; margin: 24pt 0; font-family: {fonts_body};">',
  103. r'<th>': f'<th style="border: 1pt solid #e1ded8; padding: 12pt; text-align: left; background-color: #f8f8f8; color: {gray_900}; font-weight: 700;">',
  104. r'<td>': f'<td style="border: 1pt solid #e1ded8; padding: 12pt; text-align: left; color: {gray_600};">',
  105. }
  106. for tag, styled_tag in style_map.items():
  107. html_content = html_content.replace(tag, styled_tag)
  108. return html_content
  109. def main():
  110. if len(sys.argv) < 3:
  111. print("Usage: python3 convert_to_gdoc.py <input_md> <template_html>")
  112. sys.exit(1)
  113. input_md_path = sys.argv[1]
  114. template_path = sys.argv[2]
  115. # Base directory for relative image paths
  116. base_dir = os.path.dirname(os.path.abspath(input_md_path))
  117. if not os.path.exists(input_md_path):
  118. print(f"Error: Input file {input_md_path} not found.")
  119. sys.exit(1)
  120. with open(input_md_path, 'r') as f:
  121. md_content = f.read()
  122. # Standardize Markdown formatting before conversion
  123. try:
  124. import mdformat
  125. md_content = mdformat.text(md_content, extensions=["gfm"])
  126. except Exception as e:
  127. print(f"Warning: Could not format markdown before conversion: {e}")
  128. # Get title from first H1 or filename, then STRIP that H1 from the body.
  129. # Google Docs renders the documentName as its own title bar; leaving the H1
  130. # in the body causes the title to appear twice. The conversion endpoint reads
  131. # the title from `documentName` in the payload, not from the body HTML.
  132. title_match = re.search(r'^#\s+(.+)$', md_content, re.MULTILINE)
  133. if title_match:
  134. title = title_match.group(1).strip()
  135. # Remove the first occurrence of the H1 line (and a trailing newline if present).
  136. md_content = re.sub(r'^#\s+.+\n?', '', md_content, count=1, flags=re.MULTILINE)
  137. else:
  138. title = os.path.splitext(os.path.basename(input_md_path))[0]
  139. # Convert MD to HTML with extensions for tables and fenced code
  140. html_body = markdown.markdown(md_content, extensions=['fenced_code', 'tables', 'attr_list'])
  141. # Render Mermaid blocks to base64 images within the generated HTML
  142. html_body = render_mermaid_blocks(html_body)
  143. # Embed images from repo as Base64
  144. html_body = embed_images_as_base64(html_body, base_dir)
  145. # Inject inline styles for GDoc preservation
  146. html_body = inline_styles(html_body)
  147. # Read template
  148. if not os.path.exists(template_path):
  149. print(f"Error: Template file {template_path} not found.")
  150. sys.exit(1)
  151. with open(template_path, 'r') as f:
  152. template = f.read()
  153. # Inject title and content into template
  154. full_html = template.replace('{{title}}', title).replace('{{content}}', html_body)
  155. # Prepare payload
  156. payload = {
  157. "documentString": full_html,
  158. "documentName": title
  159. }
  160. # Send POST request
  161. url = "https://eo3nite61ktdbkn.m.pipedream.net"
    • Note: Quoted as data in code: Links to a known data-relay/testing domain (m.pipedream.net) without sending anything to it
    • Critical: Sends data in a file that names a request relay
    • Line 200 on GitHub
  162. print(f"Sending payload for '{title}' to {url}...")
  163. try:
  164. response = requests.post(url, json=payload)
  165. response.raise_for_status()
  166. # Output the response (expected to contain gdocURL)
  167. print(response.text)
  168. print("\n✅ Document successfully converted and uploaded!")
  169. print("💡 TIP: For the best display (especially for diagrams), switch the Google Doc to 'Pageless' mode: File > Page setup > Pageless.")
  170. except requests.exceptions.RequestException as e:
  171. print(f"Error during request: {e}")
  172. if hasattr(e, 'response') and e.response:
  173. print(f"Response status: {e.response.status_code}")
  174. print(f"Response body: {e.response.text}")
  175. sys.exit(1)
  176. if __name__ == "__main__":
  177. main()

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.