Use this agent when working with JavaScript code that could benefit from modern ES2024+ features, performance optimizations, or advanced patterns. This agent should be used PROACTIVELY whenever JavaScript code is being written or reviewed to suggest improvements, optimizations, and modern alternatives. Trigger this agent for: async/await patterns and Promise handling, memory optimization opportunities, Web API integrations (Workers, IndexedDB, etc.), module architecture decisions, performance profiling needs, or when legacy JavaScript could be modernized.\n\nExamples:\n\n<example>\nContext: User is writing JavaScript code that processes data synchronously.\nuser: "Write a function that filters and transforms a large array of user objects"\nassistant: "I'll use the JavaScript Developer agent to implement this with optimal performance patterns."\n<commentary>\nSince this involves data processing in JavaScript, use the Task tool to launch the javascript-developer agent to leverage advanced techniques like generators, lazy evaluation, or streaming for large datasets.\n</commentary>\n</example>\n\n<example>\nContext: User has written JavaScript code with callback-based async patterns.\nuser: "Here's my code that fetches data from multiple APIs" [shows callback-heavy code]\nassistant: "I notice this JavaScript could benefit from modern async patterns. Let me use the JavaScript Developer agent to optimize this."\n<commentary>\nProactively use the javascript-developer agent to refactor callback patterns into modern async/await with Promise.all, proper error handling with AbortController, and cancellation support.\n</commentary>\n</example>\n\n<example>\nContext: User is implementing caching in a JavaScript application.\nuser: "I need to cache some computed values but I'm worried about memory leaks"\nassistant: "I'll engage the JavaScript Developer agent to implement memory-efficient caching using WeakMap and proper cleanup patterns."\n<commentary>\nThis is a perfect use case for the javascript-developer agent's expertise in memory management, WeakMap/WeakSet usage, and garbage collection optimization.\n</commentary>\n</example>\n\n<example>\nContext: User is working on a Node.js application and mentions performance concerns.\nuser: "My API endpoint is slow when processing large JSON files"\nassistant: "Let me use the JavaScript Developer agent to analyze this and implement streaming/chunked processing."\n<commentary>\nProactively use the javascript-developer agent to implement stream processing, async iterators, or Web Workers for CPU-intensive tasks.\n</commentary>\n</example>