PlugWiki

dart-migrate-to-checks-package Skill for Claude Code

Makes your agent migrate Dart tests from expect and package:matcher to the type-safe package:checks library.

Installs
18.6K
on skills.sh
Stars
537
on GitHub
Updated
Oct 2026
last repo commit

The skill gives the agent a four-step migration plan for a Dart test suite. Add package:checks, find the files that use expect, rewrite each file's imports and assertions, then check with dart analyze and dart test. It supports a full or incremental migration, and removing the old expect import afterwards makes any missed call a compile error.

Most of the file is a list of traps where a line-for-line rewrite gives a wrong test, such as equals on a list, matches with a string, or throws on a Future. It also holds a mapping table, grep commands for finding old matchers and examples. It bundles no scripts and loads when you ask to migrate tests to checks.

Good for

  • Dart teams modernizing an old test suite that uses package:matcher
  • Package maintainers who want clearer failure messages from tests
  • Developers migrating a few files at a time rather than all at once

Install dart-migrate-to-checks-package

Claude Code

  1. 1

    Copy this prompt.

    Install the dart-migrate-to-checks-package skill in Claude Code. Run this command:
    
    npx skills add https://github.com/dart-lang/skills --skill dart-migrate-to-checks-package
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.

Sections in SKILL.md

  1. Contents
  2. When to Use This Skill
  3. How to Use This Skill (The Workflow)
  4. 1. Dependency Setup
  5. 2. Identify and Plan Target Files
  6. 3. Migrating a File (Incremental or Full)
  7. 4. Verification and Feedback Loops
  8. Key Syntax Differences and Pitfalls
  9. 1. Collection Equality Pitfall (equals vs deepEquals)
  10. 2. The reason Parameter is now because
  11. 3. Regular Expression Matching (matches vs matchesPattern)
  12. 4. Property Extraction (TypeMatcher.having vs .has)
  13. 5. Synchronous vs. Asynchronous throws
  14. 6. RegExp / Pattern Equality
  15. 7. Strict Nullable Boolean Safety (bool? fields)
  16. 8. Map Key Containment (containsKey vs contains)

Key facts

Installs on skills.sh
18,592 as of 2026-11-02
Last repo commit
2026-10-16

What it includes

  • Adds package:checks as a dev dependency

    Runs dart pub add for the checks package as a dev dependency. It removes package:matcher from dev dependencies only if it was listed there explicitly.

    Runs code · Dependency setup

  • Finds files that still use expect

    Lists the grep patterns that find expect and expectLater calls, list and map expectations, matches calls and TypeMatcher having calls.

    Runs code · Discovery with grep

  • Swap the imports, rewrite each assertion

    Replaces the test import with the scaffolding and checks imports. For an incremental run it keeps the expect import until the last call is converted.

    Write · Migrate a file

  • Where a direct translation gives a wrong test

    Covers collection equality (deepEquals), reason becoming because, matches needing a RegExp, having becoming has, sync versus async throws, RegExp equality, nullable bool, map keys, extension types and JSON lookups.

    Read · Ten syntax pitfalls

  • One-to-one replacements and workarounds

    A mapping table plus workarounds for matchers with no direct equivalent. Examples are the specific error matchers, anything, the sign checks such as isPositive and the numeric range matchers.

    Read · Matcher-to-checks table

  • Rewrite custom matchers as checks extensions

    Shows how to replace custom matchers with simple, nested and asynchronous custom expectations.

    Write · Custom expectations

  • dart analyze, then dart test

    Runs static analysis and the tests, and reads the checks failure output to tell a real failure from a bad translation.

    Runs code · Verify

From the official docs

Permissions

Low risk

It rewrites assertions across your test files, and a wrong translation can make a test pass when it should not. Commit first, migrate in small steps and read the diff.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It rewrites many test files

    A migration can touch every test file. Commit first and migrate in small steps so you can review the diff.

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyNo read-only mode. The skill rewrites test files.
Talks toAdding the package runs a pub command that fetches it
Scopes
  • Edits test files and pubspec.yaml in your project

  • Runs dart pub add, grep, dart analyze and dart test

Questions

What does dart-migrate-to-checks-package do?

It makes your agent rewrite Dart tests from expect and package:matcher to package:checks. It follows a fixed workflow and a list of known traps.

How do I install it?

Use the install box at the top of this page. It lists the options for Claude Code, Codex and other tools.

Does it need an API key or an account?

No. Its SKILL.md names no API key, account or sign-in. It uses the Dart or Flutter tools already on your machine.

Can I migrate one file at a time?

Yes. SKILL.md describes an incremental migration. You keep an import of package:test/expect.dart so old expect calls still compile while you convert the rest.

What is the biggest trap?

Collections. The old expect(list, [1, 2, 3]) compared contents, but .equals in checks uses ==, so lists must use .deepEquals. SKILL.md lists nine more traps.

Is it safe to run?

It edits your test files and pubspec.yaml and runs your tests. Commit first and review the diff, because a bad translation can leave a test that passes for the wrong reason.

Information

updated Nov 2, 2026

Folder
skills/dart-migrate-to-checks-package

dart-lang/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. dart-migrate-to-checks-package SKILL.md · github.com
  2. dart-lang/skills README · github.com
  3. dart-migrate-to-checks-package on skills.sh · skills.sh
  4. dart-lang/skills · github.com

Updated Nov 2, 2026.