{"agent":"claude","input":"Add a JSON REST API for a posts resource to this Yii2 basic application. Read composer.json, config/web.php, config/console.php, config/db.php, config/test.php, config/test_db.php, models/User.php, controllers/SiteController.php, codeception.yml, the three suite files under tests, tests/Support/bin/yii, phpstan.neon, phpcs.xml.dist and the workflows under .github first. Install PHP 8.2 or later with the pdo_mysql, dom, gd and intl extensions, Composer and MariaDB if the sandbox lacks them, run composer install, and create the yii2basic_test database. Do not commit the cookie validation key that composer install writes into config/web.php. Create a migration for a post table with id, title, body, created_at and updated_at using yii migrate/create, an ActiveRecord model with validation rules and a fields() method, and controllers/api/PostController.php extending yii\\rest\\ActiveController. Enable urlManager with pretty URLs and a yii\\rest\\UrlRule for the controller, register the JSON request parser, share both with config/test.php through one required file, and protect the controller with HttpBearerAuth using the existing findIdentityByAccessToken, leaving OPTIONS requests open. Keep the site pages and their session login working. Add codeception/module-rest, an Api suite that depends on the Yii2 module, run codecept build, and write Cest tests for list, view, create, update, delete, a missing token, a validation error and an unknown id. Apply the migration to the test database with tests/Support/bin/yii. Run composer tests, composer static and composer cs and fix what they report in the files you added. Open a pull request that lists the routes, quotes the three command outputs and names anything CI will need that you could not verify.","resources":[{"url":"https://github.com/your-org/your-app"}]}