Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

dart-migration-versioningdart 迁移版本控制

Agent Skill

dart-migration-versioning 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,533

周安装

62

GitHub Stars

61

下载量

481
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dart-migration-versioning(dart 迁移版本控制)
来源仓库:https://github.com/dart-lang/skills
仓库路径:skills/dart-migration-versioning
安装命令:
npx skills add https://github.com/dart-lang/skills --skill dart-migration-versioning
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dart-lang/skills --skill dart-migration-versioning

简介

dart-migration-versioning 管理 Dart SDK 与依赖包的版本升级路径,规避 breaking changes 风险。

  • 适用于项目从旧版 Dart 迁移至 3.0+、启用 sound null safety 或调整语言版本约束。
  • 支持通过 @dart = <version> 注解对特定文件降级,实现渐进式迁移策略。
  • 使用前请查阅官方 breaking change 日志,并优先升级核心依赖而非全部包。
  • 建议结合 CI 流水线验证每个版本升级后的编译与测试结果,确保稳定性。

SKILL.md

Managing Dart Language Versions

Contents

Core Guidelines

  • Check current language version requirements in pubspec.yaml before initiating any migration or refactoring.
  • Consult breaking change logs before performing major dependency or SDK upgrades.
  • Use @dart = <version> to pin specific files to older versions during gradual migrations (e.g., migrating a large project to a new language feature like sound null safety).
  • Understand Version Derivation: The default language version for a package is strictly determined by the lower bound of the SDK constraint in pubspec.yaml. Patch versions do not introduce new language features.

Configuration & Overrides

Global Package Versioning

Set the default language version for the entire package by modifying the environment.sdk constraint in pubspec.yaml.

Per-Library Version Selection

Override the package-wide language version for individual files using a specific comment syntax.

  • Place the @dart string inside a // comment (do not use /// or /*).
  • Ensure the comment appears before any Dart code in the file.
  • Use this mechanism to maintain legacy code compatibility while upgrading the rest of the package.

Workflows

Task Progress: Gradual Language Version Migration

Use this workflow when upgrading a project to a new Dart major/minor version that contains breaking changes.

  • Analyze Current State: Run dart analyze on the current version to ensure a clean baseline.
  • Check Constraints: Inspect pubspec.yaml to identify the current lower-bound SDK constraint.
  • Review Breaking Changes: Consult the Breaking Changes Reference for the target version.
  • Update SDK Constraint: Modify the environment.sdk lower bound in pubspec.yaml to the target version.
  • Run Dependency Resolution: Execute dart pub get.
  • Identify Breakages: Run dart analyze.
  • Apply Conditional Logic for Fixes:

- *If the file is small or easily refactored*: Fix the breaking changes immediately to comply with the new language version. - *If the file is complex or part of a large legacy module*: Insert // @dart = <previous_version> at the top of the file to defer migration.

  • Run Validator: Execute dart test and dart analyze -> review errors -> fix remaining issues.

Examples

Setting the Package Language Version

# pubspec.yaml
name: my_package
environment:
  # This sets the default language version to Dart 3.3
  sdk: '>=3.3.0 <4.0.0'

Applying a Per-Library Override

// @dart = 2.19
// The above comment pins this specific file to Dart 2.19,
// even if the pubspec.yaml specifies Dart 3.0+.

import 'dart:math';

void legacyFunction() {
  // Legacy code implementation
}

Breaking Changes Reference

Dart 3.11.0

  • Wasm Compilation: Code importing dart:js_util or package:js results in a compilation error. Migrate to dart:js_interop.
  • Analyzer: Deprecated avoid_null_checks_in_equality_operators, prefer_final_parameters, and use_if_null_to_convert_nulls_to_bools lint rules.

Dart 3.10.0

  • SDK: The dart CLI and Dart VM are now separate executables (dartvm). IA32 platform support removed.
  • Wasm Compilation: dartify converts JS Promise objects to Dart Future objects instead of JSValue.

Dart 3.7.0

  • Language: Local variables and parameters named _ are non-binding and cannot be accessed.
  • Libraries: Legacy web libraries (dart:html, dart:js, etc.) are officially deprecated. Migrate to package:web and dart:js_interop.

Dart 3.5.0

  • Runtime: The Dart VM no longer supports unsound null safety. --no-sound-null-safety CLI option removed.

Dart 3.0.0 (Major Breaking Changes)

  • Language: Null safety is strictly enforced. Switch cases are now interpreted as patterns.
  • Mixins: Class declarations from Dart 3.0+ libraries can no longer be used as mixins by default.
  • Core: Iterable, ListMixin, SetMixin, and MapMixin are now mixin classes.

Dart 2.12.0

  • Language: Sound null safety enabled by default.

Related Skills

  • dart-web-development
  • dart-static-analysis

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.65%
按下载量换算176

Claude

33.19%
按下载量换算160

Cursor

18.49%
按下载量换算89

Gemini CLI

9.09%
按下载量换算44

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills