form-wizard-builder
БесплатноБез исполняемых скриптовНе проверенBuilds multi-step forms with validation schemas (Zod/Yup), step components, shared state management, progress indicators, review steps, and error handling…
от patricio0312rev★ 64 звезды на GitHubОб этом скилле
Form Wizard Builder
Create multi-step form experiences with validation, state persistence, and review steps.
Core Workflow
- Define steps: Break form into logical sections
- Create schema: Zod/Yup validation for each step
- Build step components: Individual form sections
- State management: Shared state across steps (Zustand/Context)
- Navigation: Next/Back/Skip logic
- Progress indicator: Visual step tracker
- Review step: Summary before submission
- Error handling: Per-step and final validation
Basic Wizard Structure
// types/wizard.ts
export type WizardStep = {
id: string;
title: string;
description?: string;
component: React.ComponentType<StepProps>;
schema: z.ZodSchema;
isOptional?: boolean;
};
export type WizardData = {
personal: PersonalInfoData;
contact: ContactData;
preferences: PreferencesData;
};
Validation Schemas (Zod)
// schemas/wizard.schema.ts
import { z } from "zod";
export const personalInfoSchema = z.object({
firstName: z.string().min(2, "First name must be at least 2 characters"),
lastName: z.string().min(2, "Last name must be at least 2 characters"),
dateOfBirth: z.string().refine((date) => {
const age = new Date().getFullYear() - new Date(date).getFullYear();
return age >= 18;
}, "Must be at least 18 years old"),
});
export const contactSchema = z.object({
email: z.string().email("Invalid email address"),
phone: z.string().regex(/^\+?[\d\s-()]+$/, "Invalid phone number"),
address: z.object({
street: z.string().min(1, "Street is required"),
city: z.string().min(1, "City is required"),
zipCode: z.string().regex(/^\d{5}(-\d{4})?$/, "Invalid ZIP code"),
}),
});
export const preferencesSchema = z.object({
notifications: z.object({
email: z.boolean(),
sms: z.boolean(),
push: z.boolean(),
}),
interests: z.array(z.string()).min(1, "Select at least one interest"),
});
// Complete wizard schema
export const wizardSchema = z.object({
personal: personalInfoSchema,
contact: contactSchema,
preferences: preferencesSchema,
});
export type WizardFormData = z.infer<typeof wizardSchema>;
State Management (Zustand)
// stores/wizard.store.ts
import { create } from "zustand";
import { persist } from "zustand/middleware";
interface WizardState {
currentStep: number;
data: Partial<WizardFormData>;
completedSteps: number[];
isSubmitting: boolean;
setCurrentStep: (step: number) => void;
updateStepData: (step: string, data: any) => void;
markStepComplete: (step: number) => void;
nextStep: () => void;
prevStep: () => void;
resetWizard: () => void;
submitWizard: () => Promise<void>;
}
export const useWizardStore = create<WizardState>()(
persist(
(set, get) => ({
currentStep: 0,
data: {},
completedSteps: [],
isSubmitting: false,
setCurrentStep: (step) => set({ currentStep: step }),
updateStepData: (step, newData) =>
set((state) => ({
data: {
...state.data,
[step]: { ...state.data[step], ...newData },
},
})),
markStepComplete: (step) =>
set((state) => ({
completedSteps: Array.from(new Set([...state.completedSteps, step])),
})),
nextStep: () =>
set((state) => ({
currentStep: Math.min(state.currentStep + 1, steps.length - 1),
})),
prevStep: () =>
set((state) => ({
currentStep: Math.max(state.currentStep - 1, 0),
})),
resetWizard: () =>
set({
currentStep: 0,
data: {},
completedSteps: [],
isSubmitting: false,
}),
submitWizard: async () => {
set({ isSubmitting: true });
try {
// Submit to API
await fetch("/api/wizard", {
method: "POST",
body: JSON.stringify(get().data),
});
get().resetWizard();
} catch (error) {
console.error("Submission failed:", error);
} finally {
set({ isSubmitting: false });
}
},
}),
{
name: "wizard-storage",
}
)
);
Main Wizard Component
// components/Wizard.tsx
"use client";
import { useState } from "react";
import { useWizardStore } from "@/stores/wizard.store";
import { ProgressIndicator } from "./ProgressIndicator";
import { PersonalInfoStep } from "./steps/PersonalInfoStep";
import { ContactStep } from "./steps/ContactStep";
import { PreferencesStep } from "./steps/PreferencesStep";
import { ReviewStep } from "./steps/ReviewStep";
const steps = [
{
id: "personal",
title: "Personal Information",
component: PersonalInfoStep,
schema: personalInfoSchema,
},
{
id: "contact",
title: "Contact Details",
component: ContactStep,
schema: contactSchema,
},
{
id: "preferences",
title: "Preferences",
Установить form-wizard-builder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл form-wizard-builder?
Builds multi-step forms with validation schemas (Zod/Yup), step components, shared state management, progress indicators, review steps, and error handling. Use when creating "multi-step forms", "wizard flows", "onboarding forms", or "checkout processes".
Как установить скилл form-wizard-builder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл form-wizard-builder запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic