dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing…
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
Claude Code
$ npx -y skills add dart-lang/skills --skill dart-use-path-package --agent claude-code
Codex
$ npx skills add dart-lang/skills --skill dart-use-path-package -a codex -y
Cursor
$ npx skills add dart-lang/skills --skill dart-use-path-package -a cursor -y
Gemini CLI
$ npx skills add dart-lang/skills --skill dart-use-path-package -a gemini-cli -y
GitHub Copilot
$ npx skills add dart-lang/skills --skill dart-use-path-package -a github-copilot -y
OpenCode
$ npx skills add dart-lang/skills --skill dart-use-path-package -a opencode -y
Windsurf
$ npx skills add dart-lang/skills --skill dart-use-path-package -a windsurf -y
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: Wed, 23 Sep 2026 22:10: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/`).
`p.split(path).first` throws a `StateError` on empty lists and requires separate `.skip(1)` slicing, whereas list patterns safely check non-emptiness, match multi-segment prefixes, and optionally bind `...final rest` in a single step. When unnormalized relative prefixes like `./foo/bar` may appear, use `p.isWithin('foo', path)` (or `p.split(p.normalize(path))`).
or non-extension suffixes.
compound extensions (`.js.map`, `.tar.gz`).
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…
Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface…
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…
Define and generate mock objects for external dependencies using `package:mockito` and `build_runner`. Use when unit testing…
Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.