Svelte Form Builder
This skill applies only to forms implemented with SvelteKit remote functions (form(schema, handler)).
Before using this workflow, confirm the form is a remote-form candidate via your project's form decision tree.
Workflow
- Understand the fields and validation requirements.
- Generate a form JSON following the schema below.
- Ask the user to visit https://svelte-form-builder.vercel.app/v2 and import the JSON.
- In the builder, ensure Valibot validation and SvelteKit remote functions are toggled on.
- Use btca to verify up-to-date SvelteKit remote-function patterns when needed.
- Implement the generated client/server code in the project, preserving existing UI structure and using shadcn-svelte components.
Form Builder JSON Schema
Generate a form JSON structure for the Svelte form builder using this exact schema:
- Return an array of rows
- Each row has:
"id" (string), "fields" (array)
- Each field must have:
"id": unique string (e.g., "field-1")
"name": display name (e.g., "Input", "Email")
"type": field type — text, email, password, number, textarea, boolean, select, radio, date-picker, slider, input-otp, phone, combobox, tags-input, file, location-input
"category": same as type for most fields, or "checkbox"/"switch" for boolean
"label": field label shown to user
"description": helper text (optional)
"placeholder": placeholder text
"required": boolean
"position": "full" (or "left"/"right" for side-by-side, max 2 per row)
"options": array for select/radio/combobox (each with "id", "value", "label")
"multiple": boolean (optional) for select/combobox (false=single, true=multiple)
Example
[
{
"id": "row-1",
"fields": [
{
"id": "field-1",
"name": "Input",
"type": "text",
"category": "text",
"label": "Full Name",
"description": "Enter your full name",
"placeholder": "John Doe",
"required": true,
"position": "full"
}
]
}
]
1---2name: svelte-form-builder3description: Workflow for generating form JSON and using the Svelte Form Builder (svelte-form-builder.vercel.app) to scaffold SvelteKit remote function forms with Valibot validation. Use when creating forms via the form builder.4---56# Svelte Form Builder78This skill applies only to forms implemented with SvelteKit remote functions (`form(schema, handler)`).910Before using this workflow, confirm the form is a remote-form candidate via your project's form decision tree.1112## Workflow13141. Understand the fields and validation requirements.152. Generate a form JSON following the schema below.163. Ask the user to visit <https://svelte-form-builder.vercel.app/v2> and import the JSON.174. In the builder, ensure Valibot validation and SvelteKit remote functions are toggled on.185. Use btca to verify up-to-date SvelteKit remote-function patterns when needed.196. Implement the generated client/server code in the project, preserving existing UI structure and using shadcn-svelte components.2021## Form Builder JSON Schema2223Generate a form JSON structure for the Svelte form builder using this exact schema:2425- Return an array of rows26- Each row has: `"id"` (string), `"fields"` (array)27- Each field must have:28 - `"id"`: unique string (e.g., `"field-1"`)29 - `"name"`: display name (e.g., `"Input"`, `"Email"`)30 - `"type"`: field type — `text`, `email`, `password`, `number`, `textarea`, `boolean`, `select`, `radio`, `date-picker`, `slider`, `input-otp`, `phone`, `combobox`, `tags-input`, `file`, `location-input`31 - `"category"`: same as type for most fields, or `"checkbox"`/`"switch"` for boolean32 - `"label"`: field label shown to user33 - `"description"`: helper text (optional)34 - `"placeholder"`: placeholder text35 - `"required"`: boolean36 - `"position"`: `"full"` (or `"left"`/`"right"` for side-by-side, max 2 per row)37 - `"options"`: array for select/radio/combobox (each with `"id"`, `"value"`, `"label"`)38 - `"multiple"`: boolean (optional) for select/combobox (`false`=single, `true`=multiple)3940## Example4142```json43[44 {45 "id": "row-1",46 "fields": [47 {48 "id": "field-1",49 "name": "Input",50 "type": "text",51 "category": "text",52 "label": "Full Name",53 "description": "Enter your full name",54 "placeholder": "John Doe",55 "required": true,56 "position": "full"57 }58 ]59 }60]61```