rate-limiting-persistent
Production-ready persistent rate limiting for Next.js APIs using PostgreSQL/Supabase with atomic counters, automatic fallback, and zero cold-start issues.
Skill by JimmyBlanquet
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jimmyblanquet-rate-limiting-persistent
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, cloud
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/rate-limiting-persistent
What's inside
- Skill name
rate-limiting-persistent- Description
- Production-ready persistent rate limiting for Next.js APIs using PostgreSQL/Supabase with atomic counters, automatic fallback, and zero cold-start issues. Survives serverless deployments.
- License
- MIT
- Instructions
- 486 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Agent Skills spec issues
- files: referenced but missing: examples/01-basic-usage.ts, examples/02-middleware.ts, examples/03-tiered-limits.ts, examples/04-ip-limiting.ts
Files (25)
- POSTGRESQL_SETUP.md
- PROGRESS.md
- README.md
- SKILL.md
- VALIDATION.md
- basic-usage.ts · examples/
- custom-provider.ts · examples/
- in-memory-only.ts · examples/
- nextjs-integration.ts · examples/
- supabase-setup.ts · examples/
- manifest.yaml
- create_rate_limits.sql · migrations/
- package-lock.json
- package.json
- fallback.ts · src/
- index.ts · src/
- middleware.ts · src/
- persistent-limiter.ts · src/
- pre-configured.ts · src/
- rate-limiter.ts · src/
- types.ts · src/
- index.test.ts · tests/
- persistent-limiter.test.ts · tests/
- tsconfig.json
- vitest.config.ts
SKILL.md (first lines)
# Rate Limiting Persistent
Database-backed rate limiting system for Next.js API routes with atomic PostgreSQL functions, in-memory fallback, and serverless-friendly design.
## When to Use
Use this skill when building Next.js APIs that need:
- Persistent rate limiting across serverless cold starts
- Per-user or per-action rate limiting
- Atomic counter increments (no race conditions)
- Automatic fallback when database is unavailable
- Standard HTTP rate limit headers (X-RateLimit-*)
- Protection against abuse and DoS
**Don't use this skill if:**
- You need distributed rate limiting across multiple data centers (use Redis/Upstash instead)
- Your app isn't using PostgreSQL/Supabase
- You only need in-memory rate limiting (single instance)
## Stack
- Next.js 14+ (App Router Route Handlers)
- PostgreSQL 12+ (or Supabase)
- TypeScript (strict mode)
- @supabase/supabase-js (peer dependency)
## Quick Start
### 1. Install Skill
```bash
npm install -D @project-forge/rate-limiting-persistent
npm install @supabase/supabase-js
```
### 2. Run Database Migration
```sql
-- See migrations/create_rate_limits.sql
CREATE TABLE rate_limits (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
key TEXT NOT NULL UNIQUE,
count INTEGER NOT NULL DEFAULT 1,
window_start TIMESTAMPTZ NOT NULL DEFAULT NOW(),
window_end TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE FUNCTION increment_rate_limit(...)
-- Full migration in migrations/ folder
```
### 3. Create Configuration
```typescript
// lib/config.ts
export const rateLimitConfig = {
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL!,
supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
}
```
### 4. Use in API Routes
```typescript
// app/api/generate/route.ts
import { checkRateLimit } from '@project-forge/rate-limiting-persistent'
import { apiError } from '@project-forge/error-handling-api'
import { rateLimitConfig } from '@/lib/config'
export async function POST(request: NextRequest) {
const userId = await getUserId(request)
const result = await checkRateLimit(rateLimitConfig, userId, {
action: 'ai_generation',
maxRequests: 10,
windowSeconds: 60,
})
if (!result.allowed) {
return NextResponse.json(
{ error: 'Rate limit exceeded' },
{
status: 429,
headers: {
'Retry-After': Math.ceil((result.resetAt - Date.now()) / 1000).toString()
}
}
)
}
// Process request
const data = await generateContent()
return NextResponse.json({ data })
}
```
### 5. Use Middleware Helper
```typescript
import { withRateLimit } from '@project-forge/rate-limiting-persistent/middleware'
export async function POST(request: NextRequest) {
const userId = await getUserId(request)
const rateLimitResponse = await withRateLimit(config, userId, {
action: 'api_call',
maxRequests: 60,
windowSeconds: 60,
})
if (rateLimitResponse) {
return rateLimitResponse // 429 with proper headers
}
// Continue processing
}
```From JimmyBlanquet/project-forge, MIT.
More from JimmyBlanquet/project-forge
- 0.479score
ralph-agent-teams
JimmyBlanquet
Parallel implementation of Ralph++ PRD sub-stories using Claude Opus 4.6 Agent Teams.
SkillCFreshness: CClaude Code +9 - 0.476score
email-oauth-flows
JimmyBlanquet
Production-ready Gmail and Outlook OAuth integration for Next.js with Supabase.
SkillCFreshness: CClaude Code +9 - 0.476score
context-maximizer
JimmyBlanquet
Exploit the 1M token context (Opus 4.6 / Sonnet 4.6) for full codebase awareness in SpecKit.
SkillCFreshness: CClaude Code +9 - 0.476score
auth-supabase-complete
JimmyBlanquet
Production-ready Supabase authentication for Next.js 14+ with RLS patterns, session management, OAuth flows, and comprehensive testing.
SkillCFreshness: CClaude Code +9 - 0.474score
ralph-loop
JimmyBlanquet
Use when implementing features autonomously from a prd.json, spawning fresh Task agents per story with quality gates and atomic commits
SkillCFreshness: CClaude Code +9 - 0.474score
dev-pilot
JimmyBlanquet
Full autonomous pipeline orchestrator that loops over features.json and executes the complete development cycle for each feature: spec → plan → tasks →…
SkillCFreshness: CClaude Code +9 - 0.472score
effort-optimizer
JimmyBlanquet
Optimize API costs by adjusting thinking effort per task type.
SkillCFreshness: CClaude Code +9 - 0.471score
config-centralization
JimmyBlanquet
Type-safe, environment-aware configuration management for Next.js/TypeScript applications using a singleton pattern with runtime validation.
SkillCFreshness: CClaude Code +9 - 0.471score
ai-multi-provider
JimmyBlanquet
Multi-provider LLM orchestration system with intelligent routing, fallback chains, cost optimization, and automatic observability.
SkillCFreshness: CClaude Code +9 - 0.471score
logging-structured
JimmyBlanquet
Structured logging with typed contexts for Next.js applications.
SkillCFreshness: CClaude Code +9 - 0.471score
rate-limiting-persistent
JimmyBlanquet
Persistent rate limiting using PostgreSQL for atomic counters.
SkillCFreshness: CClaude Code +9 - 0.470score
speckit-archi-review
JimmyBlanquet
Run an architecture audit on the current project to detect drift, layer violations, ADR non-compliance, and technical debt.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 2
- Last commit (this folder)
- May 10, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/JimmyBlanquet/project-forge
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from JimmyBlanquet
- 0.479score
ralph-agent-teams
JimmyBlanquet
Parallel implementation of Ralph++ PRD sub-stories using Claude Opus 4.6 Agent Teams.
SkillCFreshness: CClaude Code +9 - 0.476score
auth-supabase-complete
JimmyBlanquet
Production-ready Supabase authentication for Next.js 14+ with RLS patterns, session management, OAuth flows, and comprehensive testing.
SkillCFreshness: CClaude Code +9 - 0.476score
email-oauth-flows
JimmyBlanquet
Production-ready Gmail and Outlook OAuth integration for Next.js with Supabase.
SkillCFreshness: CClaude Code +9 - 0.476score
context-maximizer
JimmyBlanquet
Exploit the 1M token context (Opus 4.6 / Sonnet 4.6) for full codebase awareness in SpecKit.
SkillCFreshness: CClaude Code +9 - 0.474score
dev-pilot
JimmyBlanquet
Full autonomous pipeline orchestrator that loops over features.json and executes the complete development cycle for each feature: spec → plan → tasks →…
SkillCFreshness: CClaude Code +9 - 0.474score
ralph-loop
JimmyBlanquet
Use when implementing features autonomously from a prd.json, spawning fresh Task agents per story with quality gates and atomic commits
SkillCFreshness: CClaude Code +9
Cite this page
rate-limiting-persistent skill. Agent Mart. https://agentmart.dev/skills/jimmyblanquet-rate-limiting-persistent (last updated 2026-10-24)