add-component

Generate Astro or Svelte components with i18n and TypeScript interfaces.

3|1|Updated May 15, 2025
One-click install
npx skills add https://github.com/xergioalex/xergioalex.com --skill add-component-xergioalex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-component
Source: https://github.com/xergioalex/xergioalex.com/tree/main/.claude/skills/add-component
Command: npx skills add https://github.com/xergioalex/xergioalex.com --skill add-component-xergioalex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of new UI components in Astro or Svelte, ensuring they adhere to project conventions and best practices.

Core Features & Use Cases

  • Component Generation: Automatically creates .astro or .svelte files based on provided name and purpose.
  • Technology Selection: Intelligently suggests Astro for static content and Svelte for interactive elements.
  • Location Guidance: Places components in appropriate directories (e.g., src/components/blog/).
  • i18n Integration: Enforces the use of getTranslations(lang) for all user-visible text.
  • Best Practice Enforcement: Includes dark mode support, TypeScript interfaces, and accessibility considerations.
  • Use Case: When building a new feature that requires a reusable button with hover effects, use this skill to generate an interactive Svelte button component correctly placed and internationalized.

Quick Start

Use the add-component skill to create a new Svelte component named UserProfileCard for displaying user details.

Frequently Asked Questions about add-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Astro or Svelte components that automatically follow project conventions?

To generate Astro or Svelte components following project conventions, you can use an automated component generation skill that creates `.astro` or `.svelte` files. It enforces best practices like optimal placement in `src/components/` and TypeScript interfaces.

When should I use Astro vs Svelte for building new UI components?

Choose Astro for static content components and Svelte for interactive UI elements. An automated component generator can intelligently suggest the right technology based on your component's purpose, ensuring you use the appropriate framework for your specific use case.

How do I add internationalization (i18n) to a new Svelte or Astro component?

To add i18n to new Svelte or Astro components, the generation process integrates with `getTranslations(lang)` for all user-visible strings. This enforces internationalization requirements automatically, ensuring your components are ready for multi-language support.

Does component generation for Astro include dark mode support and TypeScript interfaces?

Yes, component generation for Astro and Svelte includes dark mode support and TypeScript interfaces by default. The process enforces these best practices automatically, alongside accessibility considerations, ensuring robust and fully typed UI components.

What is the best way to structure interactive Svelte components within an Astro project?

The best way to structure interactive Svelte components within an Astro project is by placing them in appropriate subdirectories like `src/components/blog/`. A component generation skill determines optimal component placement automatically based on your project's established directory patterns.

Can I create a reusable Svelte button with hover effects and internationalization automatically?

Yes, you can automatically create a reusable Svelte button with hover effects and internationalization. By specifying the component name and purpose, the generation skill outputs an interactive Svelte component correctly placed, typed, and integrated with `getTranslations(lang)`.