Usage limits and quotas
Check-and-increment must be one atomic database operation. A read-then-write quota check is a race that lets two requests both pass the last slot.
What this skill helps you build
Enforce per-plan limits — seats, projects, credits, API calls — with atomic counters that concurrency can't trick into overshooting the cap.
The production takeaway
Check-and-increment must be one atomic database operation. A read-then-write quota check is a race that lets two requests both pass the last slot.
Inside this skill
The full skill expands these implementation areas with decisions, edge cases, prompts, tests, and framework-specific code.
Unlock the full implementation
Paid access includes the complete skill body, implementation prompt, common mistakes, production checklist, and code examples where this skill includes them.