Workshops: Agentic Engineering Practices
Large-Scale Refactoring & Codemods with AI Agents: Workshop
Renaming a core API across hundreds of files, replacing a logging library or enforcing a new error-handling pattern everywhere: such changes used to take weeks of tedious work, so they got postponed. Coding agents make them feasible, but only with a method. This advanced workshop shows how to let agents write deterministic codemods instead of editing file by file, roll changes out in safe increments and review thousands of changed lines without rubber-stamping them.
Who is this workshop for?
- Senior and staff engineers who own cross-cutting changes
- Platform and developer experience teams maintaining shared libraries
- Architects driving consistency across many services or modules
- Teams with long-postponed clean-up work in large codebases
- Tech leads who have to review large change sets
What you will take away
- Choose between direct agent edits, agent-written codemods and IDE refactorings for each kind of change.
- Have agents write and test codemods with tools such as OpenRewrite, jscodeshift, ts-morph, Roslyn analyzers, LibCST or ast-grep.
- Plan refactorings as a sequence of small, independently mergeable steps using expand-and-contract and branch by abstraction.
- Build a verification chain of compiler, types, tests, static analysis and behavioural comparison that catches regressions automatically.
- Organise review so that people check the transformation rule and samples while automation checks the rest.
Agenda
Module 1
Planning the change
- Inventory: let the agent find every affected call site and variant
- Classify: mechanical, semi-mechanical, needs judgement
- Sequencing and ownership across teams, for example via CODEOWNERS
Module 2
Codemods with agents
- Exercise: the agent writes a codemod tested on before-and-after fixtures
- Running it across the codebase and handling outliers
- Reproducibility: rerun the codemod after a rebase instead of resolving conflicts
Module 3
Incremental rollout
- Expand and contract: introduce new, migrate, remove old
- Branch by abstraction and feature flags for behavioural changes
- Fanning out work to parallel agent sessions per module
Module 4
Verification
- Type checks, tests and static analysis as gates
- Golden master and snapshot comparisons for unchanged behaviour
- Detecting silent changes in logs, metrics and performance
Module 5
Review at scale
- Reviewing the rule, not every line
- Sampling, stacked pull requests and reviewer rotation
- Rollback plan and dead-code removal at the end
Let the agent write the tool, not every edit
An agent editing hundreds of files one by one is slow, costly and inconsistent: the first and the last file may be treated slightly differently. An agent writing a codemod produces one reviewable rule that applies identically everywhere and can be rerun after every rebase. Agents are good at writing AST-based transforms that used to require specialist knowledge, and they work through the remaining edge cases with a checklist.
What makes refactorings fail
Agents speed up typing, not deciding. The failure modes below are organisational, and the planning module tackles them directly.
- One giant pull request that nobody truly reviews
- Behaviour changes hidden inside supposedly mechanical edits
- Long-lived branches drifting away from main
- No defined end state, so old and new patterns coexist forever
Bring a real refactoring
The best preparation is a refactoring your team has been postponing. We work on it in your repository or a sandbox copy, remotely or on-site, in English or German, using the AST tooling of your stack.
Frequently asked questions
How is this different from legacy modernisation or framework upgrades?
Legacy modernisation and framework upgrades are specific kinds of projects. This workshop teaches the underlying technique of changing a lot of code safely, which you need there and in many other situations.
Which languages do you support?
The method is language-agnostic. For tooling we cover Java and Kotlin, JavaScript and TypeScript, C#, Python and Go, and adapt to other languages where suitable AST tools exist.
Can refactorings run fully automated in CI?
Rerunning a proven codemod in CI works well, for example to stop new code from reintroducing old patterns. The first large change should be reviewed and merged by people in stages.
Workshop
Get in touch
Which refactoring has your team been postponing for far too long?
Tell us roughly how many people will join and pick dates that work – we will get back to you within 24 hours with a proposal for content, format and schedule.
Prefer to talk first?
15 minutes, free and without obligation – with our AI Trainers and AI Code Engineers.
Book a call for free (opens in new tab) +49 761 519 751 50 (24/7)Request a training / workshop
Workshop: Large-Scale Refactoring & Codemods with AI Agents: Workshop · 1 day
More workshops
- Workshops: Agentic Engineering PracticesUnderstand a New Codebase Fast with AI Agents: Workshop
- Workshops: Agentic Engineering PracticesDebugging & Root-Cause Analysis with AI Coding Agents: Workshop
- Workshops: Agentic Engineering PracticesDocs-as-Code with AI Agents: Documentation Workshop for Devs
- Workshops: Agentic Engineering PracticesFramework & Version Upgrades with AI Agents: 2-Day Workshop
- Workshops: Agentic Engineering PracticesPerformance Optimization with AI Coding Agents: Workshop
- Deploy & App StoresShipping a Claude Code App to the Google Play Store
