Large code migrations
Give Claude Opus 4.8 the library’s changelog and the code that calls it, and have it list every call site that breaks and the change each one needs. Run the test suite after each batch of edits.
Example: Which calls break in the v4 upgrade?
Material
- Changelog v4.0
- fetchUser(id, callback) is removed; use await fetchUser(id). The option retries now defaults to 0 (was 3).
- Call sites
- a.ts: fetchUser(id, (err, user) => render(user)) · b.ts: const u = await fetchUser(id, { retries: 3 }) · c.ts: const u = await fetchUser(id)
PromptUsing the changelog and the call sites, list each call that breaks in v4 and the smallest change it needs.
Sample answer · written by hand to show the reasoning
a.ts breaks: the callback form is removed, so change it to const user = await fetchUser(id); render(user); inside an async function. b.ts keeps working because it already awaits and sets retries explicitly. c.ts still compiles but silently loses its 3 retries; add { retries: 3 } if the old behaviour is still needed.