github-image-upload
Skill1 starsChanged 8 days agoApache-2.0View on GitHub
Upload images to GitHub repository via API and return jsDelivr CDN URL. Use this skill whenever the user wants to upload an image, screenshot, or picture, or needs a hosted image URL. Triggers on phrases like "upload image", "上传图片", "图片上传", "host this image", "传图片", "图床", or when the user provides an image file and wants it stored/shared online.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jssblck/agentstheir own version, first seen Aug 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jssblck/agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- bug-botSkill
- qwen-ttsSkill
- video-summarizerSkill
- wechat-typesetSkill
- wx-articleSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Token: Read from environment variable GITHUB_TOKEN
- Very specific: line 57
If the file already exists (HTTP 422 "sha" missing), append a timestamp to the filename (e.g., image_1711872000.png) and retry
- Distinctive: line 69
When uploading multiple images, process them sequentially (GitHub API doesn't handle parallel writes to the same repo well).
- Distinctive: line 73
Always write JSON payload to a temp file rather than passing base64 inline — avoids shell argument length limits.
- Distinctive: line 74
Always clean up temp files after upload.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
GitHub Image Upload
Upload images to the GitHub repository LingyiChen-AI/images via GitHub Contents API, organized by project and date, and return a jsDelivr CDN URL (no CORS issues, fast globally).
Configuration
- Repository:
LingyiChen-AI/images - Token: Read from environment variable
GITHUB_TOKEN - Image path pattern:
{project}/images/YYYY/MM/filename(based on current date){project}is the current project directory name (e.g.,k8s-admin)
- CDN URL pattern:
https://cdn.jsdelivr.net/gh/LingyiChen-AI/images/{project}/images/YYYY/MM/filename
Workflow
- Validate the token exists — check that
GITHUB_TOKENis set in the environment. If not, tell the user to set it:export GITHUB_TOKEN=your_token - Identify the image file(s) — the user will provide file path(s). Verify each file exists and is a valid image (png, jpg, jpeg, gif, webp, svg, ico, bmp).
- Determine project name — use the current working directory's folder name as the project prefix. For example, if working in
~/codes/myself/k8s-admin, the project name isk8s-admin. - Upload via GitHub API — for each image, write the JSON payload to a temp file to avoid shell argument length limits, then upload:
DATE_PATH=$(date +"%Y/%m")
PROJECT="$(basename "$PWD")"
FILENAME=$(basename "$IMAGE_PATH")
REMOTE_PATH="${PROJECT}/images/${DATE_PATH}/${FILENAME}"
# Write JSON payload to temp file
TMPFILE=$(mktemp)
python3 -c "
import json, base64
with open('${IMAGE_PATH}', 'rb') as f:
content = base64.b64encode(f.read()).decode()
payload = {'message': 'upload: ${FILENAME}', 'content': content}
with open('${TMPFILE}', 'w') as out:
json.dump(payload, out)
"
# Upload via API
curl -s -w "\n%{http_code}" -X PUT \
"https://api.github.com/repos/LingyiChen-AI/images/contents/${REMOTE_PATH}" \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/json" \
-d @"$TMPFILE"
rm -f "$TMPFILE"- Handle the response:
- On success (HTTP 201), construct the jsDelivr CDN URL and present it to the user
- If the file already exists (HTTP 422 "sha" missing), append a timestamp to the filename (e.g.,
image_1711872000.png) and retry - On auth failure (HTTP 401/403), tell the user to check their
GITHUB_TOKENpermissions (needs Contents read/write)
- Return the CDN URL to the user in plain text:
Upload successful!
CDN URL: https://cdn.jsdelivr.net/gh/LingyiChen-AI/images/k8s-admin/images/2026/03/screenshot.pngBatch Upload
When uploading multiple images, process them sequentially (GitHub API doesn't handle parallel writes to the same repo well). Show progress for each file.
Important Notes
- Always write JSON payload to a temp file rather than passing base64 inline — avoids shell argument length limits.
- Always clean up temp files after upload.
- jsDelivr CDN has no CORS restrictions and works globally, making it ideal for embedding in articles, blogs, and external sites.
- jsDelivr caches aggressively. If the user needs to update an image, they should use a different filename rather than overwriting.
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.

