modern-javascript-patterns

modern-javascript-patterns is a skill for Claude Code from EngineerWithAI/engineerwith-agents. It costs 64 tokens per session (5,370 once invoked), scanned A, a copy of modern-javascript-patterns, MIT.

A guide to modern JavaScript features and programming patterns, including asynchronous code, modules, iteration, and functional techniques.

In plain words
What is it for?
Use it to refactor legacy JavaScript, migrate callbacks to promises or async/await, build web applications, and create data-processing pipelines.
Why use it?
It helps replace older or harder-to-maintain code with clearer approaches and makes asynchronous operations and data transformations easier to manage.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the javascript-typescript plugin — 4 skills shipped together

Good fit Use it to refactor legacy JavaScript, migrate callbacks to promises or async/await…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/engineerwithai/engineerwith-agents/modern-javascript-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add EngineerWithAI/engineerwith-agents --skill modern-javascript-patterns
Clone the repo
git clone --depth 1 https://github.com/EngineerWithAI/engineerwith-agents

Made for: Claude Code.

Or install javascript-typescript, the plugin that ships this one along with the rest of its 4 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for modern-javascript-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/modern-javascript-patterns.svg)](https://agentmods.dev/skills/engineerwithai/engineerwith-agents/modern-javascript-patterns)
Your own site
<a href="https://agentmods.dev/skills/engineerwithai/engineerwith-agents/modern-javascript-patterns"><img src="https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/modern-javascript-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,370 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.05370
Opus 5 $0.00032 $0.02685
Sonnet 5 $0.00013 $0.01074
Haiku 4.5 $0.00006 $0.00537

Measured 3d ago against content hash 98c861b36cc3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

modern-javascript-patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

return await fetch(url);
Origin

This is a copy

100% identical to modern-javascript-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/javascript-typescript/skills/modern-javascript-patterns/SKILL.md · 912 lines

How it starts

The opening of the file, as written. The whole thing — 912 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Modern JavaScript Patterns

Comprehensive guide for mastering modern JavaScript (ES6+) features, functional programming patterns, and best practices for writing clean, maintainable, and performant code.

When to Use This Skill

  • Refactoring legacy JavaScript to modern syntax
  • Implementing functional programming patterns
  • Optimizing JavaScript performance
  • Writing maintainable and readable code
  • Working with asynchronous operations
  • Building modern web applications
  • Migrating from callbacks to Promises/async-await
  • Implementing data transformation pipelines

ES6+ Core Features

1. Arrow Functions

Syntax and Use Cases:

// Traditional function
function add(a, b) {
  return a + b;
}

// Arrow function
const add = (a, b) => a + b;

// Single parameter (parentheses optional)
const double = x => x * 2;

// No parameters
const getRandom = () => Math.random();

// Multiple statements (need curly braces)
const processUser = user => {
  const normalized = user.name.toLowerCase();
  return { ...user, name: normalized };
};

// Returning objects (wrap in parentheses)
const createUser = (name, age) => ({ name, age });

Lexical 'this' Binding:

class Counter {
  constructor() {
    this.count = 0;
  }

  // Arrow function preserves 'this' context
  increment = () => {
    this.count++;
  };

  // Traditional function loses 'this' in callbacks
  incrementTraditional() {
    setTimeout(function() {
      this.count++;  // 'this' is undefined
    }, 1000);
  }

  // Arrow function maintains 'this'
  incrementArrow() {
    setTimeout(() => {
      this.count++;  // 'this' refers to Counter instance
    }, 1000);
  }
}

2. Destructuring

Object Destructuring:

const user = {
  id: 1,
  name: 'John Doe',
  email: '[email protected]',
  address: {
    city: 'New York',
    country: 'USA'
  }
};

// Basic destructuring
const { name, email } = user;

// Rename variables
const { name: userName, email: userEmail } = user;

// Default values
const { age = 25 } = user;

// Nested destructuring
const { address: { city, country } } = user;

// Rest operator
const { id, ...userWithoutId } = user;

// Function parameters
function greet({ name, age = 18 }) {
  console.log(`Hello ${name}, you are ${age}`);
}
greet(user);

Read the full file on GitHub · 912 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 912 lines · 64 tokens per session scan A 98c861b36cc3

Subscribe to this mod's changes

modern-javascript-patterns is a skill published in the GitHub repository EngineerWithAI/engineerwith-agents (4 stars, last pushed 7mo ago), licensed MIT. It adds 64 tokens to every session and 5,370 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to modern-javascript-patterns, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

compiler-port

Port a compiler pass from TypeScript to Rust. Gathers context, plans the port, implements in a subagent with test-fix loop, then reviews.

react/react · 35 tokens

prowler-ui

Prowler UI-specific patterns. For generic patterns, see: typescript, react-19, nextjs-16, tailwind-4. Trigger: When working inside ui/ on Prowler-specific conventions (shadcn, folder placement, actions/adapters, shared types/hooks/lib).

prowler-cloud/prowler · 64 tokens

convert-blazor-server-to-webapp

Guides conversion of a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. USE FOR: migrating apps that use AddServerSideBlazor and MapBlazorHub to the AddRazorComponents/MapRazorComponents model, converting Host.cshtml to an App.razor root component, replacing blazor.server.js with blazor.web.js, migrating…

dotnet/skills · 176 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens

winforms

Build, maintain, or modernize Windows Forms applications with practical guidance on designer-driven UI, event handling, data binding, MVP separation, and migration to modern .NET. USE FOR: working on Windows Forms UI, event-driven workflows, or classic LOB applications; migrating WinForms from .NET Framework to modern…

managedcode/dotnet-skills · 122 tokens

coding-standards

A set of general coding standards and practical patterns for TypeScript, JavaScript, React, and Node.js. It covers readable naming, simple designs, avoiding repetition, and delaying unnecessary features.

loulanyue/awesome-claude-notes · 41 tokens