AgentSkillsCN

flutter-upgrade

采用渠道/版本发现、迁移意识,以及格式化/分析/验证测试门禁的流程,完成Flutter SDK的升级。

SKILL.md
--- frontmatter
name: flutter-upgrade
description: Flutter SDK upgrade workflow with channel/version discovery, migration awareness, and format/analyze/test verification gates.
triggers:
  - "upgrade flutter sdk"
  - "migrate flutter app"
  - "flutter channel/version update"
inputs:
  - "mode flag: --dry-run | --execute | --verify-only"
outputs:
  - "upgrade verification report and command log"
  - "SDK and lockfile changes in execute mode"
safety:
  - "execute requires clean git tree"
  - "run dry-run first and review analyzer/test outputs before merge"
commands:
  - "skills/flutter-upgrade/scripts/run.sh --dry-run"
  - "skills/flutter-upgrade/scripts/run.sh --execute --ci"

When to use / when NOT to use

  • Use for Flutter SDK upgrades and migration checks.
  • Do not use for dependency-only updates (use flutter-deps-upgrade).

Preconditions (tools, versions, repo state)

  • Flutter/Dart installed and on PATH.
  • Flutter workspace (pubspec.yaml) available.
  • Clean git state before execute.

Workflow (DISCOVER → PLAN → EXECUTE → VERIFY → REPORT)

  1. DISCOVER: inspect Flutter version/channel, monorepo tooling, analyzer config.
  2. PLAN: identify upgrade scope and potential breaking-change hotspots.
  3. EXECUTE: run flutter upgrade and flutter pub get.
  4. VERIFY: run dart format check, flutter analyze, flutter test.
  5. REPORT: summarize outcomes and required manual migrations.

Exact commands and expected signals

bash
skills/flutter-upgrade/scripts/run.sh --dry-run
skills/flutter-upgrade/scripts/run.sh --execute --ci
skills/flutter-upgrade/scripts/run.sh --verify-only --ci

Success: verification pipeline runs and report generated. Failure: missing Flutter toolchain/project or analyzer/test errors.

If it fails (checklist)

  • Run flutter doctor and resolve toolchain issues.
  • Ensure SDK constraints in pubspec.yaml fit target channel.
  • Re-run with --verbose and inspect first failing stage.

Final report template

  • Current vs upgraded Flutter version/channel.
  • Files affected and dependency lock changes.
  • Analyze/test/build outcomes.
  • Breaking-change follow-ups.
  • Rollback command.