--- name: astro-v2 description: "Astro Web Framework workflow skill. Use this skill when the user needs Build content-focused websites with Astro \u2014 zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off." version: "0.0.1" category: frontend tags: ["astro", "ssg", "ssr", "islands", "content", "markdown", "mdx", "performance"] complexity: advanced risk: safe tools: ["cursor", "codex-cli", "claude-code", "gemini-cli", "opencode"] source: community author: "suhaibjanjua" date_added: "2026-04-19" date_updated: "2026-04-25" --- # Astro Web Framework ## Overview This public intake copy packages `plugins/antigravity-awesome-skills/skills/astro` from `https://github.com/sickn33/antigravity-awesome-skills` into the native Omni Skills editorial shape without hiding its origin. Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow. This intake keeps the copied upstream files intact and uses the `external_source` block in `metadata.json` plus `ORIGIN.md` as the provenance anchor for review. # Astro Web Framework Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: How It Works, Security & Safety Notes, Common Pitfalls, Limitations. ## When to Use This Skill Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request. - Use when building a blog, documentation site, marketing page, or portfolio - Use when performance and Core Web Vitals are the top priority - Use when the project is content-heavy with Markdown or MDX files - Use when you want SSG (static) output with optional SSR for dynamic routes - Use when the user asks about .astro files, Astro.props, content collections, or client: directives - Use when the request clearly matches the imported source intent: Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support. ## Operating Table | Situation | Start here | Why it matters | | --- | --- | --- | | First-time use | `metadata.json` | Confirms repository, branch, commit, and imported path through the `external_source` block before touching the copied workflow | | Provenance review | `ORIGIN.md` | Gives reviewers a plain-language audit trail for the imported source | | Workflow execution | `SKILL.md` | Starts with the smallest copied file that materially changes execution | | Supporting context | `SKILL.md` | Adds the next most relevant copied source file without loading the entire package | | Handoff decision | `## Related Skills` | Helps the operator switch to a stronger native skill when the task drifts | ## Workflow This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow. 1. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task. 2. Read the overview and provenance files before loading any copied upstream support files. 3. Load only the references, examples, prompts, or scripts that materially change the outcome for the current request. 4. Execute the upstream workflow while keeping provenance and source boundaries explicit in the working notes. 5. Validate the result against the upstream expectations and the evidence you can point to in the copied files. 6. Escalate or hand off to a related skill when the work moves out of this imported workflow's center of gravity. 7. Before merge or closure, record what was used, what changed, and what the reviewer still needs to verify. ### Imported Workflow Notes #### Imported: Overview Astro 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. #### Imported: How It Works ### Step 1: Project Setup ```bash npm create astro@latest my-site cd my-site npm install npm run dev ``` Add integrations as needed: ```bash npx astro add tailwind # Tailwind CSS npx astro add react # React component support npx astro add mdx # MDX support npx astro add sitemap # Auto sitemap.xml npx astro add vercel # Vercel SSR adapter ``` Project structure: ``` src/ pages/ ← File-based routing (.astro, .md, .mdx) layouts/ ← Reusable page shells components/ ← UI components (.astro, .tsx, .vue, etc.) content/ ← Type-safe content collections (Markdown/MDX) styles/ ← Global CSS public/ ← Static assets (copied as-is) astro.config.mjs ← Framework config ``` ### Step 2: Astro Component Syntax `.astro` files have a code fence at the top (server-only) and a template below: ```astro --- // src/components/Card.astro // This block runs on the server ONLY — never in the browser interface Props { title: string; href: string; description: string; } const { title, href, description } = Astro.props; ---

{title}

{description}

``` ### Step 3: File-Based Pages and Routing ``` src/pages/index.astro → / src/pages/about.astro → /about src/pages/blog/[slug].astro → /blog/:slug (dynamic) src/pages/blog/[...path].astro → /blog/* (catch-all) ``` Dynamic route with `getStaticPaths`: ```astro --- // src/pages/blog/[slug].astro export async function getStaticPaths() { const posts = await getCollection('blog'); return posts.map(post => ({ params: { slug: post.slug }, props: { post }, })); } const { post } = Astro.props; const { Content } = await post.render(); ---

{post.data.title}

``` ### Step 4: Content Collections Content collections give you type-safe access to Markdown and MDX files: ```typescript // src/content/config.ts import { z, defineCollection } from 'astro:content'; const blog = defineCollection({ type: 'content', schema: z.object({ title: z.string(), date: z.coerce.date(), tags: z.array(z.string()).default([]), draft: z.boolean().default(false), }), }); export const collections = { blog }; ``` ```astro --- // src/pages/blog/index.astro import { getCollection } from 'astro:content'; const posts = (await getCollection('blog')) .filter(p => !p.data.draft) .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()); --- ``` ### Step 5: Islands — Selective Hydration By default, UI framework components render to static HTML with no JS. Use `client:` directives to hydrate: ```astro --- import Counter from '../components/Counter.tsx'; // React component import VideoPlayer from '../components/VideoPlayer.svelte'; --- ``` ### Step 6: Layouts ```astro --- // src/layouts/BaseLayout.astro interface Props { title: string; description?: string; } const { title, description = 'My Astro Site' } = Astro.props; --- {title}
...
``` ```astro --- // src/pages/about.astro import BaseLayout from '../layouts/BaseLayout.astro'; ---

About Us

Welcome to our company...

``` ### Step 7: SSR Mode (On-Demand Rendering) Enable SSR for dynamic pages by setting an adapter: ```javascript // astro.config.mjs import { defineConfig } from 'astro/config'; import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ output: 'hybrid', // 'static' | 'server' | 'hybrid' adapter: vercel(), }); ``` Opt individual pages into SSR with `export const prerender = false`. ## Examples ### Example 1: Ask for the upstream workflow directly ```text Use @astro-v2 to handle . Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer. ``` **Explanation:** This is the safest starting point when the operator needs the imported workflow, but not the entire repository. ### Example 2: Ask for a provenance-grounded review ```text Review @astro-v2 against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why. ``` **Explanation:** Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection. ### Example 3: Narrow the copied support files before execution ```text Use @astro-v2 for . Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding. ``` **Explanation:** This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default. ### Example 4: Build a reviewer packet ```text Review @astro-v2 using the copied upstream files plus provenance, then summarize any gaps before merge. ``` **Explanation:** This is useful when the PR is waiting for human review and you want a repeatable audit packet. ### Imported Usage Notes #### Imported: Examples ### Example 1: Blog with RSS Feed ```typescript // src/pages/rss.xml.ts import rss from '@astrojs/rss'; import { getCollection } from 'astro:content'; export async function GET(context) { const posts = await getCollection('blog'); return rss({ title: 'My Blog', description: 'Latest posts', site: context.site, items: posts.map(post => ({ title: post.data.title, pubDate: post.data.date, link: `/blog/${post.slug}/`, })), }); } ``` ### Example 2: API Endpoint (SSR) ```typescript // src/pages/api/subscribe.ts import type { APIRoute } from 'astro'; export const POST: APIRoute = async ({ request }) => { const { email } = await request.json(); if (!email) { return new Response(JSON.stringify({ error: 'Email required' }), { status: 400, headers: { 'Content-Type': 'application/json' }, }); } await addToNewsletter(email); return new Response(JSON.stringify({ success: true }), { status: 200 }); }; ``` ### Example 3: React Component as Island ```tsx // src/components/SearchBox.tsx import { useState } from 'react'; export default function SearchBox() { const [query, setQuery] = useState(''); const [results, setResults] = useState([]); async function search(e: React.FormEvent) { e.preventDefault(); const data = await fetch(`/api/search?q=${query}`).then(r => r.json()); setResults(data); } return (
setQuery(e.target.value)} />
    {results.map(r =>
  • {r.title}
  • )}
); } ``` ```astro --- import SearchBox from '../components/SearchBox.tsx'; --- ``` ## Best Practices Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution. - ✅ Keep most components as static .astro files — only hydrate what must be interactive - ✅ Use content collections for all Markdown/MDX content — you get type safety and auto-validation - ✅ Prefer client:visible over client:load for below-the-fold components to reduce initial JS - ✅ Use import.meta.env for environment variables — prefix public vars with PUBLIC_ - ✅ Add from astro:transitions for smooth page navigation without a full SPA - ❌ Don't use client:load on every component — this defeats Astro's performance advantage - ❌ Don't put secrets in .astro frontmatter that gets used in client-facing templates ### Imported Operating Notes #### Imported: Best Practices - ✅ Keep most components as static `.astro` files — only hydrate what must be interactive - ✅ Use content collections for all Markdown/MDX content — you get type safety and auto-validation - ✅ Prefer `client:visible` over `client:load` for below-the-fold components to reduce initial JS - ✅ Use `import.meta.env` for environment variables — prefix public vars with `PUBLIC_` - ✅ Add `` from `astro:transitions` for smooth page navigation without a full SPA - ❌ Don't use `client:load` on every component — this defeats Astro's performance advantage - ❌ Don't put secrets in `.astro` frontmatter that gets used in client-facing templates - ❌ Don't skip `getStaticPaths` for dynamic routes in static mode — builds will fail ## Troubleshooting ### Problem: The operator skipped the imported context and answered too generically **Symptoms:** The result ignores the upstream workflow in `plugins/antigravity-awesome-skills/skills/astro`, fails to mention provenance, or does not use any copied source files at all. **Solution:** Re-open `metadata.json`, `ORIGIN.md`, and the most relevant copied upstream files. Check the `external_source` block first, then restate the provenance before continuing. ### Problem: The imported workflow feels incomplete during review **Symptoms:** Reviewers can see the generated `SKILL.md`, but they cannot quickly tell which references, examples, or scripts matter for the current task. **Solution:** Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it. ### Problem: The task drifted into a different specialization **Symptoms:** The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better. **Solution:** Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind. ## Related Skills - `@00-andruia-consultant` - Use when the work is better handled by that native specialization after this imported skill establishes context. - `@00-andruia-consultant-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context. - `@10-andruia-skill-smith` - Use when the work is better handled by that native specialization after this imported skill establishes context. - `@10-andruia-skill-smith-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context. ## Additional Resources Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding. | Resource family | What it gives the reviewer | Example path | | --- | --- | --- | | `references` | copied reference notes, guides, or background material from upstream | `references/n/a` | | `examples` | worked examples or reusable prompts copied from upstream | `examples/n/a` | | `scripts` | upstream helper scripts that change execution or validation | `scripts/n/a` | | `agents` | routing or delegation notes that are genuinely part of the imported package | `agents/n/a` | | `assets` | supporting assets or schemas copied from the source package | `assets/n/a` | ### Imported Reference Notes #### Imported: Security & Safety Notes - Frontmatter code in `.astro` files runs server-side only and is never exposed to the browser. - Use `import.meta.env.PUBLIC_*` only for non-sensitive values. Private env vars (no `PUBLIC_` prefix) are never sent to the client. - When using SSR mode, validate all `Astro.request` inputs before database queries or API calls. - Sanitize any user-supplied content before rendering with `set:html` — it bypasses auto-escaping. #### Imported: Common Pitfalls - **Problem:** JavaScript from a React/Vue component doesn't run in the browser **Solution:** Add a `client:` directive (`client:load`, `client:visible`, etc.) — without it, components render as static HTML only. - **Problem:** `getStaticPaths` data is stale after content updates during dev **Solution:** Astro's dev server watches content files — restart if changes to `content/config.ts` are not reflected. - **Problem:** `Astro.props` type is `any` — no autocomplete **Solution:** Define a `Props` interface or type in the frontmatter and Astro will infer it automatically. - **Problem:** CSS from a `.astro` component bleeds into other components **Solution:** Styles in `.astro` `