javascript-runtime
House skill. Pair with software-engineering for code changes. TypeScript work normally also loads typescript-common-practice. This skill owns JavaScript runtime semantics, not framework style or product behavior.
When to load
Load this skill when work depends on how JavaScript actually executes: shared object identity, closure capture, truthiness/defaulting, module initialization, event-loop ordering, exception flow, or language-level object behavior. It is useful in Bun, Node.js, browsers, workers, and test runners.
Do not load it merely because a file ends in .js or .ts. Load it when runtime semantics are material to correctness.
Values, identity, and copying
Primitive values are copied by value. Objects, arrays, maps, sets, functions, dates, and other objects are referenced by identity.
- Assignment of an object creates another reference to the same object.
- Object spread and array spread make shallow copies only. Nested objects remain shared.
- Object keys in Map and object values in Set compare by object identity rather than structural equality.
- Object.freeze is shallow unless nested values are frozen separately.
- A read-only TypeScript type does not make the runtime object immutable.
Before mutating nested state, know who else can observe the same object. Prefer producing a new owned value when shared mutation would make ordering or ownership unclear.