migrate · incluud — скилл для Claude Code: миграция проектов на Astro
Планирует и выполняет переезд проекта на Astro или обновление версии Astro. Полезен, когда старый фреймворк надо разобрать по частям, а не переписать вслепую.
npx skills add incluud/astro-agent-skills --skill migrate -a claude-codeЧто делает migrate
Скилл включается, когда вы переносите проект с другого фреймворка на Astro, превращаете статический сайт в Astro-проект или обновляете уже существующую кодовую базу Astro. Сначала он проводит инвентаризацию: маршрутизация, общие оболочки, источники данных, стили, интерактивные компоненты, работа с картинками, требования к рантайму. От этого зависит, будет цель статической, гибридной или серверной.
Дальше работа идёт по шагам: выбрать форму миграции, сопоставить концепции вместо копирования файлов, пересобрать маршруты и поток данных, вынести интерактив в острова. Общие оболочки переезжают в src/layouts/, маршруты — в src/pages/, структурированный контент — в src/content/. Фреймворковые компоненты остаются только там, где реально нужны; статику советует переводить в .astro. В конце — проверка паритета маршрутов, метаданных, картинок, форм, навигации с клавиатуры и сборки.
Отдельный блок про обновление версий Astro. Для Astro 6 скилл перечисляет точки отказа: нужен Node 22.12.0 или новее, коллекции контента переезжают в src/content.config.* с обязательным loader, Astro.glob() заменяется на import.meta.glob() или getCollection(), <ViewTransitions /> — на <ClientRouter />. Если в проекте остался legacy.collections, его надо убрать. Проверьте рантайм до того, как лезть в код: часть ошибок после апгрейда — это несовпадение версии Node, а не логика.
Какие задачи решает
- перенести статический сайт на Astro без переписывания с нуля
- разложить Next.js или Nuxt на страницы Astro и острова интерактива
- перевести контентный пайплайн Gatsby на content collections
- обновить Astro до новой мажорной версии и не пропустить breaking changes
- проверить паритет маршрутов и метаданных после миграции
Примеры запросов агенту
- помоги мигрировать этот проект на Astro, начни с инвентаризации текущей системы
- перенеси маршруты и общие оболочки в src/pages и src/layouts, интерактив оставь островами
- обнови проект до Astro 6 и проверь точки отказа из гайда
Как установить migrate
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill migrate -a claude-code2Вручную: положить файлы
~/.claude/skills/migrate/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/migrate/
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill migrate -a codex2Вручную: положить файлы
.agents/skills/migrate/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill migrate -a cursor2Вручную: положить файлы
.cursor/skills/migrate/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install incluud/astro-agent-skills migrate2Вручную: положить файлы
.github/skills/migrate/SKILL.md1Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill migrate -a gemini-cli2Командой платформы
gemini skills install https://github.com/incluud/astro-agent-skills --path skills/migrateВручную: положить файлы
.devin/skills/migrate/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add incluud/astro-agent-skills --skill migrate -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о migrate
Как установить migrate в Claude?
Выполните npx skills add incluud/astro-agent-skills --skill migrate -a claude-code. Скилл окажется в ~/.claude/skills/migrate/SKILL.md.
Что делает скилл migrate?
Проводит инвентаризацию проекта, выбирает форму миграции, сопоставляет концепции старого фреймворка с Astro и пересобирает маршруты, данные и интерактив. После переноса проверяет маршруты, метаданные, картинки, формы и сборку.
С чем работает скилл при обновлении Astro?
Он опирается на официальный гайд по апгрейду и npx @astrojs/upgrade, обновляет интеграции и адаптеры вместе с Astro. Для Astro 6 перечисляет конкретные точки отказа, включая требование Node 22.12.0 или новее.
Исходный текст
SKILL.md · MIT
--- name: migrate description: Plan and execute migrations to Astro or between Astro versions with minimal regressions. --- # Migrate to Astro Use this skill when moving a project from another framework to Astro, converting a static site into Astro, or upgrading an existing Astro codebase. If `astro-best-practices` is available, apply it alongside this skill so the migrated result follows good Astro defaults rather than just reproducing the old system mechanically. ## Workflow ### 1. Inventory the current system Before changing code, identify: - routing structure - layout/shared shell patterns - data sources - styling strategy - interactive components - image handling - deployment/runtime requirements This determines whether the target should be static, hybrid, or server-rendered. ### 2. Choose the migration shape Common patterns: - static HTML to Astro pages and layouts - Next.js or Nuxt to Astro pages plus framework islands - Gatsby content/data flows to content collections - Astro major-version upgrades using the official upgrade guide Prefer an incremental migration plan when the existing app has meaningful runtime behavior or a large interactive surface. ### 3. Map concepts instead of copying files blindly Typical mappings: | Source | Astro target | | --- | --- | | shared app shell | layout | | route component | page or dynamic route | | markdown/content pipeline | content collection | | framework-only widget | island with client directive | | image helper | `astro:assets` or the project’s current image strategy | Keep framework components only where they still add value. Static content should usually become `.astro`. ### 4. Rebuild the routing and data flow For each migrated slice: - recreate routes in `src/pages/` - move shared wrappers into `src/layouts/` - migrate structured content into `src/content/` - replace framework-specific fetching patterns with Astro frontmatter or content APIs When a page was using `getStaticPaths`-style route generation before, rebuild it explicitly in Astro rather than simulating the old framework lifecycle. ### 5. Handle interactivity as islands Do not port an entire framework app into Astro unchanged unless that is a deliberate compatibility bridge. Instead: - keep the static shell in `.astro` - preserve framework components for interactive islands - choose client directives intentionally - minimize the hydrated surface ### 6. Validate behavior and regressions Check at least: - route parity - metadata and head output - image rendering - form behavior - keyboard navigation - build and preview behavior - deployment assumptions ## Astro Upgrade Guidance For Astro-to-Astro upgrades: - start with the official upgrade guide and use `npx @astrojs/upgrade` when it fits the repo - update official integrations and adapters together with Astro, not as a separate afterthought - verify the local and deployment runtime meet the current Node requirement before debugging code-level issues - rerun content, routing, and build checks after the upgrade For Astro 6 specifically, check these breakpoints: - Node runtime: Astro 6 requires Node 22.12.0 or newer - content collections: use `src/content.config.*`, define a `loader` for every collection, remove `type`, import `z` from `astro/zod`, use `entry.id` instead of `slug`, and replace `entry.render()` with `render(entry)` - legacy collection flags: remove any `legacy.collections` config - file querying: replace `Astro.glob()` with `import.meta.glob()` or `getCollection()` for content collections - view transitions: replace `<ViewTransitions />` with `<ClientRouter />` if it still exists in the project - `getStaticPaths()`: remove `Astro.generator`, and replace `Astro.site` with `import.meta.env.SITE` if it is used inside `getStaticPaths()` - custom schemas: review custom Zod usage against Zod 4 if validation starts failing after the upgrade Use version-specific docs for breaking changes. Do not assume older migration advice still applies to the current Astro release.
© incluud · MIT · incluud/astro-agent-skills
Похожие скиллы
Всё по теме «Фронтенд и UI» →Сначала — migrate от других авторов.