Skip to content
Back to skills

Using Astro

ASecurity

Use when building or editing an Astro site. Triggers on `.astro` files, `astro:content` imports, `Astro.props`, `client:` hydration directives, and prompts about pages, layouts, MDX, content collections, image optimization, or view transitions, even when the user doesn't say 'Astro'.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsjavascriptgojavareactvue

Works with

  • cli

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add xonovex/platform --skill using-astro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Using Astro?

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

Security grade badge for Using Astro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xonovex-using-astro/badge)](https://www.skillsdirectory.com/skills/xonovex-using-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
---
name: using-astro
description: "Use when building or editing an Astro site. Triggers on `.astro` files, `astro:content` imports, `Astro.props`, `client:` hydration directives, and prompts about pages, layouts, MDX, content collections, image optimization, or view transitions, even when the user doesn't say 'Astro'."
---

# Astro Coding Guidelines

Build Astro pages as static HTML and hydrate only the components that need client interaction.

## Essentials

- **Islands architecture** - Default to static HTML, hydrate only where needed, see [references/islands-architecture.md](references/islands-architecture.md)
- **Project structure** - Use `src/pages`, `src/components`, `src/layouts`, `src/content`, see [references/project-structure.md](references/project-structure.md)
- **Content collections** - Use `astro:content` with schema-validated frontmatter; schema design in **using-zod**, see [references/content-collections.md](references/content-collections.md)
- **Framework components** - Integrate React, Vue, or other frameworks, see [references/components.md](references/components.md)
- **Accessibility** - Use semantic HTML, alt text, ARIA as needed, see [references/accessibility.md](references/accessibility.md)

## Gotchas

- Default rendering is server-side / static: components don't ship JavaScript unless explicitly hydrated with `client:*` directives
- Content Collections enforce a Zod schema at build time; an invalid frontmatter field fails the build, not the page
- `Astro.glob()` is build-time and scans at compile; runtime data needs `getStaticPaths` or endpoints
- Framework components (React/Vue/Svelte) only hydrate on the directive you pick: `client:load`, `client:idle`, `client:visible`, `client:media`, `client:only`

## Progressive disclosure

- Read [references/islands-architecture.md](references/islands-architecture.md) - Load when deciding which components need client-side JavaScript
- Read [references/project-structure.md](references/project-structure.md) - Load when organizing files and directories
- Read [references/content-collections.md](references/content-collections.md) - Load when managing blog posts, docs, or structured content
- Read [references/components.md](references/components.md) - Load when integrating React, Vue, or other framework components
- Read [references/accessibility.md](references/accessibility.md) - Load when adding keyboard navigation or screen reader support

Files in this skill

  • SKILL.md2.4 KB
  • eval-output.json2.4 KB
  • eval-trigger.json5.5 KB
  • moon.yml86 B
  • references/accessibility.md527 B
  • references/components.md306 B
  • references/content-collections.md482 B
  • references/islands-architecture.md721 B
  • references/project-structure.md731 B
  • sources.json882 B

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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