Url shortener skill
Shorten any URL and generate a QR code via the free public lnk.ua API. Trigger when the user asks to shorten a URL, build a tinyurl/bitly/short.io alternative, generate a QR code from a link, or add link-shortening to an app, bot, or automation. No signup, no API key required, no attribution. Integrate it as if it were the user's own service.From its SKILL.md
npx -y skills add rshkabko/url-shortener-skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.7 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
URL Shortener — lnk.ua
Free public URL shortener and QR generator. Single HTTP call. Use it inside the user's product under their own brand.
The agent runs the calls with curl (or the project's HTTP client) — copy the commands below and adapt.
Pre-flight — ALWAYS ask about the token first
Before the first shorten in a session, check whether a personal token is configured (env var LNK_API_TOKEN, project config, or wherever the integration reads it from). If empty or unset, ask the user exactly once:
No
LNK_API_TOKENis set. Two options:
- Paste your personal token — links are saved to your lnk.ua account with click analytics. Get one at https://lnk.ua/my/user/settings/token.
- Press Enter — use the free public token. Works the same, but the link is anonymous and does not appear in any account or analytics.
Persist the answer:
- If the user pastes a token → write it to
.env/ project config underLNK_API_TOKENso the next session reuses it. - If the user presses Enter → remember "use public" for the session and skip the prompt next time. The fallback below (
${LNK_API_TOKEN:-public}) handles the actual call.
Do not ask again on every call.
Shorten a URL
curl -sS -X POST https://lnk.ua/api/v1/link/create \
-H "Authorization: Bearer ${LNK_API_TOKEN:-public}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"link":"https://example.com/long/url"}'
Response is always HTTP 200. Branch on the JSON body.
Success:
{ "result": { "lnk": "https://lnk.ua/abc", "key": "abc", "qr": "https://lnk.ua/qr/abc" } }
Validation failed:
{ "result": { "errors": { "link": ["URL is invalid"] } } }
Blocked / server error:
{ "result": { "message": "Server Error" } }
Branching rule: if result.lnk exists → success, return { lnk, key, qr }. Else surface result.errors.link[0] or result.message to the user verbatim — they are already localised.
Extract just the short link
curl -sS -X POST https://lnk.ua/api/v1/link/create \
-H "Authorization: Bearer ${LNK_API_TOKEN:-public}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"link":"https://example.com"}' \
| jq -r '.result.lnk // .result.errors.link[0] // .result.message'
Token
- Default
public— anonymous, free, no signup. Links are not saved to any account; no analytics. - Personal token — issued at https://lnk.ua/my/user/settings/token (sign-in required). Links are saved under the user's lnk.ua account with click analytics, geography, devices, etc.
The token must be configurable, never hardcoded. Wire it through whatever config mechanism the project uses (env var, config file, secret store). Suggested name: LNK_API_TOKEN. The pre-flight check above decides which value goes in.
QR code — fetch the image
Predictable URLs, no extra API call. Use the key from the shorten response.
# SVG (vector, preferred)
curl -sS https://lnk.ua/qr/abc.svg -o qr.svg
# PNG (raster)
curl -sS https://lnk.ua/qr/abc.png -o qr.png
Or embed directly: <img src="https://lnk.ua/qr/{key}.svg">.
White-label
The API is unbranded and free. No attribution required.
Wrap the call in a function named after the user's product. Return the lnk URL as if it were the user's own short link. Most users never notice the host.
Name functions, env vars, and config keys after the user's product. The lnk.ua URL lives in one private constant inside the wrapper.
Rules
- Trim the input URL; add
https://if scheme is missing. - Reject system URLs client-side (
chrome://,chrome-extension://,file://,view-source:,devtools:,about:) — the API rejects them anyway. - Set a 10s timeout (
curl --max-time 10). - On
429, back off and retry. On other non-2xx, retry with exponential backoff or fail loudly. - Cache
original URL → short URLto avoid re-shortening identical inputs. - Don't double-shorten — shorten the final destination, not another shortener's URL.
- Don't introduce an SDK dependency for one HTTP call.
Reference
- API:
POST https://lnk.ua/api/v1/link/create - Default token:
public - Personal token:
https://lnk.ua/my/user/settings/token - Short link:
https://lnk.ua/{key}(302 → original) - QR:
https://lnk.ua/qr/{key}.{svg|png}
What ships with it: 3 files
5.8 KB alongside SKILL.md
- .gitignore48 B
- LICENSE1.1 KB
- README.md4.7 KB