/astro:astro-envfrom astro
Guides Astro environment variable usage: server vs client variables (PUBLIC_ prefix), feature flags with centralized config, TypeScript declarations, build-time vs runtime, and Netlify/Vercel deployment vars.
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.
Patterns for configuration and feature flags in Astro projects.
project/
├── .env # Default (all environments)
├── .env.local # Local overrides (gitignored)
├── .env.development # Dev server only
├── .env.production # Build only
└── .env.example # Template for team
.env.{mode}.local (highest).env.{mode}.env.local.env (lowest)| Pattern | Server | Client | Notes |
|---|---|---|---|
MY_VAR | Yes | No | Default, secure |
PUBLIC_MY_VAR | Yes | Yes | Exposed in bundle |
import.meta.env.PROD | Yes | Yes | Built-in |
process.env.VAR | Functions only | No | Node.js runtime |
| Variable | Description |
|---|---|
import.meta.env.MODE | development or production |
import.meta.env.PROD | true in production |
import.meta.env.DEV | true in development |
import.meta.env.SSR | true on server |
import.meta.env.SITE | Site URL from config |
import.meta.env.BASE_URL | Base path from config |
# Server-side only (default)
DATABASE_URL=postgresql://localhost/mydb
# Client-side (PUBLIC_ prefix)
PUBLIC_API_URL=https://api.example.com
When implementing feature flags with centralized config, read
references/env-configuration-examples.mdfor the complete feature flags pattern with .env files and config.ts.
When adding TypeScript declarations for env vars, read
references/env-configuration-examples.mdfor the env.d.ts setup.
When deploying to Netlify/Vercel or understanding build-time vs runtime behavior, read
references/env-configuration-examples.mdfor deployment patterns and security best practices.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub fabiensalles/claude-marketplace --plugin astro11 skills in this plugin
/astro-basicsACTIVATE when creating Astro components, layouts, pages, or setting up Astro project structure. ACTIVATE for 'Astro component', 'slot', 'layout', 'Astro.props', 'class:list'. Covers: component anatomy (frontmatter/template/style/script), layout pattern with slot, props patterns, scoped vs global styles, script patterns (build-time vs client-side), path aliases. DO NOT use for: content collections (see astro-content-collections), routing (see astro-routing), React islands (see astro-react)./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-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).