OnPush Change Detection
Installation
SKILL.md
OnPush Change Detection
Purpose
Use this skill to improve Angular rendering performance by applying ChangeDetectionStrategy.OnPush safely and intentionally. The goal is to reduce unnecessary checks without hiding state mutation bugs or breaking view updates.
This skill is complementary to change-detection-optimization; keep it focused on explicit OnPush adoption and mutation safety.
When to Use
Use this skill when:
- A component renders frequently without visible data changes.
- The component receives most data through inputs, observables, or signals.
- A performance task mentions change detection, slow rendering, or heavy templates.
- A component can be updated through immutable state changes.
- The current code already has tests or clear rendering behavior to verify.
- The project can prove the state flow before introducing OnPush.