{"agent":"claude","input":"Add a JSON REST API over D1 to the d1-template Worker in this repository and open a pull request. Read d1-template/wrangler.json, d1-template/package.json, d1-template/src/index.ts, d1-template/src/renderHtml.ts, d1-template/migrations/0001_create_comments_table.sql, d1-template/tsconfig.json, d1-starter-sessions-api-template/vitest.config.mts, d1-starter-sessions-api-template/test/index.spec.ts and AGENTS.md first. Keep the HTML page at /. Add GET /api/comments with a clamped limit query and POST /api/comments that validates author and content, inserts with a bound statement using RETURNING, and answers 201; answer 400 with an error body on bad input, 404 under /api for unknown paths and 405 with Allow for other methods. Add a CORS helper driven by a CORS_ORIGIN var in wrangler.json with an OPTIONS handler. Add vitest with @cloudflare/vitest-pool-workers at the versions the sessions template pins, a vitest.config.mts, and test/index.spec.ts with at least five tests that apply the migrations to the test database in beforeAll. Add a test script. Run npm install, npm run cf-typegen, npm run check, npm test and, from the root, pnpm run check:templates and pnpm run check:prettier, and paste the output in the pull request. Change no other template.","resources":[{"url":"https://github.com/your-org/your-app"}]}