
JavaScript Pro
FreeWrite and debug modern JavaScript with best practices.
Free · Opens the source repo
What JavaScript Pro does
JavaScript Pro is a skill designed for developers who want to enhance their JavaScript coding practices using modern features and patterns. This skill focuses on writing, debugging, and refactoring JavaScript code compliant with ES2023+ standards. It is particularly useful for those building vanilla JavaScript applications, implementing async/await patterns, and optimizing performance in both browser and Node.js environments. With a strong emphasis on best practices, this skill guides users through the entire development process, from analyzing requirements to validating code quality.
The core workflow of JavaScript Pro includes analyzing project requirements, designing architecture, implementing code, validating it with linters, and testing for coverage. Users will be encouraged to utilize advanced features such as optional chaining, nullish coalescing, and the modern ESM module system. The skill also provides reference guides covering essential topics like async patterns, browser APIs, and Node.js essentials, ensuring that developers have access to the information they need right when they need it.
JavaScript Pro is ideal for developers who are either new to modern JavaScript or those looking to refine their existing skills. By following the guidelines and patterns provided, users can avoid common pitfalls such as unhandled Promise rejections and improper error handling. The skill promotes a clean, maintainable coding style that adheres to functional programming principles, making it suitable for both front-end and back-end development tasks.
Whether you are developing a new application or maintaining existing code, JavaScript Pro will help you write efficient, high-quality JavaScript that leverages the latest language features and best practices. This skill is a valuable resource for anyone looking to elevate their JavaScript development skills and deliver robust applications.
When to use it
Use JavaScript Pro when building new JavaScript applications, especially when implementing async flows or optimizing performance.
When not to use it
This skill may not be suitable for legacy projects that rely heavily on older JavaScript patterns or for developers who prefer not to use modern ES2023+ features.
What you can build with it
Building a New Web App
Use JavaScript Pro to implement modern JavaScript features while ensuring best practices in a new web application.
Optimizing Node.js Services
Leverage this skill to improve performance and memory usage in your Node.js backend services.
Reviewing Existing Code
Utilize JavaScript Pro to analyze and refactor existing JavaScript code for compliance with modern standards.
How to install JavaScript Pro
View source1. Install with the skills CLI
npx skills add jeffallan/claude-skills/javascript-pro --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by jeffallanJavaScript Pro
When to Use This Skill
- Building vanilla JavaScript applications
- Implementing async/await patterns and Promise handling
- Working with modern module systems (ESM/CJS)
- Optimizing browser performance and memory usage
- Developing Node.js backend services
- Implementing Web Workers, Service Workers, or browser APIs
Core Workflow
- Analyze requirements — Review
package.json, module system, Node version, browser targets; confirm.js/.mjs/.cjsconventions - Design architecture — Plan modules, async flows, and error handling strategies
- Implement — Write ES2023+ code with proper patterns and optimisations
- Validate — Run linter (
eslint --fix); if linter fails, fix all reported issues and re-run before proceeding. Check for memory leaks with DevTools or--inspect, verify bundle size; if leaks are found, resolve them before continuing - Test — Write comprehensive tests with Jest achieving 85%+ coverage; if coverage falls short, add missing cases and re-run. Confirm no unhandled Promise rejections
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Modern Syntax | references/modern-syntax.md | ES2023+ features, optional chaining, private fields |
| Async Patterns | references/async-patterns.md | Promises, async/await, error handling, event loop |
| Modules | references/modules.md | ESM vs CJS, dynamic imports, package.json exports |
| Browser APIs | references/browser-apis.md | Fetch, Web Workers, Storage, IntersectionObserver |
| Node Essentials | references/node-essentials.md | fs/promises, streams, EventEmitter, worker threads |
Constraints
MUST DO
- Use ES2023+ features exclusively
- Use
X | nullorX | undefinedpatterns - Use optional chaining (
?.) and nullish coalescing (??) - Use async/await for all asynchronous operations
- Use ESM (
import/export) for new projects - Implement proper error handling with try/catch
- Add JSDoc comments for complex functions
- Follow functional programming principles
MUST NOT DO
- Use
var(always useconstorlet) - Use callback-based patterns (prefer Promises)
- Mix CommonJS and ESM in the same module
- Ignore memory leaks or performance issues
- Skip error handling in async functions
- Use synchronous I/O in Node.js
- Mutate function parameters
- Create blocking operations in the browser
Key Patterns with Examples
Async/Await Error Handling
// ✅ Correct — always handle async errors explicitly
async function fetchUser(id) {
try {
const response = await fetch(`/api/users/${id}`);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (err) {
console.error("fetchUser failed:", err);
return null;
}
}
// ❌ Incorrect — unhandled rejection, no null guard
async function fetchUser(id) {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
Optional Chaining & Nullish Coalescing
// ✅ Correct
const city = user?.address?.city ?? "Unknown";
// ❌ Incorrect — throws if address is undefined
const city = user.address.city || "Unknown";
ESM Module Structure
// ✅ Correct — named exports, no default-only exports for libraries
// utils/math.mjs
export const add = (a, b) => a + b;
export const multiply = (a, b) => a * b;
// consumer.mjs
import { add } from "./utils/math.mjs";
// ❌ Incorrect — mixing require() with ESM
const { add } = require("./utils/math.mjs");
Avoid var / Prefer const
// ✅ Correct
const MAX_RETRIES = 3;
let attempts = 0;
// ❌ Incorrect
var MAX_RETRIES = 3;
var attempts = 0;
Output Templates
When implementing JavaScript features, provide:
- Module file with clean exports
- Test file with comprehensive coverage
- JSDoc documentation for public APIs
- Brief explanation of patterns used
Frequently asked questions about JavaScript Pro
Similar skills
Quality Playbook Generator
Run comprehensive quality audits on any codebase.
PR Draft Summary
Automate PR summary generation for openai-agents-python.
Final Release Review
Streamline your release candidate audits with ease.
Unit Test Vue Pinia
Efficiently write and review unit tests for Vue 3 applications.
Slang Shader Expert
Optimize and integrate Slang shaders with ease.
Telemetry Standards
Ensure consistent event tracking in Supabase Studio.
