terminalskills/skills/astro
- community
Checking that the SKILL.md file is still in the repository.
Assists with building content-driven websites using Astro's island architecture. Use when creating static sites, blogs, documentation, or marketing pages that ship zero JavaScript by default. Trigger words: astro, static site, island architecture, content collections, SSG, hybrid rendering, astro components.
Install
npx vskill@latest install terminalskills/skills/astroSKILL.md
Astro
Overview
Astro is a web framework for building content-driven websites that ships zero JavaScript by default. Its island architecture hydrates only interactive components, achieving excellent Lighthouse scores while supporting React, Vue, Svelte, or any UI framework where interactivity is needed.
Instructions
- When starting a project, run
npm create astro@latest, thennpx astro add react(orvue,svelte,tailwind,mdx) to install integrations. Astro 6 and 7 need a recent Node 22 (seecompatibility); set it in.nvmrcand in the host's build settings. - When creating pages, use file-based routing in
src/pages/with.astro,.md, or.mdxfiles, and organize shared structure insrc/layouts/. - When adding interactivity, use client directives on framework components: prefer
client:visibleorclient:idleoverclient:loadsince most components do not need immediate hydration. - When managing content, define collections in
src/content.config.ts(not the oldsrc/content/config.ts) with aloader(glob()orfile()fromastro/loaders) and a Zod schema (import { z } from 'astro/zod'), then query withgetCollection()andgetEntry(). Entries are identified byentry.id, and you render one withrender(entry)imported fromastro:content(the oldentry.slugandentry.render()no longer exist). - When choosing rendering modes, default to static (SSG) for marketing and content pages, add a server adapter (
npx astro add node,vercel,netlify,cloudflare) for on-demand pages, and mark individual pages withexport const prerender = false. There is nooutput: "hybrid"any more;output: "server"makes every page on-demand unless it setsprerender = true. - When optimizing images, use the
<Image>component fromastro:assetsfor automatic format conversion (WebP/AVIF), resizing, and lazy loading instead of raw<img>tags. - When adding page transitions, add
<ClientRouter />fromastro:transitionsto the shared<head>for SPA-like navigation.<ViewTransitions />was renamed in Astro 5 and no longer exists: a build that imports it fails with"ViewTransitions" is not exported. - When integrating UI frameworks, install the appropriate integration (
@astrojs/react,@astrojs/vue,@astrojs/svelte) and use Astro components for static content, reaching for framework components only when interactivity is required.
A minimal collection that builds on Astro 7 (verified):
A shared layout with page transitions (verified to build on Astro 7):
Examples
Example 1: Build a blog with Content Collections
User request: "Create an Astro blog with type-safe Markdown content"
Actions:
- Define a blog Content Collection with Zod schema for frontmatter (title, date, tags, author)
- Create dynamic route
src/pages/blog/[id].astrowithgetStaticPaths() - Build blog index page querying
getCollection("blog")with sorting - Add layout with SEO meta tags, navigation, and View Transitions
Output: A statically generated blog with validated content, clean URLs, and smooth page transitions.
Example 2: Add interactive components to a static site
User request: "Add a React search component to my Astro documentation site"
Actions:
- Install
@astrojs/reactintegration - Create the React search component with state and event handling
- Add the component to the page with
client:idledirective - Pass static data as props from the Astro page frontmatter
Output: A documentation site that is fully static except for the interactive search island.
Guidelines
- Use Astro components (
.astro) for static content; only use React/Vue/Svelte when interactivity is needed. - Default to
client:visibleorclient:idleoverclient:loadfor hydration directives. - Define Content Collections with strict Zod schemas to catch content errors at build time. Astro 6 moved to Zod 4:
.default()values must match the output type, andzfromastro:contentis deprecated in favour ofastro/zod. - Astro 6 removed automatic support for legacy (v4) collections; migrate to the Content Layer API above rather than relying on
legacy.collectionsBackwardsCompat. - Astro 7 uses Vite 8, a Rust compiler and
compressHTML: 'jsx'by default, reservessrc/fetch.ts, and removed@astrojs/db. Read the upgrade guide at docs.astro.build before bumping a major version. - Use
astro:assets<Image>over raw<img>tags for automatic optimization. - Keep layouts thin with shared
<head>, navigation, and footer; put page-specific content in pages. - Keep the default static output for marketing pages and add
export const prerender = falseonly on personalized or dynamic pages (this needs an adapter). - Enable View Transitions for SPA-like navigation without shipping a router.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/astro/SKILL.md
Popularity
- Repository stars
- 157
- Repository forks
- 21
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/terminalskills/skills/astro)