dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains…
Cross-platform file and directory path manipulation, segment splitting, extension extraction, and context conversion using `package:path` and `package:file`. Use when writing, inspecting, joining, splitting, or refactoring file paths, directory names, or extensions, or replacing
$ npx -y skills add dart-lang/skills --skill dart-use-path-package --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dart-use-path-packageContext preview
The summary Claude sees to decide when to auto-load this skill.
Cross-platform file and directory path manipulation, segment splitting, extension extraction, and context conversion using `package:path` and `package:file`. Use when writing, inspecting, joining, splitting, or refactoring file paths, directory names, or extensions, or replacing
name: dart-use-path-package
description: >-
Cross-platform file and directory path manipulation, segment splitting, extension extraction, and context conversion using `package:path` and `package:file`. Use when writing, inspecting, joining, splitting, or refactoring file paths, directory names, or extensions, or replacing raw string path operations (`.split('/')`, `'$dir/$file'`, `.endsWith('.ext')`, `.replaceAll('\\', '/')`). Don't use for HTTP network URI routing, database query strings, or non-path string processing.
metadata:
model: models/gemini-3.1-pro-preview
last_modified: Sun, 06 Sep 2026 07:14:00 GMT---
**Rule**: Always decompose paths into segments using `p.split(path)` before inspecting directory hierarchy or segment names, and always join path components using `p.join(...)`.
---
slashes (`//`) when `$dir` ends with a trailing separator.
false positives on partial substring names (e.g. `barfoo/`).
as `./foo/`.
or non-extension suffixes.
compound extensions (`.js.map`, `.tar.gz`).
context with POSIX or URL targets.
percent-encoding (e.g. `%20` for spaces).
`String canonicalDirName(Directory d) => p.basename(p.normalize(d.absolute.path));`
Agent skills for Dart, maintained by the Dart team. A collection of skills providing tailored instructions for common Dart development workflows.
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains…
Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface (CLI) applications. Use when…
Collect coverage using the coverage packge and create an LCOV report
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing classes that depend on complex…
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.