component-discovery

Registers Vue 3 components automatically via component.js configuration files in Vite projects.

3|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/ZHLX2005/sl --skill component-discovery-zhlx2005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-discovery
Source: https://github.com/ZHLX2005/sl/tree/main/skills/component-discovery
Command: npx skills add https://github.com/ZHLX2005/sl --skill component-discovery-zhlx2005

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually registering routes and catalog entries for every new Vue component is repetitive and error-prone. This Skill defines the conventions for a fully automated component discovery system in Vue 3 + Vite projects, so components are registered, routed, and displayed simply by creating files in the right structure. ## Core Features & Use Cases - Automatic Component Registration: Uses Vite's import.meta.glob to scan src/components for component.js files and register them without manual route configuration. - Standardized Configuration Schema: Enforces required fields (name, title, description, version, group, category, tags, component) with automatic validation. - Automatic Routing and Display: Registers routes at /components/{name} or a custom path, and lists components on the homepage with search and filtering. - Use Case: When adding a new data table component to a Vue 3 dashboard, create src/components/MyTable/component.js and index.vue following this spec, then run npm run dev—the component appears on the homepage with its own route automatically. ## Quick Start Ask the AI to create a new Vue component named MyTable in src/components following the component-discovery conventions with a component.js config and index.vue implementation.

Frequently Asked Questions about component-discovery

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

FAQPage Schema
How do I auto-register Vue 3 components without manual route configuration?

Create a directory under src/components containing a component.js config file and an index.vue implementation. Vite's import.meta.glob scans all component.js files at build time, and the discovery system registers routes and homepage entries automatically.

What fields are required in a Vue component.js configuration file?

Eight fields are mandatory: name, title, description, version, group, category, tags, and component (the relative path to the .vue file). Missing any of these causes the component to fail validation and not be discovered.

Why is my Vue component not appearing after creating component.js?

The most common cause is a mismatch between the directory name and the name field, which is case-sensitive. Also verify all required fields are present, then restart the dev server with npm run dev.

Can I customize the route path for an auto-discovered Vue component?

Yes, add a route object with a custom path in component.js, such as route: { path: '/my-table' }. Without it, the system defaults to /components/{name}. You can also set meta.title and meta.icon for the page.

Does import.meta.glob work for component discovery in Vite production builds?

Yes, import.meta.glob is a Vite compile-time feature that works in both dev and production builds. It statically analyzes the glob pattern and bundles all matched component.js files for runtime loading.