{"agent":"claude","input":"Add JWT authentication to this Socket.IO server. Read package.json, index.js and index.html first. Add a jsonwebtoken-based io.use middleware that reads the token from the handshake auth, verifies it with JWT_SECRET and HS256, puts the user on socket.data, and rejects missing, expired and invalid tokens with distinct codes in the error data. Refuse to start without JWT_SECRET. Check and document how middleware behaves with connection state recovery in the installed version. Split the worker setup into an exported factory so it can be tested without the cluster, keep index.js as the cluster bootstrap, and have the client send the token in auth and handle connect_error. Write node:test tests with socket.io-client for the missing, valid, wrong-secret and expired cases, add a test script, run npm test and include the output. Do not change the messages table. Open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}