Astro - Advanced Developer
/install astro-advanced
Astro Advanced Skill
This skill provides production-grade guidance for Astro projects — from initial scaffolding through deployment, caching, and performance tuning. It covers the patterns that actually matter in real projects and the mistakes that actually happen.
How to use this skill
- Read this file first for the core workflow and decision tree.
- Consult the reference files in
references/for deep dives on specific topics:references/setup-and-structure.md— Project creation, file structure, config, adaptersreferences/rendering-modes.md— SSG vs SSR vs Hybrid, when to use each, caching strategiesreferences/seo.md— Meta tags, Open Graph, JSON-LD, sitemaps, canonical URLsreferences/islands-and-vue.md— Island architecture, client directives, Vue/React/Svelte integrationreferences/content-and-data.md— Content collections, data fetching, dynamic routesreferences/deployment.md— Adapters, static hosts, serverless, environment variablesreferences/performance.md— Image optimization, bundle analysis, hydration controlreferences/troubleshooting.md— Common errors and fixes organized by symptom
Core decision tree
When helping with an Astro project, follow this sequence:
1. Identify the rendering strategy first
This is the single most important decision in any Astro project. Everything else flows from it.
- Pure static site (blog, docs, marketing)? → SSG (default). No adapter needed.
- Needs user-specific data, auth, or real-time content? → SSR with an adapter.
- Mostly static but a few dynamic pages? → Hybrid mode. Set
output: 'static'in config and useexport const prerender = falseon dynamic pages.
2. Pick the right adapter
Only needed for SSR or hybrid:
- Vercel →
@astrojs/vercel(serverless or edge) - Netlify →
@astrojs/netlify - Cloudflare Pages →
@astrojs/cloudflare - Self-hosted Node →
@astrojs/node(standalone or middleware)
3. Set up integrations
Add only what you need. Each integration is a potential build-time dependency:
# Common additions
npx astro add vue # Vue islands
npx astro add tailwind # Tailwind CSS
npx astro add mdx # MDX support
npx astro add sitemap # Auto sitemap generation
4. Establish content strategy
- Few pages, hand-authored → Regular
.astropages in/src/pages - Blog/docs with structured content → Content collections with Zod schemas
- CMS-driven → Fetch at build time (SSG) or runtime (SSR)
5. Apply SEO from the start
Don't bolt it on later. See references/seo.md for the full pattern, but at minimum:
- Create a reusable
\x3CSEO>component for head tags - Set up canonical URLs
- Add structured data (JSON-LD) for key pages
- Generate sitemap via
@astrojs/sitemap
Key patterns to always follow
Layout pattern
Every page should use a layout. Layouts handle \x3Chtml>, \x3Chead>, and shared chrome:
---
// src/layouts/Base.astro
import SEO from '../components/SEO.astro';
const { title, description } = Astro.props;
---
\x3Chtml lang="en">
\x3Chead>
\x3CSEO title={title} description={description} />
\x3C/head>
\x3Cbody>
\x3Cnav>\x3C!-- shared nav -->\x3C/nav>
\x3Cslot />
\x3Cfooter>\x3C!-- shared footer -->\x3C/footer>
\x3C/body>
\x3C/html>
Island pattern
Static by default. Only hydrate what needs interactivity:
\x3C!-- Static: renders HTML, ships zero JS -->
\x3CCard title="Hello" />
\x3C!-- Interactive: hydrates on load -->
\x3CCounter client:load />
\x3C!-- Interactive: hydrates when visible (lazy) -->
\x3CImageGallery client:visible />
The #1 Astro mistake: forgetting client:* on a component that needs interactivity,
then wondering why click handlers don't work.
SSR caching pattern
SSR without caching is just a slow website. Always pair SSR with a caching strategy:
// In an SSR endpoint or page
return new Response(JSON.stringify(data), {
headers: {
"Cache-Control": "public, s-maxage=60, stale-while-revalidate=300",
"Content-Type": "application/json"
}
});
When things go wrong
Read references/troubleshooting.md for a symptom-based guide. The top 5 issues:
- "Component doesn't do anything" → Missing
client:*directive - Build fails after adding integration → Version mismatch, check
package.json - SSR returns 500 → Missing adapter or wrong
outputmode in config - Broken links after deploy → Base path not set, or trailing slash mismatch
- Hydration mismatch errors → Server/client HTML differs (conditional rendering, dates, randomness)
File output conventions
When generating Astro project files:
- Always include the frontmatter fence (
---) even if empty - Use
.astroextension for Astro components and pages - Place pages in
src/pages/, components insrc/components/, layouts insrc/layouts/ - Use TypeScript in frontmatter when the project uses TS
- Include
astro.config.mjswith only the integrations and settings actually needed
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install astro-advanced - After installation, invoke the skill by name or use
/astro-advanced - Provide required inputs per the skill's parameter spec and get structured output
What is Astro - Advanced Developer?
Comprehensive skill for building, configuring, and troubleshooting Astro projects. Use this skill whenever the user mentions Astro, .astro files, Astro confi... It is an AI Agent Skill for Claude Code / OpenClaw, with 138 downloads so far.
How do I install Astro - Advanced Developer?
Run "/install astro-advanced" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Astro - Advanced Developer free?
Yes, Astro - Advanced Developer is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Astro - Advanced Developer support?
Astro - Advanced Developer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Astro - Advanced Developer?
It is built and maintained by EncryptShawn (@encryptshawn); the current version is v1.0.0.