vue-optimizer
Skill1 starsChanged 8 days agoMITView on GitHub
Audit and optimize Vue 3 apps (Vue 3.5 stable, Vue 3.6 RC/Vapor opt-in, Vite 8 with Rolldown/Oxc, Vue Router 5 file-based routing, Pinia 4, Vitest 5) for reactivity and re-render cost, large-list and watcher behavior, Pinia store and SSR state leaks, route-level code splitting and data loading, bundle size and asset handling, forms/accessibility, hydration mismatches, and Vue 2/Vue Router/Pinia/Vite migrations, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions a slow Vue app, Vue 3.5 to 3.6, Vapor Mode, reactivity/ref/reactive/computed/watch, Pinia/Vuex, Vue Router 4 to 5, Vite 7 to 8/Rolldown, SSR/hydration, bundle size, large lists, or "optimize my Vue app" -- even if they never say "audit" or "optimize". For Nuxt apps use the Nuxt optimizer instead.
- Reads credentials
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-optimizerSkill
- csharp-optimizerSkill
- cpp-optimizerSkill
- c-optimizerSkill
- go-optimizerSkill
- node-service-optimizerSkill
- ruby-optimizerSkill
- rust-optimizerSkill
- docker-optimizerSkill
- kubernetes-optimizerSkill
- terraform-optimizerSkill
- animate-cssSkill
- animejsSkill
- auto-animateSkill
- gsapSkill
- lenisSkill
- magicuiSkill
- motionSkill
- react-moveSkill
- react-springSkill
- react-three-fiberSkill
- theatrejsSkill
- threejsSkill
- optimizer-routerSkill
- bootstrap-optimizerSkill
- pandacss-optimizerSkill
- sass-scss-optimizerSkill
- stylex-optimizerSkill
- tailwindcss-optimizerSkill
- twind-optimizerSkill
- unocss-optimizerSkill
- vanilla-extract-optimizerSkill
- angular-optimizerSkill
- astro-optimizerSkill
- ui-components-optimizerSkill
- nextjsSkill
- node-optimizerSkill
- nuxt-optimizerSkill
- react-optimizerSkill
- remix-optimizerSkill
- solid-optimizerSkill
- svelte-optimizerSkill
- tanstack-start-optimizerSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run python <skill-dir>/scripts/audit.py <project-root> -- static scan of package.json, vite.config.*, .env*, and .vue/.ts/.js sources for …
- Very specific: line 17
Read references/tooling.md once: what can be measured here (vite build, vite preview, bundle visualizer, Vue DevTools, Lighthouse).
- Very specific: line 46
Use plan mode: EnterPlanMode (load with ToolSearch if deferred), write the plan, present with ExitPlanMode.
- Very specific: line 69
Vite 8 uses Rolldown and Oxc: Prefer rolldownOptions/oxc.
- Distinctive: line 72
Docs move: Check vuejs.org, router.vuejs.org, pinia.vuejs.org and vite.dev for the installed major, not memory.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vue Optimizer
Audit a Vue 3 codebase, report what is slow or fragile and why, agree a plan with the user, then fix it. Order: evidence, approval, edits. Vue's performance is mostly decided by reactivity granularity, component boundaries, list keys and what ships to the client; changing those can alter behavior, so nothing is edited before approval.
Workflow
1. Scope (quick)
- Find the root (
package.jsonwithvue,vite.config.*). Record: Vue version (3.5 stable; 3.6 RC/Vapor opt-in), Vite/Rolldown, Vue Router 5 vs 4, Pinia 4 vs 3/Vuex, TypeScript/vue-tsc, test runner, and whether the app is SPA, SSR, or SSG. For Nuxt, hand off toskills/web/nuxt. - Run
python <skill-dir>/scripts/audit.py <project-root>-- static scan ofpackage.json,vite.config.*,.env*, and.vue/.ts/.jssources for version/compat drift, missing Vue plugin, v-for keys, v-if+v-for, v-html/XSS, store destructuring, watcher/listener leaks, route eager imports, SSR hazards and bundle config, with file:line evidence. Use--jsonto post-process. - Classify the pain: slow first load (bundle/assets), slow interactions (reactivity/re-renders), large lists, memory growth (watchers/listeners), SSR/hydration, forms/a11y, or migration. Ask which hurts if unclear.
- Read
references/tooling.mdonce: what can be measured here (vite build,vite preview, bundle visualizer, Vue DevTools, Lighthouse).
2. Audit
The script finds cheap leads; you find the rest by reading. Read vite.config.*, src/main.ts, src/App.vue, the router and store, and the 3-5 hottest components. Load only what applies:
| Area | Reference |
| ref/reactive/shallowRef, computed, watch, props, template refs | references/reactivity.md |
| Re-render cost, v-for keys, v-memo, async components, lists | references/rendering-performance.md |
| Pinia 4 stores, storeToRefs, SSR state, Vuex migration | references/state-pinia.md |
| Vue Router 5, lazy routes, guards, loaders, data fetching | references/router-data.md |
| Vite 8/Rolldown, chunks, env vars, assets, bundle analysis | references/build-bundle.md |
| Vue SSR, hydration, streaming, per-request state | references/ssr-hydration.md |
| v-model/defineModel, validation, labels, dialogs, focus | references/forms-a11y.md |
| XSS, env/secrets, auth, strict types, lint/tests | references/safety-quality.md |
| Vue 2 → 3, Vue 3.5 → 3.6/Vapor, Router 5, Pinia 4, Vite 8 | references/migration.md |
| Measurement and honest reporting | references/tooling.md |
Measure, never guess. Build for production (vite build) and serve vite preview (or the SSR server), then measure that. Dev mode and a single warm interaction are not evidence. Record route/entry JS and CSS, chunk graph, LCP/INP/CLS, Vue DevTools render counts, memory/listener counts and hydration warnings.
Mark each finding Confirmed (build output, profiler, code evidence) or Suspected (needs measuring).
3. Report
Fill assets/report-template.md, save it as VUE_OPTIMIZATION_REPORT.md in the project root, and show the user. Five-line summary, findings table by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, behavior impact). Group near-duplicates.
4. Plan -- then stop for approval
Use plan mode: EnterPlanMode (load with ToolSearch if deferred), write the plan, present with ExitPlanMode; if unavailable show it in chat and wait for an explicit "go". Structure:
- Quick wins -- stable
:key, splitv-if+v-for, replace template method calls withcomputed, addshallowRef/markRawfor big immutable data, usestoreToRefs, stop deep-watching large objects, adddefineAsyncComponent/lazy routes, addloading/dimensions to images, fix labels/button types, add bundle budgets. Low risk. - Structural -- split god components, virtualize large lists, move data fetching to route loaders/composables with cancellation, adopt Pinia setup stores and selectors, add SSR/SSG where it fits, configure Rolldown chunk groups, prune UI/icon libraries. Name each behavior change.
- Heavy -- Vue 2 → 3, Vue 3.5 → 3.6/Vapor (RC), Vue Router 4 → 5 file-based routing, Pinia 3 → 4, Vite 7 → 8, SSR architecture, design-system extraction. Separately approved. Each step: files touched, expected effect, how to verify, how to roll back.
5. Fix
Only approved items, in small groups. After each: vue-tsc --noEmit, lint, tests, vite build, and the affected route/profile. A break must trace to one change. Do not mix a major-version migration or Vapor adoption with optimization edits. If a change alters public props/emits, routing/data flow, SSR boundaries, or store contracts, stop and ask.
6. Verify and wrap up
Re-measure the same routes and interactions: entry/route JS and CSS, chunk sizes, Vue DevTools render counts, LCP/INP/CLS, memory/listener counts, hydration warnings, test time. State plainly what could not be measured. End with deferred items and one suggested next step.
Principles
- Reactivity is fine-grained by design. Vue tracks property reads; the cost appears when you make whole objects deeply reactive, deep-watch large trees, or re-render large component subtrees.
- Keys decide list identity. A stable
:keypreserves state and avoids DOM churn; index keys break reorder/insert/delete flows. shallowRefis the large-data tool. Replace the array/value instead of mutating thousands of nested properties; usemarkRawfor non-reactive instances.- Computed is the template cache. Move filtering/sorting/formatting out of templates and methods; avoid side effects in
computed. - Pinia state is not automatically reactive through destructuring. Use
storeToRefsfor state/getters and keep actions on the store. - Routes are bundle boundaries.
component: () => import(...)keeps a view out of the entry; static imports negate it. - Vite 8 uses Rolldown and Oxc. Prefer
rolldownOptions/oxc;rollupOptions/esbuildare compatibility paths, not the target. - SSR is a state and markup contract. Per-request state,
useSSRContext,onServerPrefetchand matching client markup decide whether hydration works. - Vapor Mode is an RC, not a default. Vue 3.6/Vapor is opt-in and partial; measure a single page before trusting it.
- Docs move. Check vuejs.org, router.vuejs.org, pinia.vuejs.org and vite.dev for the installed major, not memory.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

