dart_doc

A set of rules for adding detailed documentation comments to Dart classes and their public members. Dart is a programming language commonly used for Flutter applications and other software.

In plain words
What is it for?
Use it when documenting Dart classes, methods, properties, relationships, recommendations, examples, and deprecations with /// comments.
Why use it?
It gives developers and code assistants consistent explanations of purpose, design choices, usage, parameters, results, and deprecated code. This makes unfamiliar Dart code easier to understand and maintain.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/arenukvern/mcp_flutter/dart_doc
Clone the repo
git clone --depth 1 https://github.com/Arenukvern/mcp_flutter

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 978 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00978
Opus 5 $0.00000 $0.00489
Sonnet 5 $0.00000 $0.00196
Haiku 4.5 $0.00000 $0.00098

Measured 3d ago against content hash efa7e8303e94, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dart_doc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/dart_doc.mdc · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Please add comprehensive Dart documentation comments to the specified classes, following these guidelines:

  1. Always focus on WHY (key Design Decisions) it does what it does in concise manner.
  2. Use /// for documentation comments.
  3. Start with a brief, single-sentence summary of the class's purpose.
  4. Follow with a more detailed description if necessary, keeping it concise.
  5. Include an @ai annotation with specific instructions for AI tools on how to interpret and use this class.
  6. Document all public members (methods, properties, etc.) with clear, concise explanations of their purpose and usage.
  7. Use [bracketed] references for any mentioned identifiers within the class.
  8. Include code examples where appropriate, using ```dart code fences.
  9. Mention any important relationships with other classes or libraries.
  10. Use PREFER, AVOID, or CONSIDER for recommendations about usage patterns.
  11. Add @deprecated tags with explanations for any deprecated members.
  12. Place doc comments before metadata annotations.
  13. Use prose to explain parameters, return values, and exceptions.
  14. For boolean properties, start comments with "Whether" followed by a description.
  15. Document only the getter for properties with both a getter and setter.
  16. Consider including a code sample in the class-level comment.
  17. Keep 80-length characters per line.

Example format:

/// {@template progress_indicator}
/// A widget that displays a customizable progress indicator.
///
/// This class provides a flexible way to show loading progress in your app.
/// It supports both determinate and indeterminate progress modes.
///
/// Use [ProgressIndicator.circular] for a circular indicator, or
/// [ProgressIndicator.linear] for a linear one.
///
/// ```dart
/// ProgressIndicator(
///   value: 0.7,
///   backgroundColor: Colors.grey[300],
///   valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
/// )
/// ```
///
/// See also:
///
///  * [CircularProgressIndicator], which shows progress along a circular arc.
///  * [LinearProgressIndicator], which displays progress along a line.
///
/// @ai When generating code involving this class, ensure proper initialization
/// of [value] and consider the appropriate use of [backgroundColor] and [valueColor].
/// {@endtemplate}
class ProgressIndicator extends StatefulWidget {
  /// {@macro progress_indicator}
  ///
  /// Creates a progress indicator.
  ///
  /// The [value] argument should be null for an indeterminate progress indicator.
  /// For determinate progress indicators, [value] should be a non-null value
  /// between 0.0 and 1.0, inclusive.
  ///
  /// @ai Ensure [value] is within the valid range when provided.
  const ProgressIndicator({
    Key? key,
    this.value,
    this.backgroundColor,
    this.valueColor,
    this.semanticsLabel,
    this.semanticsValue,
  }) : super(key: key);

  /// The progress value between 0.0 and 1.0.
  ///
  /// If null, the progress indicator is indeterminate.
  ///
  /// @ai Use this property to control the progress. Ensure it's between 0.0 and 1.0.
  final double? value;

  /// The progress indicator's background color.
  ///
  /// @ai Consider using a contrasting color to [valueColor] for better visibility.
  final Color? backgroundColor;

  /// The progress indicator's color as an animated value.
  ///
  /// @ai Use [AlwaysStoppedAnimation] for a solid color, or custom animations for dynamic effects.
  final Animation<Color?>? valueColor;

  /// Creates a circular progress indicator.
  ///
  /// @ai Use this constructor for a circular representation of progress.
  const ProgressIndicator.circular({Key? key}) : this(key: key);

  /// Creates a linear progress indicator.
  ///
  /// @ai Use this constructor for a linear representation of progress.
  const ProgressIndicator.linear({Key? key}) : this(key: key);

  /// This method is deprecated and will be removed in the next major version.
  ///
  /// Use [newMethod] instead.
  @Deprecated('Use newMethod() instead')
  void oldMethod() {
    // ...
  }

  @override
  State<ProgressIndicator> createState() => _ProgressIndicatorState();
}

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 124 lines · 0 tokens per session scan A efa7e8303e94

Subscribe to this mod's changes

dart_doc is a cursor rule published in the GitHub repository Arenukvern/mcp_flutter (372 stars, last pushed 7d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 978 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.