返回顶部
f

fosmvvm-fields-generatorFOSMVVM字段生成器

Generate FOSMVVM Fields protocols with validation rules, FormField definitions, and localized messages. Define form contracts once, validate everywhere.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 2.0.6
安全检测
已通过
595
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

fosmvvm-fields-generator

FOSMVVM Fields Generator

Generate Form Specifications following FOSMVVM patterns.

Conceptual Foundation

For full architecture context, see FOSMVVMArchitecture.md | OpenClaw reference

A Form Specification (implemented as a {Name}Fields protocol) is the single source of truth for user input. It answers:

  1. 1. What data can the user provide? (properties)
  2. How should it be presented? (FormField with type, keyboard, autofill semantics)
  3. What constraints apply? (validation rules)
  4. What messages should be shown? (localized titles, placeholders, errors)

Why This Matters

The Form Specification is defined once, used everywhere:

CODEBLOCK0

This ensures:

  • - Consistent validation - Same rules on client and server
  • Shared localization - One YAML file, used everywhere
  • Single source of truth - Change once, applies everywhere

Connection to FOSMVVM

Form Specifications integrate with:

  • - Localization System - FormField titles/placeholders and validation messages use INLINECODE1
  • Validation System - Implements ValidatableModel protocol
  • Request System - RequestBody types adopt Fields for validated transmission
  • ViewModel System - ViewModels adopt Fields for form rendering

When to Use This Skill

  • - Defining a new form (create, edit, filter, search)
  • Adding validation to a request body
  • Any type that needs to conform to INLINECODE3
  • When fosmvvm-fluent-datamodel-generator needs form fields for a DataModel

What This Skill Generates

A complete Form Specification consists of 3 files:

FilePurpose
INLINECODE5Protocol + FormField definitions + validation methods
INLINECODE6
@FieldValidationModel struct with @LocalizedString properties |
| {Name}FieldsMessages.yml | YAML localization (titles, placeholders, error messages) |

Project Structure Configuration

Replace placeholders with your project's actual paths:

PlaceholderDescriptionExample
INLINECODE10Shared ViewModels SPM targetINLINECODE11, INLINECODE12
INLINECODE13
Localization resources path | Sources/Resources |

Expected Structure:
CODEBLOCK1

How to Use This Skill

Invocation:
/fosmvvm-fields-generator

Prerequisites:

  • - Form purpose understood from conversation context
  • Field requirements discussed (names, types, constraints)
  • Entity relationship identified (what is this form creating/editing)

Workflow integration:
This skill is used when defining form validation and user input contracts. The skill references conversation context automatically—no file paths or Q&A needed. Often precedes fosmvvm-fluent-datamodel-generator for form-backed models.

Pattern Implementation

This skill references conversation context to determine Fields protocol structure:

Form Analysis

From conversation context, the skill identifies:

  • - Form purpose (create, edit, filter, login, settings)
  • Entity relation (User, Idea, Document - what's being created/edited)
  • Protocol naming (CreateIdeaFields, UpdateProfile, LoginCredentials)

Field Design

For each field from requirements:

  • - Property specification (name, type, optional vs required)
  • Presentation type (FormFieldType: text, textArea, select, checkbox)
  • Input semantics (FormInputType: email, password, tel, date)
  • Constraints (required, length range, value range, date range)
  • Localization (title, placeholder, validation error messages)

File Generation Order

  1. 1. Fields protocol with FormField definitions and validation
  2. FieldsMessages struct with @LocalizedString properties
  3. FieldsMessages YAML with localized strings

Context Sources

Skill references information from:

  • - Prior conversation: Form requirements, field specifications discussed
  • Specification files: If Claude has read form specs into context
  • Existing patterns: From codebase analysis of similar Fields protocols

Key Patterns

Protocol Structure

CODEBLOCK2

FormField Definition

CODEBLOCK3

FormField Types Reference

FormFieldTypeUse Case
INLINECODE15Single-line input
INLINECODE16
Multi-line input | | .checkbox | Boolean toggle | | .select | Dropdown selection | | .colorPicker | Color selection |

FormInputType Reference (common ones)

FormInputTypeKeyboard/Autofill
INLINECODE20Default keyboard
INLINECODE21
Email keyboard, email autofill | | .password | Secure entry | | .tel | Phone keyboard | | .url | URL keyboard | | .date, .datetimeLocal | Date picker | | .givenName, .familyName | Name autofill |

Validation Method Pattern

CODEBLOCK4

Messages Struct Pattern

CODEBLOCK5

YAML Structure

CODEBLOCK6

Naming Conventions

ConceptConventionExample
ProtocolINLINECODE29INLINECODE30, INLINECODE31
Messages struct
{Name}FieldsMessages | IdeaFieldsMessages | | Messages property | {name}ValidationMessages | ideaValidationMessages | | Field definition | {fieldName}Field | contentField | | Range constant | {fieldName}Range | contentRange | | Validate method | validate{FieldName} | validateContent | | Required message | {fieldName}RequiredMessage | contentRequiredMessage | | OutOfRange message | {fieldName}OutOfRangeMessage | contentOutOfRangeMessage |

See Also

Version History

VersionDateChanges
1.02024-12-24Initial skill
2.0
2024-12-26 | Rewritten with conceptual foundation; generalized from Kairos-specific | | 2.1 | 2026-01-24 | Update to context-aware approach (remove file-parsing/Q&A). Skill references conversation context instead of asking questions or accepting file paths. |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 fosmvvm-fields-generator-1776420040 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 fosmvvm-fields-generator-1776420040 技能

通过命令行安装

skillhub install fosmvvm-fields-generator-1776420040

下载

⬇ 下载 fosmvvm-fields-generator v2.0.6(免费)

文件大小: 7.17 KB | 发布时间: 2026-4-17 18:53

v2.0.6 最新 2026-4-17 18:53
Initial ClawHub release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部