본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)48k · #3828

astro

하는 일

빠르고 콘텐츠 중심의 웹사이트를 만드는 도구입니다. 브라우저에 최소한의 JavaScript만 보내 페이지를 가볍고 빠르게 만듭니다. 여러 프로그래밍 기술을 함께 사용할 수 있습니다.

사용하는 경우

  • ✓블로그, 문서 사이트, 포트폴리오를 만들 때.
  • ✓웹사이트 속도와 성능을 우선할 때.
  • ✓많은 텍스트와 콘텐츠 파일을 다룰 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/astro/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/astro/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Astro로 블로그 웹사이트를 어떻게 만들 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

콘텐츠와 사이트 구조를 `.astro` 파일에 작성합니다. Astro는 모든 것을 일반 HTML로 컴파일하고, 필요할 때만 상호작용하는 부분에 JavaScript를 보냅니다. 콘텐츠와 페이지를 자동으로 정리합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Astro Web Framework

Overview

Astro is a web framework designed for content-rich websites — blogs, docs, portfolios, marketing sites, and e-commerce. Its core innovation is the Islands Architecture: by default, Astro ships zero JavaScript to the browser. Interactive components are selectively hydrated as isolated "islands." Astro supports React, Vue, Svelte, Solid, and other UI frameworks simultaneously in the same project, letting you pick the right tool per component.

When to Use This Skill

  • Use when building a blog, documentation site, marketing page, or portfolio
  • Use when performance and Core Web Vitals are the top priority
  • Use when the project is content-heavy with Markdown or MDX files
  • Use when you want SSG (static) output with optional SSR for dynamic routes
  • Use when the user asks about .astro files, Astro.props, content collections, or client: directives

How It Works

Step 1: Project Setup

npm create astro@latest my-site
cd my-site
npm install
npm run dev

Add integrations as needed:

npx astro add tailwind        # Tailwind CSS
npx astro add react           # React component support
npx astro add mdx             # MDX support
npx astro add sitemap         # Auto sitemap.xml
npx astro add vercel          # Vercel SSR adapter

Project structure:

src/
  pages/          ← File-based routing (.astro, .md, .mdx)
  layouts/        ← Reusable page shells
  components/     ← UI components (.astro, .tsx, .vue, etc.)
  content/        ← Type-safe content collections (Markdown/MDX)
  styles/         ← Global CSS
public/           ← Static assets (copied as-is)
astro.config.mjs  ← Framework config

Step 2: Astro Component Syntax

.astro files have a code fence at the top (server-only) and a template below:

---
// src/components/Card.astro
// This block runs on the server ONLY — never in the browser
interface Props {
  title: string;
  href: string;
  description: string;
}

const { title, href, description } = Astro.props;
---

<article class="card">
  <h2><a href={href}>{title}</a></h2>
  <p>{description}</p>
</article>

<style>
  /* Scoped to this component automatically */
  .card { border: 1px solid #eee; padding: 1rem; }
</style>

Step 3: File-Based Pages and Routing

src/pages/index.astro          → /
src/pages/about.astro          → /about
src/pages/blog/[slug].astro    → /blog/:slug (dynamic)
src/pages/blog/[...path].astro → /blog/* (catch-all)

Dynamic route with getStaticPaths:

---
// src/pages/blog/[slug].astro
export async function getStaticPaths() {
  const posts = await getCollection('blog');
  return posts.map(post => ({
    params: { slug: post.slug },
    props: { post },
  }));
}

const { post } = Astro.props;
const { Content } = await post.render();
---

<h1>{post.data.title}</h1>
<Content />

Step 4: Content Collections

Content collections give you type-safe access to Markdown and MDX files:

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

const blog = defineCollection({
  type: 'content',
  schema: z.object({
    title: z.string(),
    date: z.coerce.date(),
    tags: z.array(z.string()).default([]),
    draft: z.boolean().default(false),
  }),
});

export const collections = { blog };
---
// src/pages/blog/index.astro
import { getCollection } from 'astro:content';

const posts = (await getCollection('blog'))
  .filter(p => !p.data.draft)
  .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
---

<ul>
  {posts.map(post => (
    <li>
      <a href={`/blog/${post.slug}`}>{post.data.title}</a>
      <time>{post.data.date.toLocaleDateString()}</time>
    </li>
  ))}
</ul>

Step 5: Islands — Selective Hydration

By default, UI framework components render to static HTML with no JS. Use client: directives to hydrate:

---
import Counter from '../components/Counter.tsx';  // React component
import VideoPlayer from '../components/VideoPlayer.svelte';
---

<!-- Static HTML — no JavaScript sent to browser -->
<Counter initialCount={0} />

<!-- Hydrate immediately on page load -->
<Counter initialCount={0} client:load />

<!-- Hydrate when the component scrolls into view -->
<VideoPlayer src="/demo.mp4" client:visible />

<!-- Hydrate only when browser is idle -->
<Analytics client:idle />

<!-- Hydrate only on a specific media query -->
<MobileMenu client:media="(max-width: 768px)" />

…

자주 묻는 질문

Astro의 ‘아일랜드(islands)’란 무엇인가요?

아일랜드는 나머지 페이지에 영향을 주지 않고 자체 JavaScript를 독립적으로 로드하는 상호작용 컴포넌트입니다. 이 방식이 사이트를 빠르게 유지하는 데 도움이 됩니다.

Astro에서 React나 Vue를 쓸 수 있나요?

네, Astro는 같은 프로젝트 안에서 React, Vue, Svelte 같은 여러 라이브러리의 컴포넌트를 사용할 수 있게 합니다.

Astro는 콘텐츠를 어떻게 다루나요?

Astro에는 ‘Content Collections’라는 기능이 있어 Markdown과 MDX 같은 콘텐츠 파일을 정리하고 안전하게 검증합니다.

상세 정보

작성자의 원본 설명

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#3828
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬