Reviews Angular RxJS usage for memory leaks, duplicated HTTP requests, nested subscriptions, and operator choices. Provides version-specific guidance for takeUntilDestroyed and async pipe patterns.
Ships in ngautopilot-angular. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill to optimize Angular RxJS flows by removing nested subscriptions, preventing leaks, avoiding duplicated work, and selecting operators based on cancellation, ordering, and concurrency semantics.
Use the compatible variant:
async, takeUntil, Subject, and ngOnDestroy where manual subscriptions are necessary.takeUntilDestroyed only when project dependencies support it.takeUntilDestroyed for lifecycle-bound manual subscriptions.async when the observable value is used only in the template.When duplicated HTTP requests or cacheable API reads are the main issue, keep the fix localized:
shareReplay only with explicit lifecycle semantics and bounded cache rules.subscribe calls across components.Use this skill when:
subscribe appears inside another subscribe.Use switchMap for cancellable dependent requests:
readonly orders$ = this.userService.getUser().pipe(
switchMap((user) => this.orderService.getOrders(user.id)),
);
Use throttling or debouncing for high-frequency inputs:
readonly results$ = this.searchControl.valueChanges.pipe(
debounceTime(300),
distinctUntilChanged(),
switchMap((query) => this.searchService.search(query)),
);
Define when a search becomes obsolete before choosing the operator order. Here, switchMap sees only debounced, distinct terms: the old request remains active during the 300 ms wait. If new input must invalidate it immediately, move the cancellation boundary to the raw-input stream and delay the new request inside that boundary. Define whether clearing input also clears results immediately; do not change that behavior as an incidental optimization.
Keep recoverable request errors inside the inner request when later searches must continue. Test the fallback and a later success on the same subscription. Verify the 299/300 ms boundary, a second input resetting the wait, normalized arguments, duplicate suppression, stale response rejection, and request teardown. A call-count assertion alone does not prove a race is fixed.
Use lifecycle-safe cleanup for imperative subscriptions:
this.form.valueChanges
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((value) => this.formValue.set(value));
Use shareReplay only when sharing a source is intentional and lifecycle semantics are understood.
Prefer shareReplay({ bufferSize: 1, refCount: true }) or an equivalent project-safe variant when sharing a cold stream across subscribers.
Do not use shareReplay as an accidental permanent cache.
Avoid nested subscriptions:
this.userService.getUser().subscribe((user) => {
this.orderService.getOrders(user.id).subscribe((orders) => {
this.orders = orders;
});
});
Avoid unbounded manual subscriptions:
this.form.valueChanges.subscribe((value) => {
this.search(value);
});
Avoid using Subject as an improvised global state layer when a simpler observable, signal, or scoped state service would be clearer.
async where practical.debounceTime, throttleTime, or distinctUntilChanged when appropriate.switchMap, concatMap, mergeMap, and exhaustMap are selected by semantics.shareReplay.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ngautopilot-angular:angular--performance--rxjs-performancefrom ngautopilot-angular
npx claudepluginhub janpereira-dev/ngautopilot --plugin ngautopilot-angular350 skills in this plugin
/angular--ai--angular-v22-agent-skills-integrationAngular v22 Agent Skills IntegrationUse official Angular Agent Skills as reference material without copying them blindly or replacing NgAutoPilot routing. For Angular 22 projects and 21-to-22 upgrade planning.
/angular--ai--angular-v22-ai-tutor-safe-usageAngular v22 AI Tutor Safe UsageUse AI tutor workflows to teach Angular concepts without allowing unsafe code or secret exposure. For Angular 22 projects and 21-to-22 upgrade planning.
/angular--ai--angular-v22-angular-mcp-agent-workflowAngular v22 Angular MCP Agent WorkflowReview the workspace boundary, permissions, and runtime evidence of an Angular MCP integration. For Angular 22 projects and 21-to-22 upgrade planning.
Other plugins' skills for the same job