一键导入
create-component
Create Astro components, pages, and layouts with accessible markup and minimal client-side JavaScript.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create Astro components, pages, and layouts with accessible markup and minimal client-side JavaScript.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add and configure Astro integrations, adapters, and UI framework tooling.
Set up and evolve Astro content collections with typed schemas and reliable querying patterns.
Plan and execute migrations to Astro or between Astro versions with minimal regressions.
Apply performant, accessible, and maintainable defaults when building or reviewing Astro projects.
Look up official Astro documentation and answer version-sensitive Astro questions accurately.
| name | create-component |
| description | Create Astro components, pages, and layouts with accessible markup and minimal client-side JavaScript. |
Use this skill when scaffolding a new Astro component, page, layout, or route from a feature request, design, or static markup.
If astro-best-practices is available, apply it alongside this skill for project-wide conventions and review criteria.
Choose the simplest primitive that fits the requirement:
src/components/src/pages/src/layouts/Start with .astro unless there is a real need for client-side framework state.
Before scaffolding, determine:
Keep the public surface small. If a prop does not change rendering in a meaningful way, it probably should not exist.
Use typed props and semantic structure:
---
interface Props {
title: string
variant?: 'primary' | 'secondary'
}
const { title, variant = 'primary' } = Astro.props
---
<section class:list={['card', variant]}>
<h2>{title}</h2>
<slot />
</section>
<style>
.card {
padding: 1rem;
}
</style>
Good defaults:
divsclass:list for conditional classes when it keeps markup clearIf the component needs client-side behavior:
Example:
---
import SearchBox from './SearchBox.tsx'
---
<SearchBox client:visible />
Avoid turning large sections of a page into islands when a small interactive leaf component is enough.
Before calling the component done, check:
alt behaviorAlign with the existing codebase: