javascript-patterns
Skill2 starsChanged 7 days agoMITView on GitHub
JavaScript language patterns for modern syntax, async handling, ESM/CJS module systems, error handling, and review checklist, with or without TypeScript on top. Use whenever the project contains `.js`/`.mjs`/`.cjs`/`.jsx` files or a `package.json`, OR the user asks about JavaScript, its async model, its module system, or its package tooling, even if "JavaScript" is not mentioned by name.
In this repository37 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- auditSkill
- backup-patternsSkill
- bash-patternsSkill
- depsSkill
- django-patternsSkill
- docker-patternsSkill
- drf-patternsSkill
- engineering-fundamentalsSkill
- fastapi-patternsSkill
- git-patternsSkill
- go-patternsSkill
- graphql-patternsSkill
- investigateSkill
- logging-patternsSkill
- referenceSkill
- metaSkill
- monitoring-patternsSkill
- next-app-router-patternsSkill
- nuxt-patternsSkill
- opentofu-patternsSkill
- prSkill
- python-patternsSkill
- react-patternsSkill
- report-formatSkill
- security-patternsSkill
- slop-patternsSkill
- storybook-patternsSkill
- tailwind-patternsSkill
- test-patternsSkill
- typescript-patternsSkill
- unslopSkill
- vps-provisioningSkill
- vue-patternsSkill
- wcag-auditSkill
- writeSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Default assumption: a project running on the current Node.js Active LTS (Node 24, "Krypton") or a modern browser baseline.
- Distinctive: line 10
If the project also uses TypeScript, the type-aware skill applies on top of these language patterns.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
JavaScript patterns
Default assumption: a project running on the current Node.js Active LTS (Node 24, "Krypton") or a modern browser baseline.
- If the project also uses TypeScript, the type-aware skill applies on top of these language patterns.
- Adapt advice to the Node version in the project's
.nvmrc,.tool-versions, orenginesfield inpackage.json.
Reference files
| File | Covers |
| reference/modules.md | ESM and CJS, package.json "type", dynamic import(), dual-package hazard |
| reference/syntax.md | Modern syntax: optional chaining, nullish coalescing, logical assignment, at() |
| reference/async.md | async/await, Promise.*, for await...of, top-level await |
| reference/errors.md | Error subclasses, Error.cause, unhandled rejection, using (advisory) |
| reference/equality-and-numbers.md | ===, Number.isNaN, Array.isArray, IEEE 754, BigInt |
| reference/collections.md | Map, Set, WeakMap, WeakSet and when to reach for each |
| reference/jsdoc.md | // @ts-check plus JSDoc tags for editor-checked types in .js files |
| reference/anti-patterns.md | Twelve review-time anti-patterns with severity calls |
References
- MDN JavaScript reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
- Node.js packages: https://nodejs.org/api/packages.html
- Node.js ESM: https://nodejs.org/api/esm.html
- Node.js process: https://nodejs.org/api/process.html
- Node.js previous releases (LTS schedule): https://nodejs.org/en/about/previous-releases
- TC39 proposals: https://github.com/tc39/proposals
- 2ality (Axel Rauschmayer): https://2ality.com/
- You Don't Know JS, 2nd ed. (Kyle Simpson): https://github.com/getify/You-Dont-Know-JS
Version notes
Checked: 2026-09-26 against https://nodejs.org/en/about/previous-releases and https://github.com/tc39/proposals
- Node 26 is Current (2026-05); Node 24 "Krypton" is Active LTS (2025-05). Default assumption above stays on the LTS.
- Explicit resource management (
using/await using) reached Stage 4 in 2026;reference/errors.mdupdated, oldtry/finallyadvice kept as Legacy. @satisfiesJSDoc tag: TS 4.9+, unchanged.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

