Token导航 LogoToken导航

Agent Skill · 研究检索

advanced-formily-patterns(先进的形式模式)

advanced-formily-patterns 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

advanced-formily-patterns 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 10,953。

总安装 11,897周安装 336GitHub Stars 公开资料未说明下载 2,487核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:advanced-formily-patterns(先进的形式模式)
来源仓库:https://github.com/whinc/my-claude-plugins
仓库路径:skills/advanced-formily-patterns
安装命令:
npx skills add whinc/my-claude-plugins --skill "advanced-formily-patterns"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add whinc/my-claude-plugins --skill "advanced-formily-patterns"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

快速检索并筛选相关信息,辅助技能发现与安装。适用于 Codex、Claude、Cursor、Gemini CLI 中需要关键词定位的场景。使用 npx 命令从指定仓库添加 advanced-formily-patterns 技能模块。需确保网络连通性及对目标仓库的访问权限。

建议核对原始 README 以了解实际功能边界。

来源仓库内路径:skills/advanced-formily-patterns

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add whinc/my-claude-plugins --skill "advanced-formily-patterns";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

advanced-formily-patterns 怎么安装?

在终端执行 npx skills add whinc/my-claude-plugins --skill "advanced-formily-patterns"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

advanced-formily-patterns 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

advanced-formily-patterns 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

advanced-formily-patterns 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

advanced-formily-patterns 用的人多吗?

公开数据是累计安装 11,897 次,近一周安装 336 次,下载 2,487 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

advanced-formily-patterns 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
advanced-formily-patterns

先进的形式模式 · 本页

11,897—只读MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Advanced Formily Patterns

This skill provides advanced guidance for implementing complex form scenarios with Formily. Focus on dynamic forms, conditional fields, nested forms, async validation, performance optimization, and sophisticated form patterns in TypeScript.

Dynamic Forms

Conditional Field Visibility

import { createForm, onFieldChange } from '@formily/core'

const form = createForm({
  effects() {
    // Show/hide fields based on other field values
    onFieldChange('userType', ['value'], (field) => {
      const userType = field.value

      form.setFieldState('companyName', state => {
        state.visible = userType === 'business'
        if (userType !== 'business') {
          state.value = ''
        }
      })

      form.setFieldState('studentId', state => {
        state.visible = userType === 'student'
        if (userType !== 'student') {
          state.value = ''
        }
      })
    })
  }
})

Dynamic Field Options

const form = createForm({
  effects() {
    onFieldChange('country', ['value'], (field) => {
      const country = field.value

      // Update city options based on selected country
      const cityOptions = country === 'us'
        ? [
            { label: 'New York', value: 'nyc' },
            { label: 'Los Angeles', value: 'la' },
            { label: 'Chicago', value: 'chi' }
          ]
        : country === 'uk'
        ? [
            { label: 'London', value: 'lon' },
            { label: 'Manchester', value: 'man' },
            { label: 'Birmingham', value: 'bir' }
          ]
        : []

      form.setFieldState('city', state => {
        state.dataSource = cityOptions
        state.value = cityOptions.length > 0 ? cityOptions[0].value : ''
      })
    })
  }
})

Dynamic Form Schema

import { createForm, Form } from '@formily/core'

interface DynamicFormConfig {
  fields: Array<{
    name: string
    type: 'string' | 'number' | 'boolean' | 'array' | 'object'
    label: string
    required?: boolean
    options?: Array<{ label: string; value: any }>
    validation?: any[]
  }>
}

const createDynamicForm = (config: DynamicFormConfig) => {
  const schema = {
    type: 'object',
    properties: config.fields.reduce((acc, field) => {
      acc[field.name] = {
        type: field.type,
        title: field.label,
        required: field.required,
        'x-validator': field.validation
      }

      if (field.type === 'boolean') {
        acc[field.name]['x-component'] = 'Checkbox'
      } else if (field.options) {
        acc[field.name]['x-component'] = 'Select'
        acc[field.name]['x-component-props'] = {
          options: field.options
        }
      } else {
        acc[field.name]['x-component'] = 'Input'
      }

      return acc
    }, {} as any)
  }

  return createForm({ schema })
}

Array Field Patterns

Dynamic Array Items

import { createForm, isArrayField } from '@formily/core'
import { ArrayField } from '@formily/react'

const form = createForm({
  initialValues: {
    contacts: [
      { name: '', phone: '', relationship: '' }
    ]
  }
})

// Add new contact item
const addContact = () => {
  form.pushValues('contacts', {
    name: '',
    phone: '',
    relationship: ''
  })
}

// Remove contact item
const removeContact = (index: number) => {
  form.removeValues(`contacts.${index}`)
}

// Reorder contacts
const moveContact = (fromIndex: number, toIndex: number) => {
  const field = form.query('contacts')
  if (isArrayField(field)) {
    field.move(fromIndex, toIndex)
  }
}

Nested Array Objects

interface Contact {
  name: string
  emails: Array<{
    address: string
    type: 'work' | 'personal' | 'other'
  }>
}

const NestedArrayForm = () => {
  const form = createForm<Contact>({
    initialValues: {
      name: '',
      emails: []
    }
  })

  const addEmail = () => {
    form.pushValues('emails', {
      address: '',
      type: 'work'
    })
  }

  return (
    <FormProvider form={form}>
      <ArrayField name="emails">
        {(field) => (
          <div>
            {field.value?.map((email, index) => (
              <div key={index}>
                <Field name={`emails.${index}.address`}>
                  {/** Email input component */}
                </Field>
                <Field name={`emails.${index}.type`}>
                  {/** Email type select component */}
                </Field>
              </div>
            ))}
            <button onClick={addEmail}>Add Email</button>
          </div>
        )}
      </ArrayField>
    </FormProvider>
  )
}

Async Validation Patterns

Server-Side Validation

import { createForm } from '@formily/core'

const form = createForm({
  effects() {
    // Async email uniqueness check
    onFieldChange('email', ['value'], async (field) => {
      if (!field.value) return

      field.validating = true

      try {
        const isUnique = await checkEmailUniqueness(field.value)

        if (!isUnique) {
          field.errors = ['Email already exists']
        } else {
          field.errors = []
        }
      } catch (error) {
        field.errors = ['Validation failed. Please try again.']
      } finally {
        field.validating = false
      }
    })

    // Debounced validation for performance
    onFieldChange('username', ['value'],
      debounce(async (field) => {
        if (!field.value || field.value.length < 3) return

        field.validating = true

        try {
          const exists = await checkUsernameExists(field.value)
          field.errors = exists ? ['Username already taken'] : []
        } catch (error) {
          field.errors = ['Unable to validate username']
        } finally {
          field.validating = false
        }
      }, 500)
    )
  }
})

// Helper function for debouncing
const debounce = <T extends (...args: any[]) => any>(
  func: T,
  wait: number
) => {
  let timeout: NodeJS.Timeout
  return (...args: Parameters<T>) => {
    clearTimeout(timeout)
    timeout = setTimeout(() => func(...args), wait)
  }
}

Complex Validation Rules

import { createForm, onFieldReact } from '@formily/core'

const form = createForm({
  effects() {
    // Password strength validation
    onFieldReact('password', (field) => {
      const password = field.value || ''
      const errors = []

      if (password.length < 8) {
        errors.push('Password must be at least 8 characters')
      }

      if (!/[A-Z]/.test(password)) {
        errors.push('Password must contain uppercase letter')
      }

      if (!/[a-z]/.test(password)) {
        errors.push('Password must contain lowercase letter')
      }

      if (!/\d/.test(password)) {
        errors.push('Password must contain number')
      }

      if (!/[!@#$%^&*]/.test(password)) {
        errors.push('Password must contain special character')
      }

      field.errors = errors
    })

    // Confirm password validation
    onFieldReact('confirmPassword', (field) => {
      const password = form.values.password
      const confirmPassword = field.value

      if (confirmPassword && password !== confirmPassword) {
        field.errors = ['Passwords do not match']
      } else {
        field.errors = []
      }
    })

    // Date range validation
    onFieldReact('endDate', (field) => {
      const startDate = form.values.startDate
      const endDate = field.value

      if (startDate && endDate && new Date(endDate) <= new Date(startDate)) {
        field.errors = ['End date must be after start date']
      } else {
        field.errors = []
      }
    })
  }
})

Nested Form Patterns

Multi-Step Forms

import { createForm } from '@formily/core'
import { useState } from 'react'

interface MultiStepFormData {
  personal: {
    firstName: string
    lastName: string
    email: string
  }
  professional: {
    company: string
    position: string
    experience: number
  }
  preferences: {
    notifications: boolean
    theme: 'light' | 'dark'
    language: string
  }
}

const MultiStepForm = () => {
  const [currentStep, setCurrentStep] = useState(0)

  const form = createForm<MultiStepFormData>({
    initialValues: {
      personal: { firstName: '', lastName: '', email: '' },
      professional: { company: '', position: '', experience: 0 },
      preferences: { notifications: true, theme: 'light', language: 'en' }
    }
  })

  const steps = [
    { title: 'Personal Info', fields: ['personal'] },
    { title: 'Professional', fields: ['professional'] },
    { title: 'Preferences', fields: ['preferences'] }
  ]

  const handleNext = async () => {
    // Validate current step
    const currentFields = steps[currentStep].fields
    const isValid = await Promise.all(
      currentFields.map(field => form.validate(field))
    )

    if (isValid.every(result => result === null)) {
      if (currentStep < steps.length - 1) {
        setCurrentStep(currentStep + 1)
      }
    }
  }

  const handlePrevious = () => {
    if (currentStep > 0) {
      setCurrentStep(currentStep - 1)
    }
  }

  const handleSubmit = async () => {
    try {
      await form.validate()
      const values = form.values
      console.log('Form submitted:', values)
    } catch (errors) {
      console.error('Validation errors:', errors)
    }
  }

  return (
    <FormProvider form={form}>
      {/* Step content based on currentStep */}
      {/* Navigation buttons */}
    </FormProvider>
  )
}

Nested Object Management

interface Address {
  street: string
  city: string
  state: string
  zip: string
  country: string
}

interface UserProfile {
  name: string
  email: string
  address: Address
  emergencyContact: {
    name: string
    relationship: string
    phone: string
  }
}

const NestedForm = () => {
  const form = createForm<UserProfile>({
    initialValues: {
      name: '',
      email: '',
      address: {
        street: '',
        city: '',
        state: '',
        zip: '',
        country: 'us'
      },
      emergencyContact: {
        name: '',
        relationship: '',
        phone: ''
      }
    }
  })

  // Update nested object efficiently
  const updateAddress = (field: keyof Address, value: string) => {
    form.setFieldState(`address.${field}`, state => {
      state.value = value
    })
  }

  // Batch update nested object
  const updateEntireAddress = (address: Partial<Address>) => {
    form.setValues({
      address: { ...form.values.address, ...address }
    })
  }

  return (
    <FormProvider form={form}>
      {/* Nested form fields */}
    </FormProvider>
  )
}

Performance Optimization

Memoized Field Components

import React, { memo } from 'react'
import { observer } from '@formily/reactive-react'
import { useField } from '@formily/react'

interface OptimizedFieldProps {
  name: string
  component: React.ComponentType<any>
  [key: string]: any
}

const OptimizedField = observer(
  memo<OptimizedFieldProps>(({ name, component: Component, ...props }) => {
    const field = useField(name)

    return (
      <div>
        <Component {...props} value={field.value} onChange={field.onInput} />
        {field.errors && (
          <div className="error">{field.errors[0]}</div>
        )}
      </div>
    )
  })
)

// Usage
const MyForm = () => {
  return (
    <FormProvider form={form}>
      <OptimizedField name="firstName" component={Input} />
      <OptimizedField name="email" component={Input} />
    </FormProvider>
  )
}

Virtualized Large Forms

import { FixedSizeList as List } from 'react-window'

const VirtualizedForm = () => {
  const [items] = useState(() =>
    Array.from({ length: 1000 }, (_, i) => ({
      id: `field-${i}`,
      name: `Field ${i + 1}`,
      value: ''
    }))
  )

  const Row = ({ index, style }: { index: number; style: React.CSSProperties }) => (
    <div style={style}>
      <Field name={`items.${index}.value`}>
        {({ field, state }) => (
          <div>
            <label>{items[index].name}</label>
            <Input
              value={state.value}
              onChange={(e) => field.onInput(e.target.value)}
            />
          </div>
        )}
      </Field>
    </div>
  )

  return (
    <FormProvider form={form}>
      <List
        height={400}
        itemCount={items.length}
        itemSize={60}
        width="100%"
      >
        {Row}
      </List>
    </FormProvider>
  )
}

Efficient Field Updates

// Batch multiple field updates
const batchUpdateForm = () => {
  form.batch(() => {
    form.setValues({ name: 'John' })
    form.setValues({ email: 'john@example.com' })
    form.setValues({ age: 30 })
    form.setFieldState('name', state => {
      state.touched = true
    })
  })
}

// Selective re-rendering
const SelectiveForm = () => {
  const [shouldRenderExpensive, setShouldRenderExpensive] = useState(false)

  return (
    <FormProvider form={form}>
      {/* Always render essential fields */}
      <Field name="name">
        {/* Simple input */}
      </Field>

      {/* Conditionally render expensive fields */}
      {shouldRenderExpensive && (
        <Field name="complexField">
          {/* Expensive component */}
        </Field>
      )}

      <button onClick={() => setShouldRenderExpensive(!shouldRenderExpensive)}>
        Toggle Complex Field
      </button>
    </FormProvider>
  )
}

Custom Field Patterns

Address Field Component

interface AddressFieldProps {
  name: string
  label?: string
  required?: boolean
}

const AddressField: React.FC<AddressFieldProps> = ({ name, label, required }) => {
  const form = useForm()

  const handleCountryChange = (country: string) => {
    // Reset dependent fields when country changes
    form.setValues({
      [`${name}.state`]: '',
      [`${name}.city`]: ''
    })
  }

  return (
    <div>
      <h3>{label || 'Address'}</h3>

      <Row gutter={16}>
        <Col span={24}>
          <Field name={`${name}.street`}>
            <FormItem label="Street Address" required={required}>
              <Input placeholder="123 Main St" />
            </FormItem>
          </Field>
        </Col>
      </Row>

      <Row gutter={16}>
        <Col span={8}>
          <Field name={`${name}.city`}>
            <FormItem label="City" required={required}>
              <Input placeholder="City" />
            </FormItem>
          </Field>
        </Col>

        <Col span={8}>
          <Field name={`${name}.state`}>
            <FormItem label="State/Province">
              <Input placeholder="State" />
            </FormItem>
          </Field>
        </Col>

        <Col span={8}>
          <Field name={`${name}.zip`}>
            <FormItem label="ZIP/Postal Code">
              <Input placeholder="ZIP" />
            </FormItem>
          </Field>
        </Col>
      </Row>

      <Row gutter={16}>
        <Col span={24}>
          <Field name={`${name}.country`}>
            <FormItem label="Country" required={required}>
              <Select
                placeholder="Select country"
                onChange={handleCountryChange}
              >
                <Select.Option value="us">United States</Select.Option>
                <Select.Option value="ca">Canada</Select.Option>
                <Select.Option value="uk">United Kingdom</Select.Option>
              </Select>
            </FormItem>
          </Field>
        </Col>
      </Row>
    </div>
  )
}

File Upload with Progress

import { Upload, Button, Progress } from 'antd'

interface FileUploadFieldProps {
  name: string
  maxSize?: number
  accept?: string
  multiple?: boolean
}

const FileUploadField: React.FC<FileUploadFieldProps> = ({
  name,
  maxSize = 5 * 1024 * 1024, // 5MB
  accept,
  multiple = false
}) => {
  const [uploadProgress, setUploadProgress] = useState<Record<string, number>>({})

  const handleUpload = async (file: File) => {
    const formData = new FormData()
    formData.append('file', file)

    try {
      // Simulate upload progress
      let progress = 0
      const interval = setInterval(() => {
        progress += 10
        setUploadProgress(prev => ({ ...prev, [file.name]: progress }))

        if (progress >= 100) {
          clearInterval(interval)
        }
      }, 200)

      const response = await uploadFile(formData)

      // Update form field with upload result
      form.setValues({
        [name]: response.url
      })

      return response
    } catch (error) {
      console.error('Upload failed:', error)
      throw error
    }
  }

  return (
    <Field name={name}>
      {({ field, state }) => (
        <div>
          <Upload
            customRequest={({ file }) => handleUpload(file as File)}
            beforeUpload={(file) => {
              if (file.size > maxSize) {
                alert(`File size must be less than ${maxSize / 1024 / 1024}MB`)
                return false
              }
              return true
            }}
            accept={accept}
            multiple={multiple}
          >
            <Button icon={<UploadOutlined />}>
              Select {multiple ? 'Files' : 'File'}
            </Button>
          </Upload>

          {Object.entries(uploadProgress).map(([filename, progress]) => (
            <div key={filename}>
              <span>{filename}</span>
              <Progress percent={progress} size="small" />
            </div>
          ))}

          {state.value && (
            <div>Uploaded: {state.value}</div>
          )}
        </div>
      )}
    </Field>
  )
}

Additional Resources

Example Files

  • examples/dynamic-form.tsx - Complete dynamic form implementation
  • examples/performance-optimization.tsx - Performance optimization techniques
  • examples/complex-validation.tsx - Advanced validation patterns

Reference Files

  • references/performance-checklist.md - Performance optimization checklist
  • references/validation-patterns.md - Complex validation pattern reference
  • references/nested-form-patterns.md - Nested form architecture guide

Common Advanced Patterns

  • Dynamic field visibility and options
  • Async validation with debouncing
  • Nested object and array management
  • Multi-step form workflows
  • Performance optimization strategies
  • Custom field component creation

Best Practices

  1. Use debouncing for async validation to prevent excessive API calls
  2. Batch field updates using form.batch() for better performance
  3. Memoize expensive components to prevent unnecessary re-renders
  4. Virtualize large forms with hundreds of fields
  5. Use TypeScript generics for type-safe nested forms
  6. Implement proper error boundaries for complex form scenarios
  7. Optimize field dependencies to minimize validation triggers
  8. Use form effects for reactive field behavior instead of manual listeners

平台分布

Claude Code

27.07%
按下载量换算673

windsurf

24.52%
按下载量换算610

trae

18.98%
按下载量换算472

OpenCode

12.71%
按下载量换算316

Codex

8.21%
按下载量换算204

Antigravity

3.42%
按下载量换算85

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills