vue-component-patterns

Apply Vue 3 component-pattern standards to enforce consistent design and refactoring.

23|3|Updated Jun 28, 2022
One-click install
npx skills add https://github.com/Esposter/Esposter --skill vue-component-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-component-patterns
Source: https://github.com/Esposter/Esposter/tree/main/.agents/skills/vue-component-patterns
Command: npx skills add https://github.com/Esposter/Esposter --skill vue-component-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline and standardize Vue 3 component design by applying proven patterns for structure, typing, co-location, slot extraction, and abstraction levels.

Core Features & Use Cases

  • Consistent Architecture: enforce same level of abstraction, proper prop typing, and focused components.
  • Co-location & Naming: organize related components to optimize auto-imports and avoid naming collisions.
  • Slot Extraction & Reuse: extract complex slots into focused subcomponents to improve readability and testability.
  • Composition API Patterns: promote use of composables and wrapper/pure child patterns to manage async data and store access cleanly.
  • Granularity Guidance: guidance for when to extract actions into dedicated components, avoid over-extraction.

Quick Start

Analyze a target Vue component and apply the vue-component-patterns guidelines to split layout, logic, and slots into focused, co-located components.

Frequently Asked Questions about vue-component-patterns

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

FAQPage Schema
How do I structure Vue 3 components for scalability?

To structure Vue 3 components for scalability, enforce consistent architecture by co-locating related folders, requiring clearly typed props, and splitting layout, logic, and slots into focused child components to improve readability and testability.

What is slot extraction in Vue 3 and when should I use it?

Slot extraction in Vue 3 is the process of extracting complex slots into focused subcomponents. You should use it to improve readability and testability when your component's slots become too complicated to manage inline.

How do I organize Vue 3 components to avoid naming collisions?

To avoid naming collisions in Vue 3, organize your codebase using co-located folders that group related components together, which optimizes auto-imports and maintains a consistent component architecture.

When should I extract actions into dedicated Vue components?

You should extract actions into dedicated Vue components when it increases focus and reusability, but you must avoid over-extraction. Granularity guidance helps determine the right abstraction level for your UI.

Can I use Composition API patterns to manage async data in Vue 3?

Yes, you can use Composition API patterns to manage async data in Vue 3 by promoting composables and wrapper or pure child patterns. This approach cleanly manages store access and separates data logic from the UI.