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.

259 stars 28 forksFrontend & Design

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add PatternsDev/skills --skill script-setup
Manual install
git 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-setup

Personal 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>
```
Read the full skill on GitHub

Details

Skill name
script-setup
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

Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.