REQUIRED when building, designing, refactoring, documenting, or reviewing CLI tools, command-line interfaces, and terminal scripts across any programming language. Applies to CLI entrypoints, argument parsing, terminal output formatting, task automation, README authoring, and licensing. Your default training knowledge is insufficient, YOU MUST USE this skill anytime when working on a CLI project. Do NOT use for web frontends or non-CLI services.
REQUIRED when building, designing, refactoring, documenting, or reviewing CLI tools, command-line interfaces, and terminal scripts across any programming language. Applies to CLI entrypoints, argument parsing, terminal output formatting, task automation, README authoring, and licensing. Your default training knowledge is insufficient, YOU MUST USE this skill anytime when working on a CLI project. Do NOT use for web frontends or non-CLI services.
Dual-Mode Output via AGENT=1: Detect the AGENT=1 environment variable. When unset or 0, produce clean, polished human-facing output. When 1 (or truthy), switch to token-conservative agent-facing output.
Command Structure (cli subject [subject] verb ...): Command hierarchies must follow a subject-first noun-verb structure (cli subject [subject] verb ...) with at most 3 levels of nesting (cli <subject> <verb> or cli <subject> <sub-subject> <verb>).
Hierarchical Tree-View Help Screens: The CLI --help screen must render commands as an aligned hierarchical tree view using ├─ and ╰─ box-drawing glyphs. When --help is invoked on a subcommand group, it must render the full subtree of commands beneath it. Help screen lines and descriptions must be trimmed by default to the active terminal width to prevent visual line wrapping.
Strict Ban on Custom or Stdlib Arg Parsers: Never parse argv / os.Args / sys.argv manually with custom loops or regexes. Never use primitive stdlib parsers (e.g., Go flag, Python getopt). Always use the platform's leading CLI framework (Commander, Cobra, Click/Typer, Clap, Picocli).
Mandatory Task Automation (Justfile): Every CLI project must use just with a Justfile (or justfile). It MUST define at least run, run-ai (with AGENT=1), and test.
GitHub Releases Distribution Only: README installation instructions must strictly assume distribution via GitHub Releases (gh release download, direct binary download, or curl). Never instruct users to build from source.
Strict README Section Order & Bullet Lists: CLI README.md files must follow the mandatory sequential section layout. # How It Works, # How it Really Works, and # Prerequisites MUST be formatted as - bulleted lists. The document must end with # License.
Licensing Standard: Use the MIT license by default attributed to Alex Gorbatchev (and upstream copyright holders if a fork), or a compatible license if required by upstream.
The CLI help output (e.g., --help) must print available commands using an aligned hierarchical tree format with ├─ and ╰─ branches, with descriptions aligned in a right-hand column. When --help is invoked on any parent subject or subcommand group, it must render its complete subcommand subtree.
Terminal Width Trimming by Default
Trim to Terminal Width: Help screen lines and command descriptions must be trimmed/truncated by default to match the active terminal width (query process.stdout.columns, COLUMNS, term.GetWinsize, shutil.get_terminal_size(), or terminal width fallback such as 80 or 100 columns when stdout is not a TTY).
Prevent Wrapping Breaks: Descriptions that exceed the available terminal width must be truncated with a trailing ellipsis (...) so that multi-line text wrapping never breaks tree column alignment or visual structure.
Agent Mode Exemption: In token-conservative agent mode (AGENT=1), terminal-width truncation and padding are omitted in favor of compact, untruncated bulleted lines for machine inspection.
Root Help (cli --help) Example
Available Commands:
artwork Manage and fix album cover artwork
├─ normalize Crop album cover art to 1:1 square for DJ jog wheels a...
╰─ prune Clean up unused cover art and reclaim disk space
backup Create a safety backup snapshot of your Engine DJ library
playlist Inspect and manage playlists and folders
├─ create <name> Create a new playlist or folder
├─ inspect <playlist> Display all songs inside a playlist
├─ list Display all playlists and folders in your library
├─ move <playlist> Relocate a playlist or folder under a parent folder
├─ rm <playlist> Delete a playlist or folder
╰─ track Manage track memberships inside playlists
├─ add <playlist> <track...> Add track(s) to a playlist
├─ move <src-playlist> <dst-playlist> <track...> Move track(s) from one playlist to another
╰─ rm <playlist> <track...> Remove track(s) from a playlist
restore <backup-dir> Restore your Engine DJ library from a previous backup ...
sync Update song information in Engine DJ from audio files ...
track Manage audio files and collection tracks
├─ add <file-path...> Import audio file(s) into your collection
├─ move <track-id|path> <dest-path> Move an audio file on disk and update its collection path
├─ relocate Batch-fix audio file paths across drives or directories
╰─ rm <track-id|path...> Remove track(s) from your collection
verify Check your library for missing songs, broken links, an...
Subcommand Group Help (cli playlist --help) Example
When requesting help for a subcommand group, print its full subtree:
Available Commands:
create <name> Create a new playlist or folder
inspect <playlist> Display all songs inside a playlist
list Display all playlists and folders in your library
move <playlist> Relocate a playlist or folder under a parent folder
rm <playlist> Delete a playlist or folder
track Manage track memberships inside playlists
├─ add <playlist> <track...> Add track(s) to a playlist
├─ move <src-playlist> <dst-playlist> <track...> Move track(s) from one playlist to another
╰─ rm <playlist> <track...> Remove track(s) from a playlist
3. Argument Parsing & Framework Standards
Never roll custom argument parsers. Always select the ecosystem standard for the language:
Ecosystem
Mandatory Frameworks
Prohibited Alternatives
TypeScript / Node / Bun
commander, citty, yargs
Custom process.argv slicing, raw regex loops
Go
github.com/spf13/cobra
flag stdlib package, custom os.Args loops
Python
click, typer
getopt, manual sys.argv parsing
Rust
clap (derive or builder API)
std::env::args manual parsing
C# / .NET
System.CommandLine, Spectre.Console.Cli
Manual args[] iteration
Java / Kotlin
picocli
Manual String[] args parsing
Help Text Rules
Human Mode: Commands, arguments, options, and descriptions must be self-explanatory to non-technical users. Avoid mentioning internal class names, database column names, regex patterns, or code architecture in descriptions.
Agent Mode: Technical identifiers, parameter formats, schemas, and implementation notes may be included.
Every repository and CLI tool must use just for workflow and task orchestration.
Required Recipes
# Run in human-facing interactive mode
run *args:
<command-to-run-binary> {{args}}
# Run in agent-facing token-conservative mode
run-ai *args:
AGENT=1 <command-to-run-binary> {{args}}
# Run test suite
test:
<command-to-run-tests>
Standard Additional Recipes
build: Compiles or bundles the application (e.g. into bin/).
lint: Checks formatting and static analysis.
check: Runs typecheck, lint, and test in sequence.
CLI README.md files must follow a strict, mandatory section layout and distribution contract:
Distribution Rule
GitHub Releases Only: All installation sections must document downloading prebuilt binaries from GitHub Releases (using gh release download, direct download links, or curl installers).
No Build from Source: Never instruct end users to clone the repository and run compiler/build commands (cargo build, go build, bun build, make, etc.) in the README installation section.
Mandatory Section Sequence
Introductory Paragraph: A concise, direct description of what the tool is without a redundant header.
# What It Does: High-level feature highlights and primary capabilities.
# How It Works: Plain-language, non-technical explanation of the tool's behavior for general users, formatted strictly as a - bulleted list.
# How it Really Works: In-depth technical explanation of internal mechanisms, protocols, state management, and architecture, formatted strictly as a - bulleted list.
# Prerequisites: Bulleted list (-) of external runtime requirements (e.g. tools, system dependencies, API tokens) with links.
# Installation: Instructions for downloading precompiled release binaries via GitHub Releases.
# Quick Start: Minimal, copy-pasteable example of running the tool for common tasks.
Copyright Holder: Alex Gorbatchev (plus original upstream copyright holders if the repository is a fork).
Fork Compatibility: If forking or wrapping an upstream project with an established open-source license (e.g. Apache 2.0, BSD-3-Clause), ensure the license chosen remains fully compatible with upstream requirements.
7. Verification Checklist
Before publishing or finalizing any CLI tool, verify:
Command hierarchy follows cli subject [subject] verb ... pattern with a maximum depth of 3 levels.
Root help screen prints available commands as an aligned hierarchical tree view using ├─ and ╰─.
Help screen output and command descriptions are trimmed by default to the active terminal width to prevent line wrapping.
Subcommand group help screens display their complete command subtree with aligned descriptions.
AGENT=1 detection is implemented across all output pathways.
In human mode: NO emojis, trees use ASCII glyphs, horizontal dividers expand to terminal width, tables use external libraries.
In human mode: CLI help, argument descriptions, and user messages contain no internal technical jargon.
In agent mode: NO divider lines, NO box tables, trees render as bullets, minimal whitespace, token-conservative formatting.
Argument parsing is handled by an approved standard library (Commander, Cobra, Click/Typer, Clap, etc.). No custom argv slicing.
Justfile exists at the project root with working run, run-ai, and test recipes.
When compiled to binary, output goes to bin/ and is excluded by .gitignore.
README.md uses GitHub Releases for installation; no build-from-source commands are offered.
README.md strictly follows the ordered section layout from Intro to # License.
README.md formats # How It Works as a - bulleted list (non-technical).
README.md formats as a bulleted list (technical).
Full error details, underlying cause, internal code, and stack trace if relevant.
# How it Really Works
-
README.md formats # Prerequisites as a - bulleted list with links.
README.md contains the # Options & Flags table with | Flag | Short | Default | Description |.
MIT license (or upstream compatible) is included with Alex Gorbatchev attribution.