Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Code Migration at Scale: AI Agents and RuboCop
Search
George Ma
September 26, 2025
Programming
0
27
Code Migration at Scale: AI Agents and RuboCop
Learn how to automate large-scale code migrations by leveraging AI Agents to write Rubocop Cops
George Ma
September 26, 2025
Tweet
Share
More Decks by George Ma
See All by George Ma
RailsConf 2024: Ruby & Rails Versioning at Scale
georgema
0
90
Other Decks in Programming
See All in Programming
AtCoder Conference 2025
shindannin
0
1.1k
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
Oxlint JS plugins
kazupon
1
970
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
Oxlintはいいぞ
yug1224
5
1.3k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
470
CSC307 Lecture 02
javiergs
PRO
1
780
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
300
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
150
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
The Language of Interfaces
destraynor
162
26k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Transcript
George Ma - Rails World 2025 Code Migration at Scale
AI-Powered Test Driven Development
Observe.log Rails.event.notify 10,000+ callsites ~3000 files
None
3,207 file changes 30,000+ total lines changed
3,207 file changes 30,000+ total lines changed
“Migrate pls”
Agenda - ❗Why agentic tooling alone was suboptimal - 💚
Why a combination of Test Driven Development, RuboCop and agentic tooling succeeded
10,000+ instances/ 3000+ files Migrate all these instances to the
new Rails Structured Logger ❗Why agentic tooling alone was suboptimal
❗Why agentic tooling alone was suboptimal
Hash rockets Mixed (hash rockets + kwargs) ❗Why agentic tooling
alone was suboptimal
Need to preserve indentation Attribute chaining (.merge) ❗Why agentic tooling
alone was suboptimal
Base hash merged with additional parameters Kwsplat combined with explicit
key-value pairs ❗Why agentic tooling alone was suboptimal
None
Give a hat
Transform A Transform B Transform C … …. Transform X
Transform Y Transform Z
None
- Read files one at a time, manually approve changes
- Frequent hallucinations - Barely faster than performing manual edits and claude-3.5
and claude-4.0 - Sub-tasks (better parallelization) - Great when the
task at hand is simpler / smaller in scope - Imperfections when the prompt is too granular
- Great when the task at hand is simpler /
smaller in scope and claude-4.0 - Sub-tasks (better parallelization) - Imperfections when the prompt is too granular
Recap
Recap Observe.log Rails.event.notify
+
💚 Test Driven Development Step 0: Start with a new
Cop and its corresponding test Cop Cop_test
Step 1: Prompt Claude to write a (failing) test 💚
Test Driven Development
- Provides a base-line for Cop development / correctness -
Prevents regressions as you add additional cases 💚 Test Driven Development
Step 2: Ask Claude to create the Cop’s autocorrect logic
to pass this test case 💚 Test Driven Development
Step 2.5: Repeat steps 1 & 2 until all cases
are autocorrectable 💚 Test Driven Development
cops/observe_log_to_rails_event.rb
observe_log_to_rails_event_test.rb
Step 3: Run the Cop with the autocorrect flag (`-a`)
💚 Test Driven Development
Step 4: Reap the benefits 💚 Test Driven Development
- Less token use/time spent waiting for agents to run
- Leverage TDD and agentic tooling’s strengths to write the Cop itself - Cop that produces deterministic results every time 🚀
None