Agent skill

Effective Dart

by evanca in evanca/flutter-ai-rules

A skill your agent uses when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.

MITAuto-check passedDevelopment

Install Effective Dart

skills CLI
$ npx skills add evanca/flutter-ai-rules --skill effective-dart -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install evanca/flutter-ai-rules effective-dart --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/effective-dart .claude/skills/effective-dart && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
effective-dart
GitHub stars
650
Token cost
~2k tokens
SKILL.md length
733 words
Files
1
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.

  • Works in 9 steps: Naming Conventions → Types and Functions → Style → …
  • Writing Dart code
  • SKILL.md covers 1. Naming Conventions, 2. Types and Functions, 3. Style and 4. Imports and Files, plus 6 more sections
  • Calls dart

What it does

Effective Dart is an agent skill from evanca/flutter-ai-rules. Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Cross-platform mobile apps and Refactoring. It works with Dart. The repository describes itself as: Flutter AI Skills and Rules for Claude, Codex, Cursor, and Other AI-Powered IDEs. The licence is MIT.

When your agent uses it

  • Writing Dart code
  • Reviewing for style
  • Refactoring naming
  • Adding doc comments

Example prompts

  • “/effective-dart”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Naming Conventions
  2. Types and Functions
  3. Style
  4. Imports and Files
  5. Structure
  6. Usage Patterns
  7. Documentation
  8. Testing Patterns
  9. Code Review Workflow

What it can do on your machine

Read from SKILL.md and the folder at commit 7b9cce2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dart

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • dart.dev
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Effective Dart loads about 2k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 733 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from evanca/flutter-ai-rules at commit 7b9cce2, republished under its MIT licence (© evanca). 733 words, ~1,993 tokens.

Download SKILL.mdSave it as .claude/skills/effective-dart/SKILL.md (or your agent's skills folder).
name
effective-dart
description
Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.
license
MIT

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.
  • Avoid starting a function or method name with get; prefer removing get and using a getter when the API conceptually exposes a property.

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.
dart
// 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

bash
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.

Show full SKILL.md (312 more words)Show less

6. Usage Patterns

dart
// 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

dart
/// 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:
dart
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:
dart
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

© evanca, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/effective-dart of evanca/flutter-ai-rules.

Open the folder on GitHubat commit 7b9cce2

Compare with similar skills

Effective Dart next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Effective Dart compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Effective Dart this skillevanca/flutter-ai-rules650—~2kAutomated safety check: PassMIT
Code Guidelinesgetsentry/sentry-dart873—~2.2kAutomated safety check: PassMIT
Squadron Workerd-markey/squadron138—~1.6kAutomated safety check: PassMIT
Dart Multiline Stringskevmoo/dash_skills147—~1.5kAutomated safety check: PassApache-2.0
Liquid Glass Widgetssdegenaar/liquid_glass_widgets720—~4.1kAutomated safety check: PassMIT
Test Guidelinesgetsentry/sentry-dart873—~3.1kAutomated safety check: PassMIT

Similar skills

  • Code Guidelines

    getsentry/sentry-dart

    Official

    Enforce Sentry Dart/Flutter SDK code guidelines for implementation, refactoring, and review.

    873 GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Squadron Worker

    d-markey/squadron

    A skill your agent uses when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadronbuilder annotations (@SquadronService, @SquadronMethod) for…

    138 GitHub stars~1.6k tokensUpdated 16 days ago
    MobileAuto-check passed
  • Dart Multiline Strings

    kevmoo/dash_skills

    Guidelines and best practices for refactoring consecutive prints, single-line string concatenations, and complex output blocks into triple-quoted multi-line string literals (''' or """) in Dart.

    147 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Liquid Glass Widgets

    sdegenaar/liquid_glass_widgets

    Mastery guide and architectural rules for liquidglasswidgets.

    720 GitHub stars~4.1k tokensUpdated yesterday
    MobileAuto-check passed
  • Test Guidelines

    getsentry/sentry-dart

    Official

    Enforce Sentry Dart/Flutter SDK test conventions for naming, structure, and fixtures.

    873 GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Code Guidelines

    getsentry/sentry-react-native

    Official

    Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

    1.8k GitHub stars~3.2k tokensUpdated today
    DevelopmentAuto-check passed

More from evanca/flutter-ai-rules

All 37 skills in this repo
  • Code Review

    evanca/flutter-ai-rules

    A skill your agent uses when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.

    650 GitHub stars~2.4k tokensUpdated 25 days ago
    Auto-check passed
  • Developing Genkit Dart

    evanca/flutter-ai-rules

    A skill your agent uses when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.

    650 GitHub stars~961 tokensUpdated 25 days ago
    Auto-check passed
  • Generate Images With Firebase AI

    evanca/flutter-ai-rules

    A skill your agent uses when generating or editing images from Flutter/Dart with Firebase AI Logic and a Gemini image model (Nano Banana), making the first call work, choosing Gemini Developer API…

    650 GitHub stars~2.3k tokensUpdated 25 days ago
    Auto-check passed
  • Flutter Use Column Row First

    evanca/flutter-ai-rules

    A skill your agent uses when building any Flutter screen or component to choose responsive Row, Column, Expanded, Flexible, and Spacer layouts before fixed-size or coordinate-based alternatives.

    650 GitHub stars~1.3k tokensUpdated 25 days ago
    Auto-check passed
  • Architecture Feature First

    evanca/flutter-ai-rules

    A skill your agent uses when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns logic.

    650 GitHub stars~1.9k tokensUpdated 25 days ago
    Auto-check passed
  • Bloc

    evanca/flutter-ai-rules

    A skill your agent uses when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit…

    650 GitHub stars~2.8k tokensUpdated 25 days ago
    Auto-check passed

Works with

Questions about Effective Dart

What does Effective Dart do?

A skill your agent uses when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations. Effective Dart is an agent skill from evanca/flutter-ai-rules. Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.

When should I use Effective Dart?

Effective Dart fits situations like: writing Dart code; reviewing for style; refactoring naming; adding doc comments.

How do I install Effective Dart in Claude Code?

Run `npx skills add evanca/flutter-ai-rules --skill effective-dart -a claude-code`. Or copy the skill folder (skills/effective-dart in evanca/flutter-ai-rules) into .claude/skills/effective-dart in your project. Claude Code loads it when a task matches its description.

How do I install Effective Dart in Codex?

Run `npx skills add evanca/flutter-ai-rules --skill effective-dart -a codex`. Or copy the skill folder (skills/effective-dart in evanca/flutter-ai-rules) into .agents/skills/effective-dart in your project. Codex loads it when a task matches its description.

Can I use Effective Dart in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add evanca/flutter-ai-rules --skill effective-dart -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/effective-dart, .gemini/skills/effective-dart, .github/skills/effective-dart and .opencode/skills/effective-dart in your project.

What does Effective Dart need to run?

Going by SKILL.md and its folder, Effective Dart needs the command-line tools its instructions call (dart).

Does Effective Dart access the network?

SKILL.md names 2 domains. As links in the text: dart.dev and github.com. This is read from the text; nothing was executed.

Is Effective Dart safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Effective Dart use?

Effective Dart is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Effective Dart use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Effective Dart?

Skills that share tags, products or a category with Effective Dart: Code Guidelines (getsentry/sentry-dart, 873 stars), Squadron Worker (d-markey/squadron, 138 stars), Dart Multiline Strings (kevmoo/dash_skills, 147 stars) and Liquid Glass Widgets (sdegenaar/liquid_glass_widgets, 720 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Effective Dart?

evanca (a GitHub user) maintains it in evanca/flutter-ai-rules, which has 650 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on September 14, 2026.

Source: evanca/flutter-ai-rules on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.