본문으로 건너뛰기
cccskills
무료GitHub에 공개

astro-pro

Idiomatic Astro: islands architecture, content collections, SSR/SSG choices, and performance-first builds. Use when writing, reviewing, or structuring Astro sites.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Astro Pro

Overview

Astro's bet — zero JavaScript by default, interactivity as opt-in "islands" — makes it the right tool for content-heavy sites that must be fast. Professional Astro means designing around islands deliberately (what actually needs JS?), using content collections for type-safe content, choosing rendering modes per route, and treating performance budgets as architecture.

The through-line: ship HTML, hydrate surgically, and let the build do the work.

When to use

  • Building or reviewing Astro sites (marketing, docs, blogs, content platforms).
  • Choosing islands vs frameworks, or SSR vs SSG per route.
  • Structuring content (collections, MDX, i18n).
  • Integrating React/Vue/Svelte components as islands.
  • Optimizing Astro build output and runtime performance.

Core concepts

  • Islands architecture. Static HTML everywhere; interactive components become islands with client:load / client:visible / client:idle / client:media directives. The directive choice is the performance design: client:visible for below-fold widgets, client:idle for non-critical, client:load only for above-fold interactive essentials.
  • Zero JS by default. If a component doesn't need interactivity, it ships as pure HTML/CSS. Audit regularly: every island is a JavaScript cost — justify each one.
  • Content collections. Typed, validated content (src/content/blog/*.md + Zod schemas) — the CMS-without-a-CMS. Schema validation at build time catches malformed content before deploy. getCollection with filtering/sorting replaces ad-hoc file reading.
  • Rendering modes per route. SSG (default, prerendered) for content; SSR (output: 'server', per-route prerender exports) for personalized/dynamic; hybrid for the common mix. Choose per route based on data freshness needs, not globally.
  • Framework components as islands. React/Vue/Svelte/Preact components drop in via integrations — but each framework adds its runtime to the island's cost. Prefer Astro components for static parts; reserve framework islands for genuinely interactive widgets.
  • View transitions. Native-feeling page transitions with minimal code (<ViewTransitions />) — but test with islands: persistent islands (transition:persist) keep state across navigations.

Practical workflow

  1. Scaffold: npm create astro@latest with TypeScript (strict), the framework integration(s) you actually need, and Tailwind/CSS approach decided up front.
  2. Design the island map. For each page, list interactive elements and assign directives. Default: no directive (static). Document why each island exists.
  3. Model content. Content collections with Zod schemas for every content type; relationships via references; draft handling via schema fields, not folder hacks.
  4. Choose rendering per route. Prerender content pages; SSR for authenticated/personalized; set prerender exports explicitly so the choice is visible in code.
  5. Build the data layer. Astro.glob/collections at build time for static; server endpoints (src/pages/api/) or server islands for dynamic bits; cache aggressively at the edge/CDN.
  6. Enforce performance. Lighthouse CI on PRs (performance budget: e.g., < 200KB JS total, LCP < 2.5s); audit islands quarterly — static-ify what stopped needing interactivity.

Island decision guide:

Above-fold interactive (cart button, search)  → client:load
Below-fold widget (comments, reviews)          → client:visible
Non-critical enhancement (tooltips, animations)→ client:idle
Viewport-conditional (mobile menu)             → client:media="(max-width: 720px)"
Static content, tabs via <details>, etc.      → no directive (pure HTML/CSS)

Common pitfalls

  • client:load everywhere. Hydrating the whole page defeats Astro's purpose — you've built a slower SPA. Default to static; justify each island and its directive.
  • Framework islands for static content. A React component rendering static marketing copy ships React for no reason. Astro components render to pure HTML — use them.
  • Fetching in islands what the page could provide. Client-side fetching for data available at build/request time — worse performance and loading states. Pass data via props from Astro frontmatter.
  • Ignoring the build-time data story. getCollection at build time is fast and type-safe; runtime CMS fetches in SSG pages that never change waste the static advantage — or worse, doing it client-side per visitor.
  • View-transition state bugs. Islands re-mounting on navigation losing state unexpectedly. Understand transition:persist and test navigations, not just initial loads.
  • No content schema. Markdown files with inconsistent frontmatter breaking builds or rendering. Zod schemas on collections catch this at build time — use them from day one.
  • Treating Astro like Next.js. Reaching for SSR-everything and client-heavy patterns. Astro's strengths are static-first and islands — design with them, not against them.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Master 1Password: vaults, Watchtower, passkeys, SSH agent, CLI, and family/team administration. Use when getting full value from 1Password personally or administering it for others.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills242026년 10월 10일 업데이트

Create 3D visuals with modeling, texturing, lighting, rendering, and optimization for web and product.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills242026년 10월 10일 업데이트

Create 3D web experiences: scene setup, models, materials, lighting, animation, scroll-driven scenes, and performance budgets. Use when adding 3D to websites beyond basic demos.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills242026년 10월 10일 업데이트

Writing abstracts that get papers read — structured content, the 5-sentence core, and journal-specific constraints.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills242026년 10월 10일 업데이트

Learn effectively from courses and academies: choosing programs, studying actively, and converting courses into skills. Use when investing time/money in structured learning.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills242026년 10월 10일 업데이트

Audit designs for accessibility with WCAG checklists covering color, type, focus, motion, and content.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills242026년 10월 10일 업데이트

aicodedecode의 스킬 모두 보기

이 스킬의 문제 신고