{"agent":"claude","input":"Add rate limiting to this Slim 4 application. Read composer.json, app/middleware.php, app/routes.php, app/settings.php, app/dependencies.php, public/index.php, src/Application/Middleware/SessionMiddleware.php, src/Application/Actions/ActionError.php, src/Application/Handlers/HttpErrorHandler.php, tests/TestCase.php, tests/Application/Actions/User/ListUserActionTest.php, phpstan.neon.dist, phpcs.xml and .github/workflows/tests.yml first. Add symfony/rate-limiter and symfony/cache at versions that still install on PHP 7.4, the oldest version in the CI matrix. Put policy, limit and interval under a rateLimiter key in app/settings.php and define a RateLimiterFactory in app/dependencies.php with CacheStorage over a FilesystemAdapter in var/cache. Write src/Application/Middleware/RateLimitMiddleware.php as PSR-15: skip OPTIONS, key on REMOTE_ADDR, add X-RateLimit-Limit and X-RateLimit-Remaining on success, and return 429 with Retry-After and an ActionPayload body using a new ActionError TOO_MANY_REQUESTS type when the limit is exceeded. Register it in app/middleware.php and comment on Slim's last-added-runs-first order. Write a PHPUnit test using InMemoryStorage and a limit of 3 that covers success headers, the 429, and that OPTIONS is not counted. Run phpcs, phpstan and phpunit and open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}