[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6R4EGD81QB7ASQ7NE47DCRC":3,"skill-same:01M6R4EGD81QB7ASQ7NE47DCRC":82},{"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":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":64,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":67,"install":68,"resources":81},"01M6R4EGD81QB7ASQ7NE47DCRC","astro",null,"Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown\u002FMDX support.","Mishit18\u002Fclaude-code-templates","Mishit18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F244127857?v=4","01M6QXBYKWM76HSKYDNWSKKE41","Mishit Sharma","01M6QXBYRJ0CAVM51S1RTEKTZZ",1,"MIT","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-development\u002Fastro\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[5,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"2026","frontend","with","multi","islands","ssg","community","build","default","cursor","markdown","ZeRO","framework","ssr","architecture","components","support","performance","gemini","safe","2026-11-10 10:12:30",false,"---\nname: astro\ndescription: \"Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown\u002FMDX support.\"\ncategory: frontend\nrisk: safe\nsource: community\ndate_added: \"2026-03-18\"\nauthor: suhaibjanjua\ntags: [astro, ssg, ssr, islands, content, markdown, mdx, performance]\ntools: [claude, cursor, gemini]\n---\n\n# Astro Web Framework\n\n## Overview\n\nAstro is a web framework designed for content-rich websites — blogs, docs, portfolios, marketing sites, and e-commerce. Its core innovation is the **Islands Architecture**: by default, Astro ships zero JavaScript to the browser. Interactive components are selectively hydrated as isolated \"islands.\" Astro supports React, Vue, Svelte, Solid, and other UI frameworks simultaneously in the same project, letting you pick the right tool per component.\n\n## When to Use This Skill\n\n- Use when building a blog, documentation site, marketing page, or portfolio\n- Use when performance and Core Web Vitals are the top priority\n- Use when the project is content-heavy with Markdown or MDX files\n- Use when you want SSG (static) output with optional SSR for dynamic routes\n- Use when the user asks about `.astro` files, `Astro.props`, content collections, or `client:` directives\n\n## How It Works\n\n### Step 1: Project Setup\n\n```bash\nnpm create astro@latest my-site\ncd my-site\nnpm install\nnpm run dev\n```\n\nAdd integrations as needed:\n\n```bash\nnpx astro add tailwind        # Tailwind CSS\nnpx astro add react           # React component support\nnpx astro add mdx             # MDX support\nnpx astro add sitemap         # Auto sitemap.xml\nnpx astro add vercel          # Vercel SSR adapter\n```\n\nProject structure:\n\n```\nsrc\u002F\n  pages\u002F          ← File-based routing (.astro, .md, .mdx)\n  layouts\u002F        ← Reusable page shells\n  components\u002F     ← UI components (.astro, .tsx, .vue, etc.)\n  content\u002F        ← Type-safe content collections (Markdown\u002FMDX)\n  styles\u002F         ← Global CSS\npublic\u002F           ← Static assets (copied as-is)\nastro.config.mjs  ← Framework config\n```\n\n### Step 2: Astro Component Syntax\n\n`.astro` files have a code fence at the top (server-only) and a template below:\n\n```astro\n---\n\u002F\u002F src\u002Fcomponents\u002FCard.astro\n\u002F\u002F This block runs on the server ONLY — never in the browser\ninterface Props {\n  title: string;\n  href: string;\n  description: string;\n}\n\nconst { title, href, description } = Astro.props;\n---\n\n\u003Carticle class=\"card\">\n  \u003Ch2>\u003Ca href={href}>{title}\u003C\u002Fa>\u003C\u002Fh2>\n  \u003Cp>{description}\u003C\u002Fp>\n\u003C\u002Farticle>\n\n\u003Cstyle>\n  \u002F* Scoped to this component automatically *\u002F\n  .card { border: 1px solid #eee; padding: 1rem; }\n\u003C\u002Fstyle>\n```\n\n### Step 3: File-Based Pages and Routing\n\n```\nsrc\u002Fpages\u002Findex.astro          → \u002F\nsrc\u002Fpages\u002Fabout.astro          → \u002Fabout\nsrc\u002Fpages\u002Fblog\u002F[slug].astro    → \u002Fblog\u002F:slug (dynamic)\nsrc\u002Fpages\u002Fblog\u002F[...path].astro → \u002Fblog\u002F* (catch-all)\n```\n\nDynamic route with `getStaticPaths`:\n\n```astro\n---\n\u002F\u002F src\u002Fpages\u002Fblog\u002F[slug].astro\nexport async function getStaticPaths() {\n  const posts = await getCollection('blog');\n  return posts.map(post => ({\n    params: { slug: post.slug },\n    props: { post },\n  }));\n}\n\nconst { post } = Astro.props;\nconst { Content } = await post.render();\n---\n\n\u003Ch1>{post.data.title}\u003C\u002Fh1>\n\u003CContent \u002F>\n```\n\n### Step 4: Content Collections\n\nContent collections give you type-safe access to Markdown and MDX files:\n\n```typescript\n\u002F\u002F src\u002Fcontent\u002Fconfig.ts\nimport { z, defineCollection } from 'astro:content';\n\nconst blog = defineCollection({\n  type: 'content',\n  schema: z.object({\n    title: z.string(),\n    date: z.coerce.date(),\n    tags: z.array(z.string()).default([]),\n    draft: z.boolean().default(false),\n  }),\n});\n\nexport const collections = { blog };\n```\n\n```astro\n---\n\u002F\u002F src\u002Fpages\u002Fblog\u002Findex.astro\nimport { getCollection } from 'astro:content';\n\nconst posts = (await getCollection('blog'))\n  .filter(p => !p.data.draft)\n  .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());\n---\n\n\u003Cul>\n  {posts.map(post => (\n    \u003Cli>\n      \u003Ca href={`\u002Fblog\u002F${post.slug}`}>{post.data.title}\u003C\u002Fa>\n      \u003Ctime>{post.data.date.toLocaleDateString()}\u003C\u002Ftime>\n    \u003C\u002Fli>\n  ))}\n\u003C\u002Ful>\n```\n\n### Step 5: Islands — Selective Hydration\n\nBy default, UI framework components render to static HTML with no JS. Use `client:` directives to hydrate:\n\n```astro\n---\nimport Counter from '..\u002Fcomponents\u002FCounter.tsx';  \u002F\u002F React component\nimport VideoPlayer from '..\u002Fcomponents\u002FVideoPlayer.svelte';\n---\n\n\u003C!-- Static HTML — no JavaScript sent to browser -->\n\u003CCounter initialCount={0} \u002F>\n\n\u003C!-- Hydrate immediately on page load -->\n\u003CCounter initialCount={0} client:load \u002F>\n\n\u003C!-- Hydrate when the component scrolls into view -->\n\u003CVideoPlayer src=\"\u002Fdemo.mp4\" client:visible \u002F>\n\n\u003C!-- Hydrate only when browser is idle -->\n\u003CAnalytics client:idle \u002F>\n\n\u003C!-- Hydrate only on a specific media query -->\n\u003CMobileMenu client:media=\"(max-width: 768px)\" \u002F>\n```\n\n### Step 6: Layouts\n\n```astro\n---\n\u002F\u002F src\u002Flayouts\u002FBaseLayout.astro\ninterface Props {\n  title: string;\n  description?: string;\n}\nconst { title, description = 'My Astro Site' } = Astro.props;\n---\n\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Cmeta charset=\"utf-8\" \u002F>\n    \u003Ctitle>{title}\u003C\u002Ftitle>\n    \u003Cmeta name=\"description\" content={description} \u002F>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003Cnav>...\u003C\u002Fnav>\n    \u003Cmain>\n      \u003Cslot \u002F>  \u003C!-- page content renders here -->\n    \u003C\u002Fmain>\n    \u003Cfooter>...\u003C\u002Ffooter>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n```astro\n---\n\u002F\u002F src\u002Fpages\u002Fabout.astro\nimport BaseLayout from '..\u002Flayouts\u002FBaseLayout.astro';\n---\n\n\u003CBaseLayout title=\"About Us\">\n  \u003Ch1>About Us\u003C\u002Fh1>\n  \u003Cp>Welcome to our company...\u003C\u002Fp>\n\u003C\u002FBaseLayout>\n```\n\n### Step 7: SSR Mode (On-Demand Rendering)\n\nEnable SSR for dynamic pages by setting an adapter:\n\n```javascript\n\u002F\u002F astro.config.mjs\nimport { defineConfig } from 'astro\u002Fconfig';\nimport vercel from '@astrojs\u002Fvercel\u002Fserverless';\n\nexport default defineConfig({\n  output: 'hybrid',  \u002F\u002F 'static' | 'server' | 'hybrid'\n  adapter: vercel(),\n});\n```\n\nOpt individual pages into SSR with `export const prerender = false`.\n\n## Examples\n\n### Example 1: Blog with RSS Feed\n\n```typescript\n\u002F\u002F src\u002Fpages\u002Frss.xml.ts\nimport rss from '@astrojs\u002Frss';\nimport { getCollection } from 'astro:content';\n\nexport async function GET(context) {\n  const posts = await getCollection('blog');\n  return rss({\n    title: 'My Blog',\n    description: 'Latest posts',\n    site: context.site,\n    items: posts.map(post => ({\n      title: post.data.title,\n      pubDate: post.data.date,\n      link: `\u002Fblog\u002F${post.slug}\u002F`,\n    })),\n  });\n}\n```\n\n### Example 2: API Endpoint (SSR)\n\n```typescript\n\u002F\u002F src\u002Fpages\u002Fapi\u002Fsubscribe.ts\nimport type { APIRoute } from 'astro';\n\nexport const POST: APIRoute = async ({ request }) => {\n  const { email } = await request.json();\n\n  if (!email) {\n    return new Response(JSON.stringify({ error: 'Email required' }), {\n      status: 400,\n      headers: { 'Content-Type': 'application\u002Fjson' },\n    });\n  }\n\n  await addToNewsletter(email);\n  return new Response(JSON.stringify({ success: true }), { status: 200 });\n};\n```\n\n### Example 3: React Component as Island\n\n```tsx\n\u002F\u002F src\u002Fcomponents\u002FSearchBox.tsx\nimport { useState } from 'react';\n\nexport default function SearchBox() {\n  const [query, setQuery] = useState('');\n  const [results, setResults] = useState([]);\n\n  async function search(e: React.FormEvent) {\n    e.preventDefault();\n    const data = await fetch(`\u002Fapi\u002Fsearch?q=${query}`).then(r => r.json());\n    setResults(data);\n  }\n\n  return (\n    \u003Cform onSubmit={search}>\n      \u003Cinput value={query} onChange={e => setQuery(e.target.value)} \u002F>\n      \u003Cbutton type=\"submit\">Search\u003C\u002Fbutton>\n      \u003Cul>{results.map(r => \u003Cli key={r.id}>{r.title}\u003C\u002Fli>)}\u003C\u002Ful>\n    \u003C\u002Fform>\n  );\n}\n```\n\n```astro\n---\nimport SearchBox from '..\u002Fcomponents\u002FSearchBox.tsx';\n---\n\u003C!-- Hydrated immediately — this island is interactive -->\n\u003CSearchBox client:load \u002F>\n```\n\n## Best Practices\n\n- ✅ Keep most components as static `.astro` files — only hydrate what must be interactive\n- ✅ Use content collections for all Markdown\u002FMDX content — you get type safety and auto-validation\n- ✅ Prefer `client:visible` over `client:load` for below-the-fold components to reduce initial JS\n- ✅ Use `import.meta.env` for environment variables — prefix public vars with `PUBLIC_`\n- ✅ Add `\u003CViewTransitions \u002F>` from `astro:transitions` for smooth page navigation without a full SPA\n- ❌ Don't use `client:load` on every component — this defeats Astro's performance advantage\n- ❌ Don't put secrets in `.astro` frontmatter that gets used in client-facing templates\n- ❌ Don't skip `getStaticPaths` for dynamic routes in static mode — builds will fail\n\n## Security & Safety Notes\n\n- Frontmatter code in `.astro` files runs server-side only and is never exposed to the browser.\n- Use `import.meta.env.PUBLIC_*` only for non-sensitive values. Private env vars (no `PUBLIC_` prefix) are never sent to the client.\n- When using SSR mode, validate all `Astro.request` inputs before database queries or API calls.\n- Sanitize any user-supplied content before rendering with `set:html` — it bypasses auto-escaping.\n\n## Common Pitfalls\n\n- **Problem:** JavaScript from a React\u002FVue component doesn't run in the browser\n  **Solution:** Add a `client:` directive (`client:load`, `client:visible`, etc.) — without it, components render as static HTML only.\n\n- **Problem:** `getStaticPaths` data is stale after content updates during dev\n  **Solution:** Astro's dev server watches content files — restart if changes to `content\u002Fconfig.ts` are not reflected.\n\n- **Problem:** `Astro.props` type is `any` — no autocomplete\n  **Solution:** Define a `Props` interface or type in the frontmatter and Astro will infer it automatically.\n\n- **Problem:** CSS from a `.astro` component bleeds into other components\n  **Solution:** Styles in `.astro` `\u003Cstyle>` tags are automatically scoped. Use `:global()` only when intentionally targeting children.\n\n## Related Skills\n\n- `@sveltekit` — When you need a full-stack framework with reactive UI (vs Astro's content focus)\n- `@nextjs-app-router-patterns` — When you need a React-first full-stack framework\n- `@tailwind-patterns` — Styling Astro sites with Tailwind CSS\n- `@progressive-web-app` — Adding PWA capabilities to an Astro site\n\n","# Astro Web Framework\n\n## Overview\n\nAstro is a web framework designed for content-rich websites — blogs, docs, portfolios, marketing sites, and e-commerce. Its core innovation is the **Islands Architecture**: by default, Astro ships zero JavaScript to the browser. Interactive components are selectively hydrated as isolated \"islands.\" Astro supports React, Vue, Svelte, Solid, and other UI frameworks simultaneously in the same project, letting you pick the right tool per component.\n\n## When to Use This Skill\n\n- Use when building a blog, documentation site, marketing page, or portfolio\n- Use when performance and Core Web Vitals are the top priority\n- Use when the project is content-heavy with Markdown or MDX files\n- Use when you want SSG (static) output with optional SSR for dynamic routes\n- Use when the user asks about `.astro` files, `Astro.props`, content collections, or `client:` directives\n\n## How It Works\n\n### Step 1: Project Setup\n\n```bash\nnpm create astro@latest my-site\ncd my-site\nnpm install\nnpm run dev\n```\n\nAdd integrations as needed:\n\n```bash\nnpx astro add tailwind        # Tailwind CSS\nnpx astro add react           # React component support\nnpx astro add mdx             # MDX support\nnpx astro add sitemap         # Auto sitemap.xml\nnpx astro add vercel          # Vercel SSR adapter\n```\n\nProject structure:\n\n```\nsrc\u002F\n  pages\u002F          ← File-based routing (.astro, .md, .mdx)\n  layouts\u002F        ← Reusable page shells\n  components\u002F     ← UI components (.astro, .tsx, .vue, etc.)\n  content\u002F        ← Type-safe content collections (Markdown\u002FMDX)\n  styles\u002F         ← Global CSS\npublic\u002F           ← Static assets (copied as-is)\nastro.config.mjs  ← Framework config\n```\n\n### Step 2: Astro Component Syntax\n\n`.astro` files have a code fence at the top (server-only) and a template below:\n\n```astro\n---\n\u002F\u002F src\u002Fcomponents\u002FCard.astro\n\u002F\u002F This block runs on the server ONLY — never in the browser\ninterface Props {\n  title: string;\n  href: string;\n  description: string;\n}\n\nconst { title, href, description } = Astro.props;\n---\n\n\u003Carticle class=\"card\">\n  \u003Ch2>\u003Ca href={href}>{title}\u003C\u002Fa>\u003C\u002Fh2>\n  \u003Cp>{description}\u003C\u002Fp>\n\u003C\u002Farticle>\n\n\u003Cstyle>\n  \u002F* Scoped to this component automatically *\u002F\n  .card { border: 1px solid #eee; padding: 1rem; }\n\u003C\u002Fstyle>\n```\n\n### Step 3: File-Based Pages and Routing\n\n```\nsrc\u002Fpages\u002Findex.astro          → \u002F\nsrc\u002Fpages\u002Fabout.astro          → \u002Fabout\nsrc\u002Fpages\u002Fblog\u002F[slug].astro    → \u002Fblog\u002F:slug (dynamic)\nsrc\u002Fpages\u002Fblog\u002F[...path].astro → \u002Fblog\u002F* (catch-all)\n```\n\nDynamic route with `getStaticPaths`:\n\n```astro\n---\n\u002F\u002F src\u002Fpages\u002Fblog\u002F[slug].astro\nexport async function getStaticPaths() {\n  const posts = await getCollection('blog');\n  return posts.map(post => ({\n    params: { slug: post.slug },\n    props: { post },\n  }));\n}\n\nconst { post } = Astro.props;\nconst { Content } = await post.render();\n---\n\n\u003Ch1>{post.data.title}\u003C\u002Fh1>\n\u003CContent \u002F>\n```\n\n### Step 4: Content Collections\n\nContent collections give you type-safe access to Markdown and MDX files:\n\n```typescript\n\u002F\u002F src\u002Fcontent\u002Fconfig.ts\nimport { z, defineCollection } from 'astro:content';\n\nconst blog = defineCollection({\n  type: 'content',\n  schema: z.object({\n    title: z.string(),\n    date: z.coerce.date(),\n    tags: z.array(z.string()).default([]),\n    draft: z.boolean().default(false),\n  }),\n});\n\nexport const collections = { blog };\n```\n\n```astro\n---\n\u002F\u002F src\u002Fpages\u002Fblog\u002Findex.astro\nimport { getCollection } from 'astro:content';\n\nconst posts = (await getCollection('blog'))\n  .filter(p => !p.data.draft)\n  .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());\n---\n\n\u003Cul>\n  {posts.map(post => (\n    \u003Cli>\n      \u003Ca href={`\u002Fblog\u002F${post.slug}`}>{post.data.title}\u003C\u002Fa>\n      \u003Ctime>{post.data.date.toLocaleDateString()}\u003C\u002Ftime>\n    \u003C\u002Fli>\n  ))}\n\u003C\u002Ful>\n```\n\n### Step 5: Islands — Selective Hydration\n\nBy default, UI framework components render to static HTML with no JS. Use `client:` directives to hydrate:\n\n```astro\n---\nimport Counter from '..\u002Fcomponents\u002FCounter.tsx';  \u002F\u002F React component\nimport VideoPlayer from '..\u002Fcomponents\u002FVideoPlayer.svelte';\n---\n\n\u003C!-- Static HTML — no JavaScript sent to browser -->\n\u003CCounter initialCount={0} \u002F>\n\n\u003C!-- Hydrate immediately on page load -->\n\u003CCounter initialCount={0} client:load \u002F>\n\n\u003C!-- Hydrate when the component scrolls into view -->\n\u003CVideoPlayer src=\"\u002Fdemo.mp4\" client:visible \u002F>\n\n\u003C!-- Hydrate only when browser is idle -->\n\u003CAnalytics client:idle \u002F>\n\n\u003C!-- Hydrate only on a specific media query -->\n\u003CMobileMenu client:media=\"(max-width: 768px)\" \u002F>\n```\n\n### Step 6: Layouts\n\n```astro\n---\n\u002F\u002F src\u002Flayouts\u002FBaseLayout.astro\ninterface Props {\n  title: string;\n  description?: string;\n}\nconst { title, description = 'My Astro Site' } = Astro.props;\n---\n\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Cmeta charset=\"utf-8\" \u002F>\n    \u003Ctitle>{title}\u003C\u002Ftitle>\n    \u003Cmeta name=\"description\" content={description} \u002F>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003Cnav>...\u003C\u002Fnav>\n    \u003Cmain>\n      \u003Cslot \u002F>  \u003C!-- page content renders here -->\n    \u003C\u002Fmain>\n    \u003Cfooter>...\u003C\u002Ffooter>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n```astro\n---\n\u002F\u002F src\u002Fpages\u002Fabout.astro\nimport BaseLayout from '..\u002Flayouts\u002FBaseLayout.astro';\n---\n\n\u003CBaseLayout title=\"About Us\">\n  \u003Ch1>About Us\u003C\u002Fh1>\n  \u003Cp>Welcome to our company...\u003C\u002Fp>\n\u003C\u002FBaseLayout>\n```\n\n### Step 7: SSR Mode (On-Demand Rendering)\n\nEnable SSR for dynamic pages by setting an adapter:\n\n```javascript\n\u002F\u002F astro.config.mjs\nimport { defineConfig } from 'astro\u002Fconfig';\nimport vercel from '@astrojs\u002Fvercel\u002Fserverless';\n\nexport default defineConfig({\n  output: 'hybrid',  \u002F\u002F 'static' | 'server' | 'hybrid'\n  adapter: vercel(),\n});\n```\n\nOpt individual pages into SSR with `export const prerender = false`.\n\n## Examples\n\n### Example 1: Blog with RSS Feed\n\n```typescript\n\u002F\u002F src\u002Fpages\u002Frss.xml.ts\nimport rss from '@astrojs\u002Frss';\nimport { getCollection } from 'astro:content';\n\nexport async function GET(context) {\n  const posts = await getCollection('blog');\n  return rss({\n    title: 'My Blog',\n    description: 'Latest posts',\n    site: context.site,\n    items: posts.map(post => ({\n      title: post.data.title,\n      pubDate: post.data.date,\n      link: `\u002Fblog\u002F${post.slug}\u002F`,\n    })),\n  });\n}\n```\n\n### Example 2: API Endpoint (SSR)\n\n```typescript\n\u002F\u002F src\u002Fpages\u002Fapi\u002Fsubscribe.ts\nimport type { APIRoute } from 'astro';\n\nexport const POST: APIRoute = async ({ request }) => {\n  const { email } = await request.json();\n\n  if (!email) {\n    return new Response(JSON.stringify({ error: 'Email required' }), {\n      status: 400,\n      headers: { 'Content-Type': 'application\u002Fjson' },\n    });\n  }\n\n  await addToNewsletter(email);\n  return new Response(JSON.stringify({ success: true }), { status: 200 });\n};\n```\n\n### Example 3: React Component as Island\n\n```tsx\n\u002F\u002F src\u002Fcomponents\u002FSearchBox.tsx\nimport { useState } from 'react';\n\nexport default function SearchBox() {\n  const [query, setQuery] = useState('');\n  const [results, setResults] = useState([]);\n\n  async function search(e: React.FormEvent) {\n    e.preventDefault();\n    const data = await fetch(`\u002Fapi\u002Fsearch?q=${query}`).then(r => r.json());\n    setResults(data);\n  }\n\n  return (\n    \u003Cform onSubmit={search}>\n      \u003Cinput value={query} onChange={e => setQuery(e.target.value)} \u002F>\n      \u003Cbutton type=\"submit\">Search\u003C\u002Fbutton>\n      \u003Cul>{results.map(r => \u003Cli key={r.id}>{r.title}\u003C\u002Fli>)}\u003C\u002Ful>\n    \u003C\u002Fform>\n  );\n}\n```\n\n```astro\n---\nimport SearchBox from '..\u002Fcomponents\u002FSearchBox.tsx';\n---\n\u003C!-- Hydrated immediately — this island is interactive -->\n\u003CSearchBox client:load \u002F>\n```\n\n## Best Practices\n\n- ✅ Keep most components as static `.astro` files — only hydrate what must be interactive\n- ✅ Use content collections for all Markdown\u002FMDX content — you get type safety and auto-validation\n- ✅ Prefer `client:visible` over `client:load` for below-the-fold components to reduce initial JS\n- ✅ Use `import.meta.env` for environment variables — prefix public vars with `PUBLIC_`\n- ✅ Add `\u003CViewTransitions \u002F>` from `astro:transitions` for smooth page navigation without a full SPA\n- ❌ Don't use `client:load` on every component — this defeats Astro's performance advantage\n- ❌ Don't put secrets in `.astro` frontmatter that gets used in client-facing templates\n- ❌ Don't skip `getStaticPaths` for dynamic routes in static mode — builds will fail\n\n## Security & Safety Notes\n\n- Frontmatter code in `.astro` files runs server-side only and is never exposed to the browser.\n- Use `import.meta.env.PUBLIC_*` only for non-sensitive values. Private env vars (no `PUBLIC_` prefix) are never sent to the client.\n- When using SSR mode, validate all `Astro.request` inputs before database queries or API calls.\n- Sanitize any user-supplied content before rendering with `set:html` — it bypasses auto-escaping.\n\n## Common Pitfalls\n\n- **Problem:** JavaScript from a React\u002FVue component doesn't run in the browser\n  **Solution:** Add a `client:` directive (`client:load`, `client:visible`, etc.) — without it, components render as static HTML only.\n\n- **Problem:** `getStaticPaths` data is stale after content updates during dev\n  **Solution:** Astro's dev server watches content files — restart if changes to `content\u002Fconfig.ts` are not reflected.\n\n- **Problem:** `Astro.props` type is `any` — no autocomplete\n  **Solution:** Define a `Props` interface or type in the frontmatter and Astro will infer it automatically.\n\n- **Problem:** CSS from a `.astro` component bleeds into other components\n  **Solution:** Styles in `.astro` `\u003Cstyle>` tags are automatically scoped. Use `:global()` only when intentionally targeting children.\n\n## Related Skills\n\n- `@sveltekit` — When you need a full-stack framework with reactive UI (vs Astro's content focus)\n- `@nextjs-app-router-patterns` — When you need a React-first full-stack framework\n- `@tailwind-patterns` — Styling Astro sites with Tailwind CSS\n- `@progressive-web-app` — Adding PWA capabilities to an Astro site\n\n",{"name":5,"risk":48,"tags":54,"tools":57,"author":59,"source":35,"category":30,"date_added":60,"description":7},[5,34,42,33,55,39,56,46],"content","mdx",[58,38,47],"claude","suhaibjanjua","2026-03-18","main","015422534a7457348a313b6381f0255d3364eb8c","cli-tool\u002Fcomponents\u002Fskills\u002Fweb-development\u002Fastro",0,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates","https:\u002F\u002Fgithub.com\u002FMishit18","2026-11-12 18:26:48",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add Mishit18\u002Fclaude-code-templates --skill astro",{"tool":74,"command":75},"bunx","bunx skills add Mishit18\u002Fclaude-code-templates --skill astro",{"tool":77,"command":78},"pnpm","pnpm dlx skills add Mishit18\u002Fclaude-code-templates --skill astro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-development\u002Fastro\u002FSKILL.md",true,[],[83,110,135,163,190,214],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":92,"publishedAt":49},"01M6R4ARN4W2VZRDERDTMN1KP0","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[91],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[93,94,95,96,97,30,98,44,99,100,101,102,103,104,105,106,107,32,108,109],"web artifacts builder","web","artifacts","artifacts builder","builder","css","react","routing","state management","state","file","Tailwind","use","single-file","ui components","for","single",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":114,"sourceHtmlUrl":115,"categories":116,"keywords":121,"publishedAt":49},"01M6R45GXREM5DP8T08MAC788H","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[117,120],{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[122,123,124,30,125,126,94,127,128,129,130,131,132,133,134,31,108],"testing","webapp testing","webapp","screenshots","playwright","debugging","toolkit","browser","ui","logs","applications","behavior","local",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":139,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":49},"01M6R2GYJ470X8EB7R58V0B68K","think-tank","Run a Virtual Think Tank — a structured multi-persona debate — before planning or making architectural\u002Fdesign\u002Fstrategic decisions. Use this skill whenever the user is about to plan a system, make a technology choice, evaluate trade-offs, decide on an approach, or faces any decision where multiple perspectives would sharpen the outcome. Also trigger when the user says \"think tank\", \"debate this\", \"perspectives on\", \"trade-offs\", \"should I use X or Y\", \"help me decide\", \"before we plan\", or asks for pros\u002Fcons of competing approaches. This skill should run BEFORE any implementation planning begins — it produces a structured analysis that feeds into better plans.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fthink-tank\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fthink-tank\u002FSKILL.md",[],[143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162],"think tank","think","design","run","feeds","analysis","persona","plan","sharpen","virtual","decision","choice","decide","perspectives","outcome","me","debate","make","trade-offs","when",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":167,"sourceHtmlUrl":168,"categories":169,"keywords":173,"publishedAt":49},"01M6R2FSR55AVRFA9YZ8SC2GZG","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[170],{"categoryNo":171,"categoryName":172,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[174,175,176,177,178,179,180,181,182,183,184,185,186,187,31,108,188,162,189],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":194,"categories":195,"keywords":196,"publishedAt":49},"01M6R2FK42ZZ4HJTJVVK9WJBBP","ship-learn-next","Transform learning content (like YouTube transcripts, articles, tutorials) into actionable implementation plans using the Ship-Learn-Next framework. Use when user wants to turn advice, lessons, or educational content into concrete action steps, reps, or a learning quest.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fship-learn-next\u002FSKILL.md",[],[197,198,199,200,41,201,202,203,105,204,205,206,207,208,209,210,211,212,213,162],"learn","ship learn next","ship","next","learning","read","write","advice","implementation","youtube","plans","quest","transform","actionable","action","lessons","youtube transcripts",{"skillNo":215,"name":216,"nameZh":6,"description":217,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":87,"licenseFileUrl":218,"sourceHtmlUrl":219,"categories":220,"keywords":227,"publishedAt":49},"01M6R2088G1RHDA5MDX16HASRB","slack-gif-creator","Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like \"make me a GIF of X doing Y for Slack.\"","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FSKILL.md",[221,224],{"categoryNo":222,"categoryName":223,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000005","邮件与沟通",{"categoryNo":225,"categoryName":226,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[228,229,230,175,231,232,233,234,180,105,158,187,160,235,236,108,237,162],"slack gif creator","slack","gif","validation","Tools","constraints","Animation","Utilities","concepts","request"]