dart-cli-creator
Installation
SKILL.md
Dart CLI Creator Skill
This skill provides guidelines and procedures for creating and improving top-quality Command-Line Interface (CLI) tools using Dart. As an agent, you must consistently follow these best practices when requested by the user to create or modify a Dart CLI.
🎯 Core Best Practices
1. Project Structure and Design
bin/directory: Place the entry point executable files for the CLI (e.g.,bin/my_cli.dart). Keep this as a thin wrapper that only calls top-level functions or classes fromlib/orsrc/, avoiding complex logic here.lib/directory: Place business logic, command implementations, and reusable utilities here (e.g.,lib/src/commands/,lib/src/utils/).- Separation of Concerns: Always separate the CLI input/output handling (argument parsing, UI rendering) from the core business logic to maximize testability.
2. Command-Line Arguments and Routing
- Leverage the
argspackage: UseCommandRunnerandCommandclasses from the standardargspackage to build a Git-like CLI with subcommands. - Self-documenting: Carefully write
descriptionandhelpfor each command, flag, and option, ensuring that--helpprovides sufficient usage information.