{"slug":"javascript-pro","title":"javascript-pro","summary":"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 w","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-27T18:21:39.897644Z","repo":{"url":"https://github.com/Jeffallan/claude-skills","stars":12412,"forks":1191,"license":"MIT","updatedAt":"2026-11-16T17:30:27Z"},"bodyHtml":"<hr>\n<h2>name: javascript-pro\ndescription: 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.\nlicense: MIT\nmetadata:\nauthor: <a href=\"https://github.com/Jeffallan\">https://github.com/Jeffallan</a>\ncompany: <a href=\"https://synergetic.solutions\">https://synergetic.solutions</a>\nversion: \"1.1.0\"\ndomain: language\ntriggers: JavaScript, ES2023, async await, Node.js, vanilla JavaScript, Web Workers, Fetch API, browser API, module system\nrole: specialist\nscope: implementation\noutput-format: code\nrelated-skills: fullstack-guardian</h2>\n<h1>JavaScript Pro</h1>\n<h2>When to Use This Skill</h2>\n<ul>\n<li>Building vanilla JavaScript applications</li>\n<li>Implementing async/await patterns and Promise handling</li>\n<li>Working with modern module systems (ESM/CJS)</li>\n<li>Optimizing browser performance and memory usage</li>\n<li>Developing Node.js backend services</li>\n<li>Implementing Web Workers, Service Workers, or browser APIs</li>\n</ul>\n<h2>Core Workflow</h2>\n<ol>\n<li><strong>Analyze requirements</strong> — Review <code>package.json</code>, module system, Node version, browser targets; confirm <code>.js</code>/<code>.mjs</code>/<code>.cjs</code> conventions</li>\n<li><strong>Design architecture</strong> — Plan modules, async flows, and error handling strategies</li>\n<li><strong>Implement</strong> — Write ES2023+ code with proper patterns and optimisations</li>\n<li><strong>Validate</strong> — Run linter (<code>eslint --fix</code>); if linter fails, fix all reported issues and re-run before proceeding. Check for memory leaks with DevTools or <code>--inspect</code>, verify bundle size; if leaks are found, resolve them before continuing</li>\n<li><strong>Test</strong> — Write comprehensive tests with Jest achieving 85%+ coverage; if coverage falls short, add missing cases and re-run. Confirm no unhandled Promise rejections</li>\n</ol>\n<h2>Reference Guide</h2>\n<p>Load detailed guidance based on context:</p>\n<table>\n<thead>\n<tr>\n<th>Topic</th>\n<th>Reference</th>\n<th>Load When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Modern Syntax</td>\n<td><code>references/modern-syntax.md</code></td>\n<td>ES2023+ features, optional chaining, private fields</td>\n</tr>\n<tr>\n<td>Async Patterns</td>\n<td><code>references/async-patterns.md</code></td>\n<td>Promises, async/await, error handling, event loop</td>\n</tr>\n<tr>\n<td>Modules</td>\n<td><code>references/modules.md</code></td>\n<td>ESM vs CJS, dynamic imports, package.json exports</td>\n</tr>\n<tr>\n<td>Browser APIs</td>\n<td><code>references/browser-apis.md</code></td>\n<td>Fetch, Web Workers, Storage, IntersectionObserver</td>\n</tr>\n<tr>\n<td>Node Essentials</td>\n<td><code>references/node-essentials.md</code></td>\n<td>fs/promises, streams, EventEmitter, worker threads</td>\n</tr>\n</tbody>\n</table>\n<h2>Constraints</h2>\n<h3>MUST DO</h3>\n<ul>\n<li>Use ES2023+ features exclusively</li>\n<li>Use <code>X | null</code> or <code>X | undefined</code> patterns</li>\n<li>Use optional chaining (<code>?.</code>) and nullish coalescing (<code>??</code>)</li>\n<li>Use async/await for all asynchronous operations</li>\n<li>Use ESM (<code>import</code>/<code>export</code>) for new projects</li>\n<li>Implement proper error handling with try/catch</li>\n<li>Add JSDoc comments for complex functions</li>\n<li>Follow functional programming principles</li>\n</ul>\n<h3>MUST NOT DO</h3>\n<ul>\n<li>Use <code>var</code> (always use <code>const</code> or <code>let</code>)</li>\n<li>Use callback-based patterns (prefer Promises)</li>\n<li>Mix CommonJS and ESM in the same module</li>\n<li>Ignore memory leaks or performance issues</li>\n<li>Skip error handling in async functions</li>\n<li>Use synchronous I/O in Node.js</li>\n<li>Mutate function parameters</li>\n<li>Create blocking operations in the browser</li>\n</ul>\n<h2>Key Patterns with Examples</h2>\n<h3>Async/Await Error Handling</h3>\n<pre><code>// ✅ Correct — always handle async errors explicitly\nasync function fetchUser(id) {\n  try {\n    const response = await fetch(`/api/users/${id}`);\n    if (!response.ok) throw new Error(`HTTP ${response.status}`);\n    return await response.json();\n  } catch (err) {\n    console.error(\"fetchUser failed:\", err);\n    return null;\n  }\n}\n\n// ❌ Incorrect — unhandled rejection, no null guard\nasync function fetchUser(id) {\n  const response = await fetch(`/api/users/${id}`);\n  return response.json();\n}\n</code></pre>\n<h3>Optional Chaining &amp; Nullish Coalescing</h3>\n<pre><code>// ✅ Correct\nconst city = user?.address?.city ?? \"Unknown\";\n\n// ❌ Incorrect — throws if address is undefined\nconst city = user.address.city || \"Unknown\";\n</code></pre>\n<h3>ESM Module Structure</h3>\n<pre><code>// ✅ Correct — named exports, no default-only exports for libraries\n// utils/math.mjs\nexport const add = (a, b) =&gt; a + b;\nexport const multiply = (a, b) =&gt; a * b;\n\n// consumer.mjs\nimport { add } from \"./utils/math.mjs\";\n\n// ❌ Incorrect — mixing require() with ESM\nconst { add } = require(\"./utils/math.mjs\");\n</code></pre>\n<h3>Avoid var / Prefer const</h3>\n<pre><code>// ✅ Correct\nconst MAX_RETRIES = 3;\nlet attempts = 0;\n\n// ❌ Incorrect\nvar MAX_RETRIES = 3;\nvar attempts = 0;\n</code></pre>\n<h2>Output Templates</h2>\n<p>When implementing JavaScript features, provide:</p>\n<ol>\n<li>Module file with clean exports</li>\n<li>Test file with comprehensive coverage</li>\n<li>JSDoc documentation for public APIs</li>\n<li>Brief explanation of patterns used</li>\n</ol>\n<p>Maintained by <a href=\"https://github.com/jeffallan\">@jeffallan</a>, Principal Consultant at <a href=\"https://synergetic.solutions\">Synergetic Solutions</a></p>\n<p><a href=\"https://jeffallan.github.io/claude-skills/skills/language/javascript-pro/\">Documentation</a></p>\n","files":[{"path":"references/async-patterns.md","sizeBytes":8012,"isText":true},{"path":"references/browser-apis.md","sizeBytes":9507,"isText":true},{"path":"references/modern-syntax.md","sizeBytes":6078,"isText":true},{"path":"references/modules.md","sizeBytes":7679,"isText":true},{"path":"references/node-essentials.md","sizeBytes":11230,"isText":true},{"path":"SKILL.md","sizeBytes":4998,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"human-reviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"human-reviewed","screen":{"ran":true,"outcome":"flagged-cleared-by-moderator","suspicious":1,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-27T18:22:21.823087Z","sha256":"A101944A7B7E1835BA11A54E508684FE3A2FDA980CD699A2DD475207081F7EE7","sizeBytes":17897},"review":null,"source":{"repositoryUrl":"https://github.com/Jeffallan/claude-skills","path":"skills/javascript-pro","license":"MIT","commit":"67c1961b180dc92cf08983344627109e983e8f51","subtreeSha":"F25950DA49A4122500A69FA181CDB9C96956FA7FB9C025534E9D1816FE78A685","lastSyncedAt":"2026-11-17T00:40:15.350492Z"},"reviewedAt":"2026-10-27T18:24:36.837874Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/Jeffallan/claude-skills/tree/main/skills/javascript-pro"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install jeffallan-claude-skills@llmmart"},{"target":"git","command":"git clone https://github.com/Jeffallan/claude-skills.git"}]}