create-adaptable-composable

Design Vue 3 composables that normalize MaybeRef and MaybeRefOrGetter inputs with toRef or toValue.

2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/bingeli1379/eli-claude-marketplace --skill create-adaptable-composable-bingeli1379
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-adaptable-composable
Source: https://github.com/bingeli1379/eli-claude-marketplace/tree/main/plugins/eureka-sdd/skills/create-adaptable-composable
Command: npx skills add https://github.com/bingeli1379/eli-claude-marketplace --skill create-adaptable-composable-bingeli1379

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adaptable composables solve the challenge of creating reusable Vue utilities that work with both plain values and reactive inputs, eliminating the need to rewrite logic for different input types.

Core Features & Use Cases

  • Define a single API and normalize inputs with toRef or toValue to support both reactive and non-reactive values.
  • Provide support for MaybeRef and MaybeRefOrGetter inputs, enabling flexible usage across components.
  • Include practical design steps and patterns that can be applied to common Vue composables like useDocumentTitle or useCounter.

Quick Start

Design a reusable Vue composable that accepts both plain values and reactive inputs and normalizes them with toRef or toValue.

Frequently Asked Questions about create-adaptable-composable

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

FAQPage Schema
How do I make Vue composables accept both plain values and reactive inputs?

Vue composables handle both plain values and reactive inputs by defining a single API and normalizing inputs with toRef or toValue. This approach natively supports MaybeRef and MaybeRefOrGetter types without requiring duplicated logic.

What is the difference between toValue and toRef when normalizing composable inputs?

Normalizing composable inputs with toRef creates a ref from a MaybeRefOrGetter for reactive state tracking, while toValue extracts the plain value from a MaybeRefOrGetter. Choose toRef when you need ongoing reactivity, and toValue for one-time value extraction.

Does this composable pattern work with Nuxt 3 projects?

Yes, this composable pattern works with both Vue 3 and Nuxt 3 projects. The design steps for normalizing inputs with toRef or toValue apply directly to both environments to create flexible reactive utilities.

When should I use MaybeRefOrGetter instead of MaybeRef in my composable API?

You should use MaybeRefOrGetter instead of MaybeRef when you want to support getter functions as inputs for lazy evaluation. This allows passing a function that returns a value, providing extra flexibility over standard refs or plain values.

What are the steps to build an adaptable Vue composable?

Building an adaptable Vue composable requires confirming the API, normalizing inputs with toRef or toValue to support MaybeRef types, and implementing the core reactive logic using Vue's APIs. This ensures the utility works flexibly across components.

Why does my Vue composable fail to update when I pass a reactive variable?

A Vue composable may fail to update with a reactive variable if it does not normalize the input using toRef or toValue. Without normalizing MaybeRef or MaybeRefOrGetter inputs, the composable loses reactivity when processing plain values.