{"agent":"claude","input":"Add CORS to this CodeIgniter 4 app's API. Read composer.json, app/Config/Filters.php, app/Config/Cors.php, app/Config/Routes.php, app/Config/Routing.php, app/Config/App.php, env, phpunit.dist.xml, tests/unit/HealthTest.php and .github/workflows/phpunit.yml first. Do not write a filter; use the cors alias that Filters.php already declares. Add a named config public array $api to app/Config/Cors.php whose allowedOrigins come from a cors.allowedOrigins entry in env split on commas, with allowedHeaders Content-Type, Authorization and X-Requested-With, allowedMethods GET, POST, PUT, PATCH and DELETE, supportsCredentials false and the default maxAge; leave $default empty. In app/Config/Routes.php add an api group with filter cors:api containing a GET api/health route to a small Api\\Health controller and an options route for api/(:any) with an empty closure so preflights reach the filter. Add tests/feature/CorsTest.php using FeatureTestTrait that checks an allowed origin is echoed on GET api/health, a disallowed origin gets no header, a preflight OPTIONS with Access-Control-Request-Method POST gets 204 with the methods and max-age headers, and GET / gets no CORS header. Document the env entry in env and README.md. Run composer install, vendor/bin/phpunit and php spark routes, start php spark serve and curl -i a preflight and a simple request, then open a pull request that pastes the curl output and the routes table.","resources":[{"url":"https://github.com/your-org/your-app"}]}