Install Import Sorter for Dart

VerifiedCaution

Installs the import_sorter tool for Dart projects to automatically sort imports. Helps when you need to organize Dart imports, especially in monorepo setups with pub workspaces. The command installs from a specific Git branch that supports workspaces.

Sby Skills Guide Bot
DevelopmentBeginner
606/2/2026
Claude CodeCursorWindsurf
#dart#import-sorter#monorepo#code-formatting

Recommended for

Our review

Installs and configures import_sorter to automatically sort Dart imports, with support for monorepos using pub workspaces.

Strengths

  • Quick installation from a fix branch
  • Native support for pub workspaces
  • Simple command via dart pub global run

Limitations

  • Requires Dart SDK installed
  • Depends on an unofficial GitHub branch for monorepo support
When to use it

When you need to sort imports in Dart files, especially in a monorepo project with pub workspaces.

When not to use it

If you are using another import formatter like built-in dartfmt or an IDE that already handles sorting.

Security analysis

Caution
Quality score80/100

The skill instructs the agent to run 'dart pub global activate' from a GitHub repository, which downloads and executes code. While the tool is legitimate, the source is not audited, and the skill provides no assurance of the repository's trustworthiness. This introduces moderate risk of executing malicious code.

Findings
  • Installs a Dart package from an external Git repository without verifying its integrity or authenticity.
  • No checksum or signature validation is performed, posing a supply chain risk.

Examples

Install import_sorter
Install import_sorter for sorting Dart imports in my monorepo project.
Sort imports in a file
Sort the imports in my Dart file using import_sorter.
Setup import sorter for monorepo
I need to set up import_sorter with support for pub workspaces.

name: init-import-sorter description: Install import_sorter for Dart import sorting. Use when user needs import sorting, wants to sort imports, or gets "import_sorter not found". Triggers on "install import_sorter", "init import sorter", "sort imports", "setup import_sorter".

安装 Import Sorter

确保 import_sorter 已安装并可用。使用支持 pub workspaces 的修复版本。

安装步骤

# 1. 检查是否已安装
dart pub global list | grep import_sorter

# 2. 如果未安装,从修复分支安装(支持 monorepo pub workspaces)
dart pub global activate --source git https://github.com/myConsciousness/import_sorter.git --git-ref fix/monorepo-pub-workspaces

使用

# 对单个文件排序
dart pub global run import_sorter --no-comments

# 通过 melos 对所有包排序
melos sort
Related skills