Skip to content

Modern JavaScript Patterns

Teaches the agent ES6+ JavaScript idioms for cleaner, modern, more maintainable code

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
3 files

What it does

When installed, the agent follows modern JavaScript conventions (ES6+ syntax such as async/await, destructuring, arrow functions, modules, and functional patterns) when writing or refactoring JavaScript. It applies a checklist of best practices, like preferring const, using optional chaining and nullish coalescing, and avoiding data mutation, and can consult reference documents for deeper examples and common pitfalls. It does not run code or access outside services by itself.

Great for

  • Developers modernizing older callback-heavy or var-based JavaScript codebases
  • Students learning current JavaScript idioms and functional patterns
  • Teams wanting consistent style guidance during code reviews or refactors

Skip it if

  • Projects that need TypeScript-specific typing guidance, since this skill focuses on plain JavaScript (the skill lives in a TypeScript plugin folder but its text covers ES6+ generally)
  • Performance-critical tuning that requires profiling; the skill gives general advice, not measured benchmarks

Try asking

  • “Refactor this callback-based Node.js file to use async/await and modern syntax”
  • “Review my JavaScript module and suggest modern patterns like destructuring and optional chaining”
  • “Explain how to avoid mutating data in this reducer using spread operators and array methods”
  • “Show me common async pitfalls like promise anti-patterns in my code”
Step-by-step guide: how to use Modern JavaScript PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 3 original files, the MIT licence and an attribution note.

    modern-javascript-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip modern-javascript-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip modern-javascript-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Point the agent at a specific file or function so it can apply the patterns to real code rather than giving generic advice.
  • Ask it to explain why each change is made if you are learning, since the guidance includes reasoning behind best practices.
  • Review its refactors with your test suite, because syntax changes can alter behavior (for example, around this binding or error handling).

What's inside

  • references/advanced-patterns.md
  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.