create-adaptable-composable

Create Vue.js composables that normalize reactive and plain inputs with toValue() and toRef().

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/AdrianAVA9/cero-base --skill create-adaptable-composable-adrianava9
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-adaptable-composable
Source: https://github.com/AdrianAVA9/cero-base/tree/main/.agents/skills/create-adaptable-composable
Command: npx skills add https://github.com/AdrianAVA9/cero-base --skill create-adaptable-composable-adrianava9

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It addresses the challenge of creating Vue composables that can accept both reactive (ref, computed) and non-reactive (plain) values, simplifying code reuse and enhancing flexibility.

Core Features & Use Cases

  • Flexible API Design: Developers can pass plain values, refs, or getter functions without manual conversions.
  • Reactive Normalization: Uses toValue() and toRef() internally to normalize inputs for consistent reactivity.
  • Use Case: When building a Vue component or composable that needs to handle user input, URL parameters, or reactive state seamlessly.

Quick Start

Use this skill to create a Vue composable that accepts both reactive and non-reactive inputs for maximum reusability.

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 a Vue composable accept both reactive refs and plain values?

Make a Vue composable accept both reactive refs and plain values by normalizing inputs with toValue() and toRef(), ensuring consistent reactivity without manual conversions from the calling component.

What's the best way to handle mixed reactive and static inputs in Vue3 composables?

Handling mixed reactive and static inputs in Vue3 composables is best done by normalizing arguments with toValue() and toRef(), allowing seamless processing of user input, reactive state, or static values.

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

A Vue composable loses reactivity when passing a getter function if it fails to normalize the input. Using toValue() internally unpacks the getter and preserves the reactive dependency tracking.

Do I need to manually unwrap refs when building Nuxt3 composables?

You do not need to manually unwrap refs when building Nuxt3 composables if you normalize inputs with toValue() and toRef(), which automatically handles plain values, refs, and getters.

Can I use toValue() to normalize computed properties in Vue3?

Yes, you can use toValue() to normalize computed properties in Vue3. It effectively unwraps refs and computed refs into their underlying values while maintaining the reactive dependency within the composable.