
Dart Matcher Best Practices
This one helps you write cleaner test assertions in Dart by moving from manual checks to proper matchers from package:matcher. It shows you how to replace things like expect(list.length, 3) with expect(list, hasLength(3)), or manual map lookups with containsPair. The regex patterns are handy for finding code to improve in your codebase. The having() examples for chaining property checks are solid, and the async section clears up a common gotcha with expectLater timing. If you've got tests that feel clunky or produce confusing failure messages, this gives you the patterns to fix them.
- skills.sh installs
- 269
- GitHub stars
- 148
- last updated
- Aug 21, 2026
Install
$ npx -y skills add kevmoo/dash_skills --skill dart-matcher-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Dart Matcher Best Practices
When to use this skill
Use this skill when:
- Writing assertions using
expectandpackage:matcher. - Migrating legacy manual checks to cleaner matchers.
- Debugging confusing test failures.
When NOT to use (Abstention Guardrails)
Do NOT apply this skill or refactor assertions when:
- Non-Collection Properties: The property happens to be named
.lengthbut belongs to a non-collection class (e.g. geometric scalar magnitude on aVector, duration on a buffer, or line segment distance).hasLength(n)expects aninton anIterable,Map, orString. - Custom Domain Booleans: The boolean check tests an arbitrary domain
property (e.g.
expect(switch.isEnabled, isTrue)). Do not invent non-existent matchers. - Alternative Assertion Frameworks: The package has adopted
package:checks(check(x)...). Do not revertchecksback topackage:matcher. - Already Idiomatic Assertions: Tests already use declarative matchers
(
hasLength,isEmpty,isNotEmpty,contains,containsPair,isA,throwsA). Abstain and make zero modifications.
Discovery
Sponsors
Promote your product hereReach 125k+ visitors monthlyPromote your product hereReach 125k+ visitors monthly
Agent CaffeineSponsoredClose your lid, come back to finished work
SnugSponsoredThe clipboard manager for the AI eraPromote your product hereReach 125k+ visitors monthly
WaxSponsoredBlock anything with supervision, without erasing your iPhonePromote your product hereReach 125k+ visitors monthly
knobsSponsoredSee your site on any phone, any day, in any language
Details
- Repository
- github.com/kevmoo/dash_skills
- First seen
- Jun 3, 2026
More from kevmoo/dash_skills
All 8Recommended
1
cavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
3
improveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5
karpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6
find-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs