geusan/agent-skills/flutter-clean-arch-migrate
Claude Code and agent skill by geusan/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Migrate an existing Flutter application toward the architecture used by geusan/flutter-clean-arch while preserving its behavior, identifiers, integrations, and user-owned changes. Use for restructuring an established Flutter project into Domain, Repository, Service, and Presentation layers; do not use for creating a new app or merely adding Fastlane.
Install
npx vskill@latest install geusan/agent-skills/flutter-clean-arch-migrateSKILL.md
The same SKILL.md was published earlier as geusan/agent-skills/flutter-clean-arch-migrate.
Flutter Clean Arch Migrate
Refactor an existing Flutter app incrementally. Never replace its lib/, test/, pubspec, or native folders with the reference repository. The reference defines architectural responsibilities; the target project's behavior and integrations remain authoritative.
Resolve skill_root to the directory containing this SKILL.md before running bundled scripts. Bundled paths are relative to skill_root, never to the target Flutter project's working directory.
Establish context
Resolve the target Flutter project and the Clean Architecture ref. Default the ref to main so every migration run fetches the current repository. Use a branch, tag, or commit when the user requests reproducibility.
Before editing:
- Confirm the target has
pubspec.yamlandlib/. - Inspect repository instructions, Git root, branch, worktrees, and
git status --short. Preserve all pre-existing changes and do not create a branch or commit unless requested. - Fetch the reference into a temporary directory:
``bash reference_root="$(mktemp -d /tmp/flutter-clean-arch-reference.XXXXXX)" "$skill_root/scripts/fetch_clean_arch_reference.sh" \ --output "$reference_root/checkout" \ --ref main ``
- Read references/reference-contract.md, then inspect the fetched README, pubspec,
lib/di.dart,lib/main.dart, and representative files from every layer. The fetched source takes precedence over the reviewed snapshot when they differ. - Run the inventory helper and inspect its JSON rather than relying on directory names alone:
``bash "$skill_root/scripts/inventory_flutter_project.py" /absolute/path/to/app ``
Keep the fetched checkout outside the target repository and remove only that known temporary directory after recording the resolved commit.
Choose the migration contract
Read references/migration-playbook.md before changing code.
The default is a structural migration: adopt the reference layer responsibilities and dependency direction while retaining a working state-management, routing, networking, persistence, and DI stack already used by the app. If the target uses a materially different stack from Provider, Get/GetX routing, and GetIt, ask whether the user wants structural compatibility or strict stack parity before replacing those foundations. This choice changes scope too much to infer.
Capture a baseline with the project's own Flutter/FVM command, code-generation command, analyzer, and tests. Existing failures are baseline findings, not permission to weaken checks or rewrite unrelated code.
Migrate incrementally
Build a file-level mapping, then move one small vertical feature at a time:
- Domain models and rules.
- Repository contracts, remote/local adapters, and mapping.
- Services/use cases.
- View models and screens.
- Composition-root registrations and routes.
Keep the project compiling after each slice. Prefer temporary forwarding exports, adapters, or deprecated aliases over a single repo-wide rename when callers cannot move together. Preserve route names, serialized field names, database keys/schema, API payloads, DI lifetimes, state restoration, error behavior, analytics, and native identifiers unless the user explicitly includes them in scope.
Do not copy the reference chat sample, localhost endpoint, credentials, native projects, generated files, package name, dependency versions, or Flutter pin into the target. Add a dependency only when migrated code consumes it. Regenerate outputs from the target's annotations rather than moving stale .g.dart files.
After each slice, format changed Dart files and run the narrowest relevant tests. Then run the layer check:
Treat reported forbidden internal imports as migration work; do not suppress them. The script accepts the reference's legacy services -> di.dart pattern, but prefer constructor injection for newly migrated code unless strict parity requires service-locator access.
Complete the migration
Run the full project code generation, analyzer, unit/widget tests, and any platform or integration checks that were in the baseline. Compare against the baseline and do not claim success when behavior regressed or validation coverage decreased.
Remove old files and compatibility shims only after searches prove no remaining imports, routes, registrations, generated parts, or tests refer to them. Report:
- Reference repository, requested ref, and resolved commit.
- Baseline and final validation results.
- Features/layers migrated and compatibility shims retained.
- Intentional deviations from the reference stack.
- Remaining migration slices and blockers.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/flutter-clean-arch/skills/flutter-clean-arch-migrate/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/geusan/agent-skills/flutter-clean-arch-migrate)