PlugWiki

dart-build-cli-app Skill for Claude Code: Dart CLI Apps

Teaches your agent the Dart team patterns for building command-line apps, from entrypoints and exit codes to signals and AOT builds.

Installs
18.5K
on skills.sh
Stars
537
on GitHub
Files
4
besides SKILL.md
Updated
Oct 2026
last repo commit

The skill is a long rulebook for Dart command-line apps. The main rules are to avoid calling exit(), use POSIX exit codes, keep bin/ as a thin entrypoint, send results to stdout and errors to stderr, and resolve the Dart SDK with package:cli_util instead of Platform.resolvedExecutable.

It loads when you build or review a CLI tool. It has ten numbered sections, a checklist, two example programs and two reference notes. It bundles no scripts to run. The agent writes and edits your code, and may scaffold a project with dart create -t console.

Good for

  • Developers writing a new Dart command-line tool
  • Maintainers auditing an existing Dart CLI for exit, stream and signal bugs
  • Teams that publish a CLI as a native binary

Install dart-build-cli-app

Claude Code

  1. 1

    Copy this prompt.

    Install the dart-build-cli-app skill in Claude Code. Run this command:
    
    npx skills add https://github.com/dart-lang/skills --skill dart-build-cli-app
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Architectural patterns, entrypoint structure, exit codes, stream routing, and subprocess spawning for Dart command-line interface (CLI) applications. Use when building CLI tools, console utilities, scripts, argument parsing with `package:args` (ArgParser or CommandRunner), handling exit codes, configuring executables in pubspec.yaml, spawning Dart subprocesses, or compiling native CLI binaries. Don't use for Flutter UI widgets, web applications, or standalone HTTP backend servers.

Sections in SKILL.md

  1. Contents
  2. 1. Core Architecture & Process Lifecycle
  3. Avoid Destructive Exits (exit(N))
  4. The Thin Entrypoint Pattern (bin/ vs. lib/src/)
  5. 2. Output, Diagnostics & Formatting
  6. 3. Project Configuration & Packaging
  7. Scaffolding & Pubspec Executable Mapping (executables:)
  8. Single-Source Versioning (package:build_version)
  9. Caching Conventions
  10. 4. Argument Parsing & Command Routing
  11. 5. Native Async & Modern Stack Traces
  12. 6. Subprocess Spawning & AOT Resilience
  13. 7. Signal Handling & Terminal Teardown
  14. 8. Testing CLI Applications
  15. 9. Modern Compilation & Distribution
  16. 10. Workflows & Audit Checklist

Key facts

Installs on skills.sh
18,524 as of 2026-11-02
Last repo commit
2026-10-16

What it includes

  • No exit(); use exit codes and a thin bin/

    Explains why exit() drops buffered output and skips cleanup. It lists exit codes 0, 64, 65, 70 and 78 and keeps bin/ files as small entrypoints that call into lib/src/.

    Write · 1. Core architecture and process lifecycle

  • stdout for data, stderr for errors

    Results go to stdout, warnings and errors to stderr. Usage errors write the message and usage text to stderr and exit 64. ANSI colour is used only on a terminal and when NO_COLOR is not set.

    Write · 2. Streams, diagnostics and formatting

  • executables, build_version, cache folder

    Scaffolds with dart create -t console, declares executables in pubspec.yaml, generates the version string with package:build_version and keeps cache files under .dart_tool.

    Runs code · 3. Project configuration and packaging

  • package:args, CommandRunner, typed accessors

    Uses ArgParser for simple scripts and CommandRunner with Command subclasses for multi-command tools. It prefers the typed flag, option and multiOption accessors.

    Write · 4. Argument parsing and command routing

  • Skip Chain.capture; use Trace.from(st).terse

    Says the VM already keeps async stack frames, so it avoids Chain.capture and cleans traces with package:stack_trace.

    Write · 5. Native async and stack traces

  • Find the dart executable with cli_util

    Warns that in an AOT binary Platform.resolvedExecutable is not the dart command. Use package:cli_util to find the SDK. A reference file goes deeper.

    Write · 6. Subprocess spawning and AOT resilience

  • SIGINT, Windows guard, cursor, sockets

    Guards sigterm on Windows, restores echo and line mode and cursor visibility, and closes listening servers on exit.

    Write · 7. Signal handling and terminal teardown

  • In-memory unit tests plus subprocess tests

    Unit-tests command classes directly and tests the whole binary with package:test_process and test_descriptor.

    Runs code · 8. Testing CLI applications

  • dart run, dart install, dart build cli, compile exe

    Covers running a package on demand, installing it as a native binary, bundling code assets and compiling a standalone executable. It says Dart 3.12 or newer standardizes on dart run and dart install.

    Runs code · 9. Compilation and distribution

  • Eight-item implementation checklist

    A checklist to build or audit a CLI: executables declared, thin entrypoint, exit codes, stderr, typed accessors, ANSI checks, safe subprocesses and tests.

    Read · 10. Workflows and audit checklist

From the official docs

Permissions

Low risk

It mostly guides how your agent writes Dart code, so the risk is the usual one of reviewing generated edits. Read any install or compile command before you approve it.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It describes install and compile commands

    Section 9 covers dart install, dart compile exe and dart build cli. Run those yourself, or read each command before you approve it.

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyNo read-only mode. The skill writes and edits code. You can ask for a review of an existing CLI against the checklist without edits.
Scopes
  • Edits Dart source, pubspec.yaml and test files in your project

  • May scaffold a project with dart create -t console

  • May run dart commands such as dart test, and the compile and install commands it describes

Questions

What does dart-build-cli-app do?

It gives your agent the Dart team patterns for command-line apps. Examples are exit codes, stdout and stderr use, argument parsing, subprocesses, signals and how to ship a binary.

How do I install it?

Use the install box at the top of this page. It lists the options for Claude Code, Codex and other tools.

Does it need an API key or an account?

No. Its SKILL.md names no API key, account or sign-in. It uses the Dart or Flutter tools already on your machine.

Why does it say not to call exit()?

SKILL.md says exit() ends the process without unwinding the Dart stack. It names four problems: a debugger disconnect, lost coverage, truncated stdout and stderr, and skipped finally blocks. It tells you to set exitCode or return an integer from the command runner.

Does it include example code?

Yes. The folder has two example programs, a single-command tool and a multi-command runner, plus references on AOT SDK discovery and on signals and terminal handling.

Is it safe to run?

It guides how your agent writes code and bundles no scripts. Review the code it writes, and read any dart compile or install command before you approve it.

Information

updated Nov 2, 2026

Folder
skills/dart-build-cli-app

dart-lang/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. dart-build-cli-app SKILL.md · github.com
  2. dart-lang/skills README · github.com
  3. dart-build-cli-app on skills.sh · skills.sh
  4. dart-lang/skills · github.com

Updated Nov 2, 2026.