Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

effective-dart有效飞镖

Agent Skill

effective-dart 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

419

周安装

18

GitHub Stars

537

下载量

147
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/evanca/flutter-ai-rules --skill effective-dart

简介

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装方式:github,安装命令:npx skills add https://github.com/evanca/flutter-ai-rules --skill effective-dart。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Effective Dart Skill

This skill defines how to write idiomatic, high-quality Dart and Flutter code following Effective Dart guidelines.


1. Naming Conventions

KindConventionExample
Classes, enums, typedefs, type parameters, extensionsUpperCamelCaseMyWidget, UserState
Packages, directories, source fileslowercase_with_underscoresuser_profile.dart
Import prefixeslowercase_with_underscoresimport '...' as my_prefix;
Variables, parameters, named parameters, functionslowerCamelCaseuserName, fetchData()
  • Capitalize acronyms and abbreviations longer than two letters like words: HttpRequest, not HTTPRequest.
  • Avoid abbreviations unless the abbreviation is more common than the full term.
  • Prefer putting the most descriptive noun last in names.
  • Use terms consistently throughout your code.
  • Follow mnemonic conventions for type parameters: E (element), K/V (key/value), T/S/U (generic types).
  • Consider making code read like a sentence when designing APIs.
  • Prefer a noun phrase for non-boolean properties or variables.
  • Prefer a non-imperative verb phrase for boolean properties or variables; prefer the positive form.
  • Consider omitting the verb for named boolean parameters.

2. Types and Functions

  • Use class modifiers (final, sealed, interface, base, mixin) to control whether a class can be extended or implemented.
  • Type annotate variables without initializers.
  • Type annotate fields and top-level variables if the type isn't obvious.
  • Annotate return types on function declarations.
  • Annotate parameter types on function declarations.
  • Write type arguments on generic invocations that aren't inferred.
  • Annotate with dynamic instead of letting inference fail.
  • Use Future<void> as the return type of async members that do not produce values.
  • Use getters for operations that conceptually access properties.
  • Use setters for operations that conceptually change properties.
  • Use a function declaration to bind a function to a name.
  • Use inclusive start and exclusive end parameters to accept a range.
// Prefer: explicit class modifier
final class AppConfig {
  final String apiUrl;
  final int timeout;
  const AppConfig({required this.apiUrl, required this.timeout});
}

// Prefer: sealed for exhaustive pattern matching
sealed class Result<T> {}
class Success<T> extends Result<T> { final T value; Success(this.value); }
class Failure<T> extends Result<T> { final Exception error; Failure(this.error); }

3. Style

dart format .
  • Format code with dart format — don't manually format.
  • Use curly braces for all flow control statements.
  • Prefer final over var when variable values won't change.
  • Use const for compile-time constants.
  • Prefer lines 80 characters or fewer for readability.

4. Imports and Files

  • Don't import libraries inside the src directory of another package.
  • Don't allow import paths to reach into or out of lib.
  • Prefer relative import paths within a package.
  • Don't use /lib/ or ../ in import paths.
  • Consider writing a library-level doc comment for library files.

5. Structure

  • Keep files focused on a single responsibility.
  • Limit file length to maintain readability.
  • Group related functionality together.
  • Prefer making fields and top-level variables final.
  • Consider making constructors const if the class supports it.
  • Prefer making declarations private — only expose what's necessary.

6. Usage Patterns

// Adjacent string concatenation (not +)
final greeting = 'Hello, '
    'world!';

// Collection literals
final list = [1, 2, 3];
final map = {'key': 'value'};

// Initializing formals
class Point {
  final double x, y;
  Point(this.x, this.y);
}

// Empty constructor body
class Empty {
  Empty();  // not Empty() {}
}

// rethrow to preserve stack trace
try {
  doSomething();
} catch (e) {
  log(e);
  rethrow;
}
  • Use whereType<T>() to filter a collection by type.
  • Follow a consistent rule for var and final on local variables.
  • Initialize fields at their declaration when possible.
  • Override hashCode if you override ==; ensure == obeys mathematical equality rules.
  • Prefer specific exception handling: use on SomeException catch (e) instead of broad catch (e) or .catchError handlers.

7. Documentation

/// Returns the sum of [a] and [b].
///
/// Throws [ArgumentError] if either value is negative.
int add(int a, int b) { ... }
  • Format comments like sentences (capitalize, end with period).
  • Use /// doc comments — not /* */ block comments — for types and members.
  • Prefer writing doc comments for public APIs; consider them for private APIs too.
  • Start doc comments with a single-sentence summary, separated into its own paragraph.
  • Avoid redundancy with the surrounding context.
  • Start function/method comments with a third-person verb if the main purpose is a side effect.
  • Start with a noun or non-imperative verb phrase if returning a value is the primary purpose.
  • Start boolean variable/property comments with "Whether" followed by a noun or gerund phrase.
  • Use [identifier] in doc comments to refer to in-scope identifiers.
  • Use prose to explain parameters, return values, and exceptions (e.g., "The [param]", "Returns", "Throws" sections).
  • Put doc comments before metadata annotations.
  • Document why code exists or how it should be used, not just what it does.

8. Testing Patterns

  • Write unit tests for business logic, using group and descriptive test names:
import 'package:test/test.dart';

void main() {
  group('CartService', () {
    late CartService cart;

    setUp(() => cart = CartService());

    test('addItem increases item count', () {
      cart.addItem(Product(id: '1', name: 'Widget', price: 9.99));
      expect(cart.items, hasLength(1));
    });

    test('removeItem decreases total price', () {
      final product = Product(id: '1', name: 'Widget', price: 9.99);
      cart.addItem(product);
      cart.removeItem(product.id);
      expect(cart.totalPrice, equals(0.0));
    });
  });
}
  • Write widget tests using testWidgets and WidgetTester:
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets('LoginButton shows loading indicator when tapped',
      (WidgetTester tester) async {
    await tester.pumpWidget(const MaterialApp(home: LoginScreen()));
    await tester.tap(find.byType(ElevatedButton));
    await tester.pump();
    expect(find.byType(CircularProgressIndicator), findsOneWidget);
  });
}

9. Code Review Workflow

When reviewing Dart code for Effective Dart compliance, the agent should check:

  1. Naming — verify all identifiers follow the conventions in Section 1.
  2. Type annotations — confirm public API parameters, return types, and uninitialized variables are annotated.
  3. Class modifiers — verify final, sealed, or interface is used where appropriate.
  4. Documentation — confirm all public members have /// doc comments with a single-sentence summary.
  5. Style — run dart format --output=none --set-exit-if-changed. to verify formatting.
  6. Analysis — run dart analyze and confirm zero issues.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.73%
按下载量换算53

Claude

30.89%
按下载量换算45

Cursor

20.01%
按下载量换算29

Gemini CLI

10.44%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills