---
name: "nanoid-url-friendly-unique-id"
description: "Generate tiny, secure, URL-friendly unique string identifiers 2x faster than UUID v4."
metadata:
  author: "Andrey Sitnik"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "generate nanoid"
  - "custom alphabet nanoid"
  - "nanoid vs uuid"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Nano ID Secure URL-Friendly Unique String IDs

Implements Nano ID: generating 21-character collision-resistant IDs, custom alphabets (customAlphabet), non-secure mode for high-throughput non-cryptographic scenarios, and replacing bloated UUIDs in database primary keys.

## When to Invoke
Invoke this skill whenever you need to:
- generate nanoid
- custom alphabet nanoid
- nanoid vs uuid

## Execution SOP & Rules
1. Install package: pnpm add nanoid.
2. Generate default ID: import { nanoid } from 'nanoid'; const id = nanoid(); // 'V1StGXR8_Z5jdHi6B-myT'.
3. Create custom alphabet generator: const generateCode = customAlphabet('0123456789ABCDEF', 8).
4. Verify cryptographic security: Nano ID uses crypto.getRandomValues() to prevent predictable generation.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
