[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ARDFN0KXRRJJA6RFCR7XNV":3,"skill-same:01M7ARDFN0KXRRJJA6RFCR7XNV":62},{"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":41,"commitSha":42,"skillDirectory":43,"forksCount":14,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7ARDFN0KXRRJJA6RFCR7XNV","astro",null,"Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown\u002FMDX support.","GongYuanCaiJi\u002Fdsh-claude-code-templates","GongYuanCaiJi","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F129952120?v=4","01M7AK39Q4W3VPF7C1K8M58BFX","劉昱廷 Yu-Ting Liu","01M7AK39QPS2RAJKRQY0EPQJPZ",0,"MIT","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fastro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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","# 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",{"name":5,"risk":24,"tags":25,"tools":33,"author":37,"source":38,"category":39,"date_added":40,"description":7},"safe",[5,26,27,28,29,30,31,32],"ssg","ssr","islands","content","markdown","mdx","performance",[34,35,36],"claude","cursor","gemini","suhaibjanjua","community","frontend","2026-03-18","main","51493f354fd03e3f941d4df7fd64c0b8c7a2632d","skills\u002Fweb-development\u002Fastro","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi","漏洞研究、根因分析、黑箱測試｜做 AI agent 工具｜Vulnerability research, root-cause analysis, AI agent tooling","2026-08-16 02:24:07",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add GongYuanCaiJi\u002Fdsh-claude-code-templates --skill astro",{"tool":54,"command":55},"bunx","bunx skills add GongYuanCaiJi\u002Fdsh-claude-code-templates --skill astro",{"tool":57,"command":58},"pnpm","pnpm dlx skills add GongYuanCaiJi\u002Fdsh-claude-code-templates --skill astro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fastro\u002FSKILL.md",true,[],[63,70,79,86,93,100],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7ARMYTZ5D4B7N5SKFXV345V","zapier-make-patterns","No-code automation democratizes workflow building. Zapier and Make (formerly Integromat) let non-developers automate business processes without writing code. But no-code doesn't mean no-complexity - these platforms have their own patterns, pitfalls, and breaking points.  This skill covers when to use which platform, how to build reliable automations, and when to graduate to code-based solutions. Key insight: Zapier optimizes for simplicity and integrations (7000+ apps), Make optimizes for power","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fzapier-make-patterns\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":75,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7ARMX1BVNEAR98SBANMDF2V","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7ARMPR4RQ417MG1HMPGNQHH","workflow-automation","Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost money and angry customers. With it, workflows resume exactly where they left off.  This skill covers the platforms (n8n, Temporal, Inngest) and patterns (sequential, parallel, orchestrator-worker) that turn brittle scripts into production-grade automation.  Key insight: The platforms make different tradeoffs. n8n optimizes for accessibility","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fworkflow-automation\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7ARMHBERDMKGDMV7K6MQ6YP","trigger-dev","Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Ftrigger-dev\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7ARME0A7KFT330Q2H25HE2B","slack-automation","Automate Slack workspace operations including messaging, search, channel management, and reaction workflows through Composio's Slack toolkit.","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fslack-automation\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7ARM8D87V18WDG0GEZS11ZT","planning-with-files","Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage. Use when starting complex tasks, multi-step projects, research tasks, or when the user mentions planning, organizing work, tracking progress, or wants structured output.","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fplanning-with-files\u002FSKILL.md",[],[]]