做什么
撰写 Dart /// API 文件和 doc 注释的规则和格式化准则
技能库 智客分类:文档办公 dart-write-documentation
撰写 Dart /// API 文档和 doc 注释的规则和格式化准则. 用于记录 Dart 代码,为任何 Dart 声明(图书馆,类,方法,变量等)编写 doc 注释,或者被指示遵循有效 Dart 文档指南.
官方网址:skills.sh
先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。
撰写 Dart /// API 文件和 doc 注释的规则和格式化准则
记录 Dart 代码,为任何 Dart 声明( 图书馆、 类、 方法、 变量等) 编写 doc 注释, 或被指示遵循 有效 Dart 文档指南
按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Writing Dart API Documentation、Contents、1. Scope and Structure、2. Tone and Openers、3. Strict Anti-Patterns (Banned)、4. Technical Placement & Resolution。 其中含规范建议的小节:输入输出示例。
文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。
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 DocumentationContents1. Scope and Structure2. Tone and Openers3. Strict Anti-Patterns (Banned)4. Technical Placement & Resolution5. Linking and Markdown6. VerificationExamples1. Banned Tags vs. Prose2. The Annotation Placement Trap3. Openers and Tone
来源分类:skills.sh agent-skill
namedart-write-documentationdescription具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗
先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。
复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。
把 Agent Skill「dart-write-documentation」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-aea8832600d69edb-Dart-%E5%86%99%E5%85%A5%E6%96%87%E6%A1%A3.html 请存为 .cursor/skills/dart-write-documentation/SKILL.md 或 .claude/skills/dart-write-documentation/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。
npx skills add 'https://github.com/dart-lang/skills' --list
npx skills add 'https://github.com/dart-lang/skills' --skill 'dart-write-documentation'
CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。
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].
文档办公
为结构化的代理内存和可堆肥技能所打入的知识图. 在创建/征服实体(Person, project, Task, Evention, Document)时使用,链接相关对象,强制约束,规划多步动作作为图变,或技能需要共享状态时使用. 触发到"记住","我知道什么","链接X到Y",…
文档办公
使用纳米-pdf CLI编辑带有自然语言指令的PDF.
文档办公
创建,检查,并编辑有可靠样式的Microsoft Word文档和DOCX文件,编号,跟踪更改,表格,章节,并进行相容性检查. 当 (1) 任务涉及 Word 或 ".docx " 时使用; (2) 文件包括跟踪的更改,评论,字段,表格,模板,或页面布局限制; (3) 文档必须在不…
文档办公
通过 Maton 网关调用第三方 API, 它为用户已经连接的应用程序注入证书 。 当用户命名一个连接的应用程序和其中的具体行动时使用此技能——读取一个邮箱,查询一个CMM,归档一个问题,更新一个电子表格,通过一个连接的搜索或刮取提供者运行一个查询. 每一次通话都到用户连接的应用…