AgentSkillsCN

form-pattern

构建带有校验、错误提示与测试功能的类型化表单。

SKILL.md
--- frontmatter
name: form-pattern
description: Build a typed form with validation, errors, and tests.
disable-model-invocation: true

Form Pattern

Create a form that is typed, validated, accessible, and tested.

When to Use

  • Use this skill when building any form or wizard.

Inputs

  • Fields and validation rules
  • Submission behavior
  • Error and loading states

Instructions

  1. Define a typed form model.
  2. Add validation (client-side and server error mapping).
  3. Implement accessible labels, hints, and error messages.
  4. Add tests for validation and submit behavior.

Output

  • Form component(s) with validation and tests.