Skip to main content
skill CX Codex

dart-doc-validation — Claude Code skill: Dart doc comment validation

The dart-doc-validation skill for Claude Code validates Dart documentation comments with dart doc and the comment_references lint, catching broken links.

Apache-2.0 291 installs ★ 149 updated 2026-10-17

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add kevmoo/dash_skills --skill dart-doc-validation -a claude-code
Open on GitHub

What dart-doc-validation does

The skill sets up documentation comment validation in Dart projects. The agent runs dart doc -o $(mktemp -d) to surface unresolved references and undefined macros, enables the comment_references lint in analysis_options.yaml, and explains how to fix common warnings.

Inside: a command for local validation without cluttering the workspace, instructions for setting up a local HTTP server via dhttpd to browse generated pages, and an abstention rule — the agent skips pseudo-code, generated files like *.g.dart, and external Markdown links.

Suited for preparing a package for pub.dev publication and keeping documentation clean. No FFmpeg, Python, or third-party libraries — works with Dart SDK built-ins.

What it helps with

  • validate Dart documentation for broken links before publishing to pub.dev
  • enable comment_references lint in analysis_options.yaml
  • run dart doc locally without cluttering the project directory
  • fix unresolved doc reference and undefined macro warnings
  • set up a local HTTP server to browse generated documentation

Example prompts for the agent

  • Enable the comment_references lint in analysis_options.yaml and validate the docs with dart doc
  • Run Dart doc comment validation without saving files to the project
  • Show me how to fix the unresolved doc reference warning in src/models.dart

How to install dart-doc-validation

1Skills CLI (Vercel)

npx skills add kevmoo/dash_skills --skill dart-doc-validation -a claude-code

2Manually: put the files in place

~/.claude/skills/dart-doc-validation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dart-doc-validation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dart-doc-validation

How to install dart-doc-validation in Claude Code?

Run npx skills add kevmoo/dash_skills --skill dart-doc-validation -a claude-code, then check ~/.claude/skills/dart-doc-validation/SKILL.md.

What does dart-doc-validation do?

The skill teaches the agent to validate Dart documentation comments: run dart doc to find broken links and macros, enable the comment_references lint, and fix common warnings.

When does dart-doc-validation abstain?

The skill skips pseudo-code, generated files (*.g.dart, *.freezed.dart), external Markdown links, and code fences in languages other than Dart (YAML, JSON, Bash).

Source text

SKILL.md · Apache-2.0
---
name: dart-doc-validation
description: |-
  Best practices for validating Dart documentation comments.
  Covers using `dart doc` to catch unresolved references and macros.
license: Apache-2.0
key_features:
  - Documentation comment validation
  - Unresolved reference checking
  - Dart doc macro verification
---

# Dart Doc Validation

## 1. When to use this skill

Use this skill when:

- Writing or updating documentation comments (`///`) in Dart code.
- Checking for broken documentation links, references, or macros.
- Preparing a package for publishing to pub.dev.

### When NOT to use (Abstention Guardrails)

Do NOT apply this skill or refactor doc comments when:

- **Illustrative Pseudo-Code & Non-Dart Code Fences**: Comments contain
  pseudo-code, non-Dart language identifiers (e.g. ``yaml`, ``json`, ````bash`,
  ````text`), or abstract conceptual fragments intentionally not designed to
  compile as valid Dart.
- **Generated Code**: Files generated by tools (e.g. `*.g.dart`, `*.mocks.dart`,
  `*.freezed.dart`) where comments are synthesized.
- **External Markdown Hyperlinks**: Text in square brackets followed by a link
  target (e.g. `[External Guide](https://...)`), which is standard Markdown
  hyperlink syntax rather than an unresolved Dart doc reference.

## Discovery

To find documentation issues:

### Missing Lint

Verify if the `comment_references` lint is enabled:

- **Target**: `analysis_options.yaml`
- **Search Query**: `comment_references`

### Automated Validation

Run the documentation generator to surface warnings:

- **Command**: `dart doc -o $(mktemp -d)`
- **Keywords to look for**: `warning:`, `unresolved doc reference`,
  `undefined macro`

## 2. Best Practices

### Enable the doc validation lint

In your `analysis_options.yaml`, enable the `comment_references` lint.

```yaml
linter:
  rules:
    - comment_references
```

### Validating Documentation Locally

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 reference`
- `warning: undefined macro`

**Command to run:**

```bash
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.

```shell
dart install 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`.)_

### Fixing Common Warnings

- **Unresolved doc reference**: Ensure that any identifier wrapped in square
  brackets (`[Identifier]`) correctly points to an existing class, method,
  property, or parameter in the current scope or imported libraries.
- **Undefined macro**: If using `{@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.

© kevmoo · Apache-2.0 · kevmoo/dash_skills

Similar skills

All skills for Writing and docs →

From the same set9

dart-best-practices dart-best-practices enforces idiomatic Dart code style and formatting during generation and review. Focuses on clean multi-line string literals and strict 80-character line wrapping. CX Codex +1 847installs dart-test-fundamentals dart-test-fundamentals — a skill for Claude Code and Codex that enforces best practices for Dart's package:test. It structures test suites, configures dart_test.yaml, and handles teardowns. CX Codex +1 455installs dart-modern-features dart-modern-features guides coding agents on modern Dart 3.0 to 3.10 features. It helps adopt records, extension types, class modifiers, and null-aware elements during refactoring. CX Codex +1 370installs dart-package-maintenance dart-package-maintenance — a skill for maintaining Dart packages per Dart team standards: manage semantic versioning, keep CHANGELOG in sync, and prepare releases. Essential if you publish packages to pub.dev. CX Codex +1 285installs dart-matcher-best-practices dart-matcher-best-practices is a Claude Code skill for writing Dart tests with expect and package:matcher. It steps in when adding assertions, cleaning up manual checks, or investigating confusing test failures. CX Codex +1 269installs dart-test-coverage Run Dart test coverage, inspect missed lines, and identify code that needs tests. Useful when checking which parts of a package remain untested. CX Codex +1 163installs dart-long-lines dart-long-lines is a Claude Code skill for keeping Dart lines within 80 columns. It applies while writing code or fixing the lines_longer_than_80_chars lint. CX Codex +1 150installs dart-multiline-strings dart-multiline-strings — a skill for Claude Code, Codex, Cursor and other agents that teaches rewriting consecutive print() calls and string concatenations into triple-quoted literals (''' or """). CX Codex +1 116installs

Project sponsors

Companies that keep this analytics open