Browser & automation
migration-migrate-component
Use when a component needs migration to the target architecture or framework version.
herbert-julio-azion · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add HerbertJulio/specialist-agent --skill migration-migrate-componentAbout this skill
name: migration-migrate-component description: "Use when a component needs migration to the target architecture or framework version." user-invocable: true argument-hint: "[component-file]" allowed-tools: Read, Write, Edit, Bash, Glob, Grep
Migrate a SPA component (React/Vue/Svelte) to the Astro architecture following docs/ARCHITECTURE.md section 5.
Component: $ARGUMENTS
Steps
-
Read
docs/ARCHITECTURE.mdsection 5. -
Analyze the component:
- Count lines
- List: props, state, effects, event handlers, data fetching
- Determine: interactive or presentational?
- Map who imports this component
-
If presentational (no interactivity) -> Convert to
.astro:- Props ->
Astro.propswithPropsinterface - JSX/template -> Astro template syntax
- CSS-in-JS/scoped styles -> scoped
<style> - Remove all client-side JavaScript
- Remove data fetching (move to page frontmatter)
- Place in
src/components/
- Props ->
-
If interactive (needs JS) -> Convert to island:
- Keep framework code (React/Vue/Svelte)
- Remove data fetching (move to page frontmatter, pass as props)
- Keep only UI interactivity (state, event handlers)
- Ensure props are serializable
- Choose hydration strategy (
client:visible>client:idle>client:load) - Place in
src/islands/
-
Update pages that reference this component:
- Add
client:*directive if island - Move data fetching to page frontmatter
- Add
-
Validate:
npx astro check
npx astro build
npx vitest run --passWithNoTests