casoon/ai-agent-config/astro-architecture
Claude Code and agent skill by casoon/ai-agent-config
- community
Checking that the SKILL.md file is still in the repository.
Astro v6 architecture — rendering modes (SSG/SSR/hybrid), routing, Content Collections Loader API, Zod v4 schemas, hydration directives, API routes, and Node 22+ setup. Use when creating or modifying .astro pages and layouts, configuring astro.config.mjs, setting up or querying content collections, choosing rendering strategy, or hitting v5→v6 migration errors (`entry.slug`, `entry.render()`, `getEntryBySlug`, `src/content/config.ts` all changed in v6). Load this skill before touching any .astro file or astro config.
Install
npx vskill@latest install casoon/ai-agent-config/astro-architectureSKILL.md
The same SKILL.md was published earlier as casoon/ai-agent-config/astro-architecture.
Astro architecture
Goals
- Server-first, static-friendly by default.
- Minimize shipped client-side JavaScript.
- Use islands intentionally, not by default.
- Be explicit about SSG vs SSR vs hybrid per route.
Structure
src/pagesfor route entry points — keep files slim.src/layoutsfor page shells.src/componentsfor reusable UI.src/contentfor structured editorial content.publicfor static assets that skip the module graph.
Rules
- Prefer
.astrocomponents for presentational UI. - Use framework components (Svelte, React, Vue) only where client-side interaction is actually needed.
- Move logic into utilities or domain modules — keep route files thin.
- Reuse layouts and content schemas instead of duplicating page logic.
- Cover SEO-critical metadata on every public page.
Astro v6 API
Content Collections — Loader API
Rendering content
Zod v4 syntax
Removed / renamed APIs (v5 → v6)
| Old | New | |
|---|---|---|
Astro.glob() | import.meta.glob() | |
ViewTransitions | ClientRouter | |
getEntryBySlug() | getEntry() | |
post.render() | render(post) | |
entry.slug | entry.id | |
emitESMImage | emitImageMetadata | |
src/content/config.ts | src/content.config.ts | |
handleForms prop on ClientRouter | default behavior |
Component patterns
Astro component
Hydration directives
client:load— immediate (navbar, theme toggle).client:idle— browser idle (secondary features).client:visible— in viewport (footer widgets, comments).- omit directive — static render only.
API route
Configuration
astro.config.mjs
Node requirement
Astro v6 requires Node >= 22.12.0. Older versions are not supported.
New stable features (promoted from experimental)
- Live Content Collections — real-time data without rebuild.
- Content Security Policy — automatic CSP headers.
- Vite Environment API — dev server matches production runtime.
Astro 6.1 additions
Sharp image service config
Codec-specific encoder options (only for astro/assets/services/sharp, not noop):
Per-image quality prop still takes precedence over config defaults. Cloudflare Workers does not support Sharp — use noop there.
SmartyPants options object
i18n fallbackRoutes in integrations
When fallbackType: 'rewrite' is set, integrations can read fallback routes via the astro:routes:resolved hook:
Notable 6.1 bugfixes
- CSRF
checkOriginreadsX-Forwarded-Protobehind reverse proxies. - Cloudflare
server:deferdev crash fixed. - Middleware HMR: changes detected in dev server.
- Warning when Vite 8 is hoisted (Astro requires Vite 7).
ClientRouterskips animations when the browser supplies a native transition.
Review checklist
- Is hydration avoidable for this component?
- Is content modeled as a collection with a schema, not ad-hoc?
- Is the component boundary clear (server-rendered vs island)?
- Are SEO basics covered — title, description, canonical, OG?
- Is the rendering mode of the page explicit (static vs on-demand)?
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/astro-architecture/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/casoon/ai-agent-config/astro-architecture)