create-adaptable-composable

Create Vue composables that normalize MaybeRef inputs with toRef and toValue.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/jaypatrick/skills --skill create-adaptable-composable-jaypatrick
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-adaptable-composable
Source: https://github.com/jaypatrick/skills/tree/main/create-adaptable-composable
Command: npx skills add https://github.com/jaypatrick/skills --skill create-adaptable-composable-jaypatrick

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adaptable composables solve the problem of building reusable Vue logic that can accept both plain values and reactive inputs, enabling components to be flexible without forcing input types upfront.

Core Features & Use Cases

  • Normalize inputs with toValue() or toRef() inside reactive effects to maintain predictable reactivity.
  • Support MaybeRef and MaybeRefOrGetter to handle values, refs, and getters uniformly.
  • Use cases include building adaptable UI utilities like a title manager or a counter that can accept a writable input or a getter.

Quick Start

Create a Vue composable that accepts MaybeRef inputs and normalizes them with toRef()/toValue() inside a reactive effect.

Frequently Asked Questions about create-adaptable-composable

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Vue 3 composable that accepts both reactive and plain values?

To create an adaptable Vue 3 composable, type your inputs as MaybeRef or MaybeRefOrGetter, then normalize them using toValue() or toRef() inside reactive effects like watch or watchEffect to handle plain values, refs, and getters uniformly.

What is the difference between toRef and toValue in Vue 3 composables?

toValue() normalizes MaybeRef or MaybeRefOrGetter inputs into plain values within reactive effects, while toRef() converts them into a ref, which is useful when building adaptable UI utilities that require a writable input or getter to maintain predictable reactivity.

How do I normalize MaybeRefOrGetter inputs inside a Vue watchEffect?

You normalize MaybeRefOrGetter inputs inside a Vue watchEffect by calling toValue() on the input variable directly within the effect scope, ensuring the watcher correctly tracks reactive dependencies while supporting plain values, refs, and getters.

Can I use MaybeRef types to build adaptable Nuxt 3 UI utilities?

Yes, you can use MaybeRef and MaybeRefOrGetter types to build adaptable Nuxt 3 UI utilities, enabling your components to flexibly accept plain values, refs, or getters without forcing reactive inputs upfront.

Why does my Vue composable lose reactivity when passing a getter function?

Your Vue composable loses reactivity when passing a getter if you do not normalize the MaybeRefOrGetter input using toValue() inside a reactive effect like watch or watchEffect, which is required to properly track the getter's dependencies.

When should I use MaybeRefOrGetter instead of standard ref in composable arguments?

You should use MaybeRefOrGetter instead of a standard ref when building reusable Vue logic that needs to consume both reactive and non-reactive inputs, allowing components to pass plain values or getters without forcing reactivity upfront.