Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

dart-run-static-analysisdart 运行静态分析

Agent Skill

dart-run-static-analysis 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,599

周安装

68

GitHub Stars

63

下载量

560
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dart-lang/skills --skill dart-run-static-analysis

简介

dart-run-static-analysis 执行 Dart 静态分析并应用自动化修复,提升代码健壮性。

  • 适用于 CI/CD 流水线、pre-commit hook 或日常开发中的代码质量门禁场景。
  • 支持配置 analysis_options.yaml 启用 strict-casts 等规则,并批量修复 type promotion 失败。
  • 使用前请确认项目根目录存在 analysis_options.yaml,并已包含 recommended lints。
  • 涉及 fatal-infos 时应谨慎开启,避免误报阻塞关键路径的提交流程。

SKILL.md

Analyzing and Fixing Dart Code

Contents

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.yaml or package:flutter_lints/flutter.yaml) using the include: directive.
  • Strict Type Checks: Enable strict type checks under the analyzer: language: node to prevent implicit downcasts and dynamic inferences. Set strict-casts: true, strict-inference: true, and strict-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 same rules block.
  • Formatter Configuration: Configure dart format behavior under the formatter: node. Set page_width (default 80) and trailing_commas (automate or preserve).
  • Analyzer Plugins: Enable custom diagnostics by adding plugins under the analyzer: plugins: node. Ensure the plugin package is added as a dev_dependency in pubspec.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 in analysis_options.yaml to 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=lint to 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 in pubspec.yaml files (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.yaml exists at the project root.
  • 2. Run the analyzer using the analyze_files MCP tool (if available) or the CLI command dart analyze <target_directory>.
  • 3. Review the diagnostic output.
  • 4. If info-level issues must be treated as failures, append the --fatal-infos flag.
  • 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_fix MCP tool or CLI command dart 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_fix MCP tool or CLI command dart fix --apply.
  • 5. Format the modified code using the dart_format MCP tool or CLI command dart 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: preserve

Inline 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
}

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.78%
按下载量换算206

Claude

27.82%
按下载量换算156

Cursor

20.94%
按下载量换算117

Gemini CLI

10.19%
按下载量换算57

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dart-lang/skills --skill dart-run-static-analysis 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills