Vue Component Refactoring Tool skill for Claude and Codex
Breaks an oversized Vue single-file component into composables and focused child components without changing its props or emits, with each new file complete…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a Vue single-file component has grown past a few hundred lines and needs its logic pulled into composables and its template split into child components. Do not use for scaffolding a new component, fixing a bug in place, or formatting loose pieces into a single file. Related topics: coding, vue.
What it will ask you for
- Original SFC code (longer free text)
- Target style (choose one: Vue 3 script setup, Vue 3 Composition API with setup(), Vue 2 Options API)
- Max lines per component (number from 50 to 400)
- Extract logic into composables (choose one: Yes, No)
- File naming convention (choose one: PascalCase, kebab-case)
- Component granularity (choose any: Atomic, Molecular, Organism, Page)
- Must stay unchanged (longer free text)
How it works
- Map the component's concerns (fetching, form state, derived values, handlers) to the template regions that use them; every concern has an owner.
- Extract each template-free stateful concern into a composable returning refs and functions, testable without mounting.
- Extract each template region with its own data into a child component at the chosen granularity, using props down and emits up.
- Keep the parent's props, emits, and exposed methods byte-identical and re-split any file over the line limit.
- Emit one block per file with its path and a header comment, then list what moved where and anything not preserved.
What you get
Fenced code blocks for each new composable, the updated parent, and each child component with file paths, then a short list of moves and anything the split could not preserve.
What it watches out for
- Letting a child component reach into the parent's state through refs or provide, which couples the pieces the split was meant to separate.
- Changing a prop name or emit signature on the parent during the split, so every existing caller breaks.
- Extracting a composable that still references template refs, which cannot be tested without mounting the component.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.