Modern Javascript Patterns skill for Claude

Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code.

When Claude uses it

Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.

Modern Javascript Patterns SKILL.md

The full skill file from wshobson/agents (MIT).

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

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Use const by default: Only use let when reassignment is needed
  2. Prefer arrow functions: Especially for callbacks
  3. Use template literals: Instead of string concatenation
  4. Destructure objects and arrays: For cleaner code
  5. Use async/await: Instead of Promise chains
  6. Avoid mutating data: Use spread operator and array methods
  7. Use optional chaining: Prevent "Cannot read property of undefined"
  8. Use nullish coalescing: For default values
  9. Prefer array methods: Over traditional loops
  10. Use modules: For better code organization
  11. Write pure functions: Easier to test and reason about
  12. Use meaningful variable names: Self-documenting code
  13. Keep functions small: Single responsibility principle
  14. Handle errors properly: Use try/catch with async/await
  15. Use strict mode: 'use strict' for better error catching

For common pitfalls (this binding, promise anti-patterns, memory leaks), see references/advanced-patterns.md.

How to install Modern Javascript Patterns

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns#main ~/.claude/skills/modern-javascript-patterns

Codex

npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns#main ~/.codex/skills/modern-javascript-patterns

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Modern Javascript Patterns skill do?

Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.

+How do I install Modern Javascript Patterns in Claude Code?

Copy the skill folder into ~/.claude/skills/modern-javascript-patterns, for example with "npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns#main ~/.claude/skills/modern-javascript-patterns". Claude Code loads it automatically and uses it when a task matches.

+Does Modern Javascript Patterns work with ChatGPT or Codex?

Yes. Modern Javascript Patterns uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/modern-javascript-patterns. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Modern Javascript Patterns free?

Modern Javascript Patterns is published on GitHub by wshobson under the MIT license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Nextjs App Router Patterns

    Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching.

    wshobson/agents★ 43k
  5. Nodejs Backend Patterns

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication,…

    wshobson/agents★ 43k
  6. Nx Workspace Patterns

    Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or…

    wshobson/agents★ 43k
  7. Openapi Spec Generation

    Generate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns.

    wshobson/agents★ 43k
  8. Parallel Debugging

    Debug complex issues using competing hypotheses with parallel investigation, evidence collection, and root cause arbitration.

    wshobson/agents★ 43k
  9. Preference Optimization

    Align a fine-tuned model with preference data using DPO, ORPO, KTO, or SimPO.

    wshobson/agents★ 43k

See all software development skills →

More skills from wshobson

  1. Monorepo Management

    Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient, scalable multi-package repositories with optimized…

    wshobson/agents★ 43k
  2. Mtls Configuration

    Configure mutual TLS (mTLS) for zero-trust service-to-service communication.

    wshobson/agents★ 43k
  3. Multi Cloud Architecture

    Design multi-cloud architectures using a decision framework to select and integrate services across AWS, Azure, GCP, and OCI.

    wshobson/agents★ 43k

All skills by wshobson →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.