Script Setup
Teaches Vue's script setup syntax for concise Composition API usage. Use when writing Vue 3 single-file components and you want a more ergonomic, less boilerplate syntax for the Composition API.
Install
npx skills add PatternsDev/skills --skill script-setupgit clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/vue/script-setup ~/.claude/skills/script-setupPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# `<script setup>` ## Table of Contents - [When to Use](#when-to-use) - [Instructions](#instructions) - [Details](#details) - [Source](#source) `<script setup>` is compile-time syntactic sugar for using the Composition API in Vue single-file components. It eliminates boilerplate by automatically exposing top-level bindings to the template without an explicit `return` statement. ## When to Use - Use this as the recommended syntax when using both SFCs and the Composition API in Vue 3 - This is helpful for reducing boilerplate in component definitions ## Instructions - Add the `setup` attribute to the `<script>` tag: `<script setup>` - Top-level bindings (variables, functions, imports) are automatically available in the template — no `return` needed - Use `defineProps()` and `defineEmits()` (no import needed) for props and events - Use `withDefaults()` to provide default prop values in TypeScript - Imported components are automatically available in the template without explicit registration ## Details Before we delve into the `<script setup>` syntax and what it is, let's quickly recap two concepts — **single-file components** and the **Composition API**. In Vue, SFCs help couple logic by giving us the ability to define HTML/CSS and JS of a component all within a single **`.vue`** file. A single-file component consists of three parts: ```html <template> </template> <script> // JavaScript logic goes here </script> <style> /* CSS styles go here */ </style> ```
Details
- Skill name
script-setup- Repository
- PatternsDev/skills
- Path
vue/script-setup/SKILL.md- Repo updated
- 15 April 2026
FAQ
What does the Script Setup skill do?
Teaches Vue's script setup syntax for concise Composition API usage. Use when writing Vue 3 single-file components and you want a more ergonomic, less boilerplate syntax for the Composition API.
How do I install the Script Setup skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add PatternsDev/skills --skill script-setup. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Script Setup popular?
It lives in PatternsDev/skills, which has 259 GitHub stars and 28 forks.
Related skills
AI UI Patterns
259PatternsDev/skills
Teaches design patterns for building AI-powered React interfaces. Use when creating chatbots, intelligent assistants, streaming UIs, or any AI-driven user experience in React.
Async Components
259PatternsDev/skills
Teaches async component loading in Vue for performance optimization. Use when you have heavy components that aren't needed on initial render and can be loaded on demand.
Bundle Splitting
259PatternsDev/skills
Teaches bundle splitting techniques for web performance. Use when your application has a large JavaScript bundle that affects load times or when you need to reduce FCP/LCP.
Server Side Rendering
259PatternsDev/skills
Teaches server-side rendering (SSR) for React applications. Use when you need faster initial page loads, better SEO, or dynamic per-request HTML generation.
Renderless Components
259PatternsDev/skills
Teaches the renderless component pattern for logic-only Vue components. Use when you want to encapsulate behavior without dictating markup, letting consumers control rendering via scoped slots.
State Management
259PatternsDev/skills
Teaches Vue state management with stores, Pinia, and the Composition API. Use when you need to share and synchronize state across multiple components beyond what props and events can handle.
Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.