Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create modern Angular standalone components following v20+ best practices. Use for building UI components with signal-based inputs/outputs, OnPush change detection, host bindings, content projection, and lifecycle hooks. Triggers on component creation, refactoring class-based inputs to signals, adding host bindings, or implementing accessible interactive components.
.claude/skills/aiskillstore-angular-component/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 10% | 0% |
Create standalone components for Angular v20+. Components are standalone by default—do NOT set standalone: true.
typescriptimport { Component, ChangeDetectionStrategy, input, output, computed } from '@angular/core'; @Component({ selector: 'app-user-card', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'user-card', '[class.active]': 'isActive()', '(click)': 'handleClick()', }, template: ` <img [src]="avatarUrl()" [alt]="name() + ' avatar'" /> <h2>{{ name() }}</h2> @if (showEmail()) { <p>{{ email() }}</p> } `, styles: ` :host { display: block; } :host.active { border: 2px solid blue; } `, }) export class UserCard { // Required input name = input.required<string>(); // Optional input with default email = input<string>(''); showEmail = input(false); // Input with transform isActive = input(false, { transform: booleanAttribute }); // Computed from inputs avatarUrl = computed(() => `https://api.example.com/avatar/${this.name()}`); // Output selected = output<string>(); handleClick() { this.selected.emit(this.name()); } }
typescript// Required - must be provided by parent name = input.required<string>(); // Optional with default value count = input(0); // Optional without default (undefined allowed) label = input<string>(); // With alias for template binding size = input('medium', { alias: 'buttonSize' }); // With transform function disabled = input(false, { transform: booleanAttribute }); value = input(0, { transform: numberAttribute });
typescriptimport { output, outputFromObservable } from '@angular/core'; // Basic output clicked = output<void>(); selected = output<Item>(); // With alias valueChange = output<number>({ alias: 'change' }); // From Observable (for RxJS interop) scroll$ = new Subject<number>(); scrolled = outputFromObservable(this.scroll$); // Emit values this.clicked.emit(); this.selected.emit(item);
Use the host object in @Component—do NOT use @HostBinding or @HostListener decorators.
typescript@Component({ selector: 'app-button', host: { // Static attributes 'role': 'button', // Dynamic class bindings '[class.primary]': 'variant() === "primary"', '[class.disabled]': 'disabled()', // Dynamic style bindings '[style.--btn-color]': 'color()', // Attribute bindings '[attr.aria-disabled]': 'disabled()', '[attr.tabindex]': 'disabled() ? -1 : 0', // Event listeners '(click)': 'onClick($event)', '(keydown.enter)': 'onClick($event)', '(keydown.space)': 'onClick($event)', }, template: `<ng-content />`, }) export class Button { variant = input<'primary' | 'secondary'>('primary'); disabled = input(false, { transform: booleanAttribute }); color = input('#007bff'); clicked = output<void>(); onClick(event: Event) { if (!this.disabled()) { this.clicked.emit(); } } }
typescript@Component({ selector: 'app-card', template: ` <header> <ng-content select="[card-header]" /> </header> <main> <ng-content /> </main> <footer> <ng-content select="[card-footer]" /> </footer> `, }) export class Card {} // Usage: // <app-card> // <h2 card-header>Title</h2> // <p>Main content</p> // <button card-footer>Action</button> // </app-card>
typescriptimport { OnDestroy, OnInit, afterNextRender, afterRender } from '@angular/core'; export class My implements OnInit, OnDestroy { constructor() { // For DOM manipulation after render (SSR-safe) afterNextRender(() => { // Runs once after first render }); afterRender(() => { // Runs after every render }); } ngOnInit() { /* Component initialized */ } ngOnDestroy() { /* Cleanup */ } }
Components MUST:
typescript@Component({ selector: 'app-toggle', host: { 'role': 'switch', '[attr.aria-checked]': 'checked()', '[attr.aria-label]': 'label()', 'tabindex': '0', '(click)': 'toggle()', '(keydown.enter)': 'toggle()', '(keydown.space)': 'toggle(); $event.preventDefault()', }, template: `<span class="toggle-track"><span class="toggle-thumb"></span></span>`, }) export class Toggle { label = input.required<string>(); checked = input(false, { transform: booleanAttribute }); checkedChange = output<boolean>(); toggle() { this.checkedChange.emit(!this.checked()); } }
Use native control flow—do NOT use *ngIf, *ngFor, *ngSwitch.
html<!-- Conditionals --> @if (isLoading()) { <app-spinner /> } @else if (error()) { <app-error [message]="error()" /> } @else { <app-content [data]="data()" /> } <!-- Loops --> @for (item of items(); track item.id) { <app-item [item]="item" /> } @empty { <p>No items found</p> } <!-- Switch --> @switch (status()) { @case ('pending') { <span>Pending</span> } @case ('active') { <span>Active</span> } @default { <span>Unknown</span> } }
Do NOT use ngClass or ngStyle. Use direct bindings:
html<!-- Class bindings --> <div [class.active]="isActive()">Single class</div> <div [class]="classString()">Class string</div> <!-- Style bindings --> <div [style.color]="textColor()">Styled text</div> <div [style.width.px]="width()">With unit</div>
Use NgOptimizedImage for static images:
typescriptimport { NgOptimizedImage } from '@angular/common'; @Component({ imports: [NgOptimizedImage], template: ` <img ngSrc="/assets/hero.jpg" width="800" height="600" priority /> <img [ngSrc]="imageUrl()" width="200" height="200" /> `, }) export class Hero { imageUrl = input.required<string>(); }
For detailed patterns, see references/component-patterns.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | pass→pass | 13,815 | 37,790 | +174% | 1 | 1 | 0% | 2,672 | 6,575 | +146% | 0 | 0 | — |
case-01 | fail→pass | 83,099 | 36,502 | -56% | 1 | 1 | 0% | 5,739 | 6,560 | +14% | 0 | 0 | — |
case-02 | fail→pass | 178,382 | 29,215 | -84% | 1 | 1 | 0% | 5,699 | 7,391 | +30% | 0 | 0 | — |
case-03 | fail→pass | 52,211 | 72,573 | +39% | 1 | 1 | 0% | 6,882 | 8,710 | +27% | 0 | 0 | — |
case-04 | fail→pass | 24,915 | 18,304 | -27% | 1 | 1 | 0% | 3,481 | 4,909 | +41% | 0 | 0 | — |
case-05 | pass→pass | 24,017 | 42,383 | +76% | 1 | 1 | 0% | 2,988 | 6,488 | +117% | 0 | 0 | — |
case-06 | pass→pass | 26,614 | 28,289 | +6% | 1 | 1 | 0% | 4,681 | 5,977 | +28% | 0 | 0 | — |
case-07 | pass→pass | 19,471 | 27,534 | +41% | 1 | 1 | 0% | 2,439 | 7,265 | +198% | 0 | 0 | — |
case-08 | pass→pass | 11,256 | 10,716 | -5% | 1 | 1 | 0% | 1,292 | 3,225 | +150% | 0 | 0 | — |
case-09 | pass→pass | 16,086 | 15,921 | -1% | 1 | 1 | 0% | 1,601 | 3,807 | +138% | 0 | 0 | — |
case-10 | pass→pass | 14,307 | 19,427 | +36% | 1 | 1 | 0% | 1,921 | 3,972 | +107% | 0 | 0 | — |
case-11 | fail→pass | 39,748 | 32,041 | -19% | 1 | 1 | 0% | 8,210 | 9,024 | +10% | 0 | 0 | — |
case-12 | pass→pass | 28,072 | 32,530 | +16% | 1 | 1 | 0% | 6,099 | 7,186 | +18% | 0 | 0 | — |
case-14 | pass→pass | 8,797 | 12,492 | +42% | 1 | 1 | 0% | 2,087 | 3,393 | +63% | 0 | 0 | — |
case-15 | pass→pass | 12,752 | 3,822 | -70% | 1 | 1 | 0% | 1,393 | 2,481 | +78% | 0 | 0 | — |
case-16 | pass→pass | 14,771 | 7,200 | -51% | 1 | 1 | 0% | 1,245 | 2,881 | +131% | 0 | 0 | — |
case-17 | pass→pass | 10,292 | 23,737 | +131% | 1 | 1 | 0% | 1,920 | 6,120 | +219% | 0 | 0 | — |
case-18 | pass→pass | 15,689 | 20,837 | +33% | 1 | 1 | 0% | 2,521 | 5,458 | +117% | 0 | 0 | — |
case-19 | fail→fail | 5,326 | 10,350 | +94% | 1 | 1 | 0% | 1,201 | 2,783 | +132% | 0 | 0 | — |
case-20 | fail→pass | 14,957 | 19,819 | +33% | 1 | 1 | 0% | 3,206 | 5,817 | +81% | 0 | 0 | — |
case-21 | fail→pass | 11,426 | 4,659 | -59% | 1 | 1 | 0% | 727 | 2,407 | +231% | 0 | 0 | — |
case-22 | pass→pass | 9,074 | 4,038 | -55% | 1 | 1 | 0% | 1,341 | 2,649 | +98% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.