All skills
skilld-dev avatar

/formkit-core-skilld

@b9c39cb

Use whenever writing, debugging, or reviewing code that imports @formkit/core — FormKit's framework-agnostic core (node trees, values, events, hooks, message stores, ledgers, config, schema types, expression compiler). Provides correct 2.1.x API signatures, common-task examples, behavioral rules, and version limits.

Use this Skill: https://skilld.dev/gh/skilld-dev/vue-ecosystem-skills/formkit-core-skilld

This session only. Nothing lands on disk.

referencesschema-compiler.md

≈749 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Schema and compiler

Core ships the schema types and the expression compiler; rendering lives in @formkit/vue / @formkit/react (FormKitSchemaContext, dist/index.d.mts:318-325).

Schema node types

FormKitSchemaNode union (dist/index.d.mts:331):

Type Discriminator Shape
FormKitSchemaDOMNode $el { $el: 'div', attrs?, ...props }
FormKitSchemaComponent $cmp { $cmp: 'MyComp', props?, ...props }
FormKitSchemaFormKit $formkit sugar: { $formkit: 'text', ...inputProps }
FormKitSchemaTextNode — plain string
FormKitSchemaCondition if { if, then, else? }

Common props on schema nodes (FormKitSchemaProps, dist/index.d.mts:243-250): children, key, if, for (a FormKitListStatement tuple [value, key?, list]), bind, meta.

Attribute values accept condition objects (FormKitSchemaAttributesCondition: { if, then, else? }, dist/index.d.mts:277-281).

Type guards and sugar

import { isDOM, isComponent, isConditional, isSugar, sugar } from '@formkit/core'

if (isSugar(node)) node = sugar(node)   // $formkit → $cmp: 'FormKit'

sugar() rewrites { $formkit: 'text', label: X } into a FormKitSchemaComponent with props spread and moves if / for / children / bind up (dist/index.mjs:1526-1551). Guards: dist/index.d.mts:388-438.

FormKitSectionsSchema maps section names to FormKitSchemaNodeExtension values (partial nodes or null to unset) — the shape input definitions accept for section overrides (dist/index.d.mts:333-378).

Compiler

compile(expr) parses a $-token expression into one function (dist/index.d.mts:2194-2217):

const condition = compile("$name == 'bob'").provide((tokens) => {
  // tokens is the array of required token names, e.g. ['name']
  return { name: () => nameRef.value }  // every value MUST be a function
})
condition()  // false

Grammar (dist/index.mjs:1574-1598,1701-1710):

  • Token references: $foo, nested $foo.bar, calls $fn(...) (parenthesized $-prefixed operands become function tokens; tails bind this, dist/index.mjs:1552-1567).
  • Operators by precedence: && || → == != === !== > < >= <= → + - → * / %.
  • String literals in single or double quotes with \ escapes (dist/index.mjs:1660-1700).
  • A leading operator or trailing operator is a compile error (codes 103/104, dist/index.mjs:1714-1719).

Compiled output type is FormKitCompilerOutput: call with a tokens object to evaluate; .provide(callback) injects token resolvers (dist/index.d.mts:2182-2192).

In schema strings, $: prefixes mark compiled expressions; expr.startsWith('$:') is stripped before parsing (dist/index.mjs:1831). The rendering adapter supplies token values: $_value (live, non-debounced), $value (committed), $handlers, $attrs, and node props directly ($label, $type, …) (https://formkit.com/essentials/custom-inputs).

Source: SKILL.md on GitHub

1 warning8d3 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    The skill is a legitimate documentation and API reference for the FormKit form-building library. Security analysis found no malicious patterns, unauthorized capabilities, or valid threats.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: MEDIUM · 1 issue

Signed by skilld at b9c39cb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated last week

README badge

README badge for skilld-dev/vue-ecosystem-skills/formkit-core-skilld