create-adaptable-composable

Standardize Vue.js composable inputs with MaybeRef and MaybeRefOrGetter patterns.

4|Updated Jun 10, 2026
One-click install
npx skills add https://github.com/mymx2/foreman --skill create-adaptable-composable-mymx2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-adaptable-composable
Source: https://github.com/mymx2/foreman/tree/main/.qoder/skills.collected/skills/create-adaptable-composable
Command: npx skills add https://github.com/mymx2/foreman --skill create-adaptable-composable-mymx2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of managing reactivity in reusable Vue composables, ensuring they handle various input types—like plain values, refs, and getters—consistently without breaking reactivity.

Core Features & Use Cases

  • Input Normalization: Standardizes inputs using MaybeRef and MaybeRefOrGetter patterns.
  • Reactivity Safety: Implements toValue and toRef to ensure predictable behavior within watchers and effects.
  • Use Case: Ideal for building library-grade composables that need to support both static values and dynamic reactive sources, such as custom hooks for UI state or DOM manipulation.

Quick Start

Use the create-adaptable-composable skill to refactor my existing composable to support MaybeRefOrGetter inputs and normalize them using 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 refs, getters, and plain values?

To make Vue composables accept refs, getters, and plain values, implement MaybeRef and MaybeRefOrGetter patterns. This normalizes inputs using toValue and toRef, ensuring your composable maintains reactivity across various dynamic and static data sources.

What is the best way to normalize reactive inputs in Vue.js composables?

The best way to normalize reactive inputs in Vue.js composables is utilizing the toValue and toRef utilities. These functions standardize MaybeRefOrGetter inputs into predictable reactive references within watchers and effects, preventing broken state management.

How do I refactor an existing Vue composable to support MaybeRefOrGetter inputs?

To refactor an existing Vue composable to support MaybeRefOrGetter inputs, update the function signatures to accept these flexible types and process them internally using toValue. This ensures your existing composable handles both static values and dynamic reactive sources consistently.

Why does my Vue composable lose reactivity when passed a getter or plain value?

Your Vue composable loses reactivity when passed a getter or plain value if it lacks proper input normalization. By implementing MaybeRefOrGetter patterns and unwrapping values with toValue inside reactive effects, you ensure consistent state tracking across all input types.

Do I need TypeScript to build library-grade Vue composables with flexible inputs?

TypeScript is highly recommended to build library-grade Vue composables with flexible inputs because it provides type safety for MaybeRef and MaybeRefOrGetter patterns. This ensures your reusable functions correctly handle plain values, refs, and getters without breaking reactivity.