create-component · incluud — скилл для Claude Code: что делает и как установить
Генерирует компоненты, страницы и макеты для Astro с доступной вёрсткой и строгой типизацией props. Помогает переносить статичный HTML в проект без лишнего JavaScript.
npx skills add incluud/astro-agent-skills --skill create-component -a claude-codeЧто делает create-component
Скилл распределяет файлы по каталогам Astro: макеты отправляет в src/layouts/, маршруты — в src/pages/, а переиспользуемые элементы — в src/components/. Код строится на чистом .astro с интерфейсом interface Props, проверкой семантики и локальными стилями. Островная архитектура включается только при реальной интерактивности: агент добавит React или Vue с директивой вроде client:visible, изолируя клиентский скрипт в компактном элементе.
Перед сдачей компонента скилл проверяет доступность разметки. Он контролирует логику уровней заголовков, видимость фокуса, понятные имена кнопок и атрибуты alt у изображений. Если в проекте уже установлен astro-best-practices, скилл опирается на его правила для соблюдения проектных соглашений.
Какие задачи решает
- Собрать доступный Astro-компонент из макета или готового HTML
- Создать страницу в
src/pages/или шаблон вsrc/layouts/ - Разбить громоздкий
.astroфайл на компактные части - Изолировать интерактивный блок в остров с частичной гидратацией
Примеры запросов агенту
- Сделай компонент карточки товара на чистом Astro с интерфейсом Props и слотом
- Перенеси эту статическую HTML-разметку шапки в Astro-компонент с доступной вёрсткой
- Создай страницу блога в src/pages/ с подключением интерактивного поиска через client:visible
Как установить create-component
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill create-component -a claude-code2Вручную: положить файлы
~/.claude/skills/create-component/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/create-component/
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill create-component -a codex2Вручную: положить файлы
.agents/skills/create-component/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill create-component -a cursor2Вручную: положить файлы
.cursor/skills/create-component/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install incluud/astro-agent-skills create-component2Вручную: положить файлы
.github/skills/create-component/SKILL.md1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill create-component -a gemini-cli2Командой платформы
gemini skills install https://github.com/incluud/astro-agent-skills --path skills/create-componentВручную: положить файлы
.devin/skills/create-component/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill create-component -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о create-component
Как установить create-component в Claude Code?
Выполните в терминале команду npx skills add incluud/astro-agent-skills --skill create-component -a claude-code. Файл сохранится по пути ~/.claude/skills/create-component/SKILL.md.
Когда скилл подключает React или Vue вместо чистого Astro?
Внешние фреймворки привлекаются только тогда, когда элементу нужно клиентское состояние. В остальных случаях используется обычный .astro без клиентского JavaScript.
Что проверяет скилл перед созданием компонента?
Скилл уточняет входящие параметры в Props, наличие слотов, источники данных и подход к стилям. После генерации он инспектирует семантику HTML, видимость фокуса и доступность управления с клавиатуры.
Исходный текст
SKILL.md · MIT
---
name: create-component
description: Create Astro components, pages, and layouts with accessible markup and minimal client-side JavaScript.
---
# Create Astro Component
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.
## Workflow
### 1. Pick the right file type
Choose the simplest primitive that fits the requirement:
- component: reusable UI in `src/components/`
- page: route entry in `src/pages/`
- layout: shared shell in `src/layouts/`
- framework island: React, Vue, or similar only when interactivity is required
Start with `.astro` unless there is a real need for client-side framework state.
### 2. Clarify the contract
Before scaffolding, determine:
- what props the file accepts
- whether it renders children or named slots
- whether it fetches data
- whether any interactivity is required
- which styling approach the project already uses
Keep the public surface small. If a prop does not change rendering in a meaningful way, it probably should not exist.
### 3. Scaffold with strong defaults
Use typed props and semantic structure:
```astro
---
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:
- semantic elements over generic `div`s
- logical heading structure
- sensible prop defaults
- scoped styles unless the project uses another pattern intentionally
- `class:list` for conditional classes when it keeps markup clear
### 4. Add interactivity only when needed
If the component needs client-side behavior:
- keep the interactive part as small as possible
- isolate it in a framework component if that is the project pattern
- choose the lightest hydration directive that works
Example:
```astro
---
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.
### 5. Review accessibility and resilience
Before calling the component done, check:
- semantic HTML is appropriate
- interactive elements are keyboard reachable
- visible labels and accessible names exist
- images have correct `alt` behavior
- heading levels make sense in context
- focus states remain visible
### 6. Fit the component into the project
Align with the existing codebase:
- follow naming conventions
- preserve the established layout and styling approach
- keep imports relative and readable
- do not introduce a framework dependency just to mimic static HTML
## Use This Skill For
- converting static HTML into Astro components
- scaffolding new routes or layouts
- breaking large Astro files into smaller pieces
- turning a design into accessible Astro markup
© incluud · MIT · incluud/astro-agent-skills
Похожие скиллы
Все скиллы по теме «Фронтенд и UI» →Сначала — create-component от других авторов.