es-toolkit
Scannednpx machina-cli add skill deepfriedmind/agent-skills/es-toolkit --openclawes-toolkit
Run initialization first to sync references for the target project's installed es-toolkit version. If package.json is missing, does not include es-toolkit, or contains an unparsable es-toolkit range, initialization falls back to the latest es-toolkit release:
sh ./scripts/init.sh [/path/to/project/package.json]
Treat initialization as a hard prerequisite:
- Do not read any file under
references/untilinit.shexits with code0. - Do not run initialization and reference reads in parallel.
- If initialization fails, stop and report the error instead of reading references.
When writing/refactoring/reviewing utility code, check the references first and prefer an existing es-toolkit function over custom implementations whenever behavior matches.
Do not use functions under compat ("Lodash compatibility").
References (available once initialization is complete)
Source
git clone https://github.com/deepfriedmind/agent-skills/blob/main/skills/es-toolkit/SKILL.mdView on GitHub Overview
es-toolkit is an up-to-date documentation reference for writing JavaScript/TypeScript code using standardized utility helpers. It guides you when creating new utilities, refactoring, or evaluating whether existing custom code can be replaced with es-toolkit equivalents, including arrays, objects, maps/sets, promises, math, and strings.
How This Skill Works
Initialization must run to sync references for the target project's es-toolkit version. If package.json is missing or invalid, initialization falls back to the latest release. When writing or refactoring, consult the references first and prefer es-toolkit functions over custom implementations, and avoid any functions under compat (Lodash compatibility).
When to Use It
- Starting a JavaScript/TypeScript project and planning to use standardized es-toolkit utilities.
- Refactoring existing code to replace custom utilities with es-toolkit equivalents.
- Reviewing code to determine if a function can be replaced with an es-toolkit utility.
- Working on routines involving arrays/objects/Maps/Sets/Promises/math/string manipulation.
- Being explicitly asked to scan or refactor code toward es-toolkit usage.
Quick Start
- Step 1: Run sh ./scripts/init.sh [/path/to/project/package.json] to synchronize references.
- Step 2: Read the relevant references (e.g., array-utilities.md, string-utilities.md) for guidance.
- Step 3: Refactor code to use es-toolkit utilities where behavior matches and document changes.
Best Practices
- Run the initialization script to sync es-toolkit references before reading any reference docs.
- Always consult the References (once initialization is complete) before implementing a utility.
- Prefer es-toolkit functions over custom implementations when behavior matches.
- Do not use functions under compat (Lodash compatibility).
- Document replacements and rationale when refactoring to es-toolkit.
Example Use Cases
- Replace a custom array merge with es-toolkit's array utilities to ensure consistent behavior.
- Refactor a map transformation to use es-toolkit map utilities for clarity and reliability.
- Normalize strings using es-toolkit string utilities instead of a bespoke helper.
- Replace a promisify-like utility with es-toolkit promise utilities to standardize handling.
- Audit a codebase to identify and migrate potential replacements to es-toolkit.