Skip to main content

Migrate 50 Files from REST to GraphQL

Scope a 50-file REST-to-GraphQL migration, split it into conflict-free work packages, and run them all at once with batch sessions.
AuthorCognition
CategoryMigrations
FeaturesAdvanced, Playbooks
1

Scope the migration with Ask Devin

You have 50 files that import from src/lib/restClient.ts and need to move to the new graphqlClient. Before splitting anything into parallel work, you need to know how those files are connected. Use Ask Devin to map the migration surface area — which files import the legacy client, how they cluster by domain, and where the risky coupling lives. Devin uses DeepWiki and semantic search under the hood, so it can answer these questions grounded in your actual code.
Ask Devin requires your repository to be indexed. Go to Settings > Repositories to check indexing status or index a new repo.
Open Ask Devin and ask:Ask Devin returns a breakdown like this:
50 files import restClient across 8 domains:

  User Management  (7 files) — isolated, full test coverage
  Billing          (9 files) — isolated, 6/9 tested
  Analytics        (5 files) — isolated, 3/5 tested
  Auth             (6 files) — shared middleware, full test coverage
  Notifications    (8 files) — isolated, 5/8 tested
  Admin            (5 files) — depends on Auth middleware
  Search           (4 files) — isolated, 2/4 tested
  Onboarding       (6 files) — isolated, 4/6 tested

Coupling note: Admin imports requireAuth from Auth. Migrate
Auth first, then Admin. All other domains are independent.
This tells you whether parallelization makes sense. If most files are tightly coupled across domains, a sequential migration is safer. Here, 6 of 8 domains are fully independent — you can run them in parallel.
2

Create a migration playbook

Every parallel session should follow the same migration pattern so the resulting PRs are consistent and easy to review. Create a playbook that defines exactly how each file should be migrated.Go to Settings > Playbooks > Create Playbook and define the steps:Or use Advanced Devin to generate the playbook for you — describe your migration pattern and it will produce a complete playbook:Referencing this playbook in your orchestration prompt ensures all parallel sessions produce PRs that look like they came from the same developer.
3

Launch parallel sessions with Advanced Devin

Open Advanced Devin (the sparkle icon in the web app) and give it the orchestration prompt. Advanced Devin analyzes your codebase’s dependency graph, creates independent work packages, and launches one batch session per package — all running simultaneously.Advanced Devin presents a grouping for your approval before launching anything:
Proposed work packages (8 groups, 50 files total):

Group 1 — User Management (7 files, complexity: M)
  src/services/UserService.ts, src/pages/Profile.tsx,
  src/pages/Settings.tsx, src/hooks/useCurrentUser.ts,
  src/pages/UserDirectory.tsx, src/services/AvatarService.ts,
  src/components/UserCard.tsx

Group 2 — Billing (9 files, complexity: L)
  src/services/BillingService.ts, src/services/InvoiceService.ts,
  src/services/SubscriptionService.ts, src/pages/Checkout.tsx,
  src/pages/PlanSelector.tsx, src/pages/InvoiceHistory.tsx,
  src/components/PaymentForm.tsx, src/hooks/useSubscription.ts,
  src/components/PricingTable.tsx

Group 3 — Analytics (5 files, complexity: S)
  src/services/AnalyticsService.ts, src/pages/Dashboard.tsx,
  src/components/MetricsCard.tsx, src/hooks/useMetrics.ts,
  src/components/ChartPanel.tsx

Group 4 — Auth (6 files, complexity: L) ⚠ migrate first
  src/services/AuthService.ts, src/middleware/requireAuth.ts,
  src/middleware/refreshToken.ts, src/pages/Login.tsx,
  src/pages/Signup.tsx, src/services/SessionService.ts

Group 5 — Notifications (8 files, complexity: M)
  src/services/NotificationService.ts, src/services/EmailService.ts,
  src/services/PushService.ts, src/pages/NotificationPreferences.tsx,
  src/components/NotificationBell.tsx, src/hooks/useNotifications.ts,
  src/components/NotificationToast.tsx, src/services/WebhookService.ts

Group 6 — Admin (5 files, complexity: M) ⚠ depends on Auth
  src/pages/AdminDashboard.tsx, src/pages/AdminUsers.tsx,
  src/services/AdminService.ts, src/components/AdminSidebar.tsx,
  src/middleware/requireAdmin.ts

Group 7 — Search (4 files, complexity: S)
  src/services/SearchService.ts, src/pages/SearchResults.tsx,
  src/components/SearchBar.tsx, src/hooks/useSearch.ts

Group 8 — Onboarding (6 files, complexity: M)
  src/services/OnboardingService.ts, src/pages/Welcome.tsx,
  src/pages/SetupWizard.tsx, src/components/ProgressTracker.tsx,
  src/hooks/useOnboardingState.ts, src/services/ChecklistService.ts

Dependency note: Group 6 (Admin) imports middleware from Group 4
(Auth). Will launch Auth first, then Admin after Auth's PR merges.
Launch remaining 6 groups in parallel immediately.

Start 6 parallel sessions now + 2 sequential? (y/n)
Approve the grouping and six sessions launch at once. Auth runs first, then Admin follows once Auth merges.
4

Review and merge the results

Each session opens its own PR. Since the packages are independent, you can review and merge them in any order — but merge Auth first since Admin depends on it, and run full CI after each merge to catch any unexpected interactions.Once all 8 migration PRs are merged, use a follow-up session to clean up dead code: