package-merge-pattern
CommunitySafely merge LLM code into .wl packages
Software Engineering#package management#code merging#mathematica#wolfram language#safety validation#llm code update#stream-json parsing
Authortransreal
Version1.0.0
Installs0
System Documentation
What problem does it solve?
When using an LLM to update Wolfram Language (.wl) package source, naive replacement can overwrite unrelated code, drop or duplicate functions, or produce fragile results that are hard to validate and debug.
Core Features & Use Cases
- Function-block extraction: Pulls function definitions from both the original code and the LLM response into comparable blocks for targeted merging.
- Partial and full-file merge logic: Detects when a response likely contains a full file versus only changed parts, then applies the appropriate strategy.
- New-function insertion with fallbacks: Inserts newly introduced functions into robust locations (including non-standard package structures) and verifies insertion actually occurred.
- Prompt and response extraction discipline: Uses “return ONLY modified functions” prompting plus delimiter-then-codeblock fallback extraction to reduce truncation and noise.
- stream-json progress parsing support: Supports incremental parsing of Claude Code progress events to enable reliable real-time UI/status updates.
- Safety validation checklist: Applies post-merge checks (size/function ratios, structural preservation, and API error detection) to block unsafe overwrites.
Quick Start
Ask your AI to update the Wolfram package by returning only the modified function definitions, then merge them using the package-merge-pattern workflow and run the safety validation checks before accepting the result.
Dependency Matrix
Required Modules
None requiredComponents
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: package-merge-pattern Download link: https://github.com/transreal/claudecode/archive/main.zip#package-merge-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.