一键导入
dart-resolve-package-conflicts
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guidelines and format for writing pull request descriptions in this repository. Use this skill whenever the user asks you to draft a pull request description, submit a PR, or update a PR description.
Validates an in-progress PR or feature branch of dart_skills_lint against known downstream ecosystem consumers. Use when assessing breaking changes across external repositories during PR evaluation, testing migrations against the changelog, or determining necessary backwards compatibility shims.
How to integrate, update, and configure the dart_skills_lint validation tool within a repository. Make sure to use this skill whenever the user asks to update dart_skills_lint, configure skills validation tests, fix skills linter dependency drifts, verify repository state before editing, optimize lint rules execution, or draft pull request submission commands.
Use this skill when you need to validate AI agent skills with dart_skills_lint — running the linter, interpreting failures, fixing violations, and authoring custom rules.
A deliberately broken fixture used by example/README.md to show what each rule's error output looks like.
Reference fixture for dart_skills_lint. Demonstrates a SKILL.md that passes every default rule: hyphen-lowercase name matching the parent directory, a properly sized description, and no other frontmatter fields that would trigger the disallowed-field check.
| name | dart-resolve-package-conflicts |
| description | Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions. |
| metadata | {"model":"models/gemini-3.1-pro-preview","last_modified":"Fri, 24 Apr 2026 15:11:14 GMT"} |
Dart enforces a strict single-version rule for dependencies: a project and all its transitive dependencies must resolve to a single, shared version of any given package. This prevents runtime type mismatches but introduces the risk of "version lock."
To mitigate version lock, Dart relies on version constraints rather than pinned versions in the pubspec.yaml. The pubspec.lock file maintains the exact resolved versions for reproducible builds.
Understand the output columns of dart pub outdated:
pubspec.lock.pubspec.yaml. dart pub upgrade resolves to this.^1.2.3) for dependencies in pubspec.yaml. This allows pub to select newer, non-breaking versions (up to, but not including, the next major version) during resolution.dev_dependencies to the exact version currently used. This reduces resolution complexity and prevents older, incompatible dev tools from being selected.dart pub get --enforce-lockfile in CI/CD pipelines to ensure the exact versions tested locally are used in production.Run this workflow periodically to identify stale packages that may impact stability or performance.
Task Progress:
dart pub outdated.pubspec.yaml.pubspec.yaml to update.Use conditional logic based on the audit results to upgrade dependencies.
Task Progress:
dart pub upgrade.dart pub upgrade --tighten to automatically update the lower bounds in pubspec.yaml to match the newly resolved versions.pubspec.yaml to bump the version constraint to match the "Resolvable" column (e.g., change ^0.11.0 to ^0.12.1).dart pub upgrade to resolve the new constraints and update pubspec.lock.dart analyze -> review errors -> fix breaking API changes.dart test -> review failures -> fix regressions.When pub cannot find a set of concrete versions that satisfy all constraints, or when dealing with a retracted package version, manipulate the lockfile surgically.
NEVER delete the entire pubspec.lock file and run dart pub get. This causes uncontrolled upgrades across the entire dependency graph.
Task Progress:
pubspec.lock.dart pub get to fetch the newest compatible, non-retracted version for that specific package.dart pub deps -> verify the dependency graph resolves correctly.pubspec.yaml, and retry.When dart pub outdated shows a package is resolvable to a higher minor/patch version, use the --tighten flag to update the pubspec.yaml automatically.
Input (pubspec.yaml):
dependencies:
http: ^0.13.0
Command:
dart pub upgrade --tighten http
Output (pubspec.yaml):
dependencies:
http: ^0.13.5
If package_a is retracted or locked in a conflict, remove only its block from pubspec.lock.
Before (pubspec.lock):
packages:
package_a:
dependency: "direct main"
description:
name: package_a
url: "https://pub.dev"
source: hosted
version: "1.0.0" # Retracted version
package_b:
dependency: "direct main"
# ...
Action: Delete the package_a block entirely. Leave package_b untouched. Run dart pub get.