Agent skill
preventing-abuse-limiting
Implements rate limiting and abuse prevention measures. Use to protect sensitive endpoints like "Book Now" or "Contact Us".
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/preventing-abuse-limiting
SKILL.md
Rate Limiting and Abuse Prevention
When to use this skill
- Protecting public-facing endpoints (Server Actions or Route Handlers).
- Preventing bot spam or brute-force attacks.
Workflow
- Implement rate limiting in Next.js Middleware or Server Actions.
- Use an in-memory store (for simple cases) or Redis/Appwrite KV (for scaled apps).
- Return a
429 Too Many Requestsstatus code when exceeded.
Code Pattern (Middleware)
import { NextResponse } from 'next/server';
export function middleware(request: Request) {
// Logic to check IP/Token against a limit
if (isOverLimit(request)) {
return NextResponse.json({ error: 'Too many requests' }, { status: 429 });
}
}
Instructions
- Appwrite Built-in: Use Appwrite's built-in rate limits where possible (e.g., authentication limits).
- Graceful Failure: Show a "Please wait a moment before trying again" message to the user.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?