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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
AI時代の認知負荷との向き合い方
optfit
0
160
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
ぼくの開発環境2026
yuzneri
0
240
並行開発のためのコードレビュー
miyukiw
0
260
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
CSC307 Lecture 10
javiergs
PRO
1
660
SourceGeneratorのススメ
htkym
0
200
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Ethics towards AI in product and experience design
skipperchong
2
200
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
83
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
350
Marketing to machines
jonoalderson
1
4.6k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
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