add-rate-limit
Skill234 starsChanged 3 months agoMITView on GitHub
Add a rate limit policy to an endpoint
In this repository29 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-aspire-depSkill
- add-background-jobSkill
- add-ci-areaSkill
- add-email-templateSkill
- add-env-varSkill
- add-options-classSkill
- add-permissionSkill
- address-reviewSkill
- add-testSkill
- backend-conventionsSkill
- create-issueSkill
- create-prSkill
- create-releaseSkill
- frontend-conventionsSkill
- gen-typesSkill
- infra-conventionsSkill
- init-verifySkill
- manage-file-storageSkill
- new-endpointSkill
- new-entitySkill
- new-featureSkill
- new-pageSkill
- polish-uiSkill
- review-dependabotSkill
- review-designSkill
- review-prSkill
- security-conventionsSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Add a constant to src/backend/MyProject.WebApi/Shared/RateLimitPolicies.cs:
- Very specific: line 14
Add a nested configuration class inside RateLimitingOptions in src/backend/MyProject.WebApi/Options/RateLimitingOptions.cs (extend …
- Very specific: line 26
Add the property to RateLimitingOptions (same file):
- Very specific: line 35
Add config section to both appsettings.json and appsettings.Development.json
- Very specific: line 37
Add [ProducesResponseType(StatusCodes.Status429TooManyRequests)] to the endpoint
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Adds a rate limit policy.
Steps
- Add a constant to
src/backend/MyProject.WebApi/Shared/RateLimitPolicies.cs:public const string MyPolicy = "my-policy"; - Add a nested configuration class inside
RateLimitingOptionsinsrc/backend/MyProject.WebApi/Options/RateLimitingOptions.cs(extendFixedWindowPolicyOptions):public sealed class MyPolicyLimitOptions : FixedWindowPolicyOptions { public MyPolicyLimitOptions() { PermitLimit = 10; Window = TimeSpan.FromMinutes(1); QueueLimit = 0; } } - Add the property to
RateLimitingOptions(same file):[Required] [ValidateObjectMembers] public MyPolicyLimitOptions MyPolicy { get; init; } = new(); - Register in
src/backend/MyProject.WebApi/Extensions/RateLimiterExtensions.csusing existing helpers:AddIpPolicy(...)for unauthenticated endpoints (partitions by IP)AddUserPolicy(...)for authenticated endpoints (partitions by user identity)
- Add config section to both
appsettings.jsonandappsettings.Development.json - Apply to endpoints:
[EnableRateLimiting(RateLimitPolicies.MyPolicy)] - Add
[ProducesResponseType(StatusCodes.Status429TooManyRequests)]to the endpoint - Verify:
dotnet build src/backend/MyProject.slnx
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

