Token导航 LogoToken导航

Agent Skill · 前端设计

dart-api-design(dart API 设计)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

dart-api-design 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 3,094。

总安装 1,584周安装 66GitHub Stars 61下载 528核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dart-api-design(dart API 设计)
来源仓库:https://github.com/dart-lang/skills
仓库路径:skills/dart-api-design
安装命令:
npx skills add https://github.com/dart-lang/skills --skill dart-api-design
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dart-lang/skills --skill dart-api-design

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。适合梳理 endpoint、生成 OpenAPI 草稿或检查字段命名。使用时需确认真实业务语义、鉴权方式、分页和错误处理规则。涉及生成接口文档时应从现有代码或样例中提取事实,避免凭空补字段。

dart-api-design 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/dart-api-design

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dart-lang/skills --skill dart-api-design;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dart-api-design 怎么安装?

在终端执行 npx skills add https://github.com/dart-lang/skills --skill dart-api-design。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dart-api-design 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dart-api-design 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/dart-lang/skills --skill dart-api-design 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

dart-api-design 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dart-api-design 用的人多吗?

公开数据是累计安装 1,584 次,近一周安装 66 次,下载 528 次,GitHub 61 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dart-api-design 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
dart-api-design

dart API 设计 · 本页

1,58461执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Designing Effective Dart APIs

Contents

Naming Conventions

Enforce consistent, descriptive naming to leverage existing domain and core library knowledge.

  • Properties & Variables:

- Use noun phrases for non-boolean properties (e.g., pageCount, context.lineWidth). - Use non-imperative verb phrases for boolean properties (e.g., isEmpty, canClose). Prefer the "positive" name (e.g., isConnected over isNotDisconnected).

  • Methods & Functions:

- Use imperative verb phrases for side-effect-heavy operations (e.g., list.add(), window.refresh()). - Use noun phrases or non-imperative verb phrases if returning a value is the primary purpose (e.g., list.elementAt(3)). - AVOID starting method names with get. Use a getter or a descriptive verb (e.g., downloadData()). - Name methods to___() if they copy state to a new object (e.g., list.toSet()). - Name methods as___() if they return a different representation backed by the original object (e.g., table.asMap()).

  • Type Parameters: Follow standard mnemonics: E (elements), K/V (key/value), R (return type), or T/S/U (single types).

Class Modifiers & Architecture

Design for extension and encapsulate implementations using Dart 3 class modifiers. Apply modifiers to control external library access.

  • abstract: Use to define a class that requires concrete implementation of its interface. Cannot be instantiated.
  • base: Use to enforce inheritance of a class's implementation. Disallows implements outside its own library. Guarantees the base class constructor is called.
  • interface: Use to define a pure interface. Allows implements but disallows extends outside its library. Reduces the fragile base class problem.
  • final: Use to close the type hierarchy. Disallows both extends and implements outside the library. Guarantees safe incremental API changes.
  • sealed: Use to create a known, enumerable set of subtypes. Enables exhaustive switch statements over subtypes. Implicitly abstract.

*Note: Combine modifiers where appropriate (e.g., abstract interface class for a pure interface).*

Members & Encapsulation

  • Encapsulation: AVOID public fields; use getters and setters for encapsulation to control state access and modification.
  • Getters: Use getters for operations that conceptually access properties. The operation must take no arguments, return a result, have no user-visible side effects, and be idempotent.
  • Setters: Use setters for operations that conceptually change properties. The operation must take a single argument, change state, and be idempotent.

- DON'T define a setter without a corresponding getter. - DON'T specify a return type for a setter (they inherently return void).

  • Method Cascades: AVOID returning this from methods just to enable a fluent interface. Use Dart's cascade operator (..) instead.
  • Equality:

- DO override hashCode if you override ==. - AVOID defining custom equality for mutable classes. - DON'T make the parameter to == nullable (the language handles null checks automatically).

Types & Signatures

  • Type Aliases: DO use type aliases (typedef) to simplify complex function signatures. Use the modern syntax: typedef Comparison<T> = int Function(T a, T b);.
  • Inline Functions: PREFER inline function types over typedefs for simple, one-off callbacks (e.g., void Function(Event) callback).
  • Type Annotations:

- DO type annotate variables without initializers. - DO annotate return types and parameter types on non-local function declarations. - DON'T redundantly type annotate initialized local variables or inferred closure parameters.

  • Generics: Write complete generic types. AVOID incomplete generic types (e.g., use Completer<Map<String, int>>() instead of Completer<Map>()).
  • Dynamic vs. Object: AVOID using dynamic unless you explicitly want to disable static checking. Use Object? to accept any value safely.
  • Async Returns: DO use Future<void> as the return type of asynchronous members that do not produce values. AVOID using FutureOr<T> as a return type (it forces callers to check the type).

Parameters

  • Named Parameters: PREFER named parameters for functions with more than two arguments to improve call-site readability.
  • Boolean Parameters: AVOID positional boolean parameters. Use named parameters instead.

- CONSIDER omitting the 'is/can/has' prefix from named boolean parameters (e.g., use Isolate.spawn(..., paused: true) instead of isPaused: true).

  • Optional Positional Parameters: AVOID optional positional parameters if the user may want to omit earlier parameters. Use named parameters instead.
  • Ranges: DO use inclusive start and exclusive end parameters to accept a range (e.g., substring(1, 3)).

Workflows

Task Progress: API Design & Implementation

Copy this checklist to track progress when designing a new Dart class or library API.

  • Define Class Modifiers:

- If defining a contract without implementation -> abstract interface class. - If providing implementation that must be inherited -> base class. - If closing the hierarchy to external extension/implementation -> final class. - If defining an enumerable set of states for exhaustive switching -> sealed class.

  • Encapsulate State:

- Make internal fields private (_fieldName). - Expose state via getters. - Expose mutations via setters (ensure a corresponding getter exists).

  • Refine Signatures:

- Convert positional parameters to named parameters if > 2 arguments. - Convert positional booleans to named booleans (strip is/can/has prefixes). - Extract complex function parameters into typedef aliases.

  • Verify Types:

- Ensure no implicit dynamic types exist in public signatures. - Replace FutureOr<T> return types with Future<T>. - Ensure async void methods return Future<void>.

  • Run Validator -> Review Errors -> Fix:

- Run dart analyze to catch missing annotations, unhandled sealed class switch cases, and linter violations. Fix all warnings before finalizing the API.

平台分布

Codex

35.19%
按下载量换算186

Claude

29.45%
按下载量换算155

Cursor

21.04%
按下载量换算111

Gemini CLI

9.09%
按下载量换算48

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dart-lang/skills --skill dart-api-design 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills