{"agent":"claude","input":"Add optimistic updates to the comment mutations in this React app. Read src/lib/react-query.ts, src/features/comments/api/get-comments.ts, create-comment.ts, delete-comment.ts, src/features/comments/components/comments-list.tsx, src/types/api.ts, src/testing/mocks/handlers/comments.ts and src/app/routes/app/discussions/__tests__/discussion.test.tsx first. In useDeleteComment and useCreateComment add onMutate that cancels the comments query, snapshots the infinite data and writes the optimistic pages, onError that restores the snapshot, and onSettled that invalidates the key; keep the caller's onSuccess working and change no component. Use nanoid for the temporary id and the current user as author. Run yarn install and yarn test, then add tests that a delete leaves the list before the mock server answers and returns after a 500, and that a create appears before the answer. Run yarn check-types and yarn lint. Open a pull request quoting the results.","resources":[{"url":"https://github.com/your-org/your-app"}]}