{"agent":"claude","input":"Add role-based access control to this Next.js app, which uses Auth.js (next-auth v5) with JWT sessions. Read auth.ts, middleware.ts, app/api/protected/route.ts, app/client-example/page.tsx, components/session-data.tsx, package.json and .env.local.example first. Add lib/roles.ts with roleFor(email): it reads a comma-separated AUTH_ADMIN_EMAILS, compares case-insensitively, and returns \"admin\" or \"user\". In auth.ts set token.role in the jwt callback on every call (keep the existing update and Keycloak branches), expose it as session.user.role in the session callback, and extend the existing module augmentation for Session and JWT. Extend the authorized callback so /admin and anything under it needs the admin role: no session returns false, a session without the role redirects to /. Add app/admin/page.tsx that checks the role again with auth(), and app/api/admin/route.ts that answers 401 without a session and 403 without the role, because the middleware matcher skips /api. Do not pass the role through SessionProvider in the client example. Add Vitest with a test script and test roleFor and the path decision as pure functions. Install with pnpm, run tsc --noEmit, the tests and pnpm build, document AUTH_ADMIN_EMAILS in .env.local.example, and open a pull request that says what was tested and what was only compiled.","resources":[{"url":"https://github.com/your-org/your-app"}]}