TA

Handles form state management and Zod schema validation within Svelte 5 applications.

Install

mkdir -p .claude/skills/tanstack-form && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1563" && unzip -o skill.zip -d .claude/skills/tanstack-form && rm skill.zip

Installs to .claude/skills/tanstack-form

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use this skill when building or modifying forms with TanStack Form and Zod validation. Covers createForm, field-level validation, error handling, and mapping ProblemDetails API errors to form fields. Apply when adding new forms, implementing validation logic, or handling form submission in the Svelte frontend.
311 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • →Manage form state using TanStack Form
  • →Implement field-level validation with Zod schemas
  • →Map API ProblemDetails errors to form fields
  • →Handle form submission states and async operations
  • →Integrate forms within Svelte components

How it works

It uses TanStack Form to manage state and Zod for validation, providing patterns to map backend error responses directly to UI fields.

Inputs & outputs

You give it
Form requirements and validation schema
You get back
Svelte component code with form logic and error handling

When to use tanstack-form

  • →Creating complex forms
  • →Validating user input with Zod
  • →Managing form state in Svelte
  • →Implementing form error handling

About this skill

TanStack Form

Use @tanstack/svelte-form with feature schemas derived from $generated/schemas. Extend schemas in feature-owned files; do not edit generated output.

Current examples

  • src/Exceptionless.Web/ClientApp/src/routes/(auth)/login/+page.svelte: form creation, submission, field composition, and submitting state.
  • src/Exceptionless.Web/ClientApp/src/lib/features/auth/schemas.ts: generated schema exports and feature-specific validation.
  • src/Exceptionless.Web/ClientApp/src/lib/features/shared/validation.ts: ariaInvalid, mapFieldErrors, and problemDetailsToFormErrors.

Follow the current implementations rather than duplicating form infrastructure. Map API ProblemDetails into field/form errors, retain entered values after failure, and close dialogs only after successful submission.

Use installed Field components with associated labels and validation attributes. Disable duplicate submission while pending. See shadcn-svelte for component composition.

Submission lifecycle

  1. Define typed default values and extend generated Zod schemas for feature-specific or cross-field constraints.
  2. Use the current form's synchronous validation hook for schema errors and asynchronous submission hook for the server operation. Follow the referenced implementation's hook contracts rather than moving API calls between hooks blindly.
  3. Await the operation. Map expected ProblemDetails with problemDetailsToFormErrors; provide a form-level error for an unexpected failure without exposing internal details.
  4. Connect field state through ariaInvalid and mapFieldErrors. Display form-level errors as well as field errors so non-field failures remain visible.
  5. Keep pending state active through required work. Preserve values on failure; reset, navigate, or close a dialog only after success and any required cache reconciliation.

Check invalid input, server rejection, repeated submission, and successful completion. A dialog closing is not by itself proof that the save succeeded.

When not to use it

  • →When building forms outside of a Svelte 5 environment
  • →When not using TanStack Form for state management

Prerequisites

TanStack FormZodSvelte 5

Limitations

  • →Relies on specific project structures for schema generation
  • →Requires integration with existing UI component libraries

How it compares

It provides a standardized pattern for mapping complex API error structures to form fields, which is typically handled manually.

Compared to similar skills

tanstack-form side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
tanstack-form (this skill)163moNo flagsIntermediate
svelte-ui-design2310moNo flagsIntermediate
tanstack-query73moNo flagsIntermediate
svelte33moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry