url-shortener

url-shortener is a skill for Claude Code from Pierry/harness-kit. It costs 76 tokens per session (3,080 once invoked), scanned C, original, MIT.

A design guide for building a URL shortener: a service that turns long web addresses into short links and redirects visitors to the original address. It covers both creating links and handling the much larger flow of people opening them.

In plain words
What is it for?
Use it to create a system design document for TinyURL- or Bitly-style links, branded aliases, redirect services, or other read-heavy lookups from a short key to stored data.
Why use it?
It helps address the less visible problems behind a simple-looking link service, such as generating unique codes, handling heavy read traffic, caching, data placement, consistency, abuse, analytics, and multiple regions.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the harness-kit plugin — 14 skills, 17 commands, 4 agents, 4 hooks shipped together

Good fit Use it to create a system design document for TinyURL- or Bitly-style links, branded aliases, redirect services, or other read-heavy lookups from a short key to stored data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pierry/harness-kit/url-shortener
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Pierry/harness-kit --skill url-shortener
Clone the repo
git clone --depth 1 https://github.com/Pierry/harness-kit

Made for: Claude Code.

Or install harness-kit, the plugin that ships this one along with the rest of its 14 skills, 17 commands, 4 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for url-shortener

README.md
[![agentmods](https://agentmods.dev/badge/skills/pierry/harness-kit/url-shortener/github.svg)](https://agentmods.dev/skills/pierry/harness-kit/url-shortener)
Your own site
<a href="https://agentmods.dev/skills/pierry/harness-kit/url-shortener"><img src="https://agentmods.dev/badge/skills/pierry/harness-kit/url-shortener/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for url-shortener

Your own site · 80×15
<a href="https://agentmods.dev/skills/pierry/harness-kit/url-shortener"><img src="https://agentmods.dev/badge/skills/pierry/harness-kit/url-shortener.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,080 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.03080
Opus 5 $0.00038 $0.01540
Sonnet 5 $0.00015 $0.00616
Haiku 4.5 $0.00008 $0.00308

Measured 8d ago against content hash cad5200bd0bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

url-shortener scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

Validate URL (http/https only; block SSRF targets: 127.0.0.1, 169.254.169.254, RFC1918, internal
.claude/agents/system-architect/skills/url-shortener/SKILL.md · 223 lines

How it starts

The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design a URL shortener. Topic playbook. The agent loads this reference and adapts it to the user's real scale and product rules, then emits the SDD via the generic template.

Use when the problem is: a link shortener, a redirect service, vanity/branded short links, or any read-dominated lookup of an opaque key to a stored value. Looks tiny, hides almost every core system design theme: read>>write load, unique key generation, cache, partitioning, consistency, abuse, analytics, multi-region.

Ask once if missing: target read QPS, custom-alias support, single vs multi-region, dedup policy (same long URL = same code or not), edit/disable-after-create.

Read:

  • guides/design-method.md
  • guides/writing-style.md
  • guides/templates/system-design.md
  • guides/pipeline.md

Generate the SDD using the template, filled with the reference below, adapted to user scale.

Save to .claude/runtime/outputs/architect/design/{feature_id}.md. Sensors: sensors/design-structure.md, sensors/design-rigor.md. Evals: evals/design-quality.md.


Reference architecture (adapt, do not copy blindly)

One line: two very different flows share one product. Create is moderate write. Resolve is huge read and latency-critical. Design the architecture around redirect; everything else bends to it. Product and priority first, technology second. Anyone drawing Kafka in the first three minutes is answering the wrong question.

Requirements

Functional: long URL -> unique short URL; resolve short -> redirect to original; optional expiry; custom alias; basic analytics (click, ts, user agent, referer, approx country); disable/ban malicious links. Staff-level extras: TTL links, logical delete/tombstone, optional dedup, preview page for suspicious links, rate limit per account/IP/tenant, multi-tenant custom domains, different SLA for redirect vs analytics.

Non-functional priority order: redirect availability (if create fails for seconds it is bad; if redirect fails the product dies) > low redirect latency (tens of ms on cache hit) > durability (an issued code's mapping must never vanish) > horizontal read scale > security/anti-abuse > observability.

Read the full file on GitHub · 223 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 223 lines · 0 tokens per session scan C cad5200bd0bc

Subscribe to this mod's changes

url-shortener is a skill published in the GitHub repository Pierry/harness-kit (3 stars, last pushed 1mo ago), licensed MIT. It adds 76 tokens to every session and 3,080 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

cloudkit-sync

Generate CloudKit sync infrastructure using CKSyncEngine with conflict resolution, sharing, and account monitoring. Use when adding iCloud sync to an iOS/macOS app.

rshankras/claude-code-apple-skills · 37 tokens

offline-queue

Generates an offline operation queue with persistence, automatic retry on connectivity, and conflict resolution. Use when user needs offline-first behavior, queued mutations, or pending operations that sync when back online.

rshankras/claude-code-apple-skills · 42 tokens

push-notifications

Generate push notification infrastructure with APNs registration, handling, and rich notifications. Use when adding push notifications, configuring APNs, notification categories/actions, or rich notifications with images and custom UI.

rshankras/claude-code-apple-skills · 42 tokens

http-cache

Generates an HTTP caching layer with Cache-Control parsing, ETag/conditional requests, and offline fallback. Use when user wants to add response caching, offline support, or reduce API calls.

rshankras/claude-code-apple-skills · 41 tokens

pagination

Generates pagination infrastructure with offset or cursor-based patterns, infinite scroll, and search support. Use when user wants to add paginated lists, infinite scrolling, or load-more functionality.

rshankras/claude-code-apple-skills · 38 tokens

networking-layer

Generates a protocol-based networking layer with async/await, error handling, and swappable implementations. Use when user wants to add API client, networking, or HTTP layer.

rshankras/claude-code-apple-skills · 39 tokens