Source profileQuality 83/100

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

effective-dart

Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.

Source repository stars
604
Declared platforms
0
Static risk flags
0
Last source update
2026-08-04
Source checked
2026-08-04

Decision brief

What it does—and where it fits

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

Best for

  • Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/evanca/flutter-ai-rules --skill "skills/effective-dart"
Safe inspection promptEditorial

Inspect the Agent Skill "effective-dart" from https://github.com/evanca/flutter-ai-rules/blob/b294a77b68b5508f8d3151fb93d87ed9622d2ff1/skills/effective-dart/SKILL.md at commit b294a77b68b5508f8d3151fb93d87ed9622d2ff1. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    6. Usage Patterns

    Use whereType() to filter a collection by type.

    Use whereType() to filter a collection by type.Follow a consistent rule for var and final on local variables.Initialize fields at their declaration when possible.
  2. 02

    9. Code Review Workflow

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

    Naming — verify all identifiers follow the conventions in Section 1.Type annotations — confirm public API parameters, return types, and uninitialized variables are annotated.Class modifiers — verify final, sealed, or interface is used where appropriate.
  3. 03

    1. Naming Conventions

    Capitalize acronyms and abbreviations longer than two letters like words: HttpRequest, not HTTPRequest.

    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.
  4. 04

    2. Types and Functions

    Use class modifiers (final, sealed, interface, base, mixin) to control whether a class can be extended or implemented.

    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.
  5. 05

    3. Style

    Format code with dart format — don't manually 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.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score83/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars604SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
evanca/flutter-ai-rules
Skill path
skills/effective-dart/SKILL.md
Commit
b294a77b68b5508f8d3151fb93d87ed9622d2ff1
License
MIT
Collected
2026-08-04
Default branch
main
View the original 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.
  • 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.
// 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

Alternatives

Compare before choosing

Computed 976

mgiovani/cc-arsenal

team-review

Multi-agent review team: architecture, security, performance, testing, style, docs/UX, plus an adversary that cross-examines the other 6, for security-sensitive, architectural, or large PRs (15+ files) where a single-agent pass risks missing cross-cutting issues. Use for auth/payments/PII changes, schema/pattern changes, compliance sign-off, or when asked to 'get the review team on this' / 'multi-agent review' / 'thorough review before merge'. For a standard PR or a quick pre-merge check, use /r

Computed 964,922

dotnet/skills

dotnet-webapi

Guides creation and modification of ASP.NET Core Web API endpoints with correct HTTP semantics, OpenAPI metadata, and error handling. USE FOR: adding new API endpoints (controllers or minimal APIs), wiring up OpenAPI/Swagger, creating .http test files, setting up global error handling middleware. DO NOT USE FOR: general C# coding style, EF Core data access or query optimization (use optimizing-ef-core-queries), frontend/Blazor work, gRPC services, or SignalR hubs.

Computed 96106

AI-Unified-Process/marketplace

reverse-engineer

Reverse-engineers an existing software project into AI Unified Process artifacts: a PlantUML use case diagram, per-use-case specification documents, and an entity model with a Mermaid ER diagram. Use when the user asks to "reverse engineer this codebase", "extract use cases from existing code", "document the system we already have", "generate use case specs from controllers", "derive an entity model from the database", "create AIUP artifacts from a legacy project", or mentions reverse engineerin

Computed 9510,869

Jeffallan/claude-skills

fastapi-expert

Use when building high-performance async Python APIs with FastAPI and Pydantic V2. Invoke to create REST endpoints, define Pydantic models, implement authentication flows, set up async SQLAlchemy database operations, add JWT authentication, build WebSocket endpoints, or generate OpenAPI documentation. Trigger terms: FastAPI, Pydantic, async Python, Python API, REST API Python, SQLAlchemy async, JWT authentication, OpenAPI, Swagger Python.