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
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
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
- Contents
- 1. Core Architecture & Process Lifecycle
- Avoid Destructive Exits (exit(N))
- The Thin Entrypoint Pattern (bin/ vs. lib/src/)
- 2. Output, Diagnostics & Formatting
- 3. Project Configuration & Packaging
- Scaffolding & Pubspec Executable Mapping (executables:)
- Single-Source Versioning (package:build_version)
- Caching Conventions
- 4. Argument Parsing & Command Routing
- 5. Native Async & Modern Stack Traces
- 6. Subprocess Spawning & AOT Resilience
- 7. Signal Handling & Terminal Teardown
- 8. Testing CLI Applications
- 9. Modern Compilation & Distribution
- 10. Workflows & Audit Checklist
Key facts
- Author
- Dart team (dart-lang)
- Installs on skills.sh
- 18,524 as of 2026-11-02
- GitHub stars
- 537 for the whole dart-lang/skills repo
- Last repo commit
- 2026-10-16
- skills.sh audits
- Gen Agent Trust Hub: pass; Socket: pass; Snyk: pass
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 lifecyclestdout 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 formattingexecutables, 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 packagingpackage: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 routingSkip 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 tracesFind 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 resilienceSIGINT, 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 teardownIn-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 applicationsdart 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 distributionEight-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-only | No 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 |
|
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
- Repository
- dart-lang/skills
- Folder
skills/dart-build-cli-app
Sources
Docs, issue trackers and discussions this page is built from.
Show all 4Hide
- dart-build-cli-app SKILL.md · github.com
- dart-lang/skills README · github.com
- dart-build-cli-app on skills.sh · skills.sh
- dart-lang/skills · github.com