[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFZATNTRQ047G7E95V72Q5":3,"skill-same:01M6AFZATNTRQ047G7E95V72Q5":86},{"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":62,"commitSha":63,"skillDirectory":64,"forksCount":65,"repositoryHtmlUrl":66,"repositoryHomepageUrl":67,"ownerHtmlUrl":68,"ownerBlogUrl":69,"ownerDescription":70,"updatedAt":71,"install":72,"resources":85},"01M6AFZATNTRQ047G7E95V72Q5","astro",null,"Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown\u002FMDX support.","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33418,"MIT","https:\u002F\u002Fgithub.com\u002Fdavila7\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],"ZeRO","2026","with","multi","ssg","community","build","default","cursor","markdown","frontend","content","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.\"\nmetadata:\n  category: frontend\n  risk: safe\n  source: community\n  date_added: \"2026-03-18\"\n  author: suhaibjanjua\n  tags: [astro, ssg, ssr, islands, content, markdown, mdx, performance]\n  tools: [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,"metadata":54,"description":7},{"risk":48,"tags":55,"tools":58,"author":60,"source":34,"category":39,"date_added":61},[5,33,42,56,40,38,57,46],"islands","mdx",[59,37,47],"claude","suhaibjanjua","2026-03-18","main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fweb-development\u002Fastro",3926,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-12 14:45:56",{"source":8,"skillName":5,"commands":73,"prompt":83,"zipAvailable":84},[74,77,80],{"tool":75,"command":76},"npx","npx skills add davila7\u002Fclaude-code-templates --skill astro",{"tool":78,"command":79},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill astro",{"tool":81,"command":82},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill astro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-development\u002Fastro\u002FSKILL.md",true,[],[87,116,143,174,205,229],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":96,"publishedAt":49},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[93],{"categoryNo":94,"categoryName":95,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[97,98,99,100,101,102,103,104,105,106,107,31,108,109,110,111,112,113,114,115],"scoring","pool","wealthville pool scoring","liquidity","which","for","exit","now","use","when","reduce","record","track","verdict","evm","solana","how","public","look",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":123,"publishedAt":49},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[122],{"categoryNo":94,"categoryName":95,"taxonomyType":21,"taxonomyTypeDesc":22},[124,125,126,127,128,129,130,131,132,133,134,106,135,136,137,138,139,140,141,142],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":156,"publishedAt":49},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[149,152,153],{"categoryNo":150,"categoryName":151,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":94,"categoryName":95,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":154,"categoryName":155,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000033","数据分析师",[157,158,159,160,161,162,163,102,164,165,166,167,168,169,170,105,171,172,106,173],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","access","database","query",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":178,"licenseFileUrl":179,"sourceHtmlUrl":180,"categories":181,"keywords":183,"publishedAt":49},"01M6AFY6F7CC2BBZP1QD6VTNVC","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\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[182],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[184,185,186,187,188,189,190,191,192,193,39,194,195,196,44,197,198,199,200,201,202,203,102,204],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","ui","Tools","file","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":206,"name":207,"nameZh":6,"description":208,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":178,"licenseFileUrl":209,"sourceHtmlUrl":210,"categories":211,"keywords":216,"publishedAt":49},"01M6AFWF33SFV9Z3SF4PEEE4BF","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\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[212,215],{"categoryNo":213,"categoryName":214,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[217,218,219,220,221,185,222,39,194,223,224,225,226,102,227,31,228],"webapp testing","testing","webapp","browser","playwright","applications","debugging","toolkit","logs","screenshots","local","behavior",{"skillNo":230,"name":231,"nameZh":6,"description":232,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":178,"licenseFileUrl":233,"sourceHtmlUrl":234,"categories":235,"keywords":241,"publishedAt":49},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[236,239,240],{"categoryNo":237,"categoryName":238,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":94,"categoryName":95,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[242,243,244,245,246,247,248,249,187,250,196,135,40,251,252,253,254,169,255,106,256,257,258,259,260,113,261],"discernment nudge","nudge","interpretation","help","run","reasoning","data","writing","lookup","review","conversation","short","up","invoke","you","analysis","claims","argument","assemble","recommendations"]