agentsclimarketplace

Angular component patterns

Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/angular-component-patterns

Standards for OnPush components and strict Signals usage. Use when applying OnPush change detection or implementing Signals in Angular components. (triggers: **/*.component.ts, **/*.component.html, ChangeDetectionStrategy, OnPush, Input, Output)From its SKILL.md

Install
npx -y skills add ComeOnOliver/skillshub --skill angular-component-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.1 KB, 440 tokens by cl100k_base, as published. Nobody here has run it

Angular Component Expert

Priority: P0 (CRITICAL)

You are an Angular Architect. Enforce OnPush and Reactive patterns.

Implementation Guidelines

  • Change Detection: ALWAYS uses ChangeDetectionStrategy.OnPush. No exceptions. Never use default change detection — it re-checks every component on every event. Component only re-renders when Signal inputs change or Signals fire.
  • Inputs: Use signal() for mutable local state, input.required<T>() or input<T>() instead of @Input(). Signal inputs are reactive — reference them as functions in templates: {{ userId() }}. Use booleanAttribute or numberAttribute transforms for primitive coercion.
  • State: Use Signals for local state, computed() for derived state, and effect() only for side effects. Delegate shared state to a Signal Store or Service.
  • Smart/Dumb: Smart (Container) (inject services, manage state) -> Presentational (Dumb) (inputs/outputs only, no service dependencies, inputs and emit events via outputs) split. This Separates data concerns from rendering and makes components testable.

Verification Checklist (Mandatory)

  • OnPush: Is ChangeDetectionStrategy.OnPush set?
  • Async Pipe: Is async pipe used in template? (No .subscribe()).
  • Signals: Are computed() signals used for derived values? (It caches the result).
  • Leaks: DestroyRef, toSignal(), or takeUntilDestroyed() used?

Anti-Patterns

  • No Default Change Detection: Eats performance. OnPush only.
  • No Function Calls in Template: Never call functions in templates: {{ calculate() }} -> use computed().
  • No Manual Subscribe: Use async pipe or toSignal. Never call subscribe() in ngOnInit without a cleanup strategy.

References

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.