31 skills · 85 min
Skills
Skill 15 of 31
Rules and formatting guidelines for writing Dart /// API documentation and doc comments.
3 minutes · 598 words · 14 sections
Install
npx skills add flutter/agent-plugins --skill dart-write-documentationnpx skills add flutter/agent-plugins/plugin marketplace add flutter/agent-pluginsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
When asked to write or update documentation for Dart code, you must strictly follow these formatting rules based on the “Effective Dart: Documentation” guidelines.
_) unless explicitly instructed, as they do not appear in generated API reference sites.///: Use /// consecutive line comments for all API documentation. Never use /** ... */ block comments.///. Never output a completely empty newline (e.g., a \n without ///), as this terminates the doc comment block./// The radius of the sphere. (Not “Gets the radius…”)/// Whether the connection is active./// Initializes the database. (Not “Initialize” or “This method initializes”).@param, @return, @throws, etc.): Never use Javadoc-style tags (@param, @return, @returns, @throws, @exception, @see, @type). Instead, weave parameter names, return behavior, and exceptions into the prose.@override, etc.): Doc comments must be placed before metadata annotations.@override members if the behavior does not differ from the superclass or interface. Dartdoc automatically inherits the base documentation..new syntax (e.g., [ClassName.new]).[identifier]) for in-scope symbols: Use square brackets to link to any in-scope identifier (parameters, classes, methods, fields, and top-level functions) so dartdoc can resolve them. Never use backticks for parameters.[String.contains], not [String.contains()]).`null`, `true`, `void`). Never put keywords in square brackets (avoid [null] or [true]).@docImport directive at the top of the file (on the library; declaration) rather than adding a standard import.```dart for Dart, or ```sh for shell commands. Do not leave code blocks unlabelled, as Dartdoc will attempt to auto-detect the language and frequently guesses wrong.After writing or updating doc comments:
dart analyze to ensure all bracketed references resolve properly without triggering comment_references warnings.dart doc to verify the generated documentation renders cleanly.Bad:
/// This method fetches data.
/// @param force true to force reload.
/// @return the data
/// @throws NetworkException if host is unreachable.
Data load(bool force) { ... }Good:
/// Fetches the remote data.
///
/// If [force] is true, this bypasses the local cache and forces a
/// network request.
///
/// Throws a [NetworkException] if the host is unreachable.
Data load(bool force) { ... }Bad:
@override
/// Renders the widget to the screen.
Widget build(BuildContext context) { ... }Good:
/// Renders the widget to the screen.
@override
Widget build(BuildContext context) { ... }Bad:
/// Gets if the connection is active.
bool get isActive => _active;
/// This method initializes the connection.
void init() { ... }Good:
/// Whether the connection is active.
bool get isActive => _active;
/// Initializes the connection.
void init() { ... }Bad:
/// Creates a new user. Similar to calling [User()].
User.create() { ... }Good:
/// Creates a new user. Similar to calling [User.new].
User.create() { ... }Bad:
import 'package:http/http.dart'; // Adds unnecessary runtime dependency just for docs
/// To use this, you must pass a [Client].Good:
/// @docImport 'package:http/http.dart';
library;
/// To use this, you must pass a [Client].Rules and formatting guidelines for writing Dart /// API documentation and doc comments. Use when documenting Dart code, writing doc comments for any Dart declaration (libraries, classes, methods, variables, etc.), or when instructed to follow the Effective Dart documentation guidelines.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 17 September 2026.SKILL.md, not by matching a directory convention. 2 distinct layouts observed: .agents/agents/reidbaker-agent/skills/*/SKILL.md, skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Dart and Flutter Team, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree./flutter/agent-plugins.md, and each skill at its own .md URL.