dart-matcher-best-practices — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dart-matcher-best-practices (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill when:
expect and package:matcher.To find candidates for improving matcher usage, search for suboptimal patterns:
Search for length checks that should use hasLength:
expect\([^,]+.length,\s*Search for checks on boolean properties that have specific matchers:
expect\([^,]+.isEmpty,\s*(true|equals\(true\))expect\([^,]+.isNotEmpty,\s*(true|equals\(true\))expect\([^,]+.contains\(.*\),\s*(true|equals\(true\))Search for manual map lookups instead of containsPair:
expect\([^,]+\[.*\],\s*hasLength, contains, isEmpty, unorderedEquals, containsPair)expect(list, hasLength(n)) over expect(list.length, n).expect(list, isEmpty) over expect(list.isEmpty, true).expect(list, isNotEmpty) over expect(list.isNotEmpty, true).expect(list.contains(item), true).expect(list, containsAll(items)).expect(map[key], value) orexpect(map.containsKey(key), true).
isA<T> and TypeMatcher<T>)expect(obj, isA<Type>()).TypeMatcher<Type>()..having().const isMyType = TypeMatcher<MyType>();.having() works here too, but the resulting matcher is not const.having)Use .having() on isA<T>() or other TypeMatchers to check properties.
(e) => e.message) instead of generic ones like p0 to improve readability.
expect(person, isA<Person>()
.having((p) => p.name, 'name', 'Alice')
.having((p) => p.age, 'age', greaterThan(18)));This provides detailed failure messages indicating exactly which property failed.
the test continues.
await expectLater(future, completion(equals(42))).await expectLater(future, throwsA(isA<StateError>())).expect(() => function(), throwsA(isA<ArgumentError>())) (synchronousfunction throwing is fine with expect).
expectLaterUse await expectLater(...) when testing async behavior to ensure proper sequencing.
// GOOD: Waits for future to complete before checking side effects
await expectLater(future, completion(equals(42)));
expect(sideEffectState, equals('done'));
// BAD: Side effect check might run before future completes
expect(future, completion(equals(42)));
expect(sideEffectState, equals('done')); // Race condition!if statements or for loops forassertions; let matchers handle it.
containsPair for maps instead of checking keys manually).
concepts for structuring tests, lifecycles, and configuration.
[dart-test-fundamentals]: https://github.com/kevmoo/dash_skills/blob/main/skills/dart-test-fundamentals/SKILL.md
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.