brainstorming
Structured design dialogue that validates ideas before implementation begins.
fosmvvm-fields-generator
Generate FOSMVVM Form Specifications (Fields protocols) with validation and localization. Use when defining user input contracts for forms, request bodies, or any ValidatableModel.
Full skill instructions
Generate Form Specifications following FOSMVVM patterns.
For full architecture context, see FOSMVVMArchitecture.md
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:
// 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:
Form Specifications integrate with:
LocalizableStringValidatableModel protocolValidatableModelfosmvvm-fluent-datamodel-generator needs form fields for a DataModelA complete Form Specification consists of 3 files:
| File | Purpose |
|---|---|
{Name}Fields.swift | Protocol + FormField definitions + validation methods |
{Name}FieldsMessages.swift | @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 |
|---|---|---|
{ViewModelsTarget} | Shared ViewModels SPM target | ViewModels, SharedViewModels |
{ResourcesPath} | Localization resources path | Sources/Resources |
Expected Structure:
Sources/
{ViewModelsTarget}/
FieldModels/
{Name}Fields.swift
{Name}FieldsMessages.swift
{ResourcesPath}/
FieldModels/
{Name}FieldsMessages.yml
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:
public protocol {Name}Fields: ValidatableModel, Codable, Sendable {
var fieldName: FieldType { get set }
var {name}ValidationMessages: {Name}FieldsMessages { get }
}
static var contentField: FormField<String?> { .init(
fieldId: .init(id: "content"),
title: .localized(for: {Name}FieldsMessages.self, propertyName: "content", messageKey: "title"),
placeholder: .localized(for: {Name}FieldsMessages.self, propertyName: "content", messageKey: "placeholder"),
type: .textArea(inputType: .text),
options: [
.required(value: true)
] + FormInputOption.rangeLength(contentRange)
) }
| FormFieldType | Use Case |
|---|---|
.text(inputType:) | Single-line input |
.textArea(inputType:) | Multi-line input |
.checkbox | Boolean toggle |
.select | Dropdown selection |
.colorPicker | Color selection |
| FormInputType | Keyboard/Autofill |
|---|---|
.text | Default keyboard |
.emailAddress | Email keyboard, email autofill |
.password | Secure entry |
.tel | Phone keyboard |
.url | URL keyboard |
.date, .datetimeLocal | Date picker |
.givenName, .familyName | Name autofill |
internal func validateContent(_ fields: [FormFieldBase]?) -> [ValidationResult]? {
guard fields == nil || (fields?.contains(Self.contentField) == true) else {
return nil
}
var result = [ValidationResult]()
if content.isEmpty {
result.append(.init(
status: .error,
field: Self.contentField,
message: {name}ValidationMessages.contentRequiredMessage
))
} else if !Self.contentRange.contains(NSString(string: content).length) {
result.append(.init(
status: .error,
field: Self.contentField,
message: {name}ValidationMessages.contentOutOfRangeMessage
))
}
return result.isEmpty ? nil : result
}
@FieldValidationModel public struct {Name}FieldsMessages {
@LocalizedString("content", messageGroup: "validationMessages", messageKey: "required")
public var contentRequiredMessage
@LocalizedString("content", messageGroup: "validationMessages", messageKey: "outOfRange")
public var contentOutOfRangeMessage
}
en:
{Name}FieldsMessages:
content:
title: "Content"
placeholder: "Enter your content..."
validationMessages:
required: "Content is required"
outOfRange: "Content must be between 1 and 10,000 characters"
| Concept | Convention | Example |
|---|---|---|
| Protocol | {Name}Fields | IdeaFields, CreateIdeaFields |
| 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 | 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. |
Structured design dialogue that validates ideas before implementation begins.
Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Introduction to the obra skills system with mandatory skill invocation rules and best practices.
Execute a written implementation plan with critical review and task checkpoints.
Delegate independent tasks to specialized agents working concurrently with isolated context.
Isolated git worktrees with smart directory selection and safety verification.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Plan searchable and shareable content that drives traffic, builds authority, and generates leads.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.
Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.
The world's fastest calendar for remote work
Capture, organize, and utilize your knowledge effortlessly.
Instant Summaries of Audio & Video Interviews with AnySummary
Transform PDFs into engaging mind maps.
Chat with any PDF instantly
Create an optimal daily plan using your voice
A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.
AskYourPDF Pricing Plans: Tailored to Your Needs