{"slug": "automate-flutter-s-new-split-package-migration-with-ai-agent-skills", "title": "Automate Flutter's New Split Package Migration with AI Agent Skills", "summary": "Randal Schwartz's open-source repository, dart-sdk-skills, provides AI coding assistants with the knowledge and runbooks to automate migration of Flutter apps to the newly decoupled material_ui and cupertino_ui packages. The repository addresses LLM training cutoffs by offering version-specific agent skills that guide tools like Claude Code and Cursor through the migration process.", "body_md": "The Flutter framework has undergone one of its most significant architectural evolutions: **the complete unbundling of Material Design and Cupertino libraries into standalone pub packages** ([ material_ui](https://pub.dev/packages/material_ui) and\n\n`cupertino_ui`\n\nWhile this decoupling brings independent release cycles, lighter core framework footprints, and true headless UI development, it also introduces a massive migration across existing Flutter apps.\n\nIf you rely on AI coding assistants (such as Claude Code, Google Antigravity, Cursor, GitHub Copilot, or Cline), you have likely hit a familiar wall: **LLM training cutoffs**. Most models still generate monolithic `package:flutter/material.dart`\n\nimports and do not know how to perform the new split package migration.\n\nIn this article, we will explore how the open-source repository gives your AI agent the exact knowledge and execution runbooks to automate this migration in a single prompt.\n\n`dart-sdk-skills`\n\nHistorically, Flutter bundled every Material Design and Cupertino widget directly into the core `flutter`\n\nSDK. While convenient initially, this approach had drawbacks:\n\nUnder the modern decoupled architecture:\n\n```\n┌────────────────────────────────────────────────────────────────────────┐\n│ Legacy Flutter (Monolithic)                                            │\n│                                                                        │\n│  ┌──────────────────────────────────────────────────────────────────┐  │\n│  │ package:flutter/material.dart  &  package:flutter/cupertino.dart │  │\n│  ├──────────────────────────────────────────────────────────────────┤  │\n│  │ package:flutter/widgets.dart   &  package:flutter/rendering.dart │  │\n│  └──────────────────────────────────────────────────────────────────┘  │\n└────────────────────────────────────────────────────────────────────────┘\n                                    ▼\n┌────────────────────────────────────────────────────────────────────────┐\n│ Modern Decoupled Architecture                                          │\n│                                                                        │\n│  ┌───────────────────────────────┐   ┌──────────────────────────────┐  │\n│  │ package:material_ui           │   │ package:cupertino_ui         │  │\n│  └───────────────┬───────────────┘   └──────────────┬───────────────┘  │\n│                  └───────────────┬──────────────────┘                  │\n│                                  ▼                                     │\n│  ┌──────────────────────────────────────────────────────────────────┐  │\n│  │ Core Flutter SDK (package:flutter/widgets.dart)                  │  │\n│  └──────────────────────────────────────────────────────────────────┘  │\n└────────────────────────────────────────────────────────────────────────┘\n```\n\nBoth design systems are now maintained as independent packages by the official Flutter team on pub.dev:\n\n`material_ui`\n\n`^1.1.0`\n\n): Canonical entrypoint `package:material_ui/material_ui.dart`\n\n`cupertino_ui`\n\n`^1.0.1`\n\n): Canonical entrypoint `package:cupertino_ui/cupertino_ui.dart`\n\nWhen you tell an unassisted AI agent:\n\n\"Migrate my app to the new split Flutter design packages.\"\n\nIt often stumbles:\n\n`GlobalMaterialLocalizations`\n\n).This is where **Agent Skills** step in.\n\n`dart-sdk-skills`\n\n?\nis an authoritative repository of version-by-version agent skills for the Dart and Flutter SDKs. Built using the open Agent Skill specification (\n\n`dart-sdk-skills`\n\n`SKILL.md`\n\n), it progressively discloses precise rules, API matrices, and tactical upgrade runbooks to your AI pair programmer.`dart-sdk-skills`\n\nin Seconds\nYou can add the skills globally or per-project using your preferred tool:\n\n`npx skills`\n\n):\n\n```\n# Install globally for all AI agents\nnpx skills add RandalSchwartz/dart-sdk-skills -g\nskills add https://github.com/RandalSchwartz/dart-sdk-skills --global --all\ngit clone https://github.com/RandalSchwartz/dart-sdk-skills.git ~/Projects/Dart/dart-sdk-skills\nln -s ~/Projects/Dart/dart-sdk-skills/skills/flutter-sdk-changelog ~/.gemini/config/skills/flutter-sdk-changelog\n```\n\nOnce installed, your agent automatically recognizes split-package requests. Simply prompt:\n\n\"Migrate this project to the new split Material and Cupertino packages.\"\n\nHere is the exact multi-phase pipeline the agent executes based on the skill runbook:\n\nThe agent leverages the built-in Dart toolchain fix runner:\n\n```\ndart fix --apply --code=migrate_design_widgets\n```\n\nThis updates references and applies data-driven transform rules published inside `material_ui/lib/fix_data/`\n\n.\n\n`pubspec.yaml`\n\n)\nThe agent ensures your project bounds satisfy the minimum SDK constraints (`Flutter >=3.44.0`\n\n, `Dart ^3.12.0`\n\n):\n\n```\ndependencies:\n  flutter:\n    sdk: flutter\n  # Standalone design systems\n  material_ui: ^1.1.0\n  cupertino_ui: ^1.0.1\n```\n\nThe agent replaces monolithic imports across all Dart files with the canonical entrypoints:\n\n```\n// ❌ Legacy Monolithic Imports\nimport 'package:flutter/material.dart';\nimport 'package:flutter/cupertino.dart';\n\n// ✅ Modern Standalone Package Imports\nimport 'package:material_ui/material_ui.dart';\nimport 'package:cupertino_ui/cupertino_ui.dart';\n```\n\nBoth `material_ui.dart`\n\nand `cupertino_ui.dart`\n\nexport their respective global localization delegates without requiring extra legacy glue:\n\n```\nimport 'package:flutter/widgets.dart';\nimport 'package:flutter_localizations/flutter_localizations.dart';\nimport 'package:material_ui/material_ui.dart';\nimport 'package:cupertino_ui/cupertino_ui.dart';\n\nWidget buildApp() {\n  return MaterialApp(\n    localizationsDelegates: const [\n      GlobalMaterialLocalizations.delegate,\n      GlobalCupertinoLocalizations.delegate,\n      GlobalWidgetsLocalizations.delegate,\n    ],\n    supportedLocales: const [\n      Locale('en', 'US'),\n      Locale('es', 'ES'),\n    ],\n    home: const HomeScreen(),\n  );\n}\n```\n\nThe agent finishes by running static analysis and tests to ensure no ambiguous symbol collisions or unresolved imports remain:\n\n```\ndart analyze --fatal-infos\ndart test\n```\n\nOne of the greatest benefits of this decoupling is that Flutter apps with custom enterprise design systems can now completely omit `material_ui`\n\nand `cupertino_ui`\n\n.\n\nBy building directly against `package:flutter/widgets.dart`\n\n, you can create a lightweight, high-performance UI layer with zero design system bloat:\n\n```\nimport 'package:flutter/widgets.dart';\n\nclass BrandButton extends StatelessWidget {\n  final Widget child;\n  final VoidCallback onTap;\n\n  const BrandButton({\n    super.key,\n    required this.child,\n    required this.onTap,\n  });\n\n  @override\n  Widget build(BuildContext context) {\n    return GestureDetector(\n      onTap: onTap,\n      child: Container(\n        padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0),\n        decoration: BoxDecoration(\n          color: const Color(0xFF1E88E5),\n          borderRadius: BorderRadius.circular(10.0),\n        ),\n        child: child,\n      ),\n    );\n  }\n}\n```\n\nThe split package architecture is a major milestone for Flutter's scalability and modularity. By equipping your AI development workflow with , you turn what could be a tedious manual refactor into an effortless, one-command migration.\n\n`dart-sdk-skills`\n\n`material_ui`\n\non Pub`cupertino_ui`\n\non PubHappy coding, and let your agents do the heavy lifting! 🚀", "url": "https://wpnews.pro/news/automate-flutter-s-new-split-package-migration-with-ai-agent-skills", "canonical_source": "https://dev.to/gde/automate-flutters-new-split-package-migration-with-ai-agent-skills-bn2", "published_at": "2026-08-31 16:20:40+00:00", "updated_at": "2026-08-31 16:52:33.414555+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools"], "entities": ["Randal Schwartz", "dart-sdk-skills", "Flutter", "material_ui", "cupertino_ui", "Claude Code", "Cursor", "GitHub Copilot"], "alternates": {"html": "https://wpnews.pro/news/automate-flutter-s-new-split-package-migration-with-ai-agent-skills", "markdown": "https://wpnews.pro/news/automate-flutter-s-new-split-package-migration-with-ai-agent-skills.md", "text": "https://wpnews.pro/news/automate-flutter-s-new-split-package-migration-with-ai-agent-skills.txt", "jsonld": "https://wpnews.pro/news/automate-flutter-s-new-split-package-migration-with-ai-agent-skills.jsonld"}}