modern-javascript-patterns
What it does
This guide teaches how to use the latest versions of JavaScript (called ES6+) to write cleaner, faster, and easier-to-understand code. It covers features like 'async/await' and 'destructuring'.
When to use it
- ✓When you have old JavaScript code and want to update it.
- ✓When wanting to write more organized and readable code.
- ✓If you need to handle time-consuming operations, like fetching data from the internet.
Skill link
https://github.com/wshobson/agents/blob/main/plugins/javascript-typescript/skills/modern-javascript-patterns/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“How can I update this old JavaScript code to use modern features?”
5 new skills a week. 1 minute to read.
How it works
The AI uses the guide's best practices and examples to show how to rewrite your code. It focuses on using new JavaScript features to make it more efficient and readable.
Technical content (original SKILL.md)
Original text by the author, straight from 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
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
- Use const by default: Only use let when reassignment is needed
- Prefer arrow functions: Especially for callbacks
- Use template literals: Instead of string concatenation
- Destructure objects and arrays: For cleaner code
- Use async/await: Instead of Promise chains
- Avoid mutating data: Use spread operator and array methods
- Use optional chaining: Prevent "Cannot read property of undefined"
- Use nullish coalescing: For default values
- Prefer array methods: Over traditional loops
- Use modules: For better code organization
- Write pure functions: Easier to test and reason about
- Use meaningful variable names: Self-documenting code
- Keep functions small: Single responsibility principle
- Handle errors properly: Use try/catch with async/await
- Use strict mode:
'use strict'for better error catching
For common pitfalls (this binding, promise anti-patterns, memory leaks), see references/advanced-patterns.md.
FAQ
What is 'ES6+'?
These are the latest versions of the JavaScript language, which brought many improvements and new features to make programmers' lives easier.
What is 'async/await'?
It's a simpler way to handle tasks that take time, like downloading information from the internet, without stopping the rest of the program from working.
What does 'refactoring code' mean?
Refactoring is rewriting existing code to improve it, without changing what it does. It's like tidying up and cleaning the house without moving the furniture around.
Details
Original description by the author
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.
repo: wshobson/agents
Popularity
- GitHub stars
- 41k
- Ranking position
- #6713
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
screen-reader-testing
41kHas your agent test websites using screen readers to ensure they are accessible.
wcag-audit-patterns
41kHelps your agent audit websites for accessibility and fix issues according to WCAG guidelines.
multi-reviewer-patterns
41kEnables your agent to coordinate parallel code reviews, deduplicating findings and consolidating reports.
parallel-debugging
41kAllows the agent to debug complex issues with parallel investigations and root cause analysis.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.