{"agent":"claude","input":"Add optimistic updates to the add-post mutation in this tRPC and Next.js app. Read package.json, src/server/routers/post.ts, src/pages/index.tsx, src/utils/trpc.ts, playwright/smoke.test.ts and .github/workflows first. Generate the post id on the client since the add procedure accepts an optional UUID id, so the optimistic row and the saved row share a key. In onMutate cancel the list query, read the infinite data, append the new post to the first page in the order the server returns items, and return the previous pages; roll back in onError; invalidate in onSettled. Share the list input between the query and the cache helpers in one constant. Stop disabling the form during the request and reset it when the mutation starts, keeping the existing error alert. Add Playwright tests that prove the post appears before the server answers and disappears with the alert when the server fails, using page.route. Install Postgres in the sandbox, set DATABASE_URL and DIRECT_URL, run pnpm prebuild, pnpm build, pnpm test-e2e, pnpm typecheck and pnpm lint, and open a pull request with each command's output and a note on what still waits for the server.","resources":[{"url":"https://github.com/your-org/your-app"}]}