Claude-skill-registry 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.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/form-extraction" ~/.claude/skills/majiayu000-claude-skill-registry-form-extraction && rm -rf "$T"
manifest:
skills/data/form-extraction/SKILL.mdsource 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
| Pattern | Example |
|---|---|
| FormBuilder | |
| Private FB | |
| NonNullable | |
| Direct | |
| Untyped | |
Validator Patterns
| Pattern | Example |
|---|---|
| Array syntax | |
| Object syntax | |
| Group-level | |
| Async | |
Validator Mapping (Old → New)
| Old (Validators) | New (OneValidators) |
|---|---|
| |
| |
| |
| |
| |
| |
| |
Error Display Patterns
Validators with Built-in Messages (use oneUiFormError
directly)
oneUiFormErrorThese validators have i18n messages built-in, use simple pattern:
<mat-error oneUiFormError="fieldName"></mat-error>
| Validator | Built-in Message Key |
|---|---|
| |
| |
| |
| |
| |
| |
All Other Validators (MUST use @if/@else
)
@if/@elseAll 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> }
| Validator | Reason |
|---|---|
| Generic message , need specific message |
| Default , often need context-specific message |
| Custom validators | No built-in message |
| Any other validator | Not in the 6 basic validators list |
References
- Detailed patterns:
rules/tools/forms/patterns.md