Skill

form-extraction

Extract and analyze Angular Reactive Forms from source code for migration comparison and validation. Use when comparing forms between legacy and migrated code.

From one-ui-migration
Install
1
Run in your terminal
$
npx claudepluginhub michael0520/milo-claudekit --plugin one-ui-migration
Tool Access

This skill uses the workspace's default tool permissions.

Supporting Assets
View in Repository
references/patterns.md
Skill Content

Form Extraction Skill

Extract and analyze Angular Reactive Forms from source code for migration comparison and validation.

Quick Commands

Extract Form Controls

# From HTML - formControlName
grep -oE 'formControlName="[^"]+"' {path}/**/*.html | sort -u

# From HTML - formGroupName
grep -oE 'formGroupName="[^"]+"' {path}/**/*.html | sort -u

# From TypeScript - form definitions
grep -E '(this\.fb\.group|this\.#fb\.group|this\.fb\.nonNullable\.group|new FormGroup|new UntypedFormGroup)' {path}/**/*.ts

Extract Validators

# Angular Validators (old)
grep -oE 'Validators\.(required|email|minLength|maxLength|min|max|pattern|nullValidator)(\([^)]*\))?' {path}/**/*.ts | sort -u

# OneValidators (new)
grep -oE 'OneValidators\.[a-zA-Z]+(\([^)]*\))?' {path}/**/*.ts | sort -u

# Custom validators
grep -oE '#?[a-zA-Z]+Validator\b' {path}/**/*.ts | sort -u

Form Definition Patterns

PatternExample
FormBuilderthis.fb.group({ ... })
Private FBthis.#fb.group({ ... })
NonNullablethis.fb.nonNullable.group({ ... })
Directnew FormGroup({ ... })
Untypednew UntypedFormGroup({ ... })

Validator Patterns

PatternExample
Array syntaxcontrolName: ['', [Validators.required]]
Object syntaxcontrolName: this.fb.control('', { validators: [...] })
Group-levelthis.fb.group({...}, { validators: [...] })
AsynccontrolName: ['', [], [asyncValidator]]

Validator Mapping (Old → New)

Old (Validators)New (OneValidators)
Validators.requiredOneValidators.required
Validators.emailOneValidators.email
Validators.minLength(n)OneValidators.minLength(n)
Validators.maxLength(n)OneValidators.maxLength(n)
Validators.min(n)OneValidators.range(min, max)
Validators.max(n)OneValidators.range(min, max)
Validators.pattern(x)OneValidators.pattern(x)

Error Display Patterns

Validators with Built-in Messages (use oneUiFormError directly)

These validators have i18n messages built-in, use simple pattern:

<mat-error oneUiFormError="fieldName"></mat-error>
ValidatorBuilt-in Message Key
requiredvalidators.required
minLengthvalidators.require_min_length
maxLengthvalidators.invalid_max_length
rangevalidators.invalid_range
rangeLengthvalidators.invalid_range
emailvalidators.invalid_email

All Other Validators (MUST use @if/@else)

All validators NOT in the list above need explicit error handling with custom messages:

@if (ctrl.hasError('pattern')) {
  <mat-error>{{ t('validators.your_custom_pattern_message') }}</mat-error>
} @else if (ctrl.hasError('duplicate')) {
  <mat-error>{{ t('validators.duplicate_xxx') }}</mat-error>
} @else {
  <mat-error oneUiFormError="fieldName"></mat-error>
}
ValidatorReason
patternGeneric message validators.invalid, need specific message
duplicateDefault validators.duplicate, often need context-specific message
Custom validatorsNo built-in message
Any other validatorNot in the 6 basic validators list

References

  • Detailed patterns: rules/tools/forms/patterns.md
Similar Skills
cache-components

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

138.5k
Stats
Parent Repo Stars0
Parent Repo Forks0
Last CommitJan 24, 2026