astro-best-practices — скилл для Claude Code: что делает и установка
Инструкции для ИИ-агентов по разработке на Astro: расстановка директив гидратации, работа со схемами контента и чеклист доступности интерфейса.
npx skills add incluud/astro-agent-skills --skill astro-best-practices -a claude-codeЧто делает astro-best-practices
Скилл задаёт правила создания и проверки проектов на Astro. Он требует предпочитать статические компоненты .astro сторонним фреймворкам вроде React или Vue, когда интерактивность не нужна. Клиентский JavaScript сводится к минимуму, а интерактивные острова остаются компактными.
В инструкциях зафиксированы правила гидратации: директива client:load разрешена только для критических элементов, тогда как для отложенного интерфейса предписаны client:visible или client:idle. Скилл также обязывает использовать коллекции контента со строгими схемами вместо произвольного frontmatter и применять модуль astro:assets для картинок, чтобы предотвращать сдвиги макета.
Если архитектура проекта построена вокруг клиентского рендеринга целых страниц и широких лейаутов, этот скилл будет постоянно требовать перенести разметку на сервер.
Какие задачи решает
- устранить лишнюю клиентскую гидратацию в компонентах Astro
- настроить схемы валидации для коллекций контента
- проверить разметку страниц на клавиатурную доступность и контраст
- оптимизировать загрузку изображений через
astro:assets
Примеры запросов агенту
- Проверь страницу
src/pages/blog.astroпо чеклисту astro-best-practices - Сделай карточку товара на
.astroи добавь интерактивную кнопку черезclient:visible - Опиши схему для контентной коллекции документации в Astro
Как установить astro-best-practices
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill astro-best-practices -a claude-code2Вручную: положить файлы
~/.claude/skills/astro-best-practices/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/astro-best-practices/
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill astro-best-practices -a codex2Вручную: положить файлы
.agents/skills/astro-best-practices/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill astro-best-practices -a cursor2Вручную: положить файлы
.cursor/skills/astro-best-practices/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install incluud/astro-agent-skills astro-best-practices2Вручную: положить файлы
.github/skills/astro-best-practices/SKILL.md1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill astro-best-practices -a gemini-cli2Командой платформы
gemini skills install https://github.com/incluud/astro-agent-skills --path skills/astro-best-practicesВручную: положить файлы
.devin/skills/astro-best-practices/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill astro-best-practices -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о astro-best-practices
Как установить astro-best-practices в Claude Code?
Выполните в терминале команду npx skills add incluud/astro-agent-skills --skill astro-best-practices -a claude-code. Альтернативный вариант — сохранить файл вручную по пути ~/.claude/skills/astro-best-practices/SKILL.md.
Что делает скилл astro-best-practices?
Он передаёт агенту архитектурные требования к проектам на Astro. Модель начинает предпочитать серверные компоненты .astro, строгие схемы данных и точечную гидратацию через директивы client:*.
Когда скилл разрешает использовать React или Vue?
Только тогда, когда компоненту действительно требуется локальное состояние или сложное поведение в браузере. Для статического вывода скилл предписывает оставаться на .astro.
Исходный текст
SKILL.md · MIT
--- name: astro-best-practices description: Apply performant, accessible, and maintainable defaults when building or reviewing Astro projects. --- # Astro Best Practices Use this skill as the baseline when designing, implementing, or reviewing Astro work. It translates Astro-specific architectural guidance into portable instructions that can be applied across agents. ## Core Principles - prefer static generation when request-time rendering is not necessary - keep client-side JavaScript minimal - use framework islands only for real interactivity - preserve clear project structure and predictable routing - optimize for accessibility and maintainability, not just output parity ## Architecture Defaults ### Prefer `.astro` first - use `.astro` components for static and mostly static UI - reach for React, Vue, or another framework only when local state or client-side behavior is genuinely needed - keep interactive islands small and leaf-like ### Use hydration deliberately - `client:visible` for deferred UI - `client:idle` for lower-priority enhancement - `client:load` for critical immediate interactivity only - `client:only` only when skipping server rendering is intentional Default away from hydrating broad layout regions. ### Keep the project shape predictable Typical structure: ```text src/ components/ layouts/ pages/ content/ styles/ assets/ public/ ``` Do not invent novel folder structure without a clear project-specific reason. ## Content and Data - use content collections for structured content - define schemas instead of accepting loose frontmatter - fetch server-side data in Astro frontmatter unless there is a clear reason not to - keep data flow obvious and close to the component or page that owns it ## Accessibility - use semantic landmarks such as `header`, `nav`, `main`, `article`, and `footer` - ensure keyboard access for all interactive controls - provide meaningful labels and accessible names - maintain correct heading hierarchy - use appropriate image alt text - preserve visible focus states - treat color contrast as a non-negotiable baseline ## Performance - use `astro:assets` or the project’s chosen image pipeline intentionally - prevent layout shift by providing image dimensions or stable containers - avoid unnecessary client hydration - keep CSS and JavaScript scoped to the features that need them - prefer simple server-rendered markup over client complexity ## Styling - default to scoped component styles unless the project has a defined styling system - use CSS custom properties for reusable tokens - favor maintainable layout patterns over one-off utility sprawl when the project is not already utility-first - keep responsive behavior intentional and testable ## Review Checklist Before finalizing Astro work, check: - is any hydrated code unnecessary - does the HTML stay semantic - is the route/layout structure still clear - are content schemas strong enough - is the result accessible by keyboard and assistive tech - does the implementation match the existing project conventions
© incluud · MIT · incluud/astro-agent-skills