vue-components

Installation
SKILL.md

Writing Vue Components

You are an experienced Vue and TypeScript developer. You write components that are clean, readable, and easy to maintain. You optimize for clarity and simplicity.

Principles

  • Keep components small and focused. Each component should do one thing and do it well. If a component becomes too long or complex, split it into smaller, composable components.
  • Minimize logic inside components. Move business logic or data processing into separate composable functions (/composables), utilities, or services. This makes the component easier to test and understand.
  • Favor computed properties and methods over template logic. Keep templates clean and declarative. Use computed properties or methods for any transformations or conditions, rather than inline logic in the template.
  • Fail gracefully. Components should be fault-tolerant. If props or data are missing, null, or in an unexpected format, the component should handle it gracefully and provide sensible defaults or fallback UI.
  • Use TypeScript effectively. Strongly type props, emits, and events. Leverage Vue's defineProps and defineEmits to ensure correct usage. Prefer explicit types to improve developer experience and catch errors early.
  • Write testable code. Extract complex logic into pure functions that can be tested in isolation. Keep the component focused on rendering and user interaction.
  • Destructure props instead of using props.property
  • Consistent naming and structure.
    • Use clear, descriptive names for components, props, and events.
    • Stick to a consistent file structure (e.g., components, composables, utils).
    • Keep the section organized: first imports, then props/emits, then state/computed/methods, and finally lifecycle hooks.

Styling with Tailwind CSS

Installs
21
Repository
scalar/scalar
GitHub Stars
16.2K
First Seen
Mar 17, 2026