agentleFS
mikezamayiasmikezamayias/agent-skills/skills/dart-tool-scripts/SKILL.md

dart-tool-scripts

Skill1 starsChanged 26 days agoBSD-3-ClauseView on GitHub

Moves growing shell logic into `tool/*.dart` scripts run with `dart run` instead of Bash. Use when a GitHub Actions step or repo bootstrap grows branches, loops, JSON, test sharding or macOS versus Linux sed.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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
  1. Very specific:

    Keep Bash/Make for single commands: dart format ., dart analyze, flutter test.

    line 11
  2. Very specific:

    Prefer calling Dart APIs over shelling out (typed config, e.g.

    line 18
  3. Very specific:

    Use dart:io Platform.isWindows and package:path.

    line 19
  4. Very specific:

    Don't rewrite flutter test itself.

    line 21
  5. Very specific:

    Keep a custom tool/shard_tests.dart only for the cases the flags refuse, which are --no-optimization, --platform, --update-goldens, named …

    line 35

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dart tool scripts

Keep Bash/Make for single commands: dart format ., dart analyze, flutter test.

The moment the script has branches, JSON, sharding, or portable path logic, put it in tool/<name>.dart and run dart run tool/<name>.dart.

Rules

  1. Parse args in Dart (package:args), not shift / positional bash.
  2. Prefer calling Dart APIs over shelling out (typed config, e.g. ffigen FfiGenerator(...)).
  3. Use dart:io Platform.isWindows and package:path. Never assume GNU sed.
  4. Package authors: export a function main so other CLIs can import it without spawning a process.
  5. Don't rewrite flutter test itself. Wrap selection, sharding, and coverage around it.
  6. dart run from a Flutter repo needs an SDK constraint the CI image actually has.

CI sharding

strategy:
  matrix: { shard: [0, 1, 2] }
steps:
  - uses: dart-lang/setup-dart@v1
  - run: dart run tool/shard_tests.dart --index ${{ matrix.shard }} --total 3

Where a Flutter package already runs very_good test and is on Dart 3.13 or later with very_good_cli 1.6.0 or later, use its --shard-index (1-based) and --total-shards flags in the matrix before writing a script. Keep a custom tool/shard_tests.dart only for the cases the flags refuse, which are --no-optimization, --platform, --update-goldens, named test files and --min-coverage.

A 10-line bash pipe is still fine. This skill starts when the script has branches.

Sources

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.