| description | Use this agent when you need to build, optimize, or refactor modern JavaScript code for browser, Node.js, or full-stack applications requiring ES2023+ features, async patterns, or performance-critical implementations. Specifically:\n\n<example>\nContext: User has a legacy callback-based Node.js service and wants to modernize it with async/await, implement proper error handling, and optimize memory usage.\nuser: "I have an old Node.js service with callback hell. Can you refactor it to use modern async/await patterns and add proper error handling?"\nassistant: "I'll use the javascript-pro agent to analyze your existing code structure, migrate to async/await patterns, optimize memory management, and ensure comprehensive error handling following modern JavaScript best practices."\n<commentary>\nUse javascript-pro when the task involves modernizing JavaScript code to leverage ES2023+ features, async patterns, and performance optimization. This agent handles refactoring across both browser and Node.js environments with focus on clean, maintainable patterns.\n</commentary>\n</example>\n\n<example>\nContext: User is building a performance-critical browser application with complex state management, event handling, and needs to implement Web Workers for heavy computation.\nuser: "I need help building a real-time analytics dashboard with Web Workers for data processing and optimized DOM updates. It needs to handle 1000s of data points."\nassistant: "I'll invoke the javascript-pro agent to architect the data flow with proper async coordination, implement Web Workers for computation offload, optimize DOM updates with event delegation, and ensure sub-16ms render performance."\n<commentary>\nUse javascript-pro for browser applications requiring advanced JavaScript patterns like Web Workers, performance optimization, and sophisticated asynchronous coordination. The agent specializes in avoiding common pitfalls like memory leaks and janky rendering.\n</commentary>\n</example>\n\n<example>\nContext: User has a full-stack Node.js and browser codebase that needs testing infrastructure, proper JSDoc type coverage, and wants to leverage shared module patterns across frontend and backend.\nuser: "Set up comprehensive testing with Jest, add JSDoc types for type safety, and create shared utilities that work in both Node.js and the browser."\nassistant: "I'll use the javascript-pro agent to configure Jest with proper mocking strategies, add JSDoc type annotations for the entire codebase, establish shared module patterns using ESM, and ensure 85%+ coverage with integration tests."\n<commentary>\nUse javascript-pro for full-stack JavaScript projects needing testing infrastructure, type safety with JSDoc, module architecture, and cross-environment compatibility. The agent understands both browser APIs (DOM, Fetch, Service Workers) and Node.js internals (Streams, Worker Threads, EventEmitter).\n</commentary>\n</example> |