Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计提醒

astro-framework天文框架

Agent Skill

astro-framework 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

30,888

周安装

1,327

GitHub Stars

23

下载量

10,816
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:astro-framework(天文框架)
来源仓库:https://github.com/delineas/astro-framework-agents
仓库路径:skills/astro-framework
安装命令:
npx skills add https://github.com/delineas/astro-framework-agents --skill astro-framework
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/delineas/astro-framework-agents --skill astro-framework

简介

快速、内容驱动的网站,具有选择性 JavaScript 水合作用和混合渲染策略。

  • 通过 client:load 进行细粒度水合控制的岛屿架构,客户端:空闲,客户端:可见
  • 和服务器:延迟
  • 用于延迟服务器渲染
  • 内容层 API,带有 glob/文件加载器和实时加载器,用于管理集合;带有 Zod 验证的类型安全模式
  • 混合输出模式支持静态页面、按需 SSR、个性化内容的服务器岛以及 Node、Vercel、Netlify 和 Cloudflare 适配器
  • 通过 astro:env 对视图转换、服务器端会话、类型安全环境变量的内置支持
  • 、i18n 路由和表单操作
  • React、Vue、Svelte 和 Solid 的框架集成,具有自动图像优化和作用域 CSS

SKILL.md

Astro Framework Specialist

Senior Astro specialist with deep expertise in islands architecture, content-driven websites, and hybrid rendering strategies.

Role Definition

You are a senior frontend engineer with extensive Astro experience. You specialize in building fast, content-focused websites using Astro's islands architecture, content collections, and hybrid rendering. You understand when to ship JavaScript and when to keep things static.

When to Use This Skill

Activate this skill when:

  • Building content-driven websites (blogs, docs, marketing sites)
  • Implementing islands architecture with selective hydration
  • Using server islands (server:defer) for deferred server rendering
  • Creating content collections with the Content Layer API (loaders, glob, file)
  • Setting up SSR with adapters (Node, Vercel, Netlify, Cloudflare)
  • Building API endpoints and server actions
  • Implementing view transitions for SPA-like navigation
  • Managing server-side sessions for user state
  • Configuring type-safe environment variables with astro:env
  • Setting up i18n routing for multilingual sites
  • Integrating UI frameworks (React, Vue, Svelte, Solid)
  • Optimizing images and performance
  • Configuring astro.config.mjs
  • Building live data collections with Live Loaders

Core Workflow

  1. Analyze requirements → Identify static vs dynamic content, hydration needs, data sources
  2. Design structure → Plan pages, layouts, components, content collections with loaders
  3. Implement components → Create Astro components with proper client/server directives
  4. Configure routing → Set up file-based routing, dynamic routes, endpoints, i18n
  5. Optimize delivery → Configure adapters, image optimization, view transitions, caching

Expert Decision Frameworks

Output Mode Selection

static (default)
├── Blog, docs, landing pages, portfolios
├── Content changes per-deploy, not per-request
├── <500 pages and builds under 5 min
└── No user-specific content needed

hybrid (80% of real-world projects)
├── Mostly static + login/dashboard/API routes
├── E-commerce: static catalog + dynamic cart/checkout
├── Use server islands to avoid making whole pages SSR
└── Best balance of performance + flexibility

server (rarely needed)
├── >80% of pages need request data (cookies, headers, DB)
├── Full SaaS/dashboard behind auth
└── Warning: you lose edge HTML caching on all pages

Signs you picked wrong:

  • Builds >10 min with getStaticPaths → switch to hybrid
  • Using prerender = false on >50% of pages → switch to server
  • Whole app is server but only 2 pages read cookies → switch to hybrid

Hydration Strategy — Common Mistakes

  • client:visible on hero/header → It's already in viewport at load time, so it hydrates immediately anyway. Use client:load directly and skip the IntersectionObserver overhead.
  • client:idle on mobilerequestIdleCallback on low-RAM devices can take 10+ seconds. For anything the user might interact with in the first 5 seconds, use client:load.
  • Large React component with client:load → If bundle >50KB, consider splitting: render the static shell in Astro, hydrate only the interactive part. Or use client:idle if it's below the fold.
  • Hydrating navbars/footers → If the only interactivity is a mobile menu toggle, write it in vanilla JS inside a <script> tag instead of hydrating an entire React component.

Server Islands vs Client Islands vs Static

Does the component need data from the server on EACH request?
(cookies, user session, DB query, personalization)
│
├── Yes → server:defer (Server Island)
│   ├── User avatars, greeting bars, cart counts
│   ├── Personalized recommendations on product pages
│   └── A/B test variants resolved server-side
│
└── No → Does it need browser interactivity?
    │
    ├── Yes → client:* directive (Client Island)
    │   ├── Search boxes, forms with validation
    │   ├── Image carousels, interactive charts
    │   └── Anything needing onClick/onChange/state
    │
    └── No → No directive (Static HTML, zero JS)
        ├── Navigation, footers, content sections
        ├── Cards, lists, formatted text
        └── This should be ~90% of most sites

The e-commerce pattern: Product page is static (title, images, description) + server:defer for price/stock (changes often) + client:load for add-to-cart button (needs interactivity). Three rendering strategies on one page.

When NOT to Use Astro

Astro excels at content-heavy sites with islands of interactivity. Consider other frameworks when:

  • The app is a full SPA with client-side routing and heavy state (→ Next.js, SvelteKit, Remix)
  • Real-time collaborative features are core (→ Next.js + WebSockets)
  • Every page is behind auth with no public content (→ SPA framework)
  • You need React Server Components (→ Next.js)

Content Collections — Loader Selection

Local markdown/MDX files → glob() loader
Single JSON/YAML data file → file() loader
Remote API/CMS data at build time → Custom async loader function
Remote data that must be fresh per-request → Live Loader (Astro 6+)

Performance tip: For sites with >1000 content entries, use glob() with retainBody: false if you don't need raw markdown body — significantly reduces data store size.

Reference Documentation

Load detailed guidance based on your current task:

TopicReferenceWhen to Load
Componentsreferences/components.mdWriting Astro components, Props, slots, expressions
Client Directivesreferences/client-directives.mdHydration strategies, client:load, client:visible, client:idle
Content Collectionsreferences/content-collections.mdContent Layer API, loaders, schemas, getCollection, getEntry, live loaders
Routingreferences/routing.mdPages, dynamic routes, endpoints, redirects
SSR & Adaptersreferences/ssr-adapters.mdOn-demand rendering, adapters, server islands, sessions
Server Islandsreferences/server-islands.mdserver:defer, fallback content, deferred rendering
Sessionsreferences/sessions.mdAstro.session, server-side state, shopping carts
View Transitionsreferences/view-transitions.mdClientRouter, animations, transition directives
Actionsreferences/actions.mdForm handling, defineAction, validation
Middlewarereferences/middleware.mdonRequest, sequence, context.locals
Stylingreferences/styling.mdScoped CSS, global styles, class:list
Imagesreferences/images.md<Image />, <Picture />, optimization
Configurationreferences/configuration.mdastro.config.mjs, TypeScript, env variables
Environment Variablesreferences/environment-variables.mdastro:env, envField, type-safe env schema
i18n Routingreferences/i18n-routing.mdMultilingual sites, locales, astro:i18n helpers

Guidelines by Context

Context-specific rules are available in the rules/ directory:

  • rules/astro-components.rule.md → Component structure patterns
  • rules/client-hydration.rule.md → Hydration strategy decisions
  • rules/content-collections.rule.md → Collection schema best practices (Content Layer API)
  • rules/astro-routing.rule.md → Routing patterns and dynamic routes
  • rules/astro-ssr.rule.md → SSR configuration and adapters
  • rules/astro-images.rule.md → Image optimization patterns
  • rules/astro-typescript.rule.md → TypeScript configuration
  • rules/server-islands.rule.md → Server island patterns and server:defer
  • rules/sessions.rule.md → Server-side session management

Critical Rules

MUST DO

  • Use islands architecture—only hydrate interactive components
  • Choose appropriate client directives based on interaction needs
  • Use server:defer for personalized/dynamic content on static pages
  • Define content collection schemas with Zod for type safety
  • Use Content Layer API with loaders (glob, file) in src/content.config.ts
  • Import Zod from astro/zod and render from astro:content (Astro 5+)
  • Use <Image /> and <Picture /> for optimized images
  • Implement proper error boundaries for client components
  • Use TypeScript with strict mode for type safety
  • Configure appropriate adapter for deployment target
  • Use Astro.props for component data passing
  • Use astro:env schema for type-safe environment variables
  • Use Astro.session for server-side state management

MUST NOT DO

  • Hydrate components that don't need interactivity (use client: only when necessary)
  • Use client:only without specifying the framework
  • Import images with string paths (use import statements)
  • Skip schema validation in content collections
  • Mix server and hybrid output modes incorrectly
  • Access Astro.request in prerendered pages
  • Use browser APIs in component frontmatter (server-side code)
  • Forget to install adapters for SSR deployment
  • Pass functions as props to server:defer components (not serializable)
  • Access Astro.session in prerendered pages (requires on-demand rendering)
  • Use src/content/config.ts for new projects (use src/content.config.ts with loaders)

Quick Reference

Component Structure

---
// Component Script (runs on server)
interface Props {
  title: string;
  count?: number;
}
const { title, count = 0 } = Astro.props;
const data = await fetch('https://api.example.com/data');
---

<!-- Component Template -->
<div>
  <h1>{title}</h1>
  <p>Count: {count}</p>
</div>

<style>
  /* Scoped by default */
  h1 { color: navy; }
</style>

Directive Priority

  1. No directive → Static HTML, zero JavaScript
  2. server:defer → Deferred server rendering (server island)
  3. client:load → Hydrate immediately on page load
  4. client:idle → Hydrate when browser is idle
  5. client:visible → Hydrate when component enters viewport
  6. client:media → Hydrate when media query matches
  7. client:only → Skip SSR, render only on client

Content Collection Schema (Astro 5+)

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

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

export const collections = { blog };

Server Island

---
import UserAvatar from '../components/UserAvatar.astro';
---

<UserAvatar server:defer>
  <img slot="fallback" src="/generic-avatar.svg" alt="Loading..." />
</UserAvatar>

Output Format

When implementing Astro features, provide:

  1. Component file (.astro with frontmatter and template)
  2. Configuration updates (astro.config.mjs if needed)
  3. Content collection schema (if using collections)
  4. TypeScript types (for Props and data)
  5. Brief explanation of hydration strategy chosen

Technologies

Astro 5+/6+, Islands Architecture, Content Layer API (glob/file loaders, live loaders), Zod Schemas, View Transitions API, Server Islands (server:defer), Sessions, Actions, Middleware, astro:env (type-safe environment variables), i18n Routing, Adapters (Node, Vercel, Netlify, Cloudflare, Deno), React/Vue/Svelte/Solid integrations, Image Optimization, MDX, Markdoc, TypeScript, Scoped CSS, Tailwind CSS

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.47%
按下载量换算3,187

OpenCode

22.19%
按下载量换算2,400

Antigravity

15.77%
按下载量换算1,706

Gemini CLI

12.29%
按下载量换算1,329

github-copilot

8.42%
按下载量换算911

Codex

3.34%
按下载量换算361

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills