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.