vee-validate-skilld
Skill184 starsChanged 37 days agoMITView on GitHub
Use when writing, reviewing, or debugging Vue.js forms that import vee-validate (useForm, defineField, useField, useFieldArray, Form, Field, FieldArray, ErrorMessage). Provides correct v4.15.x Composition API and component usage, validation schema patterns, typed-schema integration, version-specific API changes since 4.9, deprecations, and known pitfalls.
In this repository35 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- floating-ui-vue-skilldSkill
- formkit-core-skilldSkill
- motion-v-skilldSkill
- pinia-colada-skilldSkill
- pinia-skilldSkill
- primevue-skilldSkill
- quasar-skilldSkill
- reka-ui-skilldSkill
- shadcn-vue-skilldSkill
- slidev-cli-skilldSkill
- tanstack-ai-vue-skilldSkill
- tanstack-vue-form-skilldSkill
- tanstack-vue-query-skilldSkill
- tanstack-vue-router-skilldSkill
- tanstack-vue-store-skilldSkill
- tanstack-vue-table-skilldSkill
- tanstack-vue-virtual-skilldSkill
- tresjs-core-skilldSkill
- unhead-vue-skilldSkill
- unovis-ts-skilldSkill
- unovis-vue-skilldSkill
- vitepress-skilldSkill
- vue-data-ui-skilldSkill
- vue-i18n-skilldSkill
- vue-router-skilldSkill
- vue-skilldSkill
- vue-test-utils-skilldSkill
- vuetify-skilldSkill
- vueuse-components-skilldSkill
- vueuse-core-skilldSkill
- vueuse-integrations-skilldSkill
- vueuse-math-skilldSkill
- vueuse-motion-skilldSkill
- vueuse-shared-skilldSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 81
Never write directly to values.field.
- Very specific: line 90
Keep schemas non-reactive: declare them outside ref/reactive or wrap with markRaw to avoid deep reactivity overhead …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
vee-validate 4.15.1
Form validation for Vue 3. Facts below come from the prepared source (dist/vee-validate.d.ts, dist/vee-validate.mjs, package.json) and official docs at https://vee-validate.logaretm.com/v4/.
Environment
- Package
vee-validate@4.15.1(package.json:3). Requiresvue ^3.4.26as peer (package.json:42). - ESM + CJS,
sideEffects: false, single entryvee-validate(package.json:11-26). - v4 supports Vue 3 only. Vue 2 needs vee-validate 2.x/3.x (README:69-72).
- Schema adapters live in separate packages:
@vee-validate/yup,@vee-validate/zod,@vee-validate/valibot; global rules in@vee-validate/rules; messages in@vee-validate/i18n.
Two API styles
Composition API (preferred for new code). useForm + defineField + handleSubmit:
<script setup>
import { useForm } from 'vee-validate';
function required(value) {
return value ? true : 'This field is required';
}
const { defineField, handleSubmit, errors } = useForm({
validationSchema: { field: required },
});
const [field, fieldProps] = defineField('field');
const onSubmit = handleSubmit(values => {
console.log(values);
});
</script>
<template>
<form @submit="onSubmit">
<input v-model="field" v-bind="fieldProps" />
<span>{{ errors.field }}</span>
<button>Submit</button>
</form>
</template>Source: README:84-118, https://vee-validate.logaretm.com/v4/guide/composition-api/getting-started/
Declarative components. Form + Field with scoped slots:
<script setup>
import { Field, Form } from 'vee-validate';
function required(value) {
return value ? true : 'This field is required';
}
function onSubmit(values) {
console.log(values);
}
</script>
<template>
<Form v-slot="{ errors }" @submit="onSubmit">
<Field name="field" :rules="required" />
<span>{{ errors.field }}</span>
<button>Submit</button>
</Form>
</template>Source: README:122-153, https://vee-validate.logaretm.com/v4/guide/components/handling-forms/
Core rules
- Bind fields with
defineField(path, config?). It returns[model, props]; spread the props withv-bindand the model withv-model(dist/vee-validate.d.ts:443, https://vee-validate.logaretm.com/v4/api/use-form/#definefield). - Never write directly to
values.field; use thedefineFieldmodel,setFieldValue, oruseSetFieldValue. useFieldModel,defineComponentBinds, anddefineInputBindsare deprecated in favor ofdefineField(dist/vee-validate.d.ts:444-459).- Show errors only after interaction, e.g.
v-if="errorMessage && meta.touched", to avoid aggressive validation UX (https://vee-validate.logaretm.com/v4/guide/best-practices/#avoiding-aggressive-validation). - For TypeScript, wrap yup/zod/valibot schemas with
toTypedSchemafrom the matching@vee-validate/*package. Passing a raw schema without it fails with "No such validator 'VVTypedSchema' exists" (https://vee-validate.logaretm.com/v4/guide/composition-api/typed-schema/, https://github.com/logaretm/vee-validate/discussions/4819). useFieldinside a custom component must not sync its v-model by default (syncVModeldefaults tofalse, breaking change in 4.10.0). Opt in per field withsyncVModel: trueor a model prop name string (dist/vee-validate.mjs:1862).- Field names are paths. Dots nest objects,
[0]indexes arrays; wrap the name in brackets, e.g.[user.name], to treat dots as literal (https://vee-validate.logaretm.com/v4/guide/composition-api/nested-objects-and-arrays/). - The
errorsobject is always flat: reference the exact path string used as the field name, brackets included (https://vee-validate.logaretm.com/v4/guide/composition-api/nested-objects-and-arrays/). - Iterate array fields with
fieldsfromuseFieldArrayand keyv-forbyentry.key(a stable id, never the index) (https://vee-validate.logaretm.com/v4/guide/composition-api/nested-objects-and-arrays/). - Pass reactive field names as getters (
useField(() => props.name)) so vee-validate tracks name changes (https://vee-validate.logaretm.com/v4/guide/composition-api/caveats/). - Keep schemas non-reactive: declare them outside
ref/reactiveor wrap withmarkRawto avoid deep reactivity overhead (https://vee-validate.logaretm.com/v4/guide/best-practices/#reactive-schemas). handleSubmit.withControlled(cb)submits only fields registered withuseField/defineField(dist/vee-validate.d.ts:430-432); note typed schemas can still surface all initial values (open issue: https://github.com/logaretm/vee-validate/issues/4960).
Validation modes
Global defaults: validateOnBlur: true, validateOnChange: true, validateOnInput: false, validateOnModelUpdate: true, bails: true. Change globally with configure(); note these four trigger flags only apply to the <Field> component, not useField (https://vee-validate.logaretm.com/v4/api/configuration/). To validate only on submit, disable input/change/blur triggers per field in defineField config or globally (https://github.com/logaretm/vee-validate/discussions/4903).
References
- Composition API:
useForm,defineField,useField,useFieldArray, state and setter composables, form context. - Components:
Form,Field,FieldArray,ErrorMessageprops, slots, rendering, v-model rules. - Validation: validator functions, object schemas, typed schemas, global rules, i18n, standalone
validateutils. - API surface: every runtime export and notable type, cited to
dist/vee-validate.d.ts. - Version changes: API additions, breaking changes, and deprecations from 4.9.0 to 4.15.1.
- Pitfalls: composition caveats, nested path rules, array fields, known open issues.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

