skills/dart-doc-validation/SKILL.md
Best practices for validating Dart documentation comments. Covers using `dart doc` to catch unresolved references and macros.
npx skillsauth add kevmoo/dash_skills dart-doc-validationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when:
///) in Dart code.To find documentation issues:
Verify if the comment_references lint is enabled:
analysis_options.yamlcomment_referencesRun the documentation generator to surface warnings:
dart doc -o $(mktemp -d)warning:, unresolved doc reference,
undefined macroIn your analysis_options.yaml, enable the comment_references lint.
linter:
rules:
- comment_references
Use the dart doc command with a temporary output directory to validate
documentation comments without polluting the local project workspace.
This command parses all documentation comments and reports warnings such as:
warning: unresolved doc referencewarning: undefined macroCommand to run:
dart doc -o $(mktemp -d)
This will work on Mac and Linux.
This ensures that the generated HTML files are stored in a temporary location and don't clutter the package directory, while still surfacing all validation warnings in the terminal output.
Browsing the docs:
Our docs use features designed to be run on a web server. If you want to browse
the generated docs locally, install the dhttpd package.
pub global activate dhttpd
TMP_DIR=$(mktemp -d) && dart doc -o "$TMP_DIR" && dhttpd --path "$TMP_DIR"
(Or use another HTTP server, such as python3 -m http.server.)
[Identifier]) correctly points to an existing class, method,
property, or parameter in the current scope or imported libraries.{@macro macro_name}, ensure that the
template {@template macro_name} is defined in the same file or a file
that is imported and visible to the documentation generator.testing
Core concepts and best practices for `package:test`. Covers `test`, `group`, lifecycle methods (`setUp`, `tearDown`), and configuration (`dart_test.yaml`).
testing
Understand and improve test coverage in a Dart package. Helps agents run coverage, interpret results, and identify missed lines.
documentation
Guidelines for maintaining external Dart packages, covering versioning, publishing workflows, and pull request management. Use when updating Dart packages, preparing for a release, or managing collaborative changes in a repository.
development
Guidelines and best practices for refactoring consecutive prints, single-line string concatenations, and complex output blocks into triple-quoted multi-line string literals (''' or """) in Dart.