Generate FOSMVVM Fields protocols with validation rules, FormField definitions, and localized messages. Define form contracts once, validate everywhere.
Generate Form Specifications following FOSMVVM patterns.
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:
The Form Specification is defined once, used everywhere:
CODEBLOCK0
This ensures:
Form Specifications integrate with:
ValidatableModel protocolfosmvvm-fluent-datamodel-generator needs form fields for a DataModelA complete Form Specification consists of 3 files:
| File | Purpose |
|---|---|
| INLINECODE5 | Protocol + FormField definitions + validation methods |
| INLINECODE6 |
@FieldValidationModel struct with @LocalizedString properties |{Name}FieldsMessages.yml | YAML localization (titles, placeholders, error messages) |
Replace placeholders with your project's actual paths:
| Placeholder | Description | Example |
|---|---|---|
| INLINECODE10 | Shared ViewModels SPM target | INLINECODE11 , INLINECODE12 |
| INLINECODE13 |
Sources/Resources |
Expected Structure:
CODEBLOCK1
Invocation:
/fosmvvm-fields-generator
Prerequisites:
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.
This skill references conversation context to determine Fields protocol structure:
From conversation context, the skill identifies:
For each field from requirements:
Skill references information from:
CODEBLOCK2
CODEBLOCK3
| FormFieldType | Use Case |
|---|---|
| INLINECODE15 | Single-line input |
| INLINECODE16 |
.checkbox | Boolean toggle |
| .select | Dropdown selection |
| .colorPicker | Color selection |
| FormInputType | Keyboard/Autofill |
|---|---|
| INLINECODE20 | Default keyboard |
| INLINECODE21 |
.password | Secure entry |
| .tel | Phone keyboard |
| .url | URL keyboard |
| .date, .datetimeLocal | Date picker |
| .givenName, .familyName | Name autofill |
CODEBLOCK4
CODEBLOCK5
CODEBLOCK6
| Concept | Convention | Example |
|---|---|---|
| Protocol | INLINECODE29 | INLINECODE30 , 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 |
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2024-12-24 | Initial skill |
| 2.0 |
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 fosmvvm-fields-generator-1776420040 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 fosmvvm-fields-generator-1776420040 技能
skillhub install fosmvvm-fields-generator-1776420040
文件大小: 7.17 KB | 发布时间: 2026-4-17 18:53