Skip to content

Angular performance guidance covering NgOptimizedImage, @defer lazy loading, lazy routes, and SSR hydration.

CCM score
61 of 100
skills.sh installs
359
GitHub stars
681
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers image optimization with NgOptimizedImage, deferred component loading with @defer, lazy routes, and SSR with hydration
  • Includes ngSrc usage with priority, fill, and placeholder modes, plus @defer triggers: viewport, interaction, idle, timer, and condition
  • Enforces setting width and height (or fill) on every image and forbids forcing reflows in ngOnInit or ngAfterViewInit
  • Designed for Angular teams deciding between SSR, CSR, and prerendering based on SEO needs and app type

Install

$ npx -y skills add gentleman-programming/gentleman-skills --skill angular-performance -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

NgOptimizedImage (REQUIRED for images)

import { NgOptimizedImage } from '@angular/common';

@Component({
  imports: [NgOptimizedImage],
  template: `
    <!-- LCP image: add priority -->
    <img ngSrc="hero.jpg" width="800" height="400" priority>
    
    <!-- Regular: lazy loaded by default -->
    <img ngSrc="thumb.jpg" width="200" height="200">
    
    <!-- Fill mode (parent needs position: relative) -->
    <img ngSrc="bg.jpg" fill>
    
    <!-- With placeholder -->
    <img ngSrc="photo.jpg" width="400" height="300" placeholder>
  `
})

Rules

  • ALWAYS set width and height (or fill)
  • Add priority to LCP (Largest Contentful Paint) image
  • Use ngSrc not src
  • Parent of fill image must have position: relative/fixed/absolute

@defer - Lazy Components

@defer (on viewport) {
  <heavy-component />
} @placeholder {
  <p>Placeholder shown immediately</p>
} @loading (minimum 200ms) {
  <spinner />
} @error {
  <p>Failed to load</p>
}

Triggers

Details

Repository
github.com/gentleman-programming/gentleman-skills
Category
Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the angular-performance skill do?

The angular-performance skill guides an agent through optimizing Angular apps. It covers NgOptimizedImage for images, @defer blocks and lazy routes for loading, and SSR with hydration.

How do I install the angular-performance skill?

Run npx -y skills add gentleman-programming/gentleman-skills --skill angular-performance -y in a project. Once installed, angular-performance lets the agent apply image, lazy loading and SSR practices to that project.

Which other skills sit in the same category as angular-performance?

angular-performance is in the Frontend & UI Code category, next to vercel-react-best-practices, web-design-guidelines and design-taste-frontend. Unlike those React and design skills, angular-performance focuses only on Angular runtime performance.

When should I use the angular-performance skill?

Use angular-performance when you are optimizing an Angular app's performance, images or lazy loading. Its trigger covers exactly those tasks, so the agent reads it on demand for them.

More from gentleman-programming/gentleman-skills

All 13

Similar to Angular Performance

More Frontend & UI Code