vibes-plug 1.0.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/.claude/rules/vibes-plug-core.md +32 -0
  2. package/.cursor/rules/vibes-plug-core.mdc +51 -0
  3. package/.cursorrules +42 -0
  4. package/AGENTS.md +96 -0
  5. package/BLUEPRINT.md +309 -125
  6. package/CHANGELOG.md +183 -1
  7. package/CLAUDE.md +70 -0
  8. package/LICENSE +1 -1
  9. package/README.md +641 -263
  10. package/index.js +19 -0
  11. package/package.json +61 -25
  12. package/plugin.json +24 -7
  13. package/scripts/generate_swarm_gif.py +295 -0
  14. package/scripts/install.js +201 -0
  15. package/skills/accessibility-testing-expert/SKILL.md +116 -0
  16. package/skills/ai-cost-token-optimizer/SKILL.md +82 -0
  17. package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
  18. package/skills/ai-llm-integration-expert/SKILL.md +147 -122
  19. package/skills/ai-media-generation-expert/SKILL.md +172 -0
  20. package/skills/ai-prompt-engineering-expert/SKILL.md +84 -0
  21. package/skills/angular-expert/SKILL.md +148 -0
  22. package/skills/api-design-expert/SKILL.md +316 -309
  23. package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
  24. package/skills/app-analyzer-optimizer/SKILL.md +195 -188
  25. package/skills/apple-ecosystem-expert/SKILL.md +145 -0
  26. package/skills/{asisten_ramah → asisten-ramah}/SKILL.md +7 -1
  27. package/skills/astro-framework-expert/SKILL.md +200 -0
  28. package/skills/async-queue-temporal-expert/SKILL.md +240 -0
  29. package/skills/authentication-identity-expert/SKILL.md +279 -45
  30. package/skills/auto-doc-updater/SKILL.md +219 -203
  31. package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
  32. package/skills/autonomous-red-teamer/SKILL.md +203 -0
  33. package/skills/autonomous-tdd-debugger/SKILL.md +71 -0
  34. package/skills/background-jobs-queue-expert/SKILL.md +235 -0
  35. package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
  36. package/skills/blockchain-web3-expert/SKILL.md +115 -0
  37. package/skills/bootstrap-to-modern/SKILL.md +93 -86
  38. package/skills/brainstorming/SKILL.md +381 -353
  39. package/skills/browser-automation-expert/SKILL.md +222 -0
  40. package/skills/bun-runtime-expert/SKILL.md +7 -1
  41. package/skills/chatbot-messaging-expert/SKILL.md +114 -0
  42. package/skills/ci-cd-devops-architect/SKILL.md +81 -45
  43. package/skills/cloud-hosting-expert/SKILL.md +249 -243
  44. package/skills/coderabbit/SKILL.md +197 -191
  45. package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
  46. package/skills/cron-scheduler-expert/SKILL.md +304 -0
  47. package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
  48. package/skills/data-telemetry-expert/SKILL.md +218 -212
  49. package/skills/data-visualization-expert/SKILL.md +154 -0
  50. package/skills/database-migration-versioning-expert/SKILL.md +90 -0
  51. package/skills/database-orm-expert/SKILL.md +303 -293
  52. package/skills/dependency-upgrade-migrator/SKILL.md +301 -0
  53. package/skills/design-system-architect/SKILL.md +278 -242
  54. package/skills/desktop-electron-expert/SKILL.md +128 -0
  55. package/skills/documentation-site-expert/SKILL.md +59 -0
  56. package/skills/doku-mcp-server/SKILL.md +257 -0
  57. package/skills/doku-payment-gateway/SKILL.md +233 -0
  58. package/skills/domain-driven-design-expert/SKILL.md +82 -0
  59. package/skills/e2e-testing-expert/SKILL.md +320 -314
  60. package/skills/ecommerce-expert/SKILL.md +87 -0
  61. package/skills/edge-serverless-db-expert/SKILL.md +99 -0
  62. package/skills/email-notification-expert/SKILL.md +368 -0
  63. package/skills/error-resilience-expert/SKILL.md +486 -0
  64. package/skills/event-driven-architect/SKILL.md +86 -80
  65. package/skills/feature-flag-analytics-expert/SKILL.md +66 -0
  66. package/skills/file-upload-media-expert/SKILL.md +437 -0
  67. package/skills/firebase-security-expert/SKILL.md +7 -1
  68. package/skills/form-validation-expert/SKILL.md +407 -0
  69. package/skills/fullstack-expert/SKILL.md +260 -201
  70. package/skills/fullstack-expert/references/api_design_guide.md +466 -466
  71. package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
  72. package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
  73. package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
  74. package/skills/gemini-agent-booster/SKILL.md +142 -104
  75. package/skills/geospatial-maps-expert/SKILL.md +80 -0
  76. package/skills/global-a11y-i18n-expert/SKILL.md +86 -80
  77. package/skills/glsl-shader-expert/SKILL.md +107 -0
  78. package/skills/go-programming-expert/SKILL.md +300 -294
  79. package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
  80. package/skills/graphql-apollo-expert/SKILL.md +114 -0
  81. package/skills/headless-cms-expert/SKILL.md +181 -0
  82. package/skills/hig/SKILL.md +193 -187
  83. package/skills/js-backend-expert/SKILL.md +218 -191
  84. package/skills/legacy-code-translator/SKILL.md +71 -0
  85. package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
  86. package/skills/logging-error-tracking-expert/SKILL.md +344 -0
  87. package/skills/mcp-client-orchestrator/SKILL.md +76 -0
  88. package/skills/mcp-server-architect/SKILL.md +226 -126
  89. package/skills/micro-frontend-architect/SKILL.md +112 -0
  90. package/skills/mobile-expo-expert/SKILL.md +191 -185
  91. package/skills/mobile-push-notification-expert/SKILL.md +71 -0
  92. package/skills/modern-css-native-expert/SKILL.md +189 -0
  93. package/skills/monday-design-aesthetic/SKILL.md +72 -66
  94. package/skills/monorepo-architect/SKILL.md +232 -226
  95. package/skills/mpa-orchestrator/SKILL.md +120 -101
  96. package/skills/multi-agent-orchestration/SKILL.md +173 -153
  97. package/skills/multiple-entry-points/SKILL.md +91 -55
  98. package/skills/mvc-expert/SKILL.md +237 -231
  99. package/skills/n8n-automation-expert/SKILL.md +89 -0
  100. package/skills/nextjs-app-router-expert/SKILL.md +148 -0
  101. package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
  102. package/skills/payment-gateway-expert/SKILL.md +129 -45
  103. package/skills/pdf-document-generation-expert/SKILL.md +91 -0
  104. package/skills/performance-web-vitals/SKILL.md +337 -331
  105. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
  106. package/skills/prd-architect/SKILL.md +206 -190
  107. package/skills/proactive-background-watcher/SKILL.md +68 -0
  108. package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
  109. package/skills/production-ready-hardener/SKILL.md +461 -468
  110. package/skills/production-ready-hardener/references/production_checklist.md +161 -161
  111. package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
  112. package/skills/project-context-mapper/SKILL.md +85 -0
  113. package/skills/pwa-offline-first-expert/SKILL.md +185 -0
  114. package/skills/python-programming-expert/SKILL.md +407 -270
  115. package/skills/rate-limit-abuse-prevention/SKILL.md +377 -0
  116. package/skills/realtime-collaboration-expert/SKILL.md +99 -45
  117. package/skills/rich-text-editor-expert/SKILL.md +177 -0
  118. package/skills/rust-programming-expert/SKILL.md +240 -234
  119. package/skills/saas-billing/SKILL.md +382 -376
  120. package/skills/saas-multi-tenant/SKILL.md +256 -236
  121. package/skills/saas-mvp-launcher/SKILL.md +30 -1
  122. package/skills/saas-transformer/SKILL.md +499 -445
  123. package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
  124. package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
  125. package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
  126. package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
  127. package/skills/scalability-clean-code/SKILL.md +234 -228
  128. package/skills/search-engine-expert/SKILL.md +89 -0
  129. package/skills/secure-fuzz-testing/SKILL.md +7 -1
  130. package/skills/self-evolving-memory-graph/SKILL.md +91 -0
  131. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
  132. package/skills/senior-frontend/SKILL.md +85 -105
  133. package/skills/seo/SKILL.md +258 -224
  134. package/skills/session-context-loader/SKILL.md +83 -0
  135. package/skills/session-handoff-resume/SKILL.md +163 -157
  136. package/skills/{skill_baru → skill-baru}/SKILL.md +177 -146
  137. package/skills/solidjs-expert/SKILL.md +80 -0
  138. package/skills/spa-orchestrator/SKILL.md +306 -287
  139. package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
  140. package/skills/state-management-expert/SKILL.md +277 -271
  141. package/skills/supabase-migration/SKILL.md +47 -1
  142. package/skills/supabase-security-expert/SKILL.md +248 -242
  143. package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
  144. package/skills/svg-animation-motion-expert/SKILL.md +115 -0
  145. package/skills/tailwind-expert/SKILL.md +139 -187
  146. package/skills/tanstack-query-expert/SKILL.md +204 -198
  147. package/skills/tauri-expert/SKILL.md +7 -1
  148. package/skills/token-saver/SKILL.md +118 -110
  149. package/skills/typescript-expert/SKILL.md +329 -278
  150. package/skills/ui-components-expert/SKILL.md +166 -63
  151. package/skills/ui-ux-pro-max/SKILL.md +221 -200
  152. package/skills/vector-db-rag-expert/SKILL.md +208 -0
  153. package/skills/vibe-code-gardener/SKILL.md +180 -172
  154. package/skills/visual-qa-vision-agent/SKILL.md +71 -0
  155. package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
  156. package/skills/vue-frontend-expert/SKILL.md +132 -0
  157. package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
  158. package/skills/web-3d-graphics-expert/SKILL.md +137 -0
  159. package/skills/web-game-engine-expert/SKILL.md +102 -0
  160. package/skills/web-scraper/SKILL.md +98 -146
  161. package/skills/website-design-cloner/SKILL.md +180 -0
  162. package/skills/webxr-ar-vr-expert/SKILL.md +123 -0
  163. package/skills/wordpress-headless-expert/SKILL.md +144 -0
  164. package/skills/zero-to-prod-orchestrator/SKILL.md +231 -180
  165. package/skills/zero-trust-secret-vault/SKILL.md +88 -0
  166. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  167. package/CONTRIBUTING.md +0 -199
  168. package/SECURITY.md +0 -21
  169. package/banner.png +0 -0
  170. package/skills/senior-fullstack/SKILL.md +0 -167
  171. package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
  172. package/skills/senior-fullstack/references/development_workflows.md +0 -222
  173. package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
  174. package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
  175. package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
  176. package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
  177. package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
  178. package/skills/seo-geo/SKILL.md +0 -188
  179. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  180. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  181. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  182. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  183. package/skills/ui_ux_expert/SKILL.md +0 -114
@@ -0,0 +1,407 @@
1
+ ---
2
+ name: form-validation-expert
3
+ description: "Expert guide for complex form handling with React Hook Form, server-side validation (useActionState + Zod), multi-step wizards, and accessible form patterns / Panduan ahli penanganan formulir kompleks dengan React Hook Form, validasi server-side, wizard multi-langkah, dan pola formulir aksesibel."
4
+ author: "Roedy Rustam"
5
+ ---
6
+
7
+ # Form & Validation Expert (2026 Edition)
8
+
9
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
+
11
+ ---
12
+
13
+ <a name="english"></a>
14
+ ## English
15
+
16
+ ### Orchestration & Integration
17
+ Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `project-context-mapper` to ensure cohesive execution.
18
+
19
+ ### Description
20
+ Production-grade guide for building robust, accessible, and user-friendly forms. Covers **React Hook Form v7+** with Zod/Valibot resolvers, **server-side validation** with `useActionState` + Zod, **multi-step form wizards**, **dynamic forms** from JSON Schema, **autofill-friendly patterns**, **optimistic form submission** with `useOptimistic`, **Conform** (progressive enhancement), and **form accessibility** (ARIA, error announcements).
21
+
22
+ ### Trigger Conditions
23
+ Activate this skill when:
24
+ - Building forms with client-side validation (React Hook Form, Zod, Valibot).
25
+ - Implementing server-side form validation with React 19 Server Actions.
26
+ - Creating multi-step form wizards with state persistence.
27
+ - Building dynamic forms generated from schema definitions.
28
+ - Making forms accessible (ARIA attributes, error announcements).
29
+ - Implementing file upload forms with drag-and-drop.
30
+ - Optimizing forms for autofill and mobile usability.
31
+
32
+ ---
33
+
34
+ ### Form Library Selection Guide
35
+
36
+ | Library | Best For | Key Strength |
37
+ |---|---|---|
38
+ | **React Hook Form + Zod** | Most React apps | Performance (uncontrolled), rich ecosystem |
39
+ | **Conform** | Progressive enhancement, RSC | Works without JS, native validation |
40
+ | **Formik** | Legacy projects | Mature, large community (declining) |
41
+ | **TanStack Form** | Complex, headless forms | Framework-agnostic, type-safe |
42
+
43
+ **Recommendation**: Use **React Hook Form + Zod** for most projects. Use **Conform** for Next.js Server Actions with progressive enhancement.
44
+
45
+ ---
46
+
47
+ ### 1. React Hook Form + Zod (Client-Side)
48
+
49
+ ```tsx
50
+ // components/signup-form.tsx
51
+ 'use client';
52
+
53
+ import { useForm } from 'react-hook-form';
54
+ import { zodResolver } from '@hookform/resolvers/zod';
55
+ import { z } from 'zod';
56
+
57
+ const signupSchema = z.object({
58
+ name: z.string().min(2, 'Name must be at least 2 characters'),
59
+ email: z.string().email('Please enter a valid email'),
60
+ password: z.string()
61
+ .min(8, 'Password must be at least 8 characters')
62
+ .regex(/[A-Z]/, 'Must contain an uppercase letter')
63
+ .regex(/[0-9]/, 'Must contain a number'),
64
+ confirmPassword: z.string(),
65
+ }).refine(data => data.password === data.confirmPassword, {
66
+ message: 'Passwords do not match',
67
+ path: ['confirmPassword'],
68
+ });
69
+
70
+ type SignupFormData = z.infer<typeof signupSchema>;
71
+
72
+ export function SignupForm() {
73
+ const {
74
+ register,
75
+ handleSubmit,
76
+ formState: { errors, isSubmitting },
77
+ } = useForm<SignupFormData>({
78
+ resolver: zodResolver(signupSchema),
79
+ mode: 'onBlur', // Validate on blur for better UX
80
+ });
81
+
82
+ const onSubmit = async (data: SignupFormData) => {
83
+ const res = await fetch('/api/auth/signup', {
84
+ method: 'POST',
85
+ headers: { 'Content-Type': 'application/json' },
86
+ body: JSON.stringify(data),
87
+ });
88
+ if (!res.ok) throw new Error('Signup failed');
89
+ };
90
+
91
+ return (
92
+ <form onSubmit={handleSubmit(onSubmit)} noValidate>
93
+ <div>
94
+ <label htmlFor="name">Name</label>
95
+ <input
96
+ id="name"
97
+ {...register('name')}
98
+ aria-invalid={!!errors.name}
99
+ aria-describedby={errors.name ? 'name-error' : undefined}
100
+ autoComplete="name"
101
+ />
102
+ {errors.name && <p id="name-error" role="alert">{errors.name.message}</p>}
103
+ </div>
104
+
105
+ <div>
106
+ <label htmlFor="email">Email</label>
107
+ <input
108
+ id="email"
109
+ type="email"
110
+ {...register('email')}
111
+ aria-invalid={!!errors.email}
112
+ aria-describedby={errors.email ? 'email-error' : undefined}
113
+ autoComplete="email"
114
+ />
115
+ {errors.email && <p id="email-error" role="alert">{errors.email.message}</p>}
116
+ </div>
117
+
118
+ <div>
119
+ <label htmlFor="password">Password</label>
120
+ <input
121
+ id="password"
122
+ type="password"
123
+ {...register('password')}
124
+ aria-invalid={!!errors.password}
125
+ aria-describedby={errors.password ? 'password-error' : undefined}
126
+ autoComplete="new-password"
127
+ />
128
+ {errors.password && <p id="password-error" role="alert">{errors.password.message}</p>}
129
+ </div>
130
+
131
+ <div>
132
+ <label htmlFor="confirmPassword">Confirm Password</label>
133
+ <input
134
+ id="confirmPassword"
135
+ type="password"
136
+ {...register('confirmPassword')}
137
+ aria-invalid={!!errors.confirmPassword}
138
+ aria-describedby={errors.confirmPassword ? 'confirm-error' : undefined}
139
+ autoComplete="new-password"
140
+ />
141
+ {errors.confirmPassword && <p id="confirm-error" role="alert">{errors.confirmPassword.message}</p>}
142
+ </div>
143
+
144
+ <button type="submit" disabled={isSubmitting}>
145
+ {isSubmitting ? 'Creating account...' : 'Sign Up'}
146
+ </button>
147
+ </form>
148
+ );
149
+ }
150
+ ```
151
+
152
+ ---
153
+
154
+ ### 2. Server Actions + useActionState (React 19 / Next.js 15)
155
+
156
+ ```typescript
157
+ // actions/signup.ts
158
+ 'use server';
159
+
160
+ import { z } from 'zod';
161
+
162
+ const signupSchema = z.object({
163
+ name: z.string().min(2),
164
+ email: z.string().email(),
165
+ password: z.string().min(8),
166
+ });
167
+
168
+ export type SignupState = {
169
+ errors?: Record<string, string[]>;
170
+ message?: string;
171
+ success?: boolean;
172
+ };
173
+
174
+ export async function signupAction(
175
+ prevState: SignupState,
176
+ formData: FormData,
177
+ ): Promise<SignupState> {
178
+ const parsed = signupSchema.safeParse({
179
+ name: formData.get('name'),
180
+ email: formData.get('email'),
181
+ password: formData.get('password'),
182
+ });
183
+
184
+ if (!parsed.success) {
185
+ return {
186
+ errors: parsed.error.flatten().fieldErrors as Record<string, string[]>,
187
+ message: 'Please fix the errors below.',
188
+ };
189
+ }
190
+
191
+ // Check if email already exists
192
+ const existing = await db.query.users.findFirst({
193
+ where: eq(users.email, parsed.data.email),
194
+ });
195
+ if (existing) {
196
+ return { errors: { email: ['This email is already registered'] } };
197
+ }
198
+
199
+ // Create user
200
+ await createUser(parsed.data);
201
+ return { success: true, message: 'Account created!' };
202
+ }
203
+ ```
204
+
205
+ ```tsx
206
+ // components/signup-form-server.tsx
207
+ 'use client';
208
+
209
+ import { useActionState } from 'react';
210
+ import { signupAction, type SignupState } from '@/actions/signup';
211
+
212
+ export function SignupFormServer() {
213
+ const [state, formAction, isPending] = useActionState<SignupState, FormData>(
214
+ signupAction,
215
+ {},
216
+ );
217
+
218
+ return (
219
+ <form action={formAction}>
220
+ {state.message && (
221
+ <div role="alert" className={state.success ? 'success' : 'error'}>
222
+ {state.message}
223
+ </div>
224
+ )}
225
+
226
+ <div>
227
+ <label htmlFor="name">Name</label>
228
+ <input id="name" name="name" required autoComplete="name" />
229
+ {state.errors?.name && <p role="alert">{state.errors.name[0]}</p>}
230
+ </div>
231
+
232
+ <div>
233
+ <label htmlFor="email">Email</label>
234
+ <input id="email" name="email" type="email" required autoComplete="email" />
235
+ {state.errors?.email && <p role="alert">{state.errors.email[0]}</p>}
236
+ </div>
237
+
238
+ <div>
239
+ <label htmlFor="password">Password</label>
240
+ <input id="password" name="password" type="password" required minLength={8} autoComplete="new-password" />
241
+ {state.errors?.password && <p role="alert">{state.errors.password[0]}</p>}
242
+ </div>
243
+
244
+ <button type="submit" disabled={isPending}>
245
+ {isPending ? 'Creating...' : 'Sign Up'}
246
+ </button>
247
+ </form>
248
+ );
249
+ }
250
+ ```
251
+
252
+ ---
253
+
254
+ ### 3. Multi-Step Form Wizard
255
+
256
+ ```tsx
257
+ // components/multi-step-form.tsx
258
+ 'use client';
259
+
260
+ import { useState, useCallback } from 'react';
261
+ import { useForm, FormProvider, type UseFormReturn } from 'react-hook-form';
262
+ import { zodResolver } from '@hookform/resolvers/zod';
263
+ import { z } from 'zod';
264
+
265
+ // Step schemas
266
+ const step1Schema = z.object({
267
+ companyName: z.string().min(1, 'Required'),
268
+ industry: z.string().min(1, 'Required'),
269
+ });
270
+
271
+ const step2Schema = z.object({
272
+ contactName: z.string().min(1, 'Required'),
273
+ contactEmail: z.string().email(),
274
+ });
275
+
276
+ const step3Schema = z.object({
277
+ plan: z.enum(['starter', 'pro', 'enterprise']),
278
+ billingCycle: z.enum(['monthly', 'annual']),
279
+ });
280
+
281
+ const fullSchema = step1Schema.merge(step2Schema).merge(step3Schema);
282
+ type FormData = z.infer<typeof fullSchema>;
283
+
284
+ const STEP_SCHEMAS = [step1Schema, step2Schema, step3Schema] as const;
285
+ const STEP_TITLES = ['Company Info', 'Contact Details', 'Choose Plan'] as const;
286
+
287
+ export function MultiStepForm() {
288
+ const [currentStep, setCurrentStep] = useState(0);
289
+ const methods = useForm<FormData>({
290
+ resolver: zodResolver(fullSchema),
291
+ mode: 'onChange',
292
+ });
293
+
294
+ const goNext = useCallback(async () => {
295
+ const schema = STEP_SCHEMAS[currentStep];
296
+ const fields = Object.keys(schema.shape) as (keyof FormData)[];
297
+ const isValid = await methods.trigger(fields);
298
+ if (isValid) setCurrentStep(s => Math.min(s + 1, STEP_SCHEMAS.length - 1));
299
+ }, [currentStep, methods]);
300
+
301
+ const goBack = useCallback(() => {
302
+ setCurrentStep(s => Math.max(s - 1, 0));
303
+ }, []);
304
+
305
+ const onSubmit = async (data: FormData) => {
306
+ await fetch('/api/onboarding', {
307
+ method: 'POST',
308
+ body: JSON.stringify(data),
309
+ });
310
+ };
311
+
312
+ return (
313
+ <FormProvider {...methods}>
314
+ {/* Progress indicator */}
315
+ <nav aria-label="Form progress">
316
+ <ol className="step-progress">
317
+ {STEP_TITLES.map((title, i) => (
318
+ <li key={i} className={i === currentStep ? 'active' : i < currentStep ? 'completed' : ''}>
319
+ {title}
320
+ </li>
321
+ ))}
322
+ </ol>
323
+ </nav>
324
+
325
+ <form onSubmit={methods.handleSubmit(onSubmit)}>
326
+ {currentStep === 0 && <Step1 />}
327
+ {currentStep === 1 && <Step2 />}
328
+ {currentStep === 2 && <Step3 />}
329
+
330
+ <div className="button-group">
331
+ {currentStep > 0 && <button type="button" onClick={goBack}>Back</button>}
332
+ {currentStep < STEP_SCHEMAS.length - 1
333
+ ? <button type="button" onClick={goNext}>Next</button>
334
+ : <button type="submit">Submit</button>
335
+ }
336
+ </div>
337
+ </form>
338
+ </FormProvider>
339
+ );
340
+ }
341
+ ```
342
+
343
+ ---
344
+
345
+ ### 4. Form Accessibility Checklist
346
+
347
+ | Requirement | Implementation |
348
+ |---|---|
349
+ | **Labels** | Every input has a visible `<label>` with `htmlFor` matching input `id` |
350
+ | **Error identification** | `aria-invalid="true"` on invalid fields |
351
+ | **Error description** | `aria-describedby` pointing to error message element |
352
+ | **Error announcement** | Error messages use `role="alert"` for screen readers |
353
+ | **Required fields** | Use `aria-required="true"` or native `required` attribute |
354
+ | **Autofill** | Correct `autoComplete` values (`name`, `email`, `new-password`) |
355
+ | **Focus management** | Focus moves to first error on submit failure |
356
+ | **Submit state** | Button shows loading state and is disabled during submission |
357
+
358
+ ---
359
+
360
+ ### Common Pitfalls to Avoid
361
+
362
+ | Anti-Pattern | Problem | Correct Approach |
363
+ |---|---|---|
364
+ | Validating only on submit | Late error discovery, poor UX | Validate `onBlur` or `onChange` |
365
+ | Client-side validation only | Can be bypassed | Always validate server-side too |
366
+ | No `autoComplete` attributes | Misses browser autofill | Add correct `autoComplete` values |
367
+ | Generic error messages | "Invalid field" doesn't help | Specific: "Must be at least 8 characters" |
368
+ | Resetting form on error | User loses all input | Preserve input, highlight errors |
369
+ | No loading state on submit | User clicks multiple times | Disable button + show spinner |
370
+
371
+ ---
372
+
373
+ ### Integration with Other Skills
374
+
375
+ - `senior-frontend` — React 19 form patterns, useActionState, useOptimistic
376
+ - `global-a11y-i18n-expert` — WCAG 2.2 form accessibility requirements
377
+ - `ui-components-expert` — Input control primitives, form field components
378
+ - `authentication-identity-expert` — Login/signup form patterns
379
+ - `error-resilience-expert` — Form submission error handling and retry
380
+ - `tailwind-expert` — Form styling with Tailwind CSS v4
381
+
382
+ ---
383
+
384
+ <a name="bahasa-indonesia"></a>
385
+ ## Bahasa Indonesia
386
+
387
+ ### Integrasi Orkestrasi
388
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
389
+
390
+ ### Deskripsi
391
+ Panduan tingkat produksi untuk membangun formulir yang kuat, aksesibel, dan ramah pengguna. Mencakup **React Hook Form v7+** dengan Zod/Valibot resolver, **validasi server-side** dengan `useActionState` + Zod, **wizard formulir multi-langkah**, **formulir dinamis** dari JSON Schema, **pola autofill-friendly**, **optimistic form submission**, **Conform** (progressive enhancement), dan **aksesibilitas formulir** (ARIA, pengumuman error).
392
+
393
+ ### Kondisi Pemicu
394
+ Aktifkan skill ini ketika:
395
+ - Membangun formulir dengan validasi client-side (React Hook Form, Zod, Valibot).
396
+ - Mengimplementasikan validasi formulir server-side dengan React 19 Server Actions.
397
+ - Membuat wizard formulir multi-langkah dengan persistensi state.
398
+ - Membangun formulir dinamis dari definisi skema.
399
+ - Membuat formulir yang aksesibel (atribut ARIA, pengumuman error).
400
+
401
+ ### Integrasi dengan Skill Lain
402
+
403
+ - `senior-frontend` — Pola formulir React 19, useActionState, useOptimistic
404
+ - `global-a11y-i18n-expert` — Persyaratan aksesibilitas formulir WCAG 2.2
405
+ - `ui-components-expert` — Primitif kontrol input, komponen field formulir
406
+ - `authentication-identity-expert` — Pola formulir login/signup
407
+ - `error-resilience-expert` — Penanganan error submission formulir dan retry