home / skills / aidotnet / moyucode / url-shortener

url-shortener skill

/skills/tools/url-shortener

This skill shortens URLs using multiple services and can generate QR codes for the results.

npx playbooks add skill aidotnet/moyucode --skill url-shortener

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
878 B
---
name: url-shortener
description: 使用各种服务缩短URL,并为短链接生成二维码。
metadata:
  short-description: 缩短URL
source:
  repository: https://github.com/ellisonleao/pyshorteners
  license: MIT
---

# URL Shortener Tool

## Description
Shorten long URLs using various services and optionally generate QR codes for the shortened links.

## Trigger
- `/shorten` command
- User needs to shorten URLs
- User wants short links

## Usage

```bash
# Shorten URL
python scripts/url_shortener.py "https://example.com/very/long/path"

# Shorten with specific service
python scripts/url_shortener.py "https://example.com" --service tinyurl

# Generate QR code for shortened URL
python scripts/url_shortener.py "https://example.com" --qr --output qr.png
```

## Tags
`url`, `shortener`, `link`, `tinyurl`, `qr`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill shortens long URLs using multiple popular shortening services and can generate QR codes for the resulting short links. It provides a simple command interface to pick a service, produce a short link, and export a QR image if needed. The implementation is TypeScript-based and optimized for quick link sharing and tracking workflows.

How this skill works

You supply a long URL and optionally select a shortening service (or let the skill pick a default). The skill calls the chosen service API to create a short URL, returns the short link, and can render a downloadable QR code image for easy scanning. Command flags control service selection, QR generation, and output filename.

When to use it

  • Share long, unwieldy links in chat, email, or social posts.
  • Create concise links for printed materials or presentations.
  • Generate QR codes for physical posters, business cards, or event signage.
  • Test contrasting shortening services for reliability or formatting.
  • Save characters for platforms with strict length limits.

Best practices

  • Prefer reputable shortening services to reduce risk of link downtime.
  • Include a clear destination context when sharing shortened links to maintain trust.
  • Generate QR codes at appropriate resolution for your final medium (higher DPI for print).
  • Log or store original-to-short mappings if you need to track or revert links.
  • Verify the short link after creation before mass distribution.

Example use cases

  • Convert a blog post URL into a short link for a Twitter thread.
  • Produce a tiny URL for a long registration page and add it to a printed flyer with a QR code.
  • Switch between services to compare performance or custom alias support.
  • Create short links for analytics or campaign tracking and save mappings to a database.

FAQ

Which shortening services are supported?

Multiple common services are supported; you can specify a service flag or use the default configured provider. Service availability depends on API keys and provider policies.

Can I generate a QR code for the short link?

Yes. Enable the QR flag to produce a QR image file. You can specify an output filename and image format where supported.