SPELL: Synthesis of Programmatic Edits using LLMs

Daniel Ramos, Catarina Gamboa, Inês Lynce, Vasco Manquinho, Ruben Martins +1 more
2/1/2026
cs.SEcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Library migration is a common but error-prone task in software development. Developers may need to replace one library with another due to reasons like changing requirements or licensing changes.

Show full abstract

Migration typically entails updating and rewriting source code manually. While automated migration tools exist, most rely on mining examples from real-world projects that have already undergone similar migrations. However, these data are scarce, and collecting them for arbitrary pairs of libraries is difficult. Moreover, these migration tools often miss out on leveraging modern code transformation infrastructure. In this paper, we present a new approach to automated API migration that sidesteps the limitations described above. Instead of relying on existing migration data or using LLMs directly for transformation, we use LLMs to extract migration examples. Next, we use an Agent to generalize those examples to reusable transformation scripts in PolyglotPiranha, a modern code transformation tool. Our method distills latent migration knowledge from LLMs into structured, testable, and repeatable migration logic, without requiring preexisting corpora or manual engineering effort. Experimental results across Python libraries show that our system can generate diverse migration examples and synthesize transformation scripts that generalize to real-world codebases.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ramos2026spell,
  title  = {SPELL: Synthesis of Programmatic Edits using LLMs},
  author = {Daniel Ramos and Catarina Gamboa and Inês Lynce and Vasco Manquinho and Ruben Martins and Claire Le Goues},
  year   = {2026},
  eprint = {2602.01107},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.01107v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.01107.svg)](https://codeofpaper.com/paper/2602.01107)

Discussion