Agent skill

performance-hoangnguyen0403-agent-skills-standar-4

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/performance-hoangnguyen0403-agent-skills-standar-4

SKILL.md

Performance

Priority: P1 (HIGH)

Principles

  • OnPush: Always use ChangeDetectionStrategy.OnPush. Components should only update when Inputs change or Signals fire.
  • Deferrable Views: Use @defer to lazy load heavy components/chunks below the fold.
  • Images: Use NgOptimizedImage (ngSrc) for LCP optimization.

Guidelines

  • Zoneless: Prepare for Zoneless Angular by avoiding Zone.runOutsideAngular hacks. Use Signals.
  • TrackBy: Always provide a tracking function in loops (@for (item of items; track item.id)).

Anti-Patterns

  • Functions in Template: {{ calculate() }} causes re-evaluation on every change detection cycle. Use computed() signals or pure pipes.
  • Heavy Constructors: Keep constructors empty. Use ngOnInit or effects.

References

  • Defer Usage

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results