Agent skill
lsky-uploader
Upload files to the self-hosted Lsky image bed (https://lsky.xueguo.us/api/v1), fetch the returned URLs/Markdown snippets, and manage albums or strategies via the REST API. Use this skill whenever you need to programmatically push screenshots/assets to Lsky and return shareable links inside Codex.
Install this agent skill to your Project
npx add-skill https://github.com/cihebi2/codex_skills/tree/main/lsky-uploader
SKILL.md
Lsky Uploader
Overview
This skill wraps the Lsky Pro API used by your self-hosted image bed. It explains how to authenticate with personal tokens, how to call /upload, and provides a ready-to-run Python helper (scripts/upload_image.py) that handles headers, multipart form-data, and prints the resulting URLs/Markdown snippets. See references/api_overview.md for a condensed manual extracted from the official docs.
Quick Start
- Credentials
- Generate a personal token inside the Lsky dashboard and copy the raw token string (without the
Bearerprefix). - Default base URL is
https://lsky.xueguo.us/api/v1. Override via the env varLSKY_BASE_URLor the--base-urlflag if your deployment differs. - Set the token in your shell (PowerShell:
$env:LSKY_TOKEN='1|xxxx', bash:export LSKY_TOKEN=1|xxxx).
- Generate a personal token inside the Lsky dashboard and copy the raw token string (without the
- Upload
- Run
python scripts/upload_image.py path/to/file.png. - Optional flags:
--album-id,--strategy-id,--permission 0|1,--name custom-display-name. - The script prints the direct URL, Markdown snippet, delete URL, and the full JSON payload so you can update
.lsky_upload_cache.json.
- Run
- Use the links
links.urlis the canonical image URL,links.markdowncan be pasted into blog Markdown,links.delete_urllets you remove the asset later.- If the script exits with
Lsky API error: ..., inspect the message/HTTP status and cross-check rate limits or permissions.
Manual Steps (without script)
When custom logic is needed, follow these HTTP patterns (details in references/api_overview.md):
- Upload
POST /upload: multipart form-data withfileplus optionalalbum_id,strategy_id,permission,name. - List images
GET /images?page=1&limit=50&order=latest: pagination response containsdata.totalanddata.data[], each item exposinglinks,id,album_id, etc. - Albums
GET /albums,POST /albums,DELETE /albums/:id: useful for separating assets per project. - Delete an image
DELETE /images/:id: image IDs are available via the list endpoint or the upload response (data.image.id). - Rate limiting: watch
X-RateLimit-Remainingand pause when it hits zero to avoid HTTP 429.
Script Reference
scripts/upload_image.py
- Dependency:
requests(install viapip install requestsif missing). - Environment variables:
LSKY_TOKEN(required unless you pass--token)LSKY_BASE_URL(defaults tohttps://lsky.xueguo.us/api/v1)
- Exit codes:
0= success- Non-zero = invalid arguments or API errors (an explanatory message is printed)
For automation, capture stdout and parse the final JSON block:
python scripts/upload_image.py demo.png --token "$LSKY_TOKEN" \
--base-url https://lsky.xueguo.us/api/v1 > upload.json
Then feed into jq or PowerShell ConvertFrom-Json.
Troubleshooting
- 401 Unauthorized: token missing/expired or header omitted.
- 403 Forbidden: API disabled by the admin; adjust permissions server-side.
- 413 Payload too large: respect
allow_suffixesandmax_sizeconfigured in Lsky. - 429 Too Many Requests: back off for ~60 seconds; inspect the rate-limit headers.
- Custom TLS/Proxy: if running behind an internal CA, call requests with
verify=False(not recommended) or install the CA cert on the machine.
Resources
- references/api_overview.md - condensed API cheat sheet derived from https://v1.lskypro.com/page/api-docs.html.
scripts/upload_image.py- helper script for uploads.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
tox-paper-extractor
End-to-end OA literature pipeline for toxicity/peptide experimental data. Use to discover candidates (Europe PMC), download OA full text + supplementary (PDF/JATS XML/PMC OA packages), extract traceable raw records (tables/supp → raw_extractions.csv + raw_experimental_records.csv + extracted_tables), generate monitoring reports, and screen records for training readiness (units/aggregation/censoring).
bioinforw-data-plotting
Recommend and adapt scientific plotting templates from a local Bioinforw or NGplot catalog for research data visualization. Use when Codex needs to choose a chart type from `catalog_enriched.jsonl`, refresh `embedding_input.jsonl`, return top-k templates with Python/R code paths, map user columns to template-required columns, or turn a research plotting request into an executable plotting starting point.
dl-paper-code-blog
Craft long-form, Chinese blog posts that connect deep-learning papers with their code repositories using the auto-collected bundle (materials_manifest, paper_text, figures, repo_context, lsky cache). Use this skill whenever a user provides such a bundle and wants a TL;DR, method deep dive, experiment analysis, reproduction guide, and media assets.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?