es6-refactor
Installation
SKILL.md
Skill: ES6 Refactor
1. Description
ES6 Refactor is a code transformation tool that automatically modernizes JavaScript and TypeScript codebases. It converts legacy patterns (var declarations, callbacks, CommonJS) to modern ES6+ equivalents (let/const, async/await, ES modules) while preserving functionality and improving readability.
The skill integrates seamlessly with OpenClaw agent workflows, providing both a CLI for direct use and an API for programmatic access. It's designed for developers who need to upgrade codebases quickly without manual refactoring, ensuring consistency and adherence to modern best practices.
2. Core Capabilities
Syntax Modernization
- Convert
vardeclarations toletorconstbased on reassignment analysis - Transform traditional function expressions to arrow functions where appropriate
- Replace string concatenation with template literals
- Convert
forloops to array methods (map,filter,reduce,forEach) - Modernize object manipulation (computed properties, shorthand methods, destructuring)
- Update conditional patterns (ternary operators, optional chaining, nullish coalescing)