chart-to-drive
Skill304 starsChanged 2 months agoMITView on GitHub
Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides. Use this skill whenever you need to insert charts into Google Docs or Google Slides, when the google-doc-creator or google-slides-creator agents need chart URLs, when building presentations or reports with embedded visualizations, when user asks to "upload charts", "add images to the doc", "put charts in slides", "make charts available for Google", or any time you have chart PNG files that need to be referenced in Google Workspace documents. One standard flow for upload, permissions, and URL construction, with no public file hosts involved. Always use this skill before calling insert_doc_image or createImage APIs — those require public Drive URLs, which this skill produces. Also use when you see errors like "image URL not accessible" or "permission denied" during doc/slide creation — those usually mean charts weren't properly uploaded to Drive first.
In this repository65 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- always-compareSkill
- analysis-designSkill
- analyst-coreSkill
- archaeologySkill
- archive-analysisSkill
- auth-preflightSkill
- businessSkill
- causalSkill
- close-the-loopSkill
- codex-reviewSkill
- compare-datasetsSkill
- connect-dataSkill
- connect-snowflakeSkill
- context-compareSkill
- context-traceSkill
- data-inspectSkill
- data-mapSkill
- data-profilingSkill
- data-quality-checkSkill
- datasetsSkill
- distribution-profilerSkill
- evalSkill
- evaluate-graderSkill
- experiment-briefSkill
- experimentSkill
- exploreSkill
- exportSkill
- forecastSkill
- google-doc-exportSkill
- google-slides-exportSkill
- guardrailsSkill
- historySkill
- improve-contextSkill
- knowledge-bootstrapSkill
- log-correctionSkill
- maintain-contextSkill
- metric-specSkill
- metricsSkill
- monitor-evalsSkill
- notion-exportSkill
- paceSkill
- patternsSkill
- question-framingSkill
- question-routerSkill
- reliabilitySkill
- resume-pipelineSkill
- run-pipelineSkill
- runsSkill
- score-analysisSkill
- session-handoffSkill
- setup-dev-contextSkill
- setup-notionSkill
- setupSkill
- setup-slackSkill
- setup-snowflakeSkill
- srm-checkSkill
- stakeholder-communicationSkill
- stress-testSkill
- switch-datasetSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
When building Google Docs via the python-docx → upload workflow (that embeds images in the .docx file, no Drive URLs needed)
- Very specific: line 45
Use the Google Docs MCP upload_image_to_drive tool with the LOCAL file path.
- Very specific: line 56
If that tool is unavailable, upload with the Drive API from Python using local credentials (files().create with MediaFileUpload), then set …
- Distinctive: line 59
Optional: Create a "{dataset_name} - Charts" folder first and pass its ID as the parent so uploads stay organized.
- Very specific: line 76
For Google Docs: Use drive_url (permanent, works with insert_doc_image)
- Very specific: line 77
For Google Slides: Use drive_url (permanent, works with createImage)
- Distinctive: line 93
Drive only, always: Never upload charts to public file hosts (tmpfiles, imgur, postimages, or similar).
- Distinctive: line 100
Batch uploads in a single Python script: Don't make separate Bash calls per chart — one script handles all uploads efficiently.
- Distinctive: line 103
Print the chart map: Always output the full filename → drive_id mapping so subsequent agents can reference charts by name.
- Distinctive: line 106
Check for existing uploads: Before re-uploading, search Drive for files with the same name in the expected folder.
- Distinctive: line 115
If the MCP upload tool fails or is missing:
- Distinctive: line 118
If no Drive access works at all: stop, keep the charts local, tell the user which files need manual upload.
- Distinctive: line 121
If a Drive upload returns "permission denied" or "authentication failed":
- Distinctive: line 122
Verify Google Workspace MCP authentication status
- Very specific: line 123
Run mcp__google-docs__authorize_google_docs() to re-authenticate
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Chart-to-Drive Uploader
Purpose
Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides. One standard flow for upload, permissions, and URL construction, with no public file hosts involved.
When to Apply
Automatically whenever:
- Chart PNGs need to be inserted into Google Docs or Google Slides
- The
google-doc-creatororgoogle-slides-creatoragent needs chart URLs - User asks to "upload charts" or "add images to the doc/slides"
- User encounters "permission denied" or "image URL not accessible" errors when building Google Workspace documents — this usually means charts weren't uploaded to Drive first
When NOT to use this skill:
- For single-image uploads where you just need one Drive URL (use
mcp__google-docs__upload_image_to_drivedirectly) - When building Google Docs via the python-docx → upload workflow (that embeds images in the .docx file, no Drive URLs needed)
Workflow
Step 1: Collect chart files
Identify all chart PNGs that need uploading. Standard location: outputs/charts/.
import os
chart_dir = "outputs/charts"
charts = [(f, os.path.join(chart_dir, f)) for f in sorted(os.listdir(chart_dir)) if f.endswith('.png')]Step 2: Upload each chart to Drive directly
Use the Google Docs MCP upload_image_to_drive tool with the LOCAL file path. It
uploads straight to the user's Drive and sets just enough link access for the
Docs/Slides APIs to fetch the image. No public file host is involved at any point;
never route charts through one (the analysis may contain confidential numbers).
for each (filename, filepath) in charts:
mcp__google-docs__upload_image_to_drive(image_path=filepath)
# Returns the Drive file ID; record it in the chart mapIf that tool is unavailable, upload with the Drive API from Python using local
credentials (files().create with MediaFileUpload), then set reader link access.
Optional: Create a "{dataset_name} - Charts" folder first and pass its ID as the parent so uploads stay organized.
Step 3: Build the URL map
Return a mapping of chart filename to both URL formats:
chart_map = {
"01_height_crossover.png": {
"drive_id": "1abc...",
"drive_url": "https://drive.google.com/uc?id=1abc...&export=download"
},
...
}For Google Docs: Use drive_url (permanent, works with insert_doc_image)
For Google Slides: Use drive_url (permanent, works with createImage)
URL Format Reference
| Target | URL Format | Notes |
Google Docs insert_doc_image | https://drive.google.com/uc?id={ID}&export=download | Must be public |
Google Slides createImage | https://drive.google.com/uc?id={ID}&export=download | Must be public |
| Direct Drive view | https://drive.google.com/file/d/{ID}/view | Not for API insertion |
Rules
- Drive only, always. Never upload charts to public file hosts (tmpfiles, imgur, postimages, or similar); the user's Drive is the only image host.
- Set public permissions immediately. Google Docs/Slides API cannot access
private Drive files. The MCP
upload_image_to_drivetool automatically sets public access — no additional permission call needed. - Batch uploads in a single Python script. Don't make separate Bash calls per chart — one script handles all uploads efficiently.
- Print the chart map. Always output the full filename → drive_id mapping so subsequent agents can reference charts by name.
- Check for existing uploads. Before re-uploading, search Drive for files with the same name in the expected folder. If you find existing files with matching names uploaded in the last 24 hours, reuse those Drive IDs instead of creating duplicates. Only re-upload if the file is missing or very old.
Error Recovery
If the MCP upload tool fails or is missing:
- Upload with the Drive API from Python using local credentials
(
files().create+MediaFileUpload), then set reader link access. - If no Drive access works at all: stop, keep the charts local, tell the user which files need manual upload. Never fall back to a public file host.
If a Drive upload returns "permission denied" or "authentication failed":
- Verify Google Workspace MCP authentication status
- Run
mcp__google-docs__authorize_google_docs()to re-authenticate - Retry the upload after successful auth
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

