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

astro

Use when creating or modifying .astro/.tsx files, configuring astro.config.mjs, working with Content Collections, or when TypeScript or build errors occur.

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

holger1411/astrodeck스타 80(GitHub 80 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md4.6 KB
  • LEARNINGS.md370 B

SKILL.md(원문)

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

Astro Framework Skill

Domain

Astro 6+ patterns, Islands Architecture, Content Collections, routing, build

KPIs

MetricTargetMeasurement
TypeScript Errors0npm run check (astro check — 0 errors)
Build Warnings0npm run build 2>&1 | grep -i "warn" | wc -l
Build Time<3snpm run build timing output
Deprecated patterns / relative imports0npm run check:kpis

Rules

ClientRouter (NOT ViewTransitions)

---
// ✅ Astro 6
import { ClientRouter } from 'astro:transitions';
---
<head>
  <ClientRouter />
</head>

// ❌ Deprecated
import { ViewTransitions } from 'astro:transitions';

Zod Import

// ✅ Astro 6
import { z } from 'astro/zod';

// ❌ Deprecated
import { z } from 'astro:content';
import { z } from 'astro:schema';

Content Collections

// src/content.config.ts
import { defineCollection } from 'astro:content';
import { z } from 'astro/zod';
import { glob } from 'astro/loaders';

const blog = defineCollection({
  loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
  schema: z.object({
    title: z.string(),
    description: z.string(),
    pubDate: z.coerce.date(),
    draft: z.boolean().optional(),
  }),
});

export const collections = { blog };
---
// Usage in pages
import { getCollection } from 'astro:content';
const posts = await getCollection('blog');
---

.astro vs .tsx Decision

Use .astro when...Use .tsx when...
Static contentClient-side interactivity needed
Server-side renderingState management needed
Layout componentsEvent handlers needed
Section componentsForms with validation
SEO/meta componentsComplex UI (dialogs, dropdowns)

Client Directives

<!-- Load immediately (above-the-fold interactivity) -->
<Component client:load />

<!-- Load when visible (below-the-fold) -->
<Component client:visible />

<!-- Load on idle (non-critical UI) -->
<Component client:idle />

<!-- Only on a specific platform -->
<Component client:only="react" />

Rule of thumb: client:visible > client:idle > client:load. Use client:load only for immediately visible interactive elements.

Props Interface Pattern

---
interface Props {
  title: string;
  description?: string;
  variant?: 'default' | 'compact' | 'wide';
  class?: string;
}

const {
  title,
  description,
  variant = 'default',
  class: className,
} = Astro.props;
---

Slot Composition

<!-- Named slots -->
<section>
  <div class="header">
    <slot name="header" />
  </div>
  <div class="content">
    <slot />  <!-- Default slot -->
  </div>
  <div class="footer">
    <slot name="footer" />
  </div>
</section>

astro.config.mjs Patterns

import { defineConfig } from 'astro/config';
import tailwindcss from '@tailwindcss/vite';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
  site: 'https://example.com',
  integrations: [react(), sitemap()],
  vite: {
    plugins: [tailwindcss()],
  },
});

Import Alias

Always use @/ (configured in tsconfig.json):

// ✅
import Hero from '@/components/sections/Hero.astro';
import { Button } from '@/components/ui/button';

// ❌
import Hero from '../../components/sections/Hero.astro';

Non-Negotiable

These rules always apply — even under time pressure, even when "it works anyway":

  • No ViewTransitions. Always ClientRouter. "But the docs say ViewTransitions" — those docs are outdated; Astro 6 uses ClientRouter.
  • No z from astro:content or astro:schema. Always import { z } from 'astro/zod'. Other imports compile but break Content Collections.
  • No commit with TypeScript errors. "It's just a type error, it still works" — type errors in .astro files become runtime bugs.
  • Always the @/ import alias. Relative imports (../../) work, but every file move breaks them. @/ is refactoring-safe.
  • No client:load without good reason. client:visible or client:idle are almost always better. "I need it immediately" is rarely true for below-the-fold elements.

The convention guard hook (.claude/hooks/guard-conventions.mjs) blocks the deprecated patterns automatically and warns on relative imports.

Before Applying

Read LEARNINGS.md in this directory to avoid known anti-patterns.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Use when creating or modifying any UI element visible to the user, reviewing HTML markup, adding interactive elements, or when Lighthouse Accessibility drops below 90.

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

holger1411/astrodeck802026년 9월 5일 업데이트

Use when creating or editing pages, blog posts, or content files, adding meta tags, or when Lighthouse SEO drops below 90.

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

holger1411/astrodeck802026년 9월 5일 업데이트

qa

무료

Use when completing any task (final validation step), running audits, preparing for deployment, or when ESLint/TypeScript/build errors occur.

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

holger1411/astrodeck802026년 9월 5일 업데이트

readme

무료

Use when starting work on an AstroDeck project, needing to understand the project structure, or looking up available components, sections, and layouts.

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

holger1411/astrodeck802026년 9월 5일 업데이트

tailwind

무료

Use when writing or reviewing any CSS class, changing colors, modifying globals.css, or when hardcoded colors or inline styles are detected.

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

holger1411/astrodeck802026년 9월 5일 업데이트

ui-design

무료

Use when creating or modifying any visible UI element, adjusting spacing or typography, reviewing visual consistency, or when Lighthouse Performance drops below 90.

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

holger1411/astrodeck802026년 9월 5일 업데이트

holger1411의 스킬 모두 보기

이 스킬의 문제 신고