# FOSMVVM Fields Generator
Generate Form Specifications following FOSMVVM patterns.
## Conceptual Foundation
> For full architecture context, see [FOSMVVMArchitecture.md](../../docs/FOSMVVMArchitecture.md) | [OpenClaw reference]({baseDir}/references/FOSMVVMArchitecture.md)
A **Form Specification** (implemented as a `{Name}Fields` protocol) is the **single source of truth** for user input. It answers:
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**:
```swift
// Same protocol adopted by different consumers:
struct CreateIdeaRequestBody: ServerRequestBody, IdeaFields { ... } // HTTP transmission
@ViewModel struct IdeaFormViewModel: IdeaFields { ... } // Form rendering
final class Idea: Model, IdeaFields { ... } // Persistence validation
```
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 `LocalizableString`
- **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 `ValidatableModel`
- When `fosmvvm-fluent-datamodel-generator` needs form fields for a DataModel
## What This Skill Generates
A complete Form Specification consists...