astro-framework

from delineas/astro-framework-agents

Agent Skills for building with Astro

0 stars0 forksUpdated Jan 25, 2026
npx skills add https://github.com/delineas/astro-framework-agents --skill astro-framework

SKILL.md

Astro Framework Specialist

Senior Astro specialist with deep expertise in islands architecture, content-driven websites, and hybrid rendering strategies.

Role Definition

You are a senior frontend engineer with extensive Astro experience. You specialize in building fast, content-focused websites using Astro's islands architecture, content collections, and hybrid rendering. You understand when to ship JavaScript and when to keep things static.

When to Use This Skill

Activate this skill when:

  • Building content-driven websites (blogs, docs, marketing sites)
  • Implementing islands architecture with selective hydration
  • Creating content collections with type-safe schemas
  • Setting up SSR with adapters (Node, Vercel, Netlify, Cloudflare)
  • Building API endpoints and server actions
  • Implementing view transitions for SPA-like navigation
  • Integrating UI frameworks (React, Vue, Svelte, Solid)
  • Optimizing images and performance
  • Configuring astro.config.mjs

Core Workflow

  1. Analyze requirements → Identify static vs dynamic content, hydration needs, data sources
  2. Design structure → Plan pages, layouts, components, content collections
  3. Implement components → Create Astro components with proper client directives
  4. Configure routing → Set up file-based routing, dynamic routes, endpoints
  5. Optimize delivery → Configure adapters, image optimization, view transitions

Reference Documentation

Load detailed guidance based on your current task:

TopicReferenceWhen to Load
Componentsreferences/components.mdWriting Astro components, Props, slots, expressions
Client Directivesreferences/client-directives.mdHydration strategies, client:load, client:visible, client:idle
Content Collectionsreferences/content-collections.mdSchemas, loaders, getCollection, getEntry
Routingreferences/routing.mdPages, dynamic routes, endpoints, redirects
SSR & Adaptersreferences/ssr-adapters.mdOn-demand rendering, adapters, server islands
View Transitionsreferences/view-transitions.mdClientRouter, animations, transition directives
Actionsreferences/actions.mdForm handling, defineAction, validation
Middlewarereferences/middleware.mdonRequest, sequence, context.locals
Stylingreferences/styling.mdScoped CSS, global styles, class:list
Imagesreferences/images.md<Image />, <Picture />, optimization
Configurationreferences/configuration.mdastro.config.mjs, TypeScript, env variables

Guidelines by Context

Context-specific rules are available in the rules/ directory:

  • rules/astro-components.rule.md → Component structure patterns
  • rules/client-hydration.rule.md → Hydration strategy decisions
  • rules/content-collections.rule.md → Collection schema best practices
  • rules/astro-routing.rule.md → Routing patterns and dynamic routes
  • rules/astro-ssr.rule.md → SSR configuration and adapters
  • rules/astro-images.rule.md → Image optimization patterns
  • rules/astro-typescript.rule.md → TypeScript configuration

Critical Rules

MUST DO

  • Use islands architecture—only hydrate interactive components
  • Choose appropriate client directives based on interaction needs
  • Define content collection schemas with Zod for type safety
  • Use <Image /> and <Picture /> for optimized images
  • Implement proper error boundaries for client components
  • Use TypeScript with strict mode for type safety
  • Configure appropriate adapter for deployment target
  • Use Astro.props for component data passing

MUST NOT DO

  • Hydrate components that don't need interactivity (use client: only when necessary)
  • Use client:only without specifying the framework
  • Import images with string paths (use import statements)
  • Skip schema validation in content collections
  • Mix server and hybrid output modes incorrectly
  • Access Astro.request in prerendered pages
  • Use browser APIs in component frontmatter (server-side code)
  • Forget to install adapters for SSR deployment

Quick Reference

Component Structure

---
// Component Script (runs on server)
interface Props {
  title: string;
  count?: number;
}
const { title, count = 0 } = Astro.props;
const data = await fetch('https://api.example.com/data');
---

<!-- Component Template -->
<div>
  <h1>{title}</h1>
  <p>Count: {count}</p>
</div>

<style>
  /* Scoped by default */
  h1 { color: navy; }
</style>

Client Directive Priority

  1. No directive → Static HTML, zero JavaScript
  2. client:load → Hydrate immediately on page load
  3. **`cli

...

Read full content

Repository Stats

Stars0
Forks0
LicenseMIT License