dart-write-documentation
This skill guides the agent to write Dart API documentation following Effective Dart conventions, using /// comments with proper structure, tone, and linking…
Identity proven by GitHub's verified organisation badge (flutter, google)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- BSD-3-Clause (permissive)
- Pin
- 0ef3972pinned Oct 9, 2026
- Context cost
- about 1,600 tokenswhen the skill loads
- GitHub stars
- 3,039on flutter/agent-plugins
- Scripts
- None found
What it does
“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.”
Generated summary from the skill's own text
This skill guides the agent to write Dart API documentation following Effective Dart conventions, using /// comments with proper structure, tone, and linking syntax. It enforces rules for formatting doc comments on public declarations, prohibits Javadoc-style tags in favor of prose, and ensures all symbol references resolve correctly.
When to use it
- Documenting public Dart classes, methods, variables, and other declarations
- Writing or updating /// doc comments to follow Effective Dart standards
- Ensuring proper linking syntax and Markdown formatting in Dart API docs
- Adding documentation to Dart libraries before generating API reference sites
When not to
- Documenting private Dart members starting with underscore
- Projects that require Javadoc or TSDoc-style parameter and return tags
- Non-Dart codebases or documentation in other languages
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add flutter/agent-plugins --skill dart-write-documentationInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install flutter/agent-plugins dart-write-documentation@0ef3972f93e2baa4156ba1cbb1e515cd53079c68Installs the commit we checked (0ef3972).
Copy by hand
Download the folder at 0ef3972 and put it in .claude/skills/dart-write-documentation for Claude Code and in .agents/skills/dart-write-documentation for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install chrome-devtools-mcp@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install alloydb-omni@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install bigquery-data-analytics@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "dart-write-documentation" by Google. Source, pinned to commit 0ef3972f93e2baa4156ba1cbb1e515cd53079c68: https://github.com/flutter/agent-plugins/tree/0ef3972f93e2baa4156ba1cbb1e515cd53079c68/skills/dart-write-documentation 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/dart-write-documentation/ for Claude Code and .agents/skills/dart-write-documentation/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/google/dart-write-documentation
SKILL.md at the pin
---
name: dart-write-documentation
description: "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."
---
# Writing Dart API Documentation
## Contents
* [1. Scope and Structure](#1-scope-and-structure)
* [2. Tone and Openers](#2-tone-and-openers)
* [3. Strict Anti-Patterns (Banned)](#3-strict-anti-patterns-banned)
* [4. Technical Placement & Resolution](#4-technical-placement--resolution)
* [5. Linking and Markdown](#5-linking-and-markdown)
* [6. Verification](#6-verification)
* [Examples](#examples)
When asked to write or update documentation for Dart code, you must strictly follow these formatting rules based on the "Effective Dart: Documentation" guidelines.
## 1. Scope and Structure
* **Target Public APIs:** Focus your documentation efforts on public declarations. Do not document private members (those starting with an underscore `_`) unless explicitly instructed, as they do not appear in generated API reference sites.
* **Always use `///`:** Use `///` consecutive line comments for all API documentation. Never use `/** ... */` block comments.
* **Proper Sentences:** Format all comments like proper sentences. Capitalize the first word (unless it's a lowercase identifier) and end with a period.
* **The First Paragraph:** The first paragraph of a doc comment must be a single, concise sentence that summarizes the element. End it with a period. Dartdoc extracts this verbatim for list views.
* **Separation:** Always separate the first sentence summary from the rest of the documentation with a blank line containing `///`. Never output a completely empty newline (e.g., a `\n` without `///`), as this terminates the doc comment block.
## 2. Tone and Openers
* **Noun phrases for properties:** Start descriptions of variables, getters, or setters with a noun phrase.
`/// The radius of the sphere.` (Not "Gets the radius...")
* **"Whether" for booleans:** Start documentation for boolean properties with "Whether".
`/// Whether the connection is active.`
* **Third-person verbs for methods:** Start descriptions of methods or functions with a third-person verb that describes what it does.
`/// Initializes the database.` (Not "Initialize" or "This method initializes").
* **Avoid redundancy:** Do not restate the signature or the element name. Do not say "This class is a..." or "The foo method does...".
## 3. Strict Anti-Patterns (Banned)
* **No Javadoc/TSDoc Tags (`@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.
## 4. Technical Placement & Resolution
* **Annotations (`@override`, etc.):** Doc comments must be placed before metadata annotations.
* **Inherited Documentation:** Avoid duplicating doc comments on `@override` members if the behavior does not differ from the superclass or interface. Dartdoc automatically inherits the base documentation.
* **Getter/Setter Pairs:** If a property has both a getter and a setter, place the documentation only on the getter. Tooling will emit a warning if both are documented.
* **Default Constructors:** To link to a default, unnamed constructor in doc comments, you must use the `.new` syntax (e.g., `[ClassName.new]`).
## 5. Linking and Markdown
* **Square brackets (`[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.
* **No parentheses in method links:** Avoid parentheses in links (e.g., use `[String.contains]`, not `[String.contains()]`).
* **Backticks for keywords & literals:** Use backticks for keywords, literals, and arbitrary expressions (e.g. `` `null` ``, `` `true` ``, `` `void` ``). Never put keywords in square brackets (avoid `[null]` or `[true]`).
* **Out-of-Scope Links:** If you need to link to a symbol that is not imported by the current library, use the `@docImport` directive at the top of the file (on the `library;` declaration) rather than adding a standard `import`.
* **Code Blocks:** For code samples, always label the language fence. Use ```` ```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.
* **Formatting:** Use standard Markdown (bold, lists, etc.) after the first paragraph to fully explain edge cases, exceptions thrown, and internal behavior the caller cannot see.
## 6. Verification
After writing or updating doc comments:
1. Run `dart analyze` to ensure all bracketed references resolve properly without triggering `comment_references` warnings.
2. (Optional) Run `dart doc` to verify the generated documentation renders cleanly.
## Examples
### 1. Banned Tags vs. Prose
**Bad:**
```dart
/// This method fetches data.
/// @param force true to force reload.
/// @return the data
/// @throws NetworkException if host is unreachable.
Data load(bool force) { ... }
```
**Good:**
```dart
/// 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) { ... }
```
### 2. The Annotation Placement Trap
**Bad:**
```dart
@override
/// Renders the widget to the screen.
Widget build(BuildContext context) { ... }
```
**Good:**
```dart
/// Renders the widget to the screen.
@override
Widget build(BuildContext context) { ... }
```
### 3. Openers and Tone
**Bad:**
```dart
/// Gets if the connection is active.
bool get isActive => _active;
/// This method initializes the connection.
void init() { ... }
```
**Good:**
```dart
/// Whether the connection is active.
bool get isActive => _active;
/// Initializes the connection.
void init() { ... }
```
### 4. Constructor Linking
**Bad:**
```dart
/// Creates a new user. Similar to calling [User()].
User.create() { ... }
```
**Good:**
```dart
/// Creates a new user. Similar to calling [User.new].
User.create() { ... }
```
### 5. Out-of-Scope Links (@docImport)
**Bad:**
```dart
import 'package:http/http.dart'; // Adds unnecessary runtime dependency just for docs
/// To use this, you must pass a [Client].
```
**Good:**
```dart
/// @docImport 'package:http/http.dart';
library;
/// To use this, you must pass a [Client].
```
From flutter/agent-plugins at 0ef3972, shown as plain text under its license: BSD-3-Clause (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 0ef3972Files
- SKILL.md6.7 KB · 0629abbb9e0c
1 file, 6.7 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 0ef3972More from Google
skill-creator
This skill guides agents through creating new skills that extend Gemini CLI with specialized knowledge, workflows, and tool integrations.
Contains scripts
Gemini CLI · about 5K tokens · pinned 6 days ago
chrome-devtools-cli
This skill enables agents to automate browser interactions and inspect web pages using Chrome DevTools via command-line interface.
Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago
cloud-run-basics
Deploys and manages Google Cloud Run services, jobs, and worker pools for running containerized applications or source code.
Claude Code, Codex, Cursor +4 · about 3.9K tokens · pinned 6 days ago
retail-virtual-tryon
Creates virtual try-on agents on Google Cloud using Gemini image models and Veo video generation, supporting static image try-ons and catwalk animations.
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.3K tokens · pinned 6 days ago
site-md
This skill analyzes project briefs and generates a .stitch/SITE.md constitution file that documents the project's identity, visual direction, architecture…
Claude Code, Codex, Cursor +4 · about 730 tokens · pinned 6 days ago
stitch::code-to-design
This skill converts existing frontend code (React, Vue, Angular, etc.) into a Stitch Design by extracting HTML, analyzing design systems, and uploading both…
Claude Code, Codex, Cursor +4 · about 760 tokens · pinned 6 days ago
Related in Docs and writing
n8n-docs-assistant
This skill answers questions about n8n configuration, setup, credentials, nodes, and troubleshooting by retrieving information from current n8n documentation.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 450 tokens · pinned 6 days ago
algodocs-automation
This skill automates Algodocs document processing tasks through Composio's toolkit via the Rube MCP server.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
remotion-docs
This skill enables agents to search and retrieve Remotion documentation via the Algolia API and fetch pages as Markdown.
by RemotionOfficial publisher
Claude Code, Codex, Cursor +3 · about 320 tokens · pinned 6 days ago
remotion-docs
This skill searches the Remotion documentation using the Algolia API and retrieves documentation pages as Markdown.
by RemotionOfficial publisher
Claude Code, Codex, Cursor +3 · about 320 tokens · pinned 6 days ago
receipts
This skill generates a personal Claude Code usage report from local session transcripts stored in ~/.claude/projects, mining activity across projects without…
by AnthropicOfficial publisher
Contains scripts
Claude Code · about 4.1K tokens · pinned 6 days ago
solo
This skill enables an agent to work through a single difficult mathematics problem independently within one session.
by AnthropicOfficial publisher
Claude Code · about 1.4K tokens · pinned 6 days ago
Open roles at Google
No open roles at Google on the Agent Native jobs board right now.
Browse the jobs board