The Problem
Upgrading dependencies is one of the most frustrating parts of maintaining modern applications.
A single breaking release can mean:
- Dozens of files to update
- Hours of repetitive refactoring
- Constant fear of introducing subtle bugs
For wagmi v2βv3, that means renaming hooks like useAccount, useContractRead, and updating providers across your entire codebase.
For Inngest v3βv4, it means restructuring function triggers, moving configuration, and adapting to a new middleware system.
This is slow, error-prone, and hard to get right.
The Solution
I built Boring AI Migration Suite β a production-grade codemod system that automates 70β80% of these migrations with zero false positives.
π Live demo: https://migrate-wagmi-v3.vercel.app
π GitHub: https://github.com/Web3smallie/migrate-wagmi-v3
π The goal: eliminate the boring, risky parts of upgrades.
How It Works
The system uses a hybrid approach:
1. Deterministic AST transforms (70β80%)
All safe, mechanical changes are handled automatically.
- Same input β same output
- No guessing
- No hallucinations
2. AI-ready TODO comments (20β30%)
For complex cases, the codemod inserts structured comments:
/* TODO (AI): autoConnect was removed in wagmi v3.
Use reconnectOnMount instead if needed.
See: https://wagmi.sh/react/guides/migrate-from-v2-to-v3 */
These are designed so an AI agent (or developer) can resolve them quickly.
wagmi v2βv3: Automated Changes
-
useAccountβuseConnection -
useAccountEffectβuseConnectionEffect -
useSwitchAccountβuseSwitchConnection -
useContractReadβuseReadContract -
useContractWriteβuseWriteContract -
useNetworkβuseChains -
useSwitchNetworkβuseSwitchChain -
useWaitForTransactionβuseWaitForTransactionReceipt -
WagmiConfigβWagmiProvider -
writeContractβmutate/mutateAsync -
wagmi/chainsβviem/chains - Type renames (
UseAccountReturnTypeβUseConnectionReturnType)
Inngest v3βv4: Automated Changes
-
createFunctiontrigger β moved intotriggers: [] -
serve()options β moved to constructor -
serveHostβserveOrigin -
streamingnormalization -
step.invokeβreferenceFunction()
Real World Results
scaffold-eth-2 (10k+ stars) β wagmi
npx migrate-wagmi-v3 ./scaffold-eth-2
- Files affected: 13
- Patterns detected: 15
- Automated: 11
- TODOs: 4
- Coverage: 73%
- False positives: 0
- Time: < 5 seconds
π What would normally take 1β2 hours was completed in seconds.
PR: https://github.com/scaffold-eth/scaffold-eth-2/pull/1278
Documenso (10k+ stars) β Inngest
npx migrate-wagmi-v3 --inngest ./documenso
- Files affected: 1
- Patterns detected: 3
- Automated: 1
- TODOs: 2
- False positives: 0
- Time: < 3 seconds
PR: https://github.com/documenso/documenso/pull/2736
Key Features
Dry Run (Safe Preview)
npx migrate-wagmi-v3 . --dry-run
Preview all changes without modifying files.
Auto PR Generation
npx migrate-wagmi-v3 --auto-pr https://github.com/owner/repo --token ghp_xxx
Clone β migrate β commit β open PR automatically.
Migration Report
Each run generates a migration-report.md in your project root:
- Patterns detected
- Automated changes
- TODOs
- Coverage
Why Zero False Positives Matters
False positives are heavily penalized in automated migrations.
This system avoids them by:
- Only transforming patterns with 100% certainty
- Flagging ambiguous cases instead of guessing
- Using multi-pass analysis for safer detection
π The result: migrations that are safe by default
Test Suite
wagmi: 10 tests passing
Inngest: 15 tests passing
Total: 25/25 passing
Covers:
- Happy paths
- Edge cases
- Idempotency
Try It
npx migrate-wagmi-v3 ./your-project
Final Thoughts
Software maintenance shouldnβt be this painful.
By combining deterministic codemods with AI-assisted review, we can turn migrations from hours of manual work into a fast, reliable workflow.
π This is a step toward making software maintenanceβ¦ boring.
Top comments (0)