Claude-skill-registry frontend-angular-form
Use when creating reactive forms with validation, async validators, dependent validation, and FormArrays using platform patterns.
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/angular-form" ~/.claude/skills/majiayu000-claude-skill-registry-frontend-angular-form && rm -rf "$T"
manifest:
skills/data/angular-form/SKILL.mdsource content
Angular Form Development Workflow
Use when creating/modifying reactive forms with validation, async validators, dependent validation, or FormArrays.
Decision Tree
What type of form? ├── Basic form (no auth) → PlatformFormComponent ├── Form with auth context → AppBaseFormComponent (typical choice) ├── With async validation → AppBaseFormComponent + ifAsyncValidator ├── Cross-field validation → AppBaseFormComponent + dependentValidations └── Dynamic fields → AppBaseFormComponent + FormArray config
Workflow
- Search existing forms:
grep "{Feature}FormComponent" --include="*.ts" - Read design system docs (see Read Directives below)
- Define ViewModel interface for form data
- Implement
with controls, validators, dependentValidationsinitialFormConfig() - Implement
for create/edit mode data loadinginitOrReloadVm() - Add
withonSubmit()
guardvalidateForm() - Template with BEM classes on all form elements
- Verify checklist below
Key Rules
- Always call
before submitvalidateForm() - Use
- never run async validators unconditionallyifAsyncValidator(condition, validator) - Configure
for cross-field re-validationdependentValidations - FormArrays use
config pattern{ modelItems, itemControl } - Use
to access control in templateformControls('name') - Loading state:
in templateisLoading$('save')()
File Location
src/Frontend/apps/{app-name}/src/app/features/{feature}/ ├── {feature}-form.component.ts|html|scss
⚠️ MUST READ Before Implementation
IMPORTANT: You MUST read these files before writing any code. Do NOT skip.
- ⚠️ MUST READ
— hierarchy, SCSS, platform APIs.claude/skills/shared/angular-design-system.md - ⚠️ MUST READ
— BEM form examples.claude/skills/shared/bem-component-examples.md - ⚠️ MUST READ
— basic, async, dependent, FormArray patterns.claude/skills/frontend-angular-form/references/form-patterns.md - ⚠️ MUST READ target app design system:
docs/design-system/03-form-patterns.md
Anti-Patterns
- Missing
before submitvalidateForm() - Async validator without
conditional wrapperifAsyncValidator - Missing
in FormArray template loops[formGroupName]="i" - Form elements without BEM classes
- Missing error messages for validation rules
Verification Checklist
-
returns form configurationinitialFormConfig -
handles create + edit modesinitOrReloadVm -
called before submitvalidateForm() - Async validators wrapped with
ifAsyncValidator -
configured for cross-field rulesdependentValidations - FormArrays use
+modelItemsitemControl - Error messages for all validation rules
- All form elements have BEM classes
IMPORTANT Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed