add-component

Create factory-based UI components with CSS variable theming and destroy cleanup.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams create a reusable, well-structured UI component using a factory pattern, ensuring theme compatibility and proper cleanup. It reduces duplication and enforces a consistent API across components.

Core Features & Use Cases

  • Factory-based component creation: provide a standard way to instantiate components with a defined Options and Handle interface.
  • Theme-friendly design: components consume CSS variables for colors and tokens to stay aligned with the app theme.
  • Lifecycle management: destroy() cleans up listeners and resources to prevent leaks.
  • Reuse and composition: encourages integrating with existing components like ArcadeButton, Modal, and Progress indicators.

Quick Start

Create a new component by using the factory function with a name and options, wire it into your UI, and ensure destroy cleans up resources when removed.

Frequently Asked Questions about add-component

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

FAQPage Schema
How do I build reusable UI components with a factory pattern in TypeScript?

To build reusable UI components with a factory pattern, use a standardized factory function that returns a handle with a root HTMLElement and a destroy method for safe cleanup. This enforces consistent APIs and lifecycle management across your frontend project.

What is the best way to prevent memory leaks when dynamically creating frontend components?

The best way to prevent memory leaks when creating frontend components is implementing lifecycle management via a destroy() function. This cleanup method removes event listeners and releases resources when the component is removed from the DOM.

How do I ensure my custom UI components stay aligned with the app theme?

To ensure custom UI components stay aligned with the app theme, design them to consume CSS variables for colors and design tokens. This theme-friendly approach maintains visual consistency without hardcoding styles inside the component logic.

Can I compose a new factory-based component with existing UI elements like a Modal?

Yes, you can compose a new factory-based component with existing UI elements like a Modal. The factory pattern supports optional subcomponents and safe composition, allowing you to integrate new components seamlessly alongside existing ArcadeButton or Progress indicators.

Does a factory-based component creation workflow require external UI libraries?

No, a factory-based component creation workflow does not require external UI libraries. It relies on native TypeScript and standard HTMLElement handles, enabling you to enforce reusability and design-system consistency without adding heavy dependencies to your project.