modern-javascript-patterns skill
✓ VerifiedRefactor legacy code and implement modern ES6+ features, functional programming patterns, and asynchronous operations.
- GitHub stars
- 42,413
- Files
- 3
- Last commit
- Nov 9, 2026
- License
- MIT
- Allowed tools
- —
What does the modern-javascript-patterns skill do?
modern-javascript-patterns is an agent skill. Refactor legacy code and implement modern ES6+ features, functional programming patterns, and asynchronous operations.
Summary generated from the skill's SKILL.md.
About the modern-javascript-patterns skill
Refactoring legacy codebases into modern ES6+ syntax is the primary function of this skill. Developers use it to transition from old callback structures to modern async/await patterns or to implement functional programming principles within their JavaScript applications. It provides guidance on using specific features like destructuring, spread operators, arrow functions, and modules to create cleaner and more maintainable code.
An agent should load this skill when tasked with optimizing performance or migrating outdated scripts to current standards. The skill relies on documentation located in references/details.md for deep pattern explanations and references/advanced-patterns.md to help avoid common pitfalls such as memory leaks or issues with this binding. It produces updated code that follows strict best practices, including the use of const by default, template literals, and optional chaining to prevent runtime errors.
What an agent can do with it
- 1Migrate legacy callback structuresAn agent can transform old callback-based code into modern asynchronous operations using promises and async/await.
- 2Apply functional programming principlesDevelopers can use this skill to implement data transformation pipelines and write pure functions.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the modern-javascript-patterns skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the modern-javascript-patterns skill in Plugin
/plugin marketplace add wshobson/agents /plugin install javascript-typescript@claude-code-workflows
Install the modern-javascript-patterns skill in Claude Code
~/.claude/skills/modern-javascript-patterns/SKILL.md
$ npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns ~/.claude/skills/modern-javascript-patternsInstall the modern-javascript-patterns skill in Claude Code (project)
.claude/skills/modern-javascript-patterns/SKILL.md
$ npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns .claude/skills/modern-javascript-patternsInstall the modern-javascript-patterns skill in Codex
~/.agents/skills/modern-javascript-patterns/SKILL.md
$ npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns ~/.agents/skills/modern-javascript-patternsInstall the modern-javascript-patterns skill in Gemini CLI
~/.gemini/skills/modern-javascript-patterns/SKILL.md
$ npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns ~/.gemini/skills/modern-javascript-patternsInstall the modern-javascript-patterns skill in Claude.ai
npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns modern-javascript-patterns && zip -r modern-javascript-patterns.zip modern-javascript-patterns # claude.ai → Customize → Skills → + → Create skill → Upload a skill → modern-javascript-patterns.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachablewshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns is public and reachablegithub.com/wshobson/agents/tree/HEAD/plugins/javascript-type ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-09github.com/wshobson/agents/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/wshobson/agents/blob/HEAD/plugins/javascript-type ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/wshobson/agents/blob/HEAD/plugins/javascript-type ↗Pass
SKILL.md
View on GitHubModern 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.
Files in this skill
3modern-javascript-patterns skill questions
How do I install the modern-javascript-patterns skill in Claude Code?
Run npx degit wshobson/agents/plugins/javascript-typescript/skills/modern-javascript-patterns ~/.claude/skills/modern-javascript-patterns. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the modern-javascript-patterns skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.