Communitygithub.com

YepAPI/skills

React Hook Form、Zod 驗證以及多步驟精靈流程。

skills 是什麼?

這個技能專注於使用 React Hook Form 與 Zod 驗證來建立穩固且易於使用的前端表單。它提供了處理表單狀態、客戶端與伺服器端驗證以及多步驟精靈模式的明確規則。該技能強調無障礙性,要求表單元素具備 label、利用 `aria-describedby` 的錯誤提示以及驗證失敗時焦點的正確管理。此外,它還涵蓋進階功能,如檔案上傳元件(含預覽和拖放)、長表單的自動儲存(使用去抖動機制寫入 localStorage 或伺服器),以及防止重複提交的載入狀態管理。此技能主要用於以 React 為基礎的專案(例如使用 Cursor、Claude Code 或 Codex 等 AI 代理工具的專案),特別適用於需要複雜表單邏輯、跨步驟驗證與使用者體驗最佳化的場景。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/forms

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

表單

規則

  • 使用 React Hook Form 管理表單狀態 — useForm() + register() 或 Controller
  • 使用 Zod 綱要進行驗證 — 在客戶端與伺服器端之間共用
  • 錯誤顯示:顯示在每個欄位下方,紅色文字,透過 aria-describedby 關聯
  • 多步驟表單:使用精靈模式搭配步驟狀態,獨立驗證每個步驟
  • 檔案上傳:獨立的元件,包含預覽、拖放、進度指示器
  • 長表單自動儲存 — 去抖動後儲存至伺服器或 localStorage
  • 無障礙性:標籤、錯誤描述、驗證失敗時的焦點管理
  • 載入時禁用提交按鈕 — 顯示旋轉圖示,防止重複提交

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相關技能