skilld-dev/vue-ecosystem-skills/vueuse-math-skilld
Claude Code and agent skill by skilld-dev/vue-ecosystem-skills
- community
Checking that the SKILL.md file is still in the repository.
Math composables for Vue 3 from @vueuse/math. Use when writing or debugging code that imports "@vueuse/math", or when clamping, projecting, rounding, averaging, summing, or combining reactive numbers in Vue.
Install
npx vskill@latest install skilld-dev/vue-ecosystem-skills/vueuse-math-skilldSKILL.md
@vueuse/math 15.0.0
Reactive math for Vue 3. Every composable resolves inputs with toValue inside a computed, so arguments accept plain numbers, refs, or getters (MaybeRefOrGetter<number>), and the result is a ComputedRef<number> that tracks every input (dist/index.js:70-71). The one exception: useClamp with a mutable ref returns a writable computed (dist/index.d.ts:83).
Environment
- Install:
npm i @vueuse/math @vueuse/core(README.md:10).@vueuse/coreis needed only when combining with core functions such aswhenever. - Vue
^3.5.0peer dependency (package.json:42), minimum since v14. - Node.js
>= 22(package.json:39); v15 dropped Node.js 20 (release). - ESM-only since v13:
"type": "module", no CommonJS build (package.json:3; release). Use dynamicimport()if a CJS context must load it. "sideEffects": false(package.json:24): unused composables tree shake away.- Runtime dependency:
@vueuse/shared@15.0.0(package.json:45), which suppliesclampandreactify. - Entry
dist/index.js, typesdist/index.d.ts(package.json:30,34).
Exports
From dist/index.d.ts:167:
- Functions:
createGenericProjection,createProjection,logicAnd,logicNot,logicOr,useAbs,useAverage,useCeil,useClamp,useFloor,useMath,useMax,useMin,usePrecision,useProjection,useRound,useSum,useTrunc - Types:
ProjectorFunction,UseProjection,UseMathKeys,UseMathReturn,UsePrecisionOptions - Deprecated aliases:
and,or,not(dist/index.d.ts:20-21,32-33,44-45)
Signatures, behavior notes, and per-function examples: references/api.md. Version-specific changes: references/migrations.md.
Common tasks
Writable clamped state; pass a mutable ref so assignments are clamped automatically:
Read-only clamp; pass a getter or readonly ref (dist/index.js:113):
Aggregate fixed refs with rest arguments instead of building an array (dist/index.d.ts:154-155):
Map a value between domains, for sliders, charts, or progress UIs:
Reuse one projection across components; domains may be reactive:
Round to decimal places and keep a number, not the string toFixed returns:
Combine boolean flags reactively, then feed side effects to whenever from @vueuse/core:
Rules and pitfalls
- Never use the aliases
and,or,not; deprecated since v14 in favor oflogicAnd,logicOr,logicNot(dist/index.d.ts:20,32,44; release). useAveragedivides byarray.lengthwith no empty check: empty input yieldsNaN(dist/index.js:91-96). Guard the empty case yourself.useMax()with no inputs resolves to-InfinityanduseMin()toInfinity, because both spread intoMath.max/Math.min(dist/index.js:157-176).- Aggregations (
useSum,useAverage,useMin,useMax) accept refs, getters, numbers, arrays of those, and flatten nested arrays one level viatoValueArgsFlat(dist/index.js:75-81). usePrecisionavoids float drift by scaling through the decimal string of the value (accurateMultiply,dist/index.js:187-193);options.mathdefaults to'round'(dist/index.d.ts:122).useMathaccepts onlyMathkeys that are functions, such as'pow'or'sqrt', never constants likePI(dist/index.d.ts:96).- Projection is linear by default:
(input - from[0]) / (from[1] - from[0]) * (to[1] - to[0]) + to[0](dist/index.js:12-14). For non-linear mapping (log scales, easing), pass a customprojector, or usecreateGenericProjectionfor non-number domains (dist/index.d.ts:4-6). - Prefer these composables over
computed(() => Math.x(...))in templates and watchers; they centralize theMathcall, stay reactive to every argument, and carry@__NO_SIDE_EFFECTS__annotations for tree shaking (dist/index.js:4,15,111).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/vueuse-math-skilld/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/skilld-dev/vue-ecosystem-skills/vueuse-math-skilld)