dart-run-static-analysis
Skill4 starsChanged 4 months agoMITView on GitHub
Execute `dart analyze` to identify warnings and errors, and use `dart fix --apply` to automatically resolve mechanical lint issues. Use during development to ensure code quality and before committing changes.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- dart-lang/skillsword for word, first seen Oct 16, 2026
- zhouycheng/skillsword for word, first seen Oct 13, 2026
- enrique-lozano/Monekinword for word, first seen Oct 9, 2026
- flutter/skillsword for word, first seen Oct 8, 2026
- RodotDev/arb_aiword for word, first seen May 30, 2026
Used with
Projects with it also use dart-use-doc-examples and dart-write-documentation.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
flutterSkilldart-use-doc-examples
How to inject external code examples into Dartdoc using the {@example} directive, and how to filter those files using #hide, #region, and #endregion tags.
Also in 3 projects that use this
flutterSkilldart-write-documentation
Rules and formatting guidelines for writing Dart /// API documentation and doc comments. Use when documenting Dart code, writing doc comments for any Dart declaration (libraries, classes, methods, variables, etc.), or when instructed to follow the Effective Dart documentation guidelines.
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 5
- flutter/skills★ 3.2k100% same
- dart-lang/skills★ 548100% same
- enrique-lozano/Monekin★ 268100% same
- RodotDev/arb_ai★ 1100% same
- zhouycheng/skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- engine/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- engine/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- brandkitSkill
- code-reviewSkill
- dart-add-unit-testSkill
- dart-build-cli-appSkill
- dart-collect-coverageSkill
- dart-fix-runtime-errorsSkill
- dart-generate-test-mocksSkill
- dart-migrate-to-checks-packageSkill
- dart-resolve-package-conflictsSkill
- dart-setup-ffi-assetsSkill
- dart-use-ffigenSkill
- dart-use-pattern-matchingSkill
- dart-use-primary-constructorsSkill
- design-taste-frontendSkill
- flutter-add-integration-testSkill
- flutter-add-widget-previewSkill
- flutter-add-widget-testSkill
- flutter-apply-architecture-best-practicesSkill
- flutter-build-responsive-layoutSkill
- flutter-fix-layout-issuesSkill
- flutter-implement-json-serializationSkill
- flutter-setup-declarative-routingSkill
- flutter-setup-localizationSkill
- flutter-use-http-packageSkill
- frontend-code-reviewSkill
- full-output-enforcementSkill
- github-releaseSkill
- grill-with-docsSkill
- high-end-visual-designSkill
- imagegen-frontend-webSkill
- image-to-codeSkill
- improve-codebase-architectureSkill
- industrial-brutalist-uiSkill
- minimalist-uiSkill
- redesign-existing-projectsSkill
- source-command-frontend-code-review-skillSkill
- source-command-impeccable-skillSkill
- stitch-design-tasteSkill
- tddSkill
- to-prdSkill
- frontend-code-reviewSkill
- impeccableSkill
- dart-add-unit-testSkill
- dart-build-cli-appSkill
- dart-collect-coverageSkill
- dart-fix-runtime-errorsSkill
- dart-generate-test-mocksSkill
- dart-migrate-to-checks-packageSkill
- dart-resolve-package-conflictsSkill
- dart-run-static-analysisSkill
- dart-setup-ffi-assetsSkill
- dart-use-ffigenSkill
- dart-use-pattern-matchingSkill
- dart-use-primary-constructorsSkill
- flutter-add-integration-testSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Base Configuration: Always include a standard rule set (e.g., package:lints/recommended.yaml or package:flutter_lints/flutter.yaml) using …
- Distinctive: line 29
When a diagnostic (lint or warning) yields a false positive or applies to generated code, suppress it explicitly.
- Very specific: line 31
File-level Exclusion: Use the analyzer: exclude: node in analysis_options.yaml to exclude entire files or directories (e.g., /*.g.dart) …
- Very specific: line 32
File-level Suppression: Add // ignore_for_file: <diagnostic_code> at the top of a Dart file to suppress specific diagnostics for the entire …
- Very specific: line 33
Line-level Suppression: Add // ignore: <diagnostic_code> on the line directly above the offending code, or appended to the end of the …
- Very specific: line 34
Pubspec Suppression: Add # ignore: <diagnostic_code> above the offending line in pubspec.yaml files (e.g., # ignore: sort_pub_dependencies).
- Distinctive: line 39
Use this workflow to identify type-related bugs, style violations, and potential runtime errors.
- Distinctive: line 50
Use this workflow to resolve outdated API usages, apply quick fixes, and migrate code (e.g., Dart 3 migrations).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Analyzing and Fixing Dart Code
Contents
- Analysis Configuration
- Diagnostic Suppression
- Workflow: Executing Static Analysis
- Workflow: Applying Automated Fixes
- Examples
Analysis Configuration
Configure the Dart analyzer using the analysis_options.yaml file located at the package root.
- Base Configuration: Always include a standard rule set (e.g.,
package:lints/recommended.yamlorpackage:flutter_lints/flutter.yaml) using theinclude:directive. - Strict Type Checks: Enable strict type checks under the
analyzer: language:node to prevent implicit downcasts and dynamic inferences. Setstrict-casts: true,strict-inference: true, andstrict-raw-types: true. - Linter Rules: Explicitly enable or disable specific rules under the
linter: rules:node. Use a key-value map (rule_name: true/false) when overriding included rules, or a list (- rule_name) when defining a fresh set. Do not mix list and map syntax in the samerulesblock. - Formatter Configuration: Configure
dart formatbehavior under theformatter:node. Setpage_width(default 80) andtrailing_commas(automateorpreserve). - Analyzer Plugins: Enable custom diagnostics by adding plugins under the
analyzer: plugins:node. Ensure the plugin package is added as adev_dependencyinpubspec.yaml.
Diagnostic Suppression
When a diagnostic (lint or warning) yields a false positive or applies to generated code, suppress it explicitly.
- File-level Exclusion: Use the
analyzer: exclude:node inanalysis_options.yamlto exclude entire files or directories (e.g.,**/*.g.dart) using glob patterns. - File-level Suppression: Add
// ignore_for_file: <diagnostic_code>at the top of a Dart file to suppress specific diagnostics for the entire file. Use// ignore_for_file: type=lintto suppress all linter rules. - Line-level Suppression: Add
// ignore: <diagnostic_code>on the line directly above the offending code, or appended to the end of the offending line. - Pubspec Suppression: Add
# ignore: <diagnostic_code>above the offending line inpubspec.yamlfiles (e.g.,# ignore: sort_pub_dependencies). - Plugin Diagnostics: Prefix the diagnostic code with the plugin name when suppressing plugin-specific issues (e.g.,
// ignore: some_plugin/some_code).
Workflow: Executing Static Analysis
Use this workflow to identify type-related bugs, style violations, and potential runtime errors.
Task Progress:
- 1. Verify
analysis_options.yamlexists at the project root. - 2. Run the analyzer using the
analyze_filesMCP tool (if available) or the CLI commanddart analyze <target_directory>. - 3. Review the diagnostic output.
- 4. If info-level issues must be treated as failures, append the
--fatal-infosflag. - 5. Resolve reported errors manually or proceed to the Automated Fixes workflow.
Workflow: Applying Automated Fixes
Use this workflow to resolve outdated API usages, apply quick fixes, and migrate code (e.g., Dart 3 migrations).
Task Progress:
- 1. Execute a dry run to preview proposed changes using the
dart_fixMCP tool or CLI commanddart fix --dry-run. - 2. Review the proposed fixes to ensure they align with the intended architecture.
- 3. If additional fixes are required, verify that the corresponding linter rules are enabled in
analysis_options.yaml. - 4. Apply the fixes using the
dart_fixMCP tool or CLI commanddart fix --apply. - 5. Format the modified code using the
dart_formatMCP tool or CLI commanddart format .. - 6. Run the static analysis workflow to verify all diagnostics are resolved.
Examples
Comprehensive analysis_options.yaml
include: package:flutter_lints/recommended.yaml
analyzer:
exclude:
- "**/*.g.dart"
- "lib/generated/**"
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
todo: ignore
invalid_assignment: warning
missing_return: error
linter:
rules:
avoid_shadowing_type_parameters: false
await_only_futures: true
use_super_parameters: true
formatter:
page_width: 100
trailing_commas: preserveInline Diagnostic Suppression
// Suppress for the entire file
// ignore_for_file: unused_local_variable, dead_code
void processData() {
// Suppress for a specific line
// ignore: invalid_assignment
int x = '';
const y = 10; // ignore: constant_identifier_names
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

