ccheney/robust-skills/skills/modern-javascript/SKILL.md
modern-javascript
Write, modernize, and review JavaScript against real ECMAScript language features and explicit runtime targets. Use for JavaScript or Node.js code, ES edition attribution (ES2015-ES2026), compatibility and polyfill/transpile decisions, array/iterator/Set/Map/Promise/RegExp/TypedArray APIs, modules, async code, Temporal, explicit resource management, decorators, or replacing stale and withdrawn proposal syntax. Prefer standardized features, while permitting mature proposals when the required main
- Source repository stars
- 57
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-08-15
- Source checked
- 2026-08-25
Decision brief
What it does: where it fits
Use current JavaScript without confusing specification status, runtime support, and toolchain support. Treat these as three separate questions:
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/ccheney/robust-skills --skill "skills/modern-javascript"Inspect the Agent Skill "modern-javascript" from https://github.com/ccheney/robust-skills/blob/0ace9a7f5c20d19cad678b894a717945da2ea8ed/skills/modern-javascript/SKILL.md at commit 0ace9a7f5c20d19cad678b894a717945da2ea8ed. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Workflow
1. Inspect package.json (engines, browserslist, dependencies), runtime/deployment config, tsconfig.json, and Babel/bundler config. Do not invent a baseline. 2. Select the simplest standardized feature supported by that baseline. 3. For a newer standard or mature proposal, state…
Inspect package.json (engines, browserslist, dependencies), runtime/deployment config, tsconfig.json, and Babel/bundler config. Do not invent a baseline.Select the simplest standardized feature supported by that baseline.For a newer standard or mature proposal, state the required runtime, transform, or polyfill in the implementation or handoff. - 02
Review Traps
.sort(), .reverse(), .splice(), Mapset, Setadd, and most TypedArray methods mutate. That is not automatically wrong; make it intentional.
.sort(), .reverse(), .splice(), Mapset, Setadd, and most TypedArray methods mutate. That is not automatically wrong; make it intentional.Object/array spread is shallow and invokes ordinary property access; it does not preserve prototypes or descriptors.structuredClone is a host API and cannot clone functions, weak collections, or every platform object. - 03
Status Rules
Use the frozen ECMAScript 2026 specification for ES2026 attribution and the living draft for already-integrated future features.
Use the frozen ECMAScript 2026 specification for ES2026 attribution and the living draft for already-integrated future features.Use TC39's finished-proposals table for Stage 4 publication-year mapping and its active tracker for current stages.Do not infer an edition from the year a browser shipped a feature. Array.fromAsync, for example, shipped before its ES2026 publication. - 04
Edition Map
This is a routing index, not a substitute for the detailed references.
This is a routing index, not a substitute for the detailed references.Already Stage 4 with publication expected in ES2027: Temporal, explicit resource management (using / await using), Atomics.pause, and Iterator.zip / zipKeyed. See references/UPCOMING.md. - 05
Choose by Semantics
Do not replace mutation mechanically. A private, newly allocated array can be mutated efficiently without exposing mutable shared state. Use change-by-copy methods when preserving the source is part of the contract.
structuredClone, fetch, streams, AbortController, and DOM APIs are host/web APIs, not ECMA-262 language features.Intl. is standardized in ECMA-402, not ECMA-262.TypeScript syntax and types are not JavaScript runtime features.
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 57 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- ccheney/robust-skills
- Skill path
- skills/modern-javascript/SKILL.md
- Commit
- 0ace9a7f5c20d19cad678b894a717945da2ea8ed
- License
- MIT
- Collected
- 2026-08-25
- Default branch
- main
View the original SKILL.md
Modern JavaScript
Use current JavaScript without confusing specification status, runtime support, and toolchain support. Treat these as three separate questions:
- Is it standardized? Check the frozen annual ECMA-262 edition or TC39's current proposal tracker.
- Does the target run it? Check the project's declared Node/browser targets and current compatibility data.
- Can tooling bridge the gap? Syntax may need a transform; built-ins need a polyfill. One does not imply the other.
Workflow
- Inspect
package.json(engines,browserslist, dependencies), runtime/deployment config,tsconfig.json, and Babel/bundler config. Do not invent a baseline. - Select the simplest standardized feature supported by that baseline.
- For a newer standard or mature proposal, state the required runtime, transform, or polyfill in the implementation or handoff.
- Preserve observable behavior while modernizing: mutation, evaluation order, iterator consumption, concurrency, cancellation, property descriptors, and error propagation matter more than shorter syntax.
- Run the project's formatter, type-checker, linter, and tests. Exercise both the native path and compatibility path when both ship.
Read references/COMPATIBILITY.md whenever support is uncertain, the feature is newer than ES2023, or a proposal is involved.
Status Rules
- Use the frozen ECMAScript 2026 specification for ES2026 attribution and the living draft for already-integrated future features.
- Use TC39's finished-proposals table for Stage 4 publication-year mapping and its active tracker for current stages.
- Do not infer an edition from the year a browser shipped a feature.
Array.fromAsync, for example, shipped before its ES2026 publication. - Do not describe Stage 3 or 2.7 syntax as standard JavaScript. It can still be a sound project choice when a maintained toolchain implements the selected proposal revision.
- Do not emit withdrawn Records & Tuples syntax (
#{}/#[]).
Edition Map
This is a routing index, not a substitute for the detailed references.
| Edition | Representative additions |
|---|---|
| ES2015 | let/const, classes, modules, arrow functions, destructuring, promises, generators, Map/Set, Proxy |
| ES2016 | exponentiation, Array.prototype.includes |
| ES2017 | async functions, Object.values/entries, string padding, shared memory and Atomics |
| ES2018 | object rest/spread, async iteration, Promise.prototype.finally, major RegExp additions |
| ES2019 | flat/flatMap, Object.fromEntries, optional catch binding, stable sort |
| ES2020 | optional chaining, nullish coalescing, BigInt, Promise.allSettled, dynamic import(), globalThis |
| ES2021 | logical assignment, Promise.any, replaceAll, numeric separators, WeakRef |
| ES2022 | .at, Object.hasOwn, top-level await, class fields/private elements/static blocks, error cause, RegExp indices |
| ES2023 | array change-by-copy methods, findLast/findLastIndex, hashbang grammar, symbols as weak keys |
| ES2024 | grouping, Promise.withResolvers, well-formed strings, RegExp v, resizable/transferable buffers, Atomics.waitAsync |
| ES2025 | Set methods, sync iterator helpers, RegExp.escape, Promise.try, import attributes/JSON modules, RegExp modifiers, Float16 |
| ES2026 | Array.fromAsync, Error.isError, Math.sumPrecise, Uint8Array base64/hex, Iterator.concat, Map/WeakMap upsert, JSON source access |
Already Stage 4 with publication expected in ES2027: Temporal, explicit resource management (using / await using), Atomics.pause, and Iterator.zip / zipKeyed. See references/UPCOMING.md.
Choose by Semantics
Collections
| Need | Prefer | Important behavior |
|---|---|---|
| Transform/filter an array | map, filter, flatMap | Eager; creates arrays |
| Process a large/infinite sync source | iterator helpers | Lazy; consumes the iterator |
| Find from the end | findLast, findLastIndex | Does not reverse or copy |
| Change without mutating the source | toSorted, toReversed, toSpliced, with | Shallow copy |
| Group under string/symbol keys | Object.groupBy | Returns a null-prototype object |
| Group under identity keys | Map.groupBy | Preserves key identity |
| Collect an async iterable | Array.fromAsync | Pulls and awaits sequentially |
| Run already-created work concurrently | Promise.all | Rejects early; does not cancel inputs |
Do not replace mutation mechanically. A private, newly allocated array can be mutated efficiently without exposing mutable shared state. Use change-by-copy methods when preserving the source is part of the contract.
const ranked = scores.toSorted((a, b) => b.points - a.points);
const byTeam = Object.groupBy(players, player => player.team);
if (Object.hasOwn(byTeam, requestedTeam)) {
render(byTeam[requestedTeam]);
}
Nullish and Property Checks
const city = user?.address?.city ?? 'Unknown';
// `??` preserves 0, false, and ''. Use `||` only when all falsy values mean absent.
settings.timeout ??= 5_000;
// Safe for overwritten or null-prototype objects.
if (Object.hasOwn(record, 'id')) use(record.id);
Async Work
// Independent work: concurrent.
const [user, permissions] = await Promise.all([
fetchUser(id),
fetchPermissions(id),
]);
// Ordered source: sequential consumption.
const pages = await Array.fromAsync(fetchPages());
// A loop is correct when each step depends on the previous one.
for (const migration of migrations) {
await migration.run();
}
Never use forEach(async () => ...) when completion must be awaited. Read references/PROMISES.md for combinators and references/CONCURRENCY.md for bounded concurrency and cancellation.
Modules
Use with for import attributes; the older assert spelling is not current ECMAScript.
import config from './config.json' with { type: 'json' };
const locale = await import(`./locales/${language}.js`);
Import attributes and JSON modules are ES2025, but module loading remains host-sensitive. Verify Node, browser, bundler, and test-runner support together.
Exact API Boundaries
structuredClone,fetch, streams,AbortController, and DOM APIs are host/web APIs, not ECMA-262 language features.Intl.*is standardized in ECMA-402, not ECMA-262.- TypeScript syntax and types are not JavaScript runtime features.
- A TypeScript
libentry supplies type declarations, not a runtime implementation. - Babel syntax transforms do not automatically install missing globals or prototype methods.
Compatibility Paths
Prefer native support when the target has it. Otherwise choose deliberately:
| Feature kind | Compatibility mechanism |
|---|---|
Syntax (using, decorators) | Babel/TypeScript transform that matches the selected proposal revision |
Built-in (Iterator.concat, Map#getOrInsert) | Runtime upgrade or maintained polyfill such as current core-js |
| Namespace API (Temporal) | Runtime upgrade or a maintained Temporal polyfill |
Shared-memory primitive (Atomics.pause) | Native support only; feature-detect and keep a fallback algorithm |
TypeScript 7.0 is released, but it is not a polyfill and 7.0 has no stable programmatic compiler API. Projects whose framework/linter embeds TypeScript may need TypeScript 6 alongside it. See references/COMPATIBILITY.md.
Review Traps
.sort(),.reverse(),.splice(),Map#set,Set#add, and most TypedArray methods mutate. That is not automatically wrong; make it intentional.- Object/array spread is shallow and invokes ordinary property access; it does not preserve prototypes or descriptors.
structuredCloneis a host API and cannot clone functions, weak collections, or every platform object.Object.groupByhas no inheritedhasOwnPropertyortoString.- Iterator helpers are lazy and single-pass; arrays are reusable and eager.
Promise.alldoes not cancel remaining operations after rejection. PassAbortSignalwhen cancellation is required.Math.sumPreciseaccurately sums the binary Number inputs; it does not make decimal money exact.Error.isErroris cross-realm-safe for ECMAScript Error objects; host error types can have runtime-specific behavior.Temporalis not part of ES2026. Its Stage 4 publication target is ES2027.- Standard decorators are not legacy TypeScript
experimentalDecorators.
References
Load only what the task needs.
| Reference | Use for |
|---|---|
| ES2016-ES2017.md | early annual additions, async functions, shared memory |
| ES2018-ES2019.md | async iteration, object spread, RegExp, flattening |
| ES2022-ES2023.md | classes, .at, change-by-copy, weak symbol keys |
| ES2024.md | grouping, resolvers, Unicode sets, buffers |
| ES2025.md | Set/iterator helpers, modules, RegExp, Float16 |
| ES2026.md | all seven finalized ES2026 feature proposals |
| UPCOMING.md | Stage 4 ES2027 set, selected mature proposals, withdrawn syntax |
| COMPATIBILITY.md | runtime matrices, Babel/TypeScript/core-js/polyfill decisions |
| PROMISES.md | promise semantics and anti-patterns |
| CONCURRENCY.md | pools, retries, cancellation, async iteration |
| CHEATSHEET.md | compact syntax lookup |
Authority Order
- Frozen annual ECMA-262 editions for edition membership
- Living ECMA-262 plus TC39 proposal tracker/spec repositories for future status and semantics
- Test262 for conformance cases
- MDN Browser Compatibility Data and official engine/runtime releases for availability
- Official TypeScript, Babel, and polyfill documentation for compatibility paths
Frequently asked questions
What to verify before installation and use
What does the modern-javascript source document cover?
Use current JavaScript without confusing specification status, runtime support, and toolchain support. Treat these as three separate questions:
How do I install modern-javascript?
The source record exposes this install command: npx skills add https://github.com/ccheney/robust-skills --skill "skills/modern-javascript". Inspect the command and pinned source before running it.
Alternatives
Compare before choosing
garrytan/gbrain
bulk-ingestion
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
app-store-optimization
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
migrate-vstest-to-mtp
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
oaustegard/claude-skills
featuring
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre