[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A4Z898TC2663PAWP42N7ZP":3,"skill-same:01M7A4Z898TC2663PAWP42N7ZP":102},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7A4Z898TC2663PAWP42N7ZP","clerk-astro-patterns",null,"Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering. Triggers on: astro clerk, clerk astro middleware, astro protected page, clerk island component, astro API route auth, clerk astro SSR.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"MIT","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering. Triggers on: astro clerk, clerk astro middleware, astro protected page, clerk island component, astro API route auth, clerk astro SSR.\"\nlicense: \"MIT\"\nmetadata: {\"author\":\"clerk\",\"version\":\"1.0.0\"}\n---\n# Astro Patterns\n\nSDK: `@clerk\u002Fastro` v3+. Requires Astro 4.15+.\n\n## What Do You Need?\n\n| Task | Reference |\n|------|-----------|\n| Configure middleware | references\u002Fmiddleware.md |\n| Protect SSR pages | references\u002Fssr-pages.md |\n| Use Clerk in island components | references\u002Fisland-components.md |\n| Auth in API routes | references\u002Fapi-routes.md |\n| Use Clerk with React in Astro | references\u002Fastro-react.md |\n\n## Mental Model\n\nAstro has two rendering modes per page: **SSR** and **static prerender**. Clerk works differently in each:\n\n- **SSR pages** — use `Astro.locals.auth()` which is populated by the middleware\n- **Static pages** (`export const prerender = true`) — Clerk middleware skips them; use client-side hooks in islands\n- **Islands** — React\u002FVue\u002FSvelte components; use `useAuth()` and other hooks from `@clerk\u002Fastro\u002Freact`\n\n```\nRequest → clerkMiddleware() → SSR page → Astro.locals.auth()\n                                ↓\n                         Island (.client) → useAuth() hook\n```\n\n## Setup\n\n### astro.config.mjs\n\n```ts\nimport { defineConfig } from 'astro\u002Fconfig'\nimport clerk from '@clerk\u002Fastro'\n\nexport default defineConfig({\n  integrations: [clerk()],\n  output: 'server',\n})\n```\n\n### src\u002Fmiddleware.ts\n\n```ts\nimport { clerkMiddleware, createRouteMatcher } from '@clerk\u002Fastro\u002Fserver'\n\nconst isProtectedRoute = createRouteMatcher(['\u002Fdashboard(.*)'])\n\nexport const onRequest = clerkMiddleware((auth, context, next) => {\n  if (isProtectedRoute(context.request) && !auth().userId) {\n    return auth().redirectToSignIn()\n  }\n  return next()\n})\n```\n\n## SSR Page Auth\n\n```astro\n---\nconst { userId, orgId } = Astro.locals.auth()\nif (!userId) return Astro.redirect('\u002Fsign-in')\n---\n\n\u003Ch1>Dashboard\u003C\u002Fh1>\n```\n\n## Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `Astro.locals.auth` is undefined | Missing middleware | Add `clerkMiddleware` to `src\u002Fmiddleware.ts` |\n| Auth works in dev but not production | `output: 'static'` globally | Set `output: 'server'` or `hybrid` for protected pages |\n| Static page has no auth | Prerendered pages skip middleware | Use `export const prerender = false` or move to island |\n| Island not reactive to sign-in | Missing `client:load` directive | Add `client:load` to the island component |\n\n## Import Map\n\n| What | Import From |\n|------|-------------|\n| `clerkMiddleware`, `createRouteMatcher` | `@clerk\u002Fastro\u002Fserver` |\n| `useAuth`, `useUser`, `UserButton` | `@clerk\u002Fastro\u002Freact` |\n| Astro components (`\u003CSignIn>`, etc.) | `@clerk\u002Fastro\u002Fcomponents` |\n\n## Env Variables\n\n```\n# .env\nPUBLIC_CLERK_PUBLISHABLE_KEY=pk_...\nCLERK_SECRET_KEY=sk_...\n```\n\nAstro uses `PUBLIC_` prefix for client-exposed variables (not `NEXT_PUBLIC_`).\n\n## See Also\n\n- `clerk-setup` - Initial Clerk install\n- `clerk-custom-ui` - Custom flows & appearance\n- `clerk-orgs` - B2B organizations\n\n## Docs\n\n[Astro SDK](https:\u002F\u002Fclerk.com\u002Fdocs\u002Fastro\u002Fgetting-started\u002Fquickstart)\n","# Astro Patterns\n\nSDK: `@clerk\u002Fastro` v3+. Requires Astro 4.15+.\n\n## What Do You Need?\n\n| Task | Reference |\n|------|-----------|\n| Configure middleware | references\u002Fmiddleware.md |\n| Protect SSR pages | references\u002Fssr-pages.md |\n| Use Clerk in island components | references\u002Fisland-components.md |\n| Auth in API routes | references\u002Fapi-routes.md |\n| Use Clerk with React in Astro | references\u002Fastro-react.md |\n\n## Mental Model\n\nAstro has two rendering modes per page: **SSR** and **static prerender**. Clerk works differently in each:\n\n- **SSR pages** — use `Astro.locals.auth()` which is populated by the middleware\n- **Static pages** (`export const prerender = true`) — Clerk middleware skips them; use client-side hooks in islands\n- **Islands** — React\u002FVue\u002FSvelte components; use `useAuth()` and other hooks from `@clerk\u002Fastro\u002Freact`\n\n```\nRequest → clerkMiddleware() → SSR page → Astro.locals.auth()\n                                ↓\n                         Island (.client) → useAuth() hook\n```\n\n## Setup\n\n### astro.config.mjs\n\n```ts\nimport { defineConfig } from 'astro\u002Fconfig'\nimport clerk from '@clerk\u002Fastro'\n\nexport default defineConfig({\n  integrations: [clerk()],\n  output: 'server',\n})\n```\n\n### src\u002Fmiddleware.ts\n\n```ts\nimport { clerkMiddleware, createRouteMatcher } from '@clerk\u002Fastro\u002Fserver'\n\nconst isProtectedRoute = createRouteMatcher(['\u002Fdashboard(.*)'])\n\nexport const onRequest = clerkMiddleware((auth, context, next) => {\n  if (isProtectedRoute(context.request) && !auth().userId) {\n    return auth().redirectToSignIn()\n  }\n  return next()\n})\n```\n\n## SSR Page Auth\n\n```astro\n---\nconst { userId, orgId } = Astro.locals.auth()\nif (!userId) return Astro.redirect('\u002Fsign-in')\n---\n\n\u003Ch1>Dashboard\u003C\u002Fh1>\n```\n\n## Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `Astro.locals.auth` is undefined | Missing middleware | Add `clerkMiddleware` to `src\u002Fmiddleware.ts` |\n| Auth works in dev but not production | `output: 'static'` globally | Set `output: 'server'` or `hybrid` for protected pages |\n| Static page has no auth | Prerendered pages skip middleware | Use `export const prerender = false` or move to island |\n| Island not reactive to sign-in | Missing `client:load` directive | Add `client:load` to the island component |\n\n## Import Map\n\n| What | Import From |\n|------|-------------|\n| `clerkMiddleware`, `createRouteMatcher` | `@clerk\u002Fastro\u002Fserver` |\n| `useAuth`, `useUser`, `UserButton` | `@clerk\u002Fastro\u002Freact` |\n| Astro components (`\u003CSignIn>`, etc.) | `@clerk\u002Fastro\u002Fcomponents` |\n\n## Env Variables\n\n```\n# .env\nPUBLIC_CLERK_PUBLISHABLE_KEY=pk_...\nCLERK_SECRET_KEY=sk_...\n```\n\nAstro uses `PUBLIC_` prefix for client-exposed variables (not `NEXT_PUBLIC_`).\n\n## See Also\n\n- `clerk-setup` - Initial Clerk install\n- `clerk-custom-ui` - Custom flows & appearance\n- `clerk-orgs` - B2B organizations\n\n## Docs\n\n[Astro SDK](https:\u002F\u002Fclerk.com\u002Fdocs\u002Fastro\u002Fgetting-started\u002Fquickstart)\n",{"license":15,"metadata":24,"description":7},{"author":25,"version":26},"clerk","1.0.0","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fclerk-astro-patterns","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add NeelakshSaxena\u002FVayu --skill clerk-astro-patterns",{"tool":40,"command":41},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill clerk-astro-patterns",{"tool":43,"command":44},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill clerk-astro-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002FSKILL.md",true,[48,54,58,62,66,70,74,80,84,90,94,98],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"evals\u002Fevals.json","REFERENCE","参考文档",5580,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Fevals\u002Fevals.json",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fapi-routes.md",2009,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Freferences\u002Fapi-routes.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fastro-react.md",2309,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Freferences\u002Fastro-react.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fisland-components.md",1456,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Freferences\u002Fisland-components.md",{"path":67,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fmiddleware.md",1645,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Freferences\u002Fmiddleware.md",{"path":71,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fssr-pages.md",1811,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Freferences\u002Fssr-pages.md",{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"templates\u002Fastro-basic-auth\u002Fastro.config.mjs","SCRIPT","脚本",229,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Ftemplates\u002Fastro-basic-auth\u002Fastro.config.mjs",{"path":81,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":82,"sourceHtmlUrl":83},"templates\u002Fastro-basic-auth\u002Fpackage.json",227,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Ftemplates\u002Fastro-basic-auth\u002Fpackage.json",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"templates\u002Fastro-basic-auth\u002Fsrc\u002Flayouts\u002FLayout.astro","OTHER","其他",520,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Ftemplates\u002Fastro-basic-auth\u002Fsrc\u002Flayouts\u002FLayout.astro",{"path":91,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":92,"sourceHtmlUrl":93},"templates\u002Fastro-basic-auth\u002Fsrc\u002Fmiddleware.ts",98,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Ftemplates\u002Fastro-basic-auth\u002Fsrc\u002Fmiddleware.ts",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"templates\u002Fastro-basic-auth\u002Fsrc\u002Fpages\u002Findex.astro",258,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Ftemplates\u002Fastro-basic-auth\u002Fsrc\u002Fpages\u002Findex.astro",{"path":99,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":100,"sourceHtmlUrl":101},"templates\u002Fastro-basic-auth\u002Ftsconfig.json",42,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fclerk-astro-patterns\u002Ftemplates\u002Fastro-basic-auth\u002Ftsconfig.json",[103,111,118,125,132,139],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":19},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":19},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":19},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]