rate-limit-setup — rate-limit-setup install rate-limit-setup, grokify, community, rate-limit-setup install, ide skills, database-backed rate limiting, premium image generation limit, SHA-256 hash identification, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Security Agents needing advanced rate limiting capabilities to prevent abuse and ensure fair usage. rate-limit-setup is a database-backed rate limiting implementation that tracks user activity and limits requests based on a SHA-256 hash of IP and User-Agent.

Features

Implements rate limiting via the `usage_tracking` table
Limits 2 premium images per user per 24 hours
Uses SHA-256 hash of IP + User-Agent for anonymous identification
Automatically resets limits after 24 hours
Utilizes TypeScript for implementation, specifically in `app/api/generate-image/route.ts`

# Core Topics

AppleLamps AppleLamps
[0]
[0]
Updated: 3/8/2026

Agent Capability Analysis

The rate-limit-setup skill by AppleLamps is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for rate-limit-setup install, database-backed rate limiting, premium image generation limit.

Ideal Agent Persona

Perfect for Security Agents needing advanced rate limiting capabilities to prevent abuse and ensure fair usage.

Core Value

Empowers agents to implement database-backed rate limiting via the `usage_tracking` table, utilizing SHA-256 hash of IP + User-Agent for anonymous identification and automatic reset after 24 hours, effectively preventing excessive premium image generation.

Capabilities Granted for rate-limit-setup

Preventing abuse of premium image generation
Enforcing fair usage policies for users
Tracking and limiting API requests

! Prerequisites & Limits

  • Requires database access for `usage_tracking` table
  • Limited to 2 premium images per user per 24 hours
  • Relies on SHA-256 hash for anonymous user identification
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

rate-limit-setup

Discover how to set up rate limiting with database-backed implementation. Learn to limit premium image generation and more with this AI agent skill.

SKILL.md
Readonly

Rate Limiting Implementation

This project uses database-backed rate limiting via the usage_tracking table.

Current Implementation

Located in app/api/generate-image/route.ts:

  • Limit: 2 premium images per user per 24 hours
  • Identification: SHA-256 hash of IP + User-Agent (anonymous)
  • Reset: Automatic after 24 hours

Instructions

  1. Create user identifier (anonymous hash):
typescript
1const getUserIdentifier = async (req: NextRequest): Promise<string> => { 2 const ip = req.headers.get('x-forwarded-for')?.split(',')[0] 3 || req.headers.get('x-real-ip') 4 || 'unknown'; 5 const userAgent = req.headers.get('user-agent') || 'unknown'; 6 7 const encoder = new TextEncoder(); 8 const data = encoder.encode(ip + userAgent); 9 const hashBuffer = await crypto.subtle.digest('SHA-256', data); 10 const hashArray = Array.from(new Uint8Array(hashBuffer)); 11 return hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); 12};
  1. Check and update usage:
typescript
1import { db, usageTracking } from '@/db'; 2import { eq } from 'drizzle-orm'; 3 4const checkUsage = async (identifier: string, limit: number) => { 5 const existing = await db 6 .select() 7 .from(usageTracking) 8 .where(eq(usageTracking.userIdentifier, identifier)) 9 .limit(1); 10 11 let usage = existing[0] || null; 12 const now = new Date(); 13 const resetNeeded = !usage || 14 now.getTime() - new Date(usage.lastResetAt!).getTime() > 24 * 60 * 60 * 1000; 15 16 if (!usage) { 17 const [inserted] = await db 18 .insert(usageTracking) 19 .values({ userIdentifier: identifier, premiumImagesCount: 0, lastResetAt: now }) 20 .returning(); 21 usage = inserted; 22 } else if (resetNeeded) { 23 const [updated] = await db 24 .update(usageTracking) 25 .set({ premiumImagesCount: 0, lastResetAt: now, updatedAt: now }) 26 .where(eq(usageTracking.userIdentifier, identifier)) 27 .returning(); 28 usage = updated; 29 } 30 31 const withinLimit = (usage?.premiumImagesCount || 0) < limit; 32 return { withinLimit, usage }; 33};
  1. Increment counter after successful action:
typescript
1await db 2 .update(usageTracking) 3 .set({ 4 premiumImagesCount: (usage?.premiumImagesCount || 0) + 1, 5 updatedAt: new Date(), 6 }) 7 .where(eq(usageTracking.userIdentifier, userIdentifier));
  1. Return appropriate response when limited:
typescript
1if (!withinLimit) { 2 return NextResponse.json( 3 { error: 'Rate limit exceeded. Try again in 24 hours.' }, 4 { status: 429, headers: corsHeaders } 5 ); 6}

For New Rate-Limited Features

If tracking a different resource, add a new column to usage_tracking or create a new table:

typescript
1// In db/schema.ts 2featureCount: integer('feature_count').default(0),

Examples

  • "Limit roasts to 5 per day" → Add roastCount column, apply pattern above
  • "Add API request throttling" → Create new tracking table for general requests

Guardrails

  • Never expose user identifiers in responses
  • Log usage counts, not full hashes
  • Use 429 status code for rate limit responses
  • Include reset time info in rate limit responses when possible
  • Test reset logic carefully (24-hour boundary)

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is rate-limit-setup?

Perfect for Security Agents needing advanced rate limiting capabilities to prevent abuse and ensure fair usage. rate-limit-setup is a database-backed rate limiting implementation that tracks user activity and limits requests based on a SHA-256 hash of IP and User-Agent.

How do I install rate-limit-setup?

Run the command: npx killer-skills add AppleLamps/grokify/rate-limit-setup. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for rate-limit-setup?

Key use cases include: Preventing abuse of premium image generation, Enforcing fair usage policies for users, Tracking and limiting API requests.

Which IDEs are compatible with rate-limit-setup?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for rate-limit-setup?

Requires database access for `usage_tracking` table. Limited to 2 premium images per user per 24 hours. Relies on SHA-256 hash for anonymous user identification.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add AppleLamps/grokify/rate-limit-setup. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use rate-limit-setup immediately in the current project.

Related Skills

Looking for an alternative to rate-limit-setup or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI