Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

astroastro 搜索

Agent Skill

astro 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

783

周安装

32

GitHub Stars

12

下载量

251
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill astro

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,辅助围绕仓库状态进行整理与分析。

  • 可帮助 Agent 梳理代码变更、协作事项及仓库上下文,适用于需要快速定位问题或审查提交的场景。
  • 使用时建议先确认权限范围和维护状态,避免触发不必要的联网或命令执行。
  • 安装前请核实来源仓库的稳定性,并注意是否会访问敏感文件或修改项目配置。
  • astro 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Astro Core Knowledge

Deep Knowledge: Use mcp__documentation__fetch_docs with technology: astro for comprehensive documentation.

Component Structure

---
// Component script (runs at build time)
import Header from '../components/Header.astro';
import ReactCounter from '../components/Counter.tsx';

const { title } = Astro.props;
const posts = await Astro.glob('./posts/*.md');
---

<!-- Component template -->
<html>
  <head><title>{title}</title></head>
  <body>
    <Header />
    <main>
      <slot />
    </main>
    <!-- Island: hydrates on client -->
    <ReactCounter client:load />
  </body>
</html>

<style>
  main { max-width: 800px; }
</style>

Client Directives (Islands)

DirectiveBehavior
client:loadHydrate immediately
client:idleHydrate when idle
client:visibleHydrate when visible
client:mediaHydrate on media query
client:onlySkip SSR, client only

Content Collections

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

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

export const collections = { blog };
---
import { getCollection } from 'astro:content';
const posts = await getCollection('blog', ({ data }) => !data.draft);
---

Key Features

  • Zero JS by default (ship HTML)
  • Use React, Vue, Svelte together
  • Content collections with type safety
  • Built-in Markdown/MDX support

Production Readiness

Security Configuration

// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
  security: {
    checkOrigin: true, // CSRF protection for SSR
  },
  vite: {
    define: {
      // Never expose secrets to client
      'import.meta.env.SECRET_KEY': 'undefined',
    },
  },
});

// src/middleware.ts
import { defineMiddleware } from 'astro:middleware';

export const onRequest = defineMiddleware(async (context, next) => {
  const response = await next();

  // Security headers
  response.headers.set('X-Frame-Options', 'DENY');
  response.headers.set('X-Content-Type-Options', 'nosniff');
  response.headers.set('Referrer-Policy', 'strict-origin-when-cross-origin');
  response.headers.set(
    'Content-Security-Policy',
    "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'"
  );

  return response;
});

Content Validation

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

const blog = defineCollection({
  type: 'content',
  schema: ({ image }) =>
    z.object({
      title: z.string().max(100),
      description: z.string().max(200),
      date: z.date(),
      author: reference('authors'),
      cover: image().refine((img) => img.width >= 800, {
        message: 'Cover image must be at least 800px wide',
      }),
      tags: z.array(z.string()).max(5),
      draft: z.boolean().default(false),
    }),
});

export const collections = { blog };

Performance

// astro.config.mjs
import { defineConfig } from 'astro/config';
import compress from 'astro-compress';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
  site: 'https://example.com',
  integrations: [
    sitemap(),
    compress({
      CSS: true,
      HTML: true,
      Image: true,
      JavaScript: true,
      SVG: true,
    }),
  ],
  build: {
    inlineStylesheets: 'auto',
  },
  prefetch: {
    prefetchAll: true,
    defaultStrategy: 'viewport',
  },
});
---
// Image optimization
import { Image, getImage } from 'astro:assets';
import heroImage from '../assets/hero.png';

const optimizedBackground = await getImage({ src: heroImage, format: 'webp' });
---

<Image
  src={heroImage}
  alt="Hero"
  widths={[400, 800, 1200]}
  sizes="(max-width: 800px) 100vw, 800px"
  loading="eager"
/>

<!-- Lazy hydration for islands -->
<ReactWidget client:visible />

<!-- View Transitions -->
<ViewTransitions />

Error Handling

---
// src/pages/404.astro
import Layout from '../layouts/Layout.astro';
---

<Layout title="Page Not Found">
  <div class="error-page">
    <h1>404</h1>
    <p>Page not found</p>
    <a href="/">Go home</a>
  </div>
</Layout>
---
// src/pages/500.astro
import Layout from '../layouts/Layout.astro';
---

<Layout title="Server Error">
  <div class="error-page">
    <h1>500</h1>
    <p>Something went wrong</p>
    <a href="/">Go home</a>
  </div>
</Layout>
// src/pages/api/data.ts
import type { APIRoute } from 'astro';

export const GET: APIRoute = async ({ request }) => {
  try {
    const data = await fetchData();
    return new Response(JSON.stringify(data), {
      status: 200,
      headers: { 'Content-Type': 'application/json' },
    });
  } catch (error) {
    console.error('API error:', error);
    return new Response(JSON.stringify({ error: 'Internal server error' }), {
      status: 500,
      headers: { 'Content-Type': 'application/json' },
    });
  }
};

Testing

// tests/e2e/blog.spec.ts
import { test, expect } from '@playwright/test';

test.describe('Blog', () => {
  test('lists published posts', async ({ page }) => {
    await page.goto('/blog');

    const posts = page.locator('article');
    await expect(posts).toHaveCount(await posts.count());
    await expect(posts.first()).toBeVisible();
  });

  test('navigates to post', async ({ page }) => {
    await page.goto('/blog');
    await page.click('article a');

    await expect(page.locator('h1')).toBeVisible();
    await expect(page).toHaveURL(/\/blog\/.+/);
  });
});

// Component testing with container queries
test('island hydrates on visibility', async ({ page }) => {
  await page.goto('/');

  const counter = page.locator('[data-testid="counter"]');
  await expect(counter).not.toBeVisible();

  await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
  await expect(counter).toBeVisible();
});

Deployment Configuration

# Vercel - vercel.json
{
  "buildCommand": "astro build",
  "outputDirectory": "dist",
  "framework": "astro"
}

# Netlify - netlify.toml
[build]
  command = "astro build"
  publish = "dist"

# Docker
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

Monitoring Metrics

MetricTarget
Lighthouse Score> 95
First Contentful Paint< 1s
Time to Interactive< 1.5s
Total Blocking Time< 50ms
Bundle size (JS)< 50KB

Checklist

  • Security headers in middleware
  • checkOrigin enabled for SSR
  • Content collections with Zod schemas
  • Image optimization with astro:assets
  • Lazy hydration (client:visible/idle)
  • View Transitions enabled
  • 404/500 error pages
  • Sitemap generation
  • Asset compression
  • E2E tests with Playwright
  • Lighthouse CI in pipeline

When NOT to Use This Skill

This skill is for Astro (content-focused, islands architecture). DO NOT use for:

  • Next.js (React meta-framework): Use nextjs-app-router skill instead
  • Nuxt (Vue meta-framework): Use nuxt3 skill instead
  • SvelteKit (Svelte meta-framework): Use sveltekit skill instead
  • Remix (React meta-framework): Use remix skill instead
  • Pure React applications: Use frontend-react skill instead
  • Pure Vue applications: Use frontend-vue skill instead
  • Pure Svelte applications: Use frontend-svelte skill instead
  • Gatsby: Astro is a modern alternative, but migration differs

Anti-Patterns

Anti-PatternWhy It's WrongCorrect Approach
Using client:load everywhereDefeats zero-JS philosophy, large bundlesUse client:idle or client:visible for deferred hydration
Not using content collectionsUnvalidated content, no type safetyDefine collections in src/content/config.ts
Mixing frameworks unnecessarilyIncreases bundle size, complexityUse one framework per project, or Astro components
Ignoring image optimizationPoor performance, large assetsUse from astro:assets
Not setting alt text on imagesAccessibility issue, SEO penaltyAlways provide meaningful alt text
Using client:only for all contentNo SSR, poor SEOUse client:only only for browser-only components
Hardcoding data in componentsUnmaintainable, no CMS integrationUse content collections or API fetching
No ViewTransitionsChoppy navigation UXAdd to layout

Quick Troubleshooting

IssuePossible CauseSolution
"Cannot use import.meta.env in client"Accessing server-only env varPrefix with PUBLIC_ for client access
Island not hydratingWrong client directiveCheck client:load/idle/visible directive is set
Content collection not foundSchema not defined or wrong pathDefine in src/content/config.ts, check src/content/{collection}
Images not optimizedUsing instead ofImport and use from astro:assets
"getCollection is not defined"Wrong importImport from 'astro:content'
Build fails with type errorsContent schema mismatchCheck frontmatter matches Zod schema
404 page not showingMissing src/pages/404.astroCreate 404.astro in src/pages/
CSS not scopedMissing in componentAdd block to Astro component

Reference Documentation

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

32.35%
按下载量换算81

Claude

30.34%
按下载量换算76

Cursor

20.26%
按下载量换算51

Gemini CLI

9.75%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills