Command Palette

Search for a command to run...

Назад к скиллам
скилл № 80633

frontend-astro-architecture

Use when the user asks about Astro, building a content site with Astro islands, .astro files, content collections, file-based routing, static vs server output…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить frontend-astro-architecture в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Astro Architecture

Purpose

Build content-focused websites with Astro's zero-JS-by-default approach. Use islands for interactive parts, content collections for type-safe markdown, and adapters for deployment flexibility.

Agent Protocol

Trigger

Exact user phrases: "Astro", "Astro architecture", "Astro islands", "Astro component", "Astro page", "Astro content collection", "Astro SSG", "Astro SSR", ".astro file".

Input Context

Before activating, verify:

  • package.json has astro dependency.
  • Whether the project uses SSG, SSR, or hybrid mode.
  • Which framework integrations (React, Vue, Svelte, Solid) are configured.
  • Content collection structure in src/content/.

Output Artifact

No file output. Produces component patterns, island strategies, content collection schemas, and deployment config as text.

Response Format

Component code: .astro file template. Island patterns: client directive usage. Content: Zod schema + query.

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • Pages are .astro files with frontmatter separated by ---.
  • Interactive components use client:* directives (load, idle, visible, media, only).
  • Content collections have Zod schemas in src/content/config.ts.
  • Images optimized via astro:assets Image/Picture components.
  • Adapter configured for target deployment (node/deno/cloudflare/netlify).
  • Zero JS by default — only hydrated islands ship framework JS.

Max Response Length

Component code: 20 lines. Island examples: 10 lines each.

Component Architecture / Decision Trees

Architecture Options

Approach Trade-off When to Use
Pure .astro components Zero JS, fully static Content pages, headers, layout shells
Framework islands via client:* JS for interactivity Widgets, forms, interactive UI
MDX components Markdown + component interop Blogs with embedded interactive content
Server endpoints (.ts) JSON API, no HTML rendering API routes, form handlers
Middleware Per-request processing Auth, redirects, logging

Decision Tree: Rendering Mode

Is the site mostly static content (blog, docs, marketing)?
  ├── Yes -> output: 'static' (SSG)
  └── No -> Are some routes dynamic?
       ├── Yes -> output: 'hybrid' (SSG + SSR per route)
       └── No -> output: 'server' (full SSR)

Decision Tree: Component Framework

Does the component need client-side interactivity?
  ├── No -> .astro component (zero JS)
  └── Yes -> Which framework?
       ├── Already in project -> Use it
       ├── Need smallest runtime -> Preact or SolidJS
       ├── Need rich ecosystem -> React
       └── Need template syntax -> Vue or Svelte

Decision Tree: Hydration Timing

When does the user need this component?
  ├── Immediately visible and interactive -> client:load
  ├── Visible but not urgent -> client:idle
  ├── Below the fold -> client:visible
  ├── Only on certain screen sizes -> client:media
  └── Browser-only, no SSR needed -> client:only

Decision Tree: Content Source

Where does content live?
  ├── Local markdown/MDX files -> Content Collections
  ├── Headless CMS (Sanity, Contentful) -> CMS SDK in frontmatter
  ├── Database (SQLite, PostgreSQL) -> Server endpoint + fetch
  └── Git-based (MDX in repo) -> Content Collections + MDX integration

Decision Tree: Data Fetching Strategy

Is data needed at build time or request time?
  ├── Build time (static) -> fetch in frontmatter, getStaticPaths
  ├── Request time (SSR) -> fetch in frontmatter, no getStaticPaths
  └── Client-side (after hydration) -> fetch in framework component useEffect/onMount

Decision Tree: Asset Handling

What type of asset?
  ├── Images -> astro:assets Image/Picture
  ├── Fonts -> @fontsource or local font files in public/
  ├── Third-party scripts -> Partytown or data-astro-script
  └── Styles -> <style> tag (scoped) or <style is:global> or CSS imports

Component Design Patterns

Layout Component

---
import Header from '../components/Header.astro'
import Footer from '../components/Footer.astro'
const { title } = Astro.props
---
<!doctype html>
<html lang="en">
<head><title>{title}</title></head>
<body>
  <Header />
  <slot />
  <Footer />
</body>
</html>

Data-Fetching Page Component

---
import Layout from '../layouts/BlogLayout.astro'
import BlogCard from '../components/BlogCard.astro'

const response = await fetch('https://api.example.com/posts')
const posts = await response.json()
---
<Layout title="Blog">
  <h1>Blog</h1>
  <ul>
    {posts.map(post => (
      <BlogCard title={post.title} slug={post.slug} date={post.date} />
    ))}
  </ul>
</Layout>

Dynamic Route with getStaticPaths

---
export async function getStaticPaths() {
  const posts = await fetch('https://api.example
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/astro-collections.md
  • references/astro-content.md
  • references/astro-data-fetching.md
  • references/astro-data-loading.md
  • references/astro-integrations.md
  • references/astro-islands.md
  • references/astro-project-architecture.md

FAQ

Что делает скилл frontend-astro-architecture?

Use when the user asks about Astro, building a content site with Astro islands, .astro files, content collections, file-based routing, static vs server output or Astro adapters. Produces a zero-JS-by-default Astro project structure with typed content and deployment config. Not for client:* tuning, view transitions or integrations (use frontend-astro-patterns).

Как установить скилл frontend-astro-architecture?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл frontend-astro-architecture запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить frontend-astro-architecture с