rate-limiting-persistent
Persistent rate limiting using PostgreSQL for atomic counters.
Skill by JimmyBlanquet
Chalk Labs
Need help deploying rate-limiting-persistent?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
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-22d8b9
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: 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
- Persistent rate limiting using PostgreSQL for atomic counters. Survives serverless cold starts and deployments with automatic in-memory fallback.
- License
- MIT
- Instructions
- 378 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions call the network
Files (6)
- README.md
- SKILL.md
- persistent-limiter.ts · files/lib/rate-limit/
- install.sh
- 20251223100001_create_rate_limits.sql · supabase/migrations/
- persistent-limiter.test.ts · tests/
SKILL.md (first lines)
# Rate Limiting Persistent Skill
**Version:** 1.0.0
**Category:** Core
**Extracted from:** Production-tested in a real-world SaaS
**Production-ready:** ✅ Yes
## Description
Persistent rate limiting using PostgreSQL for atomic counters. Survives serverless cold starts and deployments with automatic in-memory fallback.
**Key Features:**
- 🗄️ **Persistent Storage**: Uses PostgreSQL for atomic rate limit tracking
- ⚡ **Serverless-Ready**: Survives Vercel/Railway cold starts
- 🛡️ **Automatic Fallback**: In-memory limiter if database unavailable
- ⚙️ **Flexible Configuration**: Per-action rate limits
- 🔒 **Thread-Safe**: Atomic PostgreSQL function prevents race conditions
- 🧹 **Auto-Cleanup**: Periodic cleanup of expired entries
## What This Skill Provides
### Core Components
1. **checkRateLimit()** - Main rate limiting function
- Uses PostgreSQL `increment_rate_limit()` function
- Automatic fallback to in-memory limiter
- Returns: `{ allowed, remaining, resetAt }`
2. **PostgreSQL Function** - Atomic counter increment
- UPSERT with ON CONFLICT
- Automatic window reset when expired
- Returns allowed status + remaining count
3. **In-Memory Fallback** - Resilience when DB unavailable
- Map-based storage
- Automatic cleanup every 5 minutes
- Same interface as persistent limiter
## Installation
### 1. Run Installation Script
```bash
cd skills/core/rate-limiting-persistent
bash install.sh
```
### 2. Apply Supabase Migration
In your Supabase dashboard or CLI:
```bash
supabase migration new create_rate_limits
# Copy contents from supabase/migrations/20251223100001_create_rate_limits.sql
supabase db push
```
Or manually:
```sql
-- See supabase/migrations/20251223100001_create_rate_limits.sql
CREATE TABLE rate_limits (...);
CREATE FUNCTION increment_rate_limit(...);
```
### 3. Install Dependencies
Already included if you have Supabase:
```bash
npm install @supabase/supabase-js
```
## Usage
### Basic Usage
```typescript
import { checkRateLimit } from '@/lib/rate-limit/persistent-limiter'
// In your API route
export async function POST(request: Request) {
const { userId } = await getUser()
const rateLimit = await checkRateLimit(userId, {
action: 'api_call',
maxRequests: 60,
windowSeconds: 60
})
if (!rateLimit.allowed) {
return new Response('Rate limit exceeded', {
status: 429,
headers: {
'X-RateLimit-Remaining': '0',
'X-RateLimit-Reset': new Date(rateLimit.resetAt).toISOString()
}
})
}
// Process request...
return Response.json({ success: true })
}
```
### With Rate Limit Headers
```typescript
async function handleRateLimitedRequest(userId: string) {
const rateLimit = await checkRateLimit(userId, {
action: 'api',
maxRequests: 100,
windowSeconds: 60
})
const headers = new Headers({
'X-RateLimit-Limit': '100',
'X-RateLimit-Remaining': String(rateLimit.remaining),
'X-RateLimit-Reset': String(rateLimit.resetAt)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
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
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
logging-structured
JimmyBlanquet
Structured logging with typed contexts for Next.js applications.
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 - 0.469score
email-oauth-flows
JimmyBlanquet
OAuth 2.0 flows for Gmail and Outlook integration with token encryption.
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
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get rate-limiting-persistent running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
rate-limiting-persistent skill. Agent Mart. https://agentmart.dev/skills/jimmyblanquet-rate-limiting-persistent-22d8b9 (last updated 2026-10-24)