mayrlabs-javascript
Installation
SKILL.md
JavaScript Code Doctrine
JavaScript must be treated as a strict, production-ready language. We avoid historical JS quirks and default to modern, deterministic, and safe patterns.
The Iron Law
No silent failures, no implicit globals, no parameter mutation.
Core Principles
- Modern Context (ESM & strict): Always use ES Modules (
import/export). Always operate in strict mode (inherent in ESM). - Immutability First: Never mutate function parameters. Treat all inputs as read-only. Prefer
constoverlet. Never usevar. Use array/object spread operators to create new references instead of mutating existing ones. - Pure Functions: Functions should be deterministic. If a function requires external state, inject it as a dependency.
- Predictable Types (Runtime): Even without TS, ensure objects are structured consistently. Avoid dynamically adding/removing object keys if possible.