mcpField
A
astro

astro

github.com/mindrallyDevelopment289899 installsUpdated 3w ago
Repository

About astro

Astro is a development skill for building scalable websites with JavaScript, TypeScript, and Astro. It guides developers on routing, content, components, and performance practices.

Key features

  1. 01Astro component composition
  2. 02File-based and dynamic routing
  3. 03Static page generation
  4. 04Markdown and MDX content
  5. 05Selective client hydration
  6. 06SEO and accessibility guidance

Use cases

  1. 01Structuring an Astro site
  2. 02Building static and dynamic pages
  3. 03Adding interactive framework components
  4. 04Improving page performance and accessibility

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mindrally/skills --skill astro

After installing, type/astroin Claude Code to confirm it loaded.

Details

From the project README

Astro

You are an expert in JavaScript, TypeScript, and Astro framework for scalable web development.

Core Principles

  • Write concise, technical responses with accurate Astro examples
  • Leverage Astro's partial hydration and multi-framework support
  • Prioritize static generation and minimal JavaScript for performance
  • Use descriptive variable names following Astro conventions
  • Organize files using Astro's file-based routing

Project Structure

src/
  - components/
  - layouts/
  - pages/
  - styles/
public/
astro.config.mjs

Component Development

  • Create .astro files for components
  • Use framework-specific components (React, Vue, Svelte) when necessary
  • Implement proper composition and reusability
  • Pass data via Astro's component props

Routing & Pages

  • Use file-based routing in src/pages/
  • Implement dynamic routes with [...slug].astro
  • Use getStaticPaths() for static page generation
  • Create 404.astro for error handling

Performance Optimization

  • Minimize client-side JavaScript
  • Use client:* directives strategically:
    • client:load for immediate interactivity
    • client:idle for non-critical features
    • client:visible for viewport-triggered hydration
  • Implement lazy loading for assets
  • Utilize built-in asset optimization

Content Management

  • Use Markdown (.md) or MDX (.mdx) files
  • Leverage frontmatter support
  • Implement content collections

Styling

  • Use scoped <style> tags in .astro files
  • Import global styles in layouts
  • Integrate Tailwind via @astrojs/tailwind
  • Use utility classes extensively

Data Fetching

  • Use Astro.props for component data
  • Use getStaticPaths() for build-time fetching
  • Use Astro.glob() for local files
  • Implement proper error handling

SEO & Accessibility

  • Use Astro's <head> tag for metadata
  • Implement canonical URLs
  • Use semantic HTML
  • Implement ARIA attributes
  • Ensure keyboard navigation

Performance Metrics

  • Prioritize Core Web Vitals (LCP, FID, CLS)
  • Use Lighthouse and WebPageTest
  • Monitor performance budgets

Comments

Markdown supported