1{2 "skill_name": "clerk-nuxt-patterns",3 "evals": [4 {5 "id": 1,6 "prompt": "i have a nuxt 3 app with @clerk/nuxt installed. i need to protect my /dashboard route so only signed-in users can access it. unauthenticated users should be redirected to the sign-in page.",7 "expected_output": "Adds definePageMeta middleware auth guard to dashboard page, or creates a route middleware using clerkMiddleware",8 "scaffold": "nuxt-basic-auth",9 "expectations": [
10 "Uses definePageMeta({ middleware: 'auth' }) on the dashboard page OR creates a named route middleware",
11 "Handles redirect for unauthenticated users",
12 "Does NOT use client-side only checks for route protection",
13 "Imports are correct for @clerk/nuxt",
14 "Does not break the existing app structure"
15 ]
16 },
17 {
18 "id": 2,
19 "prompt": "i need to create a server API route in my nuxt app that returns the current user's data. the route should only work for authenticated users and return 401 for unauthenticated requests.",
20 "expected_output": "Creates a Nitro server route using event.context.auth or clerkClient to get the current user",
21 "scaffold": "nuxt-basic-auth",
22 "expectations": [
23 "Creates a file in server/api/ directory",
24 "Accesses auth state via event.context.auth or imports clerkClient from @clerk/nuxt/server",
25 "Returns 401 status for unauthenticated requests",
26 "Returns user data for authenticated requests",
27 "Uses defineEventHandler from Nitro"
28 ]
29 },
30 {
31 "id": 3,
32 "prompt": "i want to show user profile information on my nuxt page - the user's name, email, and avatar. how do i access this data in my page component?",
33 "expected_output": "Uses useUser() composable to access user data in the Vue component",
34 "scaffold": "nuxt-basic-auth",
35 "expectations": [
36 "Uses useUser() composable (auto-imported by @clerk/nuxt)",
37 "Accesses user.firstName, user.lastName, user.emailAddresses, or user.imageUrl",
38 "Handles the loading state before rendering user data",
39 "Does NOT make a server fetch for user data when composables suffice",
40 "Component uses <script setup> syntax"
41 ]
42 },
43 {
44 "id": 4,
45 "prompt": "my nuxt saas app needs organization support. users should be able to switch between their organizations in the header. show me how to add org switching and display org-scoped content on the dashboard.",
46 "expected_output": "Adds OrganizationSwitcher component, reads orgId from useAuth() to scope dashboard content",
47 "scaffold": "nuxt-basic-auth",
48 "expectations": [
49 "Adds <OrganizationSwitcher /> component to the header or layout",
50 "Uses orgId from useAuth() composable to scope data",
51 "Handles case where no org is selected (prompts user to select or create one)",
52 "Does NOT remove existing user authentication logic",
53 "Dashboard content is conditional on orgId being present"
54 ]
55 },
56 {
57 "id": 5,
58 "prompt": "i want to replace the hosted sign-in page with a custom one inside my nuxt app. show me how to create a custom sign-in page using clerk components.",
59 "expected_output": "Creates a pages/sign-in.vue page with <SignIn /> component and configures the sign-in URL",
60 "scaffold": "nuxt-basic-auth",
61 "expectations": [
62 "Creates a sign-in page in the pages/ directory",
63 "Renders the <SignIn /> component from @clerk/nuxt",
64 "Configures NUXT_PUBLIC_CLERK_SIGN_IN_URL or signInUrl in nuxt.config.ts",
65 "Does NOT implement a custom auth form from scratch",
66 "Page is publicly accessible (no auth middleware on it)"
67 ]
68 },
69 {
70 "id": 6,
71 "prompt": "i need to protect a nitro server route that handles payments. the route needs to verify the user is authenticated and get their userId to record the payment in my database.",
72 "expected_output": "Server route using event.context.auth to get userId, returns 401 if not authenticated",
73 "scaffold": "nuxt-basic-auth",
74 "expectations": [
75 "Uses event.context.auth.userId in a Nitro server route",
76 "Returns createError({ statusCode: 401 }) or setResponseStatus(event, 401) for unauthenticated",
77 "Extracts userId from auth context to use in database operation",
78 "File is placed in server/api/ or server/routes/",
79 "Does NOT re-verify the session token manually"
80 ]
81 },
82 {
83 "id": 7,
84 "prompt": "i'm adding clerk to my nuxt 3 app. set up the module and protect the /dashboard route so unauthenticated users are redirected to /sign-in.",
85 "expected_output": "Adds @clerk/nuxt to modules in nuxt.config.ts, creates Nuxt route middleware that checks auth and redirects",
86 "scaffold": "nuxt-basic-auth",
87 "expectations": [
88 "Adds @clerk/nuxt to the modules array in nuxt.config.ts",
89 "Creates a route middleware that checks authentication",
90 "Uses useAuth composable inside the middleware",
91 "Redirects unauthenticated users to /sign-in via navigateTo",
92 "Applies the middleware to the /dashboard route"
93 ]
94 },
95 {
96 "id": 8,
97 "prompt": "my nuxt app has a server API route /api/user-data that should only work for authenticated users. implement the server-side auth check.",
98 "expected_output": "Uses getAuth from @clerk/nuxt/server in the event handler, throws 401 when userId is falsy",
99 "scaffold": "nuxt-basic-auth",
100 "expectations": [
101 "Imports getAuth from @clerk/nuxt/server",
102 "Calls getAuth(event) to get userId",
103 "Throws createError({ statusCode: 401 }) when userId is falsy",
104 "Uses userId in the data fetching logic",
105 "Does NOT use client-side composables in the server route"
106 ]
107 },
108 {
109 "id": 9,
110 "prompt": "i need to add a global nuxt server middleware that checks auth on all protected routes and redirects to /sign-in. use clerkMiddleware from @clerk/nuxt.",
111 "expected_output": "Creates server/middleware/clerk.ts with clerkMiddleware that checks H3Event context for auth",
112 "scaffold": "nuxt-basic-auth",
113 "expectations": [
114 "Creates server/middleware/clerk.ts",
115 "Uses clerkMiddleware from @clerk/nuxt/server",
116 "Exports the result as default",
117 "Can access auth state via event.context.auth",
118 "Does NOT create the middleware in middleware/ (that is for route middleware, not server middleware)"