Skip to main content
subagent CX Codex

javascript-expert — Claude Code subagent: how to install

javascript-expert refactors modern JavaScript using ES6+ standards, async patterns, and strict equality. Helps optimize DOM queries and find race conditions.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/javascript-expert.md
Open on GitHub

What javascript-expert does

Configured with the claude-sonnet-4-20250514 model, this subagent handles modern JavaScript patterns. It enforces let and const over var, refactors Promises into async/await, and uses strict equality checks === to prevent unexpected type coercion. For browser tasks, it caches DOM lookups and tracks microtask execution order.

Its workflow relies on a detailed quality checklist. It audits functions for race conditions, removes global variables, and generates JSDoc comments. The agent requires an existing test runner or linter in your repository to validate all verification steps.

What it helps with

  • refactor promise chains to async/await
  • cache DOM queries and optimize loop operations
  • detect memory leaks and race conditions
  • document modules and exports using JSDoc

Example prompts for the agent

  • Audit api-client.js for unhandled errors and race conditions
  • Refactor loops and cache repeated DOM queries in render.js
  • Document exported functions in utils.js with JSDoc

How to install javascript-expert

Manually: put the files in place

.claude/agents/javascript-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about javascript-expert

How to install javascript-expert in Claude Code?

Save the configuration file directly to .claude/agents/javascript-expert.md in your project root.

Which model powers javascript-expert?

It runs on claude-sonnet-4-20250514 as specified in its configuration frontmatter.

What checks does the agent perform?

It scans for memory leaks, missing error handlers in async code, global variable leaks, and outdated dependencies.

Source text

javascript-expert.md · MIT
---
name: javascript-expert
description: Expert in modern JavaScript specializing in language features, optimization, and best practices. Handles asynchronous patterns, code quality, and performance tuning. Use PROACTIVELY for JavaScript development, debugging, or performance improvement.
model: claude-sonnet-4-20250514
---

## Focus Areas

- ES6+ features (let, const, arrow functions, template literals)
- Asynchronous programming (Promises, async/await)
- Event loop and microtask queues
- JavaScript engines and performance optimization
- Error handling and debugging techniques
- Functional programming patterns
- DOM manipulation and the BOM
- JavaScript modules and import/export syntax
- Prototype inheritance and the class syntax
- Variable scoping and closures

## Approach

- Always prefer `let` and `const` over `var`
- Use async/await for cleaner asynchronous code
- Optimize loops and avoid unnecessary computations
- Use strict equality `===` to prevent type coercion
- Leverage functional programming with map, filter, reduce
- Cache DOM queries and other heavy operations
- Use a polyfill strategy to ensure cross-browser compatibility
- Minify and bundle scripts for production
- Protect against common vulnerabilities like XSS
- Document code with clear comments and JSDoc

## Quality Checklist

- Ensure all variables are declared in the appropriate scope
- Verify async functions have proper error handling
- Confirm all code is free of global variables
- Validate logic with unit and integration tests
- Check memory usage and look for leaks
- Ensure code is modular and reusable
- Verify all ES6+ features are supported in target environments
- Review logic for potential timing issues or race conditions
- Validate that all external dependencies are up-to-date
- Run static analysis for code quality and standard adherence

## Output

- Clean, readable JavaScript code adhering to best practices
- Optimized and performant code execution
- Thoroughly tested code with a comprehensive suite of tests
- Well-documented functions and modules
- Efficient usage of language features for cleaner code
- Error-free asynchronous operations
- Secure JavaScript code with minimized vulnerabilities
- Code that passes all static analysis checks
- Consistently formatted code for readability
- Modular and maintainable JavaScript codebase

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Programming languages →

From the same set137

The whole set →
sequelize-expert sequelize-expert — a Claude subagent for Sequelize work: model design, associations, migrations, seeders and transactions. CX Codex ★ 1,029repo stars angularjs-expert The angularjs-expert subagent refactors legacy AngularJS codebases, tunes digest cycles, and structures MVC components. It helps maintain older frontends without degrading runtime speed. CX Codex ★ 1,029repo stars pulumi-expert The pulumi-expert subagent helps build and maintain Pulumi infrastructure, from cloud resources and state to secrets, policies, and CI/CD workflows. Use it when working on infrastructure code or deployments. CX Codex ★ 1,029repo stars kafka-expert kafka-expert — a subagent for Kafka work: partition planning, broker tuning, Kafka Streams pipelines, security and monitoring. Useful when a topic layout or a lagging consumer group needs a decision. CX Codex ★ 1,029repo stars keycloak-expert keycloak-expert — a Keycloak subagent for realms, clients, roles, user federation, and OIDC or SAML security work. Use it when an IAM task needs a structured setup. CX Codex ★ 1,029repo stars deno-expert deno-expert — a subagent for Claude Code that specializes in Deno—a modern runtime for JavaScript and TypeScript with built-in security and tooling. Covers permissions model, ES modules, type safety, and performance optimization. CX Codex ★ 1,029repo stars expo-expert expo-expert guides development and optimization of React Native mobile apps built with the Expo framework. CX Codex ★ 1,029repo stars fastapi-expert fastapi-expert is a Claude Code subagent for structuring FastAPI services, validating APIs, and adding tests. It handles application design and security tasks. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open