association-mutation-patterns

Community

Update Associations safely without silent key loss.

Authortransreal
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill prevents silent failures when mutating Wolfram Language Associations—especially the misconception that ReplacePart can add new keys—so your state updates and registries remain correct.

Core Features & Use Cases

  • ReplacePart limitation awareness: Clarifies that ReplacePart only replaces existing keys/paths and will ignore new keys without warnings.
  • Correct update operator selection: Explains when to use Append, Join, AssociateTo, and MapAt for adding new keys, replacing values, merging multiple Associations, and transforming nested structures.
  • Nested Association mutation patterns: Provides safe two-step and MapAt-based approaches for cases where a nested path includes new keys.
  • Debugging and test verification cues: Shows how Missing["KeyAbsent", ...] can surface downstream as Part::pspec1 and recommends VerificationTest checks that confirm both key existence and value correctness.
  • Use Cases: Updating token registries, configuration maps, and state objects in codebases that build and mutate nested Association-based data.

Quick Start

Use association-mutation-patterns when you need to update or extend an Association (including nested ones) and verify new keys are actually present after the mutation.

Dependency Matrix

Required Modules

None required

Components

Standard package

đź’» Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: association-mutation-patterns
Download link: https://github.com/transreal/claudecode/archive/main.zip#association-mutation-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.