Back to skills
SKILL.md
Astro
ASecurity> The web framework for content-driven websites — islands architecture, zero JS by default.
- 2 stars
- 0 votes
- 0 copies
- 3 views
- Added October 26, 2026
Works with
Security analysis
100/100npx -y skills add nhan03bit/ultrathink --skill astro --agent claude-codeAre you the author of Astro?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nhan03bit-astro)# Astro
> The web framework for content-driven websites — islands architecture, zero JS by default.
## When to Use
- Content-heavy sites (blogs, docs, marketing, portfolios)
- Static-first with selective interactivity (islands)
- Multi-framework pages (React + Svelte + Vue on same page)
- Maximum performance with minimal client JS
## Core Patterns
### Project Structure
```
src/
pages/ # File-based routing (.astro, .md, .mdx)
layouts/ # Reusable page layouts
components/ # .astro, .tsx, .svelte, .vue components
content/ # Content collections (type-safe markdown)
styles/ # Global styles
public/ # Static assets (copied as-is)
astro.config.mjs
```
### Astro Components
```astro
---
// Server-side (runs at build time, not in browser)
const { title, items } = Astro.props;
const response = await fetch("https://api.example.com/data");
const data = await response.json();
---
<section>
<h2>{title}</h2>
{items.map((item) => <p>{item.name}</p>)}
<!-- Island: only this component ships JS to the browser -->
<ReactCounter client:load />
<HeavyWidget client:visible /> <!-- Lazy hydrate on scroll -->
</section>
<style>
/* Scoped by default */
section { padding: 2rem; }
</style>
```
### Content Collections
```typescript
// src/content/config.ts
import { defineCollection, z } from "astro:content";
const blog = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
date: z.date(),
tags: z.array(z.string()).default([]),
draft: z.boolean().default(false),
}),
});
export const collections = { blog };
```
### Key Features
- **Islands**: `client:load`, `client:idle`, `client:visible`, `client:media`, `client:only`
- **View Transitions**: `<ViewTransitions />` for SPA-like page transitions
- **Server endpoints**: `src/pages/api/*.ts` for API routes
- **SSR adapters**: `@astrojs/node`, `@astrojs/vercel`, `@astrojs/cloudflare`
- **Integrations**: `@astrojs/tailwind`, `@astrojs/mdx`, `@astrojs/sitemap`, `@astrojs/image`
- **Type-safe**: Full TypeScript, typed content collections, typed API routes
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.