Skip to main content
skill CX Codex

angular-forms · gentleman-programming — Angular skill for Signal Forms and Reactive Forms

A skill for building Angular forms: covers Signal Forms (experimental, Angular 21+) and production-ready Reactive Forms. Activates when you work with form validation, state management, or form creation.

MIT 150 installs ★ 678 updated 2026-03-28

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-forms -a claude-code
Open on GitHub

What angular-forms does

The skill provides patterns and examples for both approaches. Signal Forms use the form() function with automatic two-way binding and type safety—suited to new projects. Reactive Forms use FormBuilder with nonNullable.group() for type correctness and getRawValue() to fetch values; this synchronous, testable pattern is the production standard.

Examples cover simple login forms, nested groups, and FormArray for dynamic fields. Signal Forms require Angular 21+; Reactive Forms need ReactiveFormsModule imported.

What it helps with

  • Choose between Signal Forms and Reactive Forms for a new project
  • Build a form with validation and type safety
  • Handle nested forms and dynamically added fields
  • Extract typed values from a form without casting

Example prompts for the agent

  • Build a login form using Signal Forms on Angular 21
  • Show me a Reactive Form with email and password fields
  • Add a dynamic phone number array with FormArray

How to install angular-forms

1Skills CLI (Vercel)

npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-forms -a claude-code

2Manually: put the files in place

~/.claude/skills/forms/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/forms/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about angular-forms

How do I install angular-forms in Claude Code?

Run npx skills add Gentleman-Programming/Gentleman-Skills --skill angular-forms -a claude-code, then npx skills add Gentleman-Programming/Gentleman-Skills --skill forms -a claude-code. The skill will be available at ~/.claude/skills/forms/SKILL.md.

What Angular version supports Signal Forms?

Signal Forms are available in Angular 21+ and remain experimental. For production, use Reactive Forms, which work with any current Angular version.

Why use fb.nonNullable.group() instead of the regular group()?

It enforces correct TypeScript types: form fields are non-nullable by default, reducing runtime errors when accessing form values.

Source text

SKILL.md · MIT
---
name: angular-forms
description: >
  Angular forms: Signal Forms (experimental) and Reactive Forms.
  Trigger: When working with forms, validation, or form state in Angular.
metadata:
  author: gentleman-programming
  version: "1.0"
---

## When to Use What

| Use Case | Recommendation |
|----------|----------------|
| New apps with signals | Signal Forms (experimental) |
| Production apps | Reactive Forms |
| Simple forms | Template-driven |

---

## Signal Forms (v21+, experimental)

```typescript
import { form, FormField, required, email } from '@angular/forms/signals';

@Component({
  imports: [FormField],
  template: `
    <form>
      <input [formField]="emailField" type="email" />
      <input [formField]="passwordField" type="password" />
      <button (click)="submit()">Login</button>
    </form>
  `
})
export class LoginComponent {
  readonly loginForm = form({
    email: ['', [required, email]],
    password: ['', required]
  });
  
  readonly emailField = this.loginForm.controls.email;
  readonly passwordField = this.loginForm.controls.password;
  
  submit() {
    if (this.loginForm.valid()) {
      const values = this.loginForm.value();
    }
  }
}
```

### Signal Forms Benefits
- Automatic two-way binding
- Type-safe field access
- Schema-based validation
- Built on signals

---

## Reactive Forms (production)

```typescript
import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';

@Component({
  imports: [ReactiveFormsModule],
  template: `
    <form [formGroup]="form" (ngSubmit)="submit()">
      <input formControlName="email" type="email" />
      <input formControlName="password" type="password" />
      <button type="submit" [disabled]="form.invalid">Login</button>
    </form>
  `
})
export class LoginComponent {
  private readonly fb = inject(FormBuilder);

  form = this.fb.nonNullable.group({
    email: ['', [Validators.required, Validators.email]],
    password: ['', [Validators.required, Validators.minLength(8)]],
  });
  
  submit() {
    if (this.form.valid) {
      const { email, password } = this.form.getRawValue();
    }
  }
}
```

### Key Points
- ALWAYS use `fb.nonNullable.group()` for type safety
- Use `getRawValue()` to get typed values
- Reactive Forms are synchronous (easier to test)

---

## Nested Forms & FormArray

```typescript
form = this.fb.nonNullable.group({
  name: [''],
  address: this.fb.group({
    street: [''],
    city: [''],
  }),
  phones: this.fb.array([this.fb.control('')]),
});

get phones() {
  return this.form.get('phones') as FormArray;
}

addPhone() {
  this.phones.push(this.fb.control(''));
}
```

---

## Resources

- https://angular.dev/guide/forms/signals/overview
- https://angular.dev/guide/forms/reactive-forms

© gentleman-programming · MIT · Gentleman-Programming/Gentleman-Skills

Similar skills

All skills for Frontend and UI →

angular-forms by other authors comes first.

From the same set20

The whole set →

Project sponsors

Companies that keep this analytics open