Skip to content
Development
Skill

/rate-limiting

Implement rate limiting with the Symfony RateLimiter (sliding window, token bucket, fixed window) and the #[RateLimit] controller attribute

From plugin
superpowers-symfony
23344 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill rate-limiting --agent claude-code

SKILL.md

rate-limiting.SKILL.md
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`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

23344 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
233
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about rate-limiting.

Which coding agents can use rate-limiting?
rate-limiting installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.