Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

forms

/forms

Obsługuje formularze i uwierzytelnianie: walidację z React Hook Form i Zod, stany błędów, zakupy, logowanie, rejestrację, OTP/MFA i płatności ze Stripe PaymentElement.

Licencja
MIT
Ostatnia zmiana repozytorium
20.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
16
Skrypty
12
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 20.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 12 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: examples/_r3f-jsx.d.ts, examples/_stubs.d.ts, examples/good-auth.test.tsx, examples/good-auth.tsx, examples/good-checkout.test.tsx, examples/good-checkout.tsx, examples/good-form.test.tsx, examples/good-form.tsx

Co robi i kiedy

Obsługuje formularze i uwierzytelnianie: walidację z React Hook Form i Zod, stany błędów, zakupy, logowanie, rejestrację, OTP/MFA i płatności ze Stripe PaymentElement.

Oryginalny opis (EN)

Forms and auth — validation, RHF + Zod, error states, checkout, login/signup, OTP/MFA, payments. Use when the UI collects input — contact, newsletter, checkout, login, signup, password reset, OTP/MFA, multi-step wizards, settings panels. React Hook Form, Zod, aria-describedby or Stripe PaymentElement route here.

Jak działa

  1. When to Use
  2. Stack
  3. Core Rules
  4. Patterns
  5. Examples
  6. Reference Index
  7. Constraints
Sekcje z nagłówków SKILL.md, w oryginale · 43 linii, 451 słów
Podgląd SKILL.md
---
name: forms
description: Forms and auth — validation, RHF + Zod, error states, checkout, login/signup, OTP/MFA, payments. Use when the UI collects input — contact, newsletter, checkout, login, signup, password reset, OTP/MFA, multi-step wizards, settings panels. React Hook Form, Zod, aria-describedby or Stripe PaymentElement route here.
metadata:
  version: "15.0.0"
  core-deps:
    - core/component-api.md
    - core/accessibility-baseline.md
---

# Forms

## When to Use
Any input-collecting UI: contact, newsletter, checkout, login, signup, password reset, OTP/MFA, multi-step wizards, settings panels. Mentions of React Hook Form, Zod, validation, `aria-describedby`, or Stripe PaymentElement route here.

## Stack
React 19 · TypeScript strict · Tailwind v4 · React Hook Form + Zod · Next.js App Router (default)

## Core Rules
1. **Label everything.** Every input is wired via `htmlFor`/`id` or wraps its control. Placeholders never replace labels — they end with `…` and show an example pattern.
2. **Errors live beside their field**, linked with `aria-describedby`, marked with `aria-invalid`, announced with `role="alert"`. Focus the first invalid field on submit.
3. **Validate on blur**, not on every keystroke. Re-validate on change only after the first error appears.
4. **Error copy is a fix, not a verdict.** "Enter a valid email — for example ana@arclight.io", never "Invalid input".
5. **Submit stays enabled** until the request starts; then disable and show a spinner *inside* the button. Never block paste.
6. **Correct input semantics.** `type` + `inputMode` + `autocomplete` on every field. `spellCheck={false}` on emails, codes and usernames. `autocomplete="off"` on non-auth fields so password managers stay quiet.
7. **Schema-first.** Zod schema is the single source of truth; infer the TS type from it, resolve with `zodResolver`. Discriminated unions for conditional branches.
8. **Four states always.** Loading skeleton (from a real `isLoading` input, never `setTimeout`), empty, error, success.
9. **Unsaved-changes guard** on any form a user can navigate away from.
10. **Touch targets ≥44×44px**, including checkbox/radio hit areas — label and control share one target with no dead zones.

## Patterns
- **RHF + Zod** — `useForm({ resolver: zodResolver(schema) })`, `Controller` for non-native inputs.
- **Multi-step wizard** — one decision per step, 3–5 steps, progress as an `<ol>` with `aria-current="step"`, Back never destroys data.
- **OTP input** — six inputs, `autoComplete="one-time-code"`, paste distributes across boxes, backspace walks backwards, resend countdown in an `aria-live` region.
- **Checkout** — PaymentElement + sticky order summary, trust strip, four states.
- **Server Actions** — `useActionState` for pending/error without client state.

## Examples
`examples/good-form.tsx` (contact, file upload, all states) · `examples/good-rhf.tsx` (multi-step wizard) · `examples/good-auth.tsx` (login/signup/magic link/OAuth) · `examples/good-checkout.tsx` (Stripe) · `examples/good-storybook.tsx` (form with CSF3 stories).

## Reference Index
Load only for the specific task:

| Task | Load |
|---|---|
| RHF API, resolvers, field arrays, Server Actions | `references/react-hook-form.md` |
| Login/OAuth/magic link/OTP/MFA/protected routes | `references/auth-patterns.md` |
| Optimistic UI, rollback, axe checks, error boundaries | `references/verification-loops.md` |

## Constraints
Every input labelled · errors linked via `aria-describedby` · `A11Y-02` focus-visible on interactive elements · four states, no mount-time fake delays · OKLCH tokens · TypeScript strict with exported prop interfaces · WCAG 2.2 AA including §3.3.7 (never re-ask session data).
Pliki w paczce (16)
  • SKILL.md 4 KB
  • examples/_r3f-jsx.d.ts 2 KB
  • examples/_stubs.d.ts 4 KB
  • examples/good-auth.test.tsx 1 KB
  • examples/good-auth.tsx 24 KB
  • examples/good-checkout.test.tsx 2 KB
  • examples/good-checkout.tsx 21 KB
  • examples/good-form.test.tsx 1 KB
  • examples/good-form.tsx 12 KB
  • examples/good-rhf.test.tsx 1 KB
  • examples/good-rhf.tsx 32 KB
  • examples/good-storybook.test.tsx 1 KB
  • examples/good-storybook.tsx 20 KB
  • references/auth-patterns.md 45 KB
  • references/react-hook-form.md 46 KB
  • references/verification-loops.md 20 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · krishna-modi12/frontend-design-pro100MIT
lukedj78/dev-flow100MIT
arbazkhan971/godmode100MIT
mgifford/accessibility-skills95AGPL-3.0
PIXARTSeu/Synapse95AGPL-3.0
sukirman1901/frontend-expert90MIT
aladicf/better-web-ui90MIT

Migawka bazy z 28.10.2026 · wersja paczki e122be9c4496 (skrót SHA-256 całej paczki)

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100react-hook-form-zod-patterns
    Tworzy typowane formularze z react-hook-form i walidacją Zod, także wieloetapowe procesy rejestracji i zakupu.
  • 100rhf-zod-server-actions
    Opisuje wzorzec formularzy w Next.js 15 z react-hook-form, Zod, Server Actions i useActionState, w tym walidację po obu stronach, aktualizacje optymistyczne i obsługę błędów.
  • 95form-validation-architect
    Obsługuje formularze od początku do końca z react-hook-form i Zod: wzorce walidacji, komunikaty błędów, tablice pól, kreatory wieloetapowe, autozapis i zależności pól.
  • 100react-hook-form
    Obsługuje React Hook Form z walidacją Zod: konfiguracja formularza, schematy, komponenty pól, błędy i wysyłka z integracją shadcn/ui.
  • 95react-hook-form-zod
    Buduje typowane formularze React z React Hook Form i walidacją Zod: schematy, tablice pól, formularze wieloetapowe oraz błędy resolvera i pól zagnieżdżonych.
  • 95react-form-validator
    Wymusza wzorzec React Hook Form z Zod przy tworzeniu formularzy, walidacji i obsłudze wysyłki, w tym formularzy logowania, rejestracji i wprowadzania danych.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.