/astro:astro-basicsfrom astro
Covers Astro component anatomy, layout patterns with slots, props, scoped vs global styles, build-time vs client-side scripts, and path aliases for Astro 5.x projects.
Ships in astro. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Core patterns for Astro 5.x development based on project conventions.
src/
├── components/ # Reusable .astro components
├── content.config.ts # Collection schemas (Zod) — see astro-content-collections
├── content/ # Content collections (markdown, yaml)
├── layouts/ # Page layouts (BaseLayout, etc.)
├── pages/ # File-based routing
│ ├── index.astro
│ └── [...slug].astro # Dynamic routes
├── styles/ # Global styles (SCSS or Tailwind)
└── utils/ # Helper functions
public/ # Static assets (copied to dist/)
---
// 1. Imports
import Layout from '@layouts/Layout.astro';
// 2. Props interface
interface Props {
title: string;
description?: string;
}
// 3. Data fetching (runs at build time)
const posts = await getCollection('blog');
// 4. Props destructuring
const { title, description = '' } = Astro.props;
---
<!-- 5. Template -->
<Layout title={title}>
<h1>{title}</h1>
<slot />
</Layout>
<!-- 6. Scoped styles (optional) -->
<style>
h1 { color: var(--accent-color); }
</style>
<!-- 7. Client-side script (optional) -->
<script>
console.log('Runs in browser');
</script>
When implementing layouts, props patterns, named slots, style scoping, or script patterns, read
references/component-patterns.mdfor complete BaseLayout, slot, style, and script examples.
When setting up path aliases (tsconfig.json), read
references/component-patterns.mdfor the standard alias configuration.
| Pattern | Usage |
|---|---|
Astro.props | Access component props |
Astro.url | Current URL object |
Astro.params | Route parameters |
Astro.slots.has('name') | Check if slot provided |
<slot /> | Render children |
class:list={[]} | Conditional classes |
set:html={html} | Render raw HTML |
define:vars={{}} | Pass vars to script |
is:global | Global styles |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fabiensalles/claude-marketplace --plugin astro11 skills in this plugin
/astro-content-collectionsACTIVATE when working with Astro content collections, markdown/MDX files, YAML frontmatter, Zod schemas for content, or content-driven pages. ACTIVATE for 'getCollection', 'getEntry', 'defineCollection', 'content collection', 'content.config.ts'. Covers: collection schema definition with Zod, loader-based collections, querying/filtering collections, dynamic routes with getStaticPaths, YAML meta files, MDX with components, collection references. DO NOT use for: routing logic (see astro-routing), general Astro components (see astro-basics)./astro-envACTIVATE when working with environment variables, feature flags, or runtime configuration in Astro. ACTIVATE for 'import.meta.env', '.env', 'PUBLIC_', 'feature flag'. Covers: server vs client variables (PUBLIC_ prefix), feature flags pattern with centralized config, TypeScript env declarations, build-time vs runtime variables, Netlify/Vercel deployment vars. DO NOT use for: general Astro setup, content configuration.Other plugins' skills for the same job
/astro-i18nACTIVATE when implementing multilingual Astro sites, language switching, translated routes, or translation patterns. ACTIVATE for 'i18n', 'multilingual', 'language switch', 'hreflang', 'translate route', 'getLang'. Covers: prefix-based routing (fr default, /en prefix), route mapping between languages, translation dictionary without external library, multilingual content collections, hreflang SEO tags, language switcher component. DO NOT use for: Astro routing basics (see astro-routing), SEO tags (see astro-seo).