cli-design
Skill0 starsChanged yesterdayMITView on GitHub
Design or review a command-line interface that people, scripts and coding agents run (commands, flags, output, --json, exit codes, help, errors, prompts, signals). Use before adding or changing a command or flag, and when reviewing one. Not for the library a command wraps (api-design).
18 other projects use a version of this.
Adopted by
Most recently taken up by
- danielsitek/skillstheir own version, first seen Nov 8, 2026
- TidalPaladin/skillstheir own version, first seen Nov 8, 2026
- notque/vexjoy-agenttheir own version, first seen Nov 7, 2026
- drinkspiller/skillstheir own version, first seen Nov 6, 2026
- yahyabedirhan/skillstheir own version, first seen Nov 1, 2026
- damacus/agent-skillstheir own version, first seen Oct 29, 2026
Used with
Projects with it also use writing and review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
alxyrginSkillwriting
Создание контента для личного бренда — статьи, посты, туториалы. Use when user asks to "напиши статью", "создай пост", "подготовь контент", "write article", "create content", or when task requires content creation for blogging, LinkedIn, Medium, or other publishing platforms.
Also in 3 projects that use this
SentrySkillreview
Fixture review skill.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- vm0-ai/vm0★ 1.2ksame name
- notque/claude-code-toolkit★ 448same name
- notque/vexjoy-agent★ 448same name
- joelhooks/joelclaw★ 65same name
- tenstorrent/tt-studio★ 52same name
- z-Zihan/Evir★ 11same name
- markphelps/agent-plugins★ 5same name
- magarcia/skills★ 4same name
- yahyabedirhan/skills★ 3same name
- damacus/agent-skills★ 2same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- astroSkill
- bun-standardsSkill
- postgresSkill
- react-engineeringSkill
- rust-standardsSkill
- spring-bootSkill
- tailwind-v4Skill
- typescript-standardsSkill
- vitest-testingSkill
- api-designSkill
- architecture-reviewSkill
- benchmark-readiness-reviewSkill
- codebase-scoutingSkill
- code-review-findingsSkill
- config-projection-reviewSkill
- documentation-hygieneSkill
- domain-modelingSkill
- formal-verificationSkill
- implementation-planningSkill
- orchestration-workflowSkill
- problem-clarificationSkill
- product-copySkill
- refactorSkill
- repository-text-hygieneSkill
- researchSkill
- security-scope-reviewSkill
- setup-canastaSkill
- system-designSkill
- task-closeoutSkill
- tddSkill
- technical-writingSkill
- upstream-contributionSkill
- writing-issuesSkill
- writing-prSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
When the CLI wraps a library, design the library first with api-design: the command line maps arguments onto it and prints its result.
- Very specific: line 52
Use the platform's parser in strict mode (util.parseArgs with strict: true, clap, argparse).
- Very specific: line 55
Prefer flags to positionals.
- Distinctive: line 59
When a value can contain commas, as an expression can, repeat the flag instead of splitting on commas.
- Distinctive: line 61
No catch-all command and no prefix matching of command names.
- Distinctive: line 74
Keep the JSON deterministic: the same input gives the same bytes.
- Distinctive: line 86
Keep codes clear of the shell (126 to 165, 255), the runtime (Node uses 1 and 3 to 14) and any tool you wrap.
- Distinctive: line 93
Every error says what went wrong, where, and the exact next command to run.
- Very specific: line 101
Never require a prompt. Without a TTY on stdin, or with --no-input, fail fast and name the flag to pass.
- Distinctive: line 116
Run the checklist in contract tests.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLI design
A command line is an API whose callers are people, scripts and agents. An agent reads the exit code first, then stdout, and never answers a prompt. Design for that reader and for a person at a terminal at once.
When the CLI wraps a library, design the library first with api-design:
the command line maps arguments onto it and prints its result. Document the
CLI with technical-writing.
Design a command line
Each step ends when its output exists. Stop when a step shows that no consumer needs the feature.
- Consumers. List the real callers (a person at a terminal, an agent's tool call, a CI job), each with the exact command line it will run.
- Result. Fix the result type first.
--jsonprints exactly that result. The CLI adds fields only for failures that happen before the library is called. - Grammar. A synopsis per command: at most one positional (usually the input file), long names for every flag, value names, which flags repeat, defaults, and mutual exclusions. Reuse the standard names below and the wrapped tool's names.
- Outcomes. One row per outcome: exit code, stream, human summary line,
JSON
status. Include usage error, crash, interrupt and timeout. - Errors. For each failure a user can cause: the message and the next command or flag to try.
- Terminal behaviour. Colour, progress and prompts, split by TTY and non-TTY.
- Help.
--helpper command, leading with examples, plus the short help printed when required input is missing. - Contract tests, written before the implementation: see contract tests.
For a change to an existing CLI, run steps 2 to 5 and 8 against the diff and mark every removed or renamed flag, exit code or JSON field as breaking.
Rules
Parsing
- Use the platform's parser in strict mode (
util.parseArgswithstrict: true, clap, argparse). An unknown flag, a missing value, a bad value or an extra positional is a usage error. - Prefer flags to positionals. Every flag has a long name. Reserve
-h/--helpand--version. Standard names:--json,-n/--dry-run,--no-input,-o/--output,-q/--quiet,-f/--force.--ends options;-means stdin or stdout where a file is taken. - When a value can contain commas, as an expression can, repeat the flag instead of splitting on commas.
- No catch-all command and no prefix matching of command names.
Output
- The result goes to stdout. Progress, logs, warnings, hints and errors go to stderr.
- Human-readable output by default.
--jsonprints one JSON document on stdout, with the same exit code as human mode. Add another format only for a consumer that needs it. Use JSON Lines only for long runs that emit events. - Once parsing succeeded, failures in
--jsonmode use the result's error shape on stdout. Usage errors stay text on stderr with the usage code, since no result exists yet. - Keep the JSON deterministic: the same input gives the same bytes. Put timestamps and durations in a separate field, or leave them out.
--jsonfields, exit codes, flag names and environment variable names are a versioned interface. Human text may change.
Exit codes
- 0 only when the command did what was asked. A check that examined nothing is not a success.
- Usage error is 2. Uncaught crash is 1.
- Give distinct codes only to outcomes a caller branches on, and publish them as a table.
- Keep codes clear of the shell (126 to 165, 255), the runtime (Node uses 1 and 3 to 14) and any tool you wrap. A range such as 20 to 29 is clear of all three for a Node CLI.
- Interrupt exits 130 (SIGINT) or 143 (SIGTERM), after a bounded cleanup.
Errors and help
- Every error says what went wrong, where, and the exact next command to run. Put the key line last. No stack trace for an expected error.
--helpgoes to stdout with exit 0, shows defaults, and leads with real examples. Missing required input prints short help to stderr with the usage code.
Terminal and environment
- Never require a prompt. Without a TTY on stdin, or with
--no-input, fail fast and name the flag to pass. Read stdin only when it is not a TTY or when-is given. - Colour and animation only when that stream is a TTY. Respect
NO_COLOR,TERM=dumband--no-color. On a non-TTY, print progress as plain lines. - Print something within about 100 ms for anything slow.
- Bound every wait with a timeout that has a default. A timeout is its own outcome, never success.
- Configuration precedence: flags, then environment, then project file, then user file. Read secrets from a file or stdin, never from a flag.
- Make state-changing commands safe to rerun. Destructive ones get
--dry-runand an explicit--yesor--force.
Review an existing CLI
Run the checklist in contract tests. Report each failure with the command line that shows it, its exit code and output, and the rule it breaks.
Done when
- the synopsis, the outcome table and the error messages exist;
- the contract tests run the built binary, and pass;
- the stable surface (flags, exit codes, JSON fields) is listed in the docs.
Sources lists the evidence behind these rules and where sources disagree.
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
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.

