Communitygithub.com

ComeOnOliver/skillshub

Astro 是一个用于构建内容驱动型网站的 Web 框架,默认情况下不发送任何 JavaScript。其岛屿架构仅水合交互组件,在支持 React、Vue、Svelte 或任何需要交互性的 UI 框架的同时,可获得卓越的 Lighthouse 评分。

skillshub 是什么?

Astro 是一个现代的 Web 框架,专为构建内容驱动型网站而设计,其突出特性是默认情况下不向客户端发送任何 JavaScript。它采用“岛屿架构”,这意味着只有页面中的交互式组件才会被水合(客户端激活),而静态内容则保持纯 HTML 和 CSS,从而显著提升性能并获得优异的 Lighthouse 评分。该技能为 AI 代理提供了使用 Astro 构建网站的最佳实践,涵盖文件路由、客户端指令(如 `client:visible`)、内容集合(使用 Zod 模式)、渲染模式(SSG、SSR 或混合)、图像优化(`astro:assets` 的 `<Image>` 组件)以及视图过渡等功能。它支持多种 UI 框架(React、Vue、Svelte),但鼓励仅在需要交互性时使用框架组件,而在其他情况下使用原生的 `.astro` 组件。通过遵循这些原则,开发者可以构建出速度快、SEO 友好且用户体验出色的网站。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Astro

概述

Astro 是一个用于构建内容驱动型网站的 Web 框架,默认情况下不发送任何 JavaScript。其岛屿架构仅水合交互组件,在支持 React、Vue、Svelte 或任何需要交互性的 UI 框架的同时,可获得卓越的 Lighthouse 评分。

指令

  • 创建页面时,在 src/pages/ 中使用基于文件的路由,文件格式为 .astro、.md 或 .mdx,并将共享结构组织在 src/layouts/ 中。
  • 添加交互性时,对框架组件使用客户端指令:优先使用 client:visible 或 client:idle,而不是 client:load,因为大多数组件不需要立即水合。
  • 管理内容时,在 src/content/ 中使用严格的 Zod 模式定义内容集合,使用 defineCollection(),并通过 getCollection() 和 getEntry() 进行查询。
  • 选择渲染模式时,对于营销和内容页面默认使用静态(SSG),对于动态页面使用 output: "server",或使用混合渲染,在每页通过 export const prerender = false 进行控制。
  • 优化图像时,请使用 astro:assets 中的 <Image> 组件进行自动格式转换(WebP/AVIF)、调整大小和延迟加载,而不是使用原始 <img> 标签。
  • 添加页面过渡时,启用 <ViewTransitions /> 实现类似 SPA 的导航,而无需发送客户端路由器。
  • 集成 UI 框架时,安装相应的集成(@astrojs/react、@astrojs/vue、@astrojs/svelte),并使用 Astro 组件处理静态内容,仅在需要交互性时才使用框架组件。

示例

示例 1:使用内容集合构建博客

用户请求:"创建一个具有类型安全 Markdown 内容的 Astro 博客"

操作:

  1. 使用 Zod 模式为博客内容集合定义 frontmatter(标题、日期、标签、作者)
  2. 创建动态路由 src/pages/blog/[slug].astro,并使用 getStaticPaths()
  3. 构建博客索引页面,通过 getCollection("blog") 查询并排序
  4. 添加包含 SEO 元标签、导航和视图过渡的布局

**输出:**一个静态生成的博客,具有经过验证的内容、干净的 URL 和流畅的页面过渡。

示例 2:向静态站点添加交互组件

用户请求:"向我的 Astro 文档站点添加一个 React 搜索组件"

操作:

  1. 安装 @astrojs/react 集成
  2. 创建带有状态和事件处理的 React 搜索组件
  3. 使用 client:idle 指令将组件添加到页面
  4. 从 Astro 页面的 frontmatter 中将静态数据作为 props 传递

**输出:**一个完全静态的文档站点,但包含一个交互式搜索岛屿。

指南

  • 使用 Astro 组件(.astro)处理静态内容;仅在需要交互性时使用 React/Vue/Svelte。
  • 对于水合指令,默认使用 client:visible 或 client:idle 而不是 client:load。
  • 使用严格的 Zod 模式定义内容集合,以便在构建时捕获内容错误。
  • 使用 astro:assets 的 <Image> 组件而非原始 <img> 标签进行自动优化。
  • 保持布局精简,包含共享的 <head>、导航和页脚;将页面特定内容放在各个页面中。
  • 使用混合渲染:营销页面使用静态渲染,仅对个性化或动态页面使用 SSR。
  • 启用视图过渡以实现类似 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

相关技能