{"agent":"claude","input":"Add CSRF protection to this Slim 4 app with the slim/csrf package. Read composer.json, public/index.php, app/middleware.php, app/dependencies.php, app/routes.php, src/Application/Middleware/SessionMiddleware.php, src/Application/Handlers/HttpErrorHandler.php, tests/TestCase.php and .github/workflows/tests.yml first. Register Slim\\Csrf\\Guard in the container with a failure handler that answers the same JSON ActionPayload shape the app's error handler uses, add it to the app so it runs inside the session middleware and inside body parsing, make the session start for every non-preflight request with httponly and SameSite cookie flags, and add a GET route that returns the token key names and a fresh pair. Write a PHPUnit test that gives the Guard array storage, posts without tokens and expects 400, posts with a pair from the token route and expects 200, and shows a used pair is refused. Run phpcs, phpstan and phpunit, start the server and curl one refused and one accepted POST, then open a pull request that explains the middleware order.","resources":[{"url":"https://github.com/your-org/your-app"}]}