Skip to main content
skill CX Codex

rate-limiting — Claude Code skill: what it does, how to install

rate-limiting guides Claude Code through setting up Symfony RateLimiter policies, controller attributes, and 429 responses with Retry-After headers.

MIT ★ 234 updated 2026-10-05

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dev-toolings/superpowers-symfony --skill rate-limiting -a claude-code
Open on GitHub

What rate-limiting does

This skill guides Claude Code through configuring the Symfony RateLimiter component. It helps select the appropriate strategy for traffic patterns: sliding window, token bucket, or fixed window. Limits and burst values are defined directly under framework.rate_limiter.

Protection is attached using the #[RateLimit] controller attribute, inside services, or via event subscribers. The skill enforces sending an HTTP 429 status with the Retry-After header instead of dropping connections, followed by tests that cover permitted requests, throttled calls, and quota resets.

One critical constraint: blocking while reserving tokens must never run on a web request, because halting the PHP worker freezes the client connection.

What it helps with

  • cap login and password reset attempts in Symfony
  • declare rate limiter policies under framework.rate_limiter
  • return HTTP 429 responses with the Retry-After header
  • write automated tests for rate limit hits and resets

Example prompts for the agent

  • Set up a token bucket rate limiter for public API endpoints
  • Apply the #[RateLimit] attribute to the authentication controller
  • Write functional tests verifying the 429 status and quota reset

How to install rate-limiting

1Skills CLI (Vercel)

npx skills add dev-toolings/superpowers-symfony --skill rate-limiting -a claude-code

2Manually: put the files in place

~/.claude/skills/rate-limiting/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/rate-limiting/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about rate-limiting

How to install rate-limiting in Claude Code?

Run npx skills add dev-toolings/superpowers-symfony --skill rate-limiting -a claude-code in your terminal.

What does the rate-limiting skill do?

It instructs the agent on configuring Symfony RateLimiter policies, applying them to routes, and handling 429 response headers.

Can rate limiting rely on per-process storage?

Storage isolated to a single process fails across multiple workers, so shared storage is required for accurate tracking.

Source text

SKILL.md · MIT
---
name: rate-limiting
description: "Implement rate limiting with the Symfony RateLimiter (sliding window, token bucket, fixed window) and the #[RateLimit] controller attribute"
capabilities: [read, search, edit, shell]
tags: [security]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash
---
# Rate Limiting (Symfony)

## Use when
- Capping how often a caller may reach an endpoint: login, password reset, public API, any public write.
- Choosing between sliding window, token bucket and fixed window.
- Applying a limiter by controller attribute, in a service, or globally through an event subscriber.
- Returning a correct 429 with `Retry-After`.
- Blocking until a token frees up, rather than refusing outright.

## Default workflow
1. Name what is limited and what identifies the caller.
2. Pick the algorithm the traffic shape calls for, and state the rate and the burst.
3. Declare the policy under `framework.rate_limiter`, one entry per limiter.
4. Apply it where the request is refused, and answer 429 with `Retry-After`.
5. Prove the limit under test: the call that passes, the one refused, the reset.

## Guardrails
- The caller identity decides who is counted. Behind a proxy, an untrusted client address counts everyone as one.
- A limiter is not authorization. It caps a rate; it never decides a right.
- Refuse with 429 and `Retry-After`, never with a silent drop or a 500.
- A limiter whose storage is per process does not limit anything across several workers.
- Reserving tokens blocks the calling process: never on a web request.

## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.

## Output contract
- Limiter policies, with the algorithm, the rate and the burst for each.
- Where each limiter is applied, and on what caller identity.
- The 429 response shape, headers included.
- Tests covering the accepted call, the refused one, and the reset.


## References
- `reference.md`

© dev-toolings · MIT · dev-toolings/superpowers-symfony

Similar skills

All skills for Backend and APIs →

From the same set51

The whole set →
using-symfony-superpowers using-symfony-superpowers is a Claude Code skill that detects the Symfony version, selects a skill, and sequences steps for complex tasks. CX Codex +1 ★ 234repo stars interfaces-and-autowiring interfaces-and-autowiring guides Symfony dependency injection in Claude Code by binding interfaces, configuring #[Target] aliases, and decorating services cleanly. CX Codex +1 ★ 234repo stars symfony-cache Configure Symfony Cache pools, entry expiry, and tag-based invalidation with this skill. It helps when caching costly reads or preventing a burst of recomputations after a key expires. CX Codex +1 ★ 234repo stars test-doubles-mocking test-doubles-mocking — a skill for creating test doubles with PHPUnit mocks in Symfony, used to replace slow or external dependencies, verify method calls, and write simplified repository fakes in isolated unit tests. CX Codex +1 ★ 234repo stars api-platform-tests The api-platform-tests skill guides functional tests for Symfony API Platform resources, including response checks, filters, JSON schemas, and access control. Use it while building or changing API endpoints. CX Codex +1 ★ 234repo stars api-platform-serialization Skill configures API Platform serialization: field groups per operation, IRIs instead of nested objects, computed properties, and normalizer options. CX Codex +1 ★ 234repo stars symfony-scheduler Configures recurring tasks with the Symfony Scheduler component without system crontab entries. Useful for scheduled report generation, database cleanups, and Messenger syncs. CX Codex +1 ★ 234repo stars tdd-with-pest tdd-with-pest guides RED-GREEN-REFACTOR in Symfony projects using Pest v4. Use it to write new tests, reproduce bugs before a fix, or move PHPUnit tests to Pest syntax. CX Codex +1 ★ 234repo stars

Project sponsors

Companies that keep this analytics open