rate-limit-setup

Implement a database-backed rate-limiting system for API requests.

1|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/AppleLamps/xpic2 --skill rate-limit-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-limit-setup
Source: https://github.com/AppleLamps/xpic2/tree/main/.claude/skills/rate-limit-setup
Command: npx skills add https://github.com/AppleLamps/xpic2 --skill rate-limit-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill documents and implements a database-backed rate-limiting system that protects APIs by limiting premium image requests per user.

Core Features & Use Cases

  • Anonymous user hashing: generate a hash from IP and User-Agent to identify users
  • Windowed quotas: 24-hour reset with per-user counters
  • Usage enforcement: return 429 when limits are reached and increment counts on success

Quick Start

Integrate the checkUsage pattern into your API route, initialize the usage_tracking table, and enforce limits for premium actions.