agentleFS
wmy2981wmy2981/skills/zurl/SKILL.md

zurl

Skill1 starsChanged 4 months agoMITView on GitHub

Manage a Zurl short link service — create, update, delete, search, and list short URLs, and fetch URL metadata. Trigger whenever the user asks to "shorten this link", "generate a short URL", "create a short link", "短链接", "缩短", "短链", manage short links, or pastes a long URL and asks to make it shorter. Do NOT skip this skill just because the user didn't explicitly say "短链接" or "short URL" — even "帮我缩短这个链接" or "把这个 网址变短" should trigger it. Any request involving URL shortening, short link management, or batch URL operations should use this skill.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration.

    line 22
  2. Very specific:

    After creating or updating a short link, parse the JSON response and present the result to the user using the short_links field (configured …

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Zurl Short Link Management

Manage short URLs via the Zurl service API.

Execution Rule

Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration. If something is wrong, the script will fail with a clear error — check and fix only then.

Important Rules

  1. API URL from env var only — ZURL_APIURL must be set; never hardcode the API address.
  2. Auto-generate short code — When the user asks to shorten a URL without specifying a code, the script auto-generates a 4-character random code (letters + digits).
  3. No title on creation — Pass empty string "" for title on new short links so Zurl auto-fetches the page title. Do NOT fill in a title yourself.
  4. Display all domains — After creating/updating a short link, always show all configured display domains (from ZURL_DISPLAY_URLS; the script's short_links field contains the full URLs).
  5. QR code domain — If generating a QR code, use the first domain from ZURL_DISPLAY_URLS as the QR content (unless the user specifies one).

Environment Variables

VariableRequiredDescription
ZURL_APIURL✅API base URL, e.g. http://192.168.1.100:3088
ZURL_TOKEN❌API auth token (required if server has auth enabled)
ZURL_DISPLAY_URLS❌Comma-separated display domain list; defaults to ZURL_APIURL

The script loads these from ~/.wmyskills/.env (shared across skills) automatically; a scripts/.env in the script directory takes priority if present. Use scripts/.env.example as the template — add the variables to ~/.wmyskills/.env, never overwriting an existing file.

Requirements

pip install python-dotenv

Usage

Script: scripts/zurl_api.py

Create a Short URL

python scripts/zurl_api.py shorten <long_url> [short_code] [title] [description] [ttl_days]
ArgRequiredDescription
long_url✅Original long URL
short_code❌Custom short code; auto-generated (4 chars) if omitted
title❌Title (leave empty to auto-fetch)
description❌Description
ttl_days❌Time-to-live in days

Update a Short URL

python scripts/zurl_api.py update <id> [long_url] [short_code] [title] [description] [ttl_days]
ArgRequiredDescription
id✅URL database ID (from list/search results)
long_url❌New long URL
short_code❌New short code
title❌New title
description❌New description
ttl_days❌New TTL in days

The script skips None (unset) arguments — they are not sent to the API. If the API requires long_url or short_code, omitting them causes a 422 error. Pass "" (empty string) to clear a field. short_code must be non-empty; an empty value is skipped to avoid a 500 error from the API.

Edit a Short URL (key=value style)

# Update specific fields using -o key=value (repeatable)
python scripts/zurl_api.py edit <id> -o long_url=https://new.url -o title="New Title"
ArgRequiredDescription
id✅URL database ID (from list/search results)
-o / --option✅key=value pair (repeatable). Keys: long_url, short_code, title, description, ttl_days

This is an alternative to update that uses -o key=value pairs instead of positional arguments. Only the fields you specify with -o will be changed — unspecified fields are left untouched (unlike update where omitted positional args skip sending, but empty "" clears the field).

Delete Short URLs

# Delete by short code
python scripts/zurl_api.py delete <short_code>

# Batch delete by short codes (comma-separated)
python scripts/zurl_api.py delete-batch code1,code2,code3

delete-batch accepts short codes (slugs) — the script looks up the corresponding database IDs across all pages, then deletes them. Codes that don't match any URL are silently skipped.

List & Search

# List short URLs (paginated)
python scripts/zurl_api.py list [page] [limit]

# Search
python scripts/zurl_api.py search <keyword> [filter_type]

filter_type: all (default) / long_url / short_url / title

Get URL Metadata

python scripts/zurl_api.py metadata <url>

Returns the target page's title and description.

Display to User

After creating or updating a short link, parse the JSON response and present the result to the user using the short_links field (configured via ZURL_DISPLAY_URLS). Example:

✅ Short URL created

Short Links:
  https://short.example.com/abc123
  https://s.example.com/abc123

Original URL: https://very-long-url.com/page
Title: Page Title

The actual domains come from ZURL_DISPLAY_URLS — the example above is illustrative.

API Endpoints Verified

EndpointMethodStatus
/api/shorten_urlPOST JSON✅
/api/update_url/{id}POST JSON✅
/api/delete/urlPOST form✅
/api/delete/urlsPOST JSON✅
/api/urlsGET✅
/api/searchPOST JSON✅
/api/get_url_metadataPOST form✅

Response Format

The script outputs JSON to stdout.

Success (commands that include short_links):

{"code": 200, "msg": "...", "data": {"short_url": "abc123", "long_url": "...", ...}, "short_links": ["https://s.example/abc123", ...]}

The short_links field is added by shorten, update, list, and search. Other commands (delete, delete-batch, metadata) return the raw API response without it.

Success (commands without short_links):

{"code": 200, "msg": "...", "data": {...}}

Failure:

{"error": true, "status": 4XX, "detail": {...}}

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.