사용 방법
- 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
- 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
- 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/incluud/astro-agent-skills --skill astro-best-practices시작 전 확인
- 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
- 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.
Astro Best Practices
Use this skill as the baseline when designing, implementing, or reviewing Astro work. It translates Astro-specific architectural guidance into portable instructions that can be applied across agents.
Core Principles
- prefer static generation when request-time rendering is not necessary
- keep client-side JavaScript minimal
- use framework islands only for real interactivity
- preserve clear project structure and predictable routing
- optimize for accessibility and maintainability, not just output parity
Architecture Defaults
Prefer .astro first
- use
.astrocomponents for static and mostly static UI - reach for React, Vue, or another framework only when local state or client-side behavior is genuinely needed
- keep interactive islands small and leaf-like
Use hydration deliberately
client:visiblefor deferred UIclient:idlefor lower-priority enhancementclient:loadfor critical immediate interactivity onlyclient:onlyonly when skipping server rendering is intentional
Default away from hydrating broad layout regions.
Keep the project shape predictable
Typical structure:
src/
components/
layouts/
pages/
content/
styles/
assets/
public/Do not invent novel folder structure without a clear project-specific reason.
Content and Data
- use content collections for structured content
- define schemas instead of accepting loose frontmatter
- fetch server-side data in Astro frontmatter unless there is a clear reason not to
- keep data flow obvious and close to the component or page that owns it
Accessibility
- use semantic landmarks such as
header,nav,main,article, andfooter - ensure keyboard access for all interactive controls
- provide meaningful labels and accessible names
- maintain correct heading hierarchy
- use appropriate image alt text
- preserve visible focus states
- treat color contrast as a non-negotiable baseline
Performance
- use
astro:assetsor the project’s chosen image pipeline intentionally - prevent layout shift by providing image dimensions or stable containers
- avoid unnecessary client hydration
- keep CSS and JavaScript scoped to the features that need them
- prefer simple server-rendered markup over client complexity
Styling
- default to scoped component styles unless the project has a defined styling system
- use CSS custom properties for reusable tokens
- favor maintainable layout patterns over one-off utility sprawl when the project is not already utility-first
- keep responsive behavior intentional and testable
Review Checklist
Before finalizing Astro work, check:
- is any hydrated code unnecessary
- does the HTML stay semantic
- is the route/layout structure still clear
- are content schemas strong enough
- is the result accessible by keyboard and assistive tech
- does the implementation match the existing project conventions



