Skip to content
Back to skills

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
developmenttypescriptreactvuenodeapiperformance

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 26, 2026

npx -y skills add nhan03bit/ultrathink --skill astro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Astro?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Astro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nhan03bit-astro/badge)](https://www.skillsdirectory.com/skills/nhan03bit-astro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.