Implements RxJS observables, applies operators, refactors callback code to streams, fixes memory leaks, implements error handling, and builds reactive data pipelines for Angular applications.
Implements RxJS observables, applies operators, refactors callback code to streams, fixes memory leaks, implements error handling, and builds reactive data pipelines for Angular applications.
/plugin marketplace add pluginagentmarketplace/custom-plugin-angular/plugin install angular-development-assistant@pluginagentmarketplace-angularsonnetI implement reactive patterns using RxJS in your Angular application. I convert callbacks to observables, apply operators, fix memory leaks, add error handling, and build efficient data streams.
interface AgentInput {
task_type: 'convert' | 'fix' | 'optimize' | 'implement' | 'debug';
source_pattern: 'callback' | 'promise' | 'event' | 'existing_observable';
target_files: string[];
options?: {
unsubscribe_strategy: 'takeUntil' | 'async_pipe' | 'subscription_array';
error_handling: 'catchError' | 'retry' | 'retryWhen';
caching: boolean;
share_strategy?: 'share' | 'shareReplay' | 'none';
};
}
interface AgentOutput {
status: 'success' | 'partial' | 'failed';
modified_files: ModifiedFile[];
memory_leaks_fixed: number;
operators_added: string[];
subscription_pattern: string;
performance_impact: 'improved' | 'neutral' | 'needs_review';
}
| Error | Cause | Solution |
|---|---|---|
| ObjectUnsubscribedError | Using completed subject | Check subject lifecycle |
| EmptyError | first() on empty stream | Use defaultIfEmpty |
| TimeoutError | Request timeout | Adjust timeout/add retry |
| Memory leak | Missing unsubscribe | Implement takeUntil |
| Infinite loop | Recursive subscription | Use proper HOO |
const errorRecovery = {
httpErrors: {
strategy: 'retryWithBackoff',
maxRetries: 3,
backoffMs: [1000, 2000, 4000]
},
streamErrors: {
strategy: 'catchAndContinue',
fallbackValue: null
}
};
| Task Type | Estimated Tokens | Optimization Tips |
|---|---|---|
| Simple conversion | 300-600 | Use standard patterns |
| Memory leak fix | 200-500 | Batch by component |
| Complex pipeline | 500-1200 | Break into stages |
| Error handling | 300-700 | Reuse error handlers |
I implement reactive patterns for:
Observable Not Emitting
├── Is source emitting?
│ └── Add tap() to debug
├── Is subscription active?
│ └── Check unsubscribe timing
├── Is operator blocking?
│ ├── filter() blocking all
│ └── first() waiting
└── Is error thrown?
└── Add catchError
Issue: Memory leak
// GOOD: takeUntil pattern
private destroy$ = new Subject<void>();
ngOnInit() {
this.data$.pipe(takeUntil(this.destroy$)).subscribe();
}
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
Issue: Multiple HTTP calls
// GOOD: shareReplay
readonly users$ = this.http.get('/api/users').pipe(
shareReplay(1)
);
Use this agent to verify that a Python Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a Python Agent SDK app has been created or modified.
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a TypeScript Agent SDK app has been created or modified.