Communitygithub.com

ComeOnOliver/skillshub

Astro 是一個專為內容驅動網站設計的網頁框架,預設不載入任何 JavaScript。其島嶼架構僅對互動元件進行水合,在支援 React、Vue、Svelte 或任何需要互動性的 UI 框架同時,能達成優異的 Lighthouse 評分。

skillshub 是什麼?

此技能提供 Astro 網頁框架的專業使用指引,Astro 是一個以內容為中心的框架,其特色是預設不傳送 JavaScript,並透過「島嶼架構」(island architecture) 僅對互動元件進行選擇性水合,從而實現極快的頁面載入速度與優異的 Lighthouse 評分。技能詳細說明了 Astro 的核心功能與最佳實踐,包括:使用 `src/pages/` 的基於檔案的路由系統、透過 `client:visible` 或 `client:idle` 指令進行高效的水合策略、在 `src/content/` 中搭配 Zod 嚴格 schema 定義內容集合 (Content Collections) 以實現型別安全的內容管理,以及靜態生成 (SSG)、伺服器端渲染 (SSR) 與混合渲染的選擇時機。此外,技能也涵蓋了使用 Astro 內建 `astro:assets` 的 `<Image>` 元件進行圖片最佳化、啟用 `ViewTransitions` 提供類 SPA 的頁面轉場效果,以及整合 React、Vue、Svelte 等主流 UI 框架的步驟。此技能適用於任何支援 markdown 技能定義的 AI 代理平台(如 Claude Code、Cursor、Codex),能幫助開發者遵循 Astro 官方最佳實踐,建立高效能、最佳化的內容驅動網站。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/TerminalSkills/skills/astro

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Astro

概述

Astro 是一個專為內容驅動網站設計的網頁框架,預設不載入任何 JavaScript。其島嶼架構僅對互動元件進行水合,在支援 React、Vue、Svelte 或任何需要互動性的 UI 框架同時,能達成優異的 Lighthouse 評分。

使用說明

  • 建立頁面時,請在 src/pages/ 中使用 .astro、.md 或 .mdx 檔案進行基於檔案的路由,並在 src/layouts/ 中組織共用的版面結構。
  • 加入互動性時,請在框架元件上使用客戶端指令:優先使用 client:visible 或 client:idle,而非 client:load,因為大多數元件不需要立即水合。
  • 管理內容時,請在 src/content/ 中使用 defineCollection() 並搭配嚴格的 Zod schema 定義內容集合,並使用 getCollection() 與 getEntry() 進行查詢。
  • 選擇渲染模式時,行銷與內容頁面預設使用靜態生成 (SSG),動態頁面使用 output: "server",或透過每個頁面的 export const prerender = false 使用混合渲染。
  • 最佳化圖片時,請使用 astro:assets 的 <Image> 元件進行自動格式轉換 (WebP/AVIF)、調整大小與延遲載入,而非使用原始的 <img> 標籤。
  • 加入頁面轉場效果時,請啟用 View Transitions(使用 <ViewTransitions />),以實現類 SPA 的導航體驗,而無需載入客戶端路由器。
  • 整合 UI 框架時,請安裝相應的整合套件(@astrojs/react、@astrojs/vue、@astrojs/svelte),並使用 Astro 元件處理靜態內容,僅在需要互動性時才使用框架元件。

範例

範例 1:使用內容集合建立部落格

使用者請求:「建立一個具有型別安全 Markdown 內容的 Astro 部落格」

操作步驟:

  1. 使用 Zod schema 為 frontmatter(標題、日期、標籤、作者)定義一個部落格內容集合
  2. 建立動態路由 src/pages/blog/[slug].astro 並使用 getStaticPaths()
  3. 透過 getCollection("blog") 查詢並排序,建立部落格索引頁面
  4. 加入包含 SEO meta 標籤、導覽列與 View Transitions 的版面配置

輸出: 一個靜態生成的部落格,具有經過驗證的內容、簡潔的 URL 以及流暢的頁面轉場效果。

範例 2:在靜態網站中加入互動元件

使用者請求:「在我的 Astro 文件網站中加入一個 React 搜尋元件」

操作步驟:

  1. 安裝 @astrojs/react 整合套件
  2. 建立包含狀態與事件處理的 React 搜尋元件
  3. 使用 client:idle 指令將該元件加入到頁面中
  4. 從 Astro 頁面的 frontmatter 將靜態資料作為 props 傳遞

輸出: 一個完全靜態的文件網站,除了互動式搜尋島嶼之外。

指引

  • 使用 Astro 元件處理靜態內容;僅在需要互動性時才使用 React/Vue/Svelte。
  • 水合指令預設使用 client:visible 或 client:idle,而非 client:load。
  • 使用嚴格的 Zod schema 定義內容集合,以便在建置時捕捉內容錯誤。
  • 使用 astro:assets 的 <Image> 元件取代原始 <img> 標籤,以獲得自動最佳化。
  • 保持版面輕量,共用 <head>、導覽列與頁尾;頁面特定內容放在頁面中。
  • 使用混合渲染:行銷頁面使用靜態生成,僅個人化或動態頁面使用 SSR。
  • 啟用 View Transitions 以獲得類 SPA 的導航體驗,無需載入路由器。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能