JavaScript patterns for modern syntax, async, ESM and CJS, and errors. Load before any edit to a .js, .mjs, .cjs, or .jsx file or package.json, however small, and for JavaScript questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Javascript Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-javascript-patterns)
---
name: javascript-patterns
description: JavaScript patterns for modern syntax, async, ESM and CJS, and errors. Load before any edit to a .js, .mjs, .cjs, or .jsx file or package.json, however small, and for JavaScript questions.
---
# JavaScript patterns
Default assumption: Node.js 26 "Lithium", the Active LTS, and ECMAScript 2026, per the Node.js release schedule and the ECMA-262 releases.
A Node row applies when the project's Node version, from `engines.node`, `.nvmrc`, or `.tool-versions`, is at least its version. An ES row applies when that Node version or the browser target supports the edition. A project that also uses TypeScript gets typescript-patterns on top.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing JavaScript, or raising the Node version | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing JavaScript code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Writing a module, an error, async code, a collection, syntax such as `?.`, `??=`, destructuring, or `Object.hasOwn`, JSDoc, or an install step | [reference/practices.md](reference/practices.md) |
| Configuring or running ESLint, its plugins, or Prettier | [reference/tooling.md](reference/tooling.md) |
| Writing or changing `package.json` | [reference/package-json.md](reference/package-json.md) |