Skip to content
Skillpedia
Websites & UI (frontend)12k Β· #11431

javascript-pro

What it does

It guides the AI agent to write clean, modern JavaScript for browsers and Node.js. It is for developers who work with vanilla JavaScript or need to improve existing JS code.

When to use it

  • βœ“When you are building a vanilla JavaScript app or a Node.js service.
  • βœ“When you need Promise-based async code cleaned up or fixed.
  • βœ“When you want a JavaScript file reviewed for correctness and best practices.

Skill link

https://github.com/Jeffallan/claude-skills/blob/main/skills/javascript-pro/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/Jeffallan/claude-skills/blob/main/skills/javascript-pro/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œRefactor this JavaScript file to use async and await, then check it with the linter.”

5 new skills a week. 1 minute to read.

How it works

The agent reviews the project setup, designs the modules and async flows, and writes modern code. It runs ESLint and checks for memory leaks and unhandled promise rejections before finishing.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

JavaScript 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

  1. Analyze requirements β€” Review package.json, module system, Node version, browser targets; confirm .js/.mjs/.cjs conventions
  2. Design architecture β€” Plan modules, async flows, and error handling strategies
  3. Implement β€” Write ES2023+ code with proper patterns and optimisations
  4. 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
  5. 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 | null or X | undefined patterns
  • 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 use const or let)
  • 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:

  1. Module file with clean exports
  2. Test file with comprehensive coverage
  3. JSDoc documentation for public APIs
  4. Brief explanation of patterns used

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

FAQ

Does it use TypeScript?

No. The skill focuses on modern JavaScript in .js, .mjs, and .cjs files.

How does it test the code?

It writes Jest tests and aims for 85 percent or more coverage.

Does it check for memory leaks?

Yes. It checks with DevTools or the Node inspector and fixes any leaks it finds.

Details

Original description by the author

Writes, debugs, and refactors JavaScript code using modern ES2023+ features, async/await patterns, ESM module systems, and Node.js APIs. Use when building vanilla JavaScript applications, implementing Promise-based async flows, optimising browser or Node.js performance, working with Web Workers or Fetch API, or reviewing .js/.mjs/.cjs files for correctness and best practices.

repo: Jeffallan/claude-skills

Popularity

GitHub stars
12k
Ranking position
#11431
License
MIT
Updated
10/30/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills