immutability

Installation
SKILL.md

Immutability

Overview

Never mutate. Always return new objects.

Mutation causes bugs that are hard to track - when objects change unexpectedly, debugging becomes a nightmare. Immutability makes state changes explicit and predictable.

When to Use

  • Modifying objects or arrays
  • Updating state in React/Redux
  • Function receives object as parameter
  • Data shared between multiple parts of code

The Iron Rule

NEVER mutate objects or arrays. ALWAYS return new copies with changes.
Related skills
Installs
26
GitHub Stars
10
First Seen
Jan 22, 2026