Agent skill

Nodejs CLI Best Practices

by lirantal in lirantal/nodejs-cli-apps-best-practices

Guide and audit Node.js CLI application development against 41 established best practices covering UX, distribution, interoperability, accessibility, testing, error handling, development setup…

CC-BY-SA-4.0Auto-check passedDevelopment

Install Nodejs CLI Best Practices

skills CLI
$ npx skills add lirantal/nodejs-cli-apps-best-practices --skill nodejs-cli-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lirantal/nodejs-cli-apps-best-practices nodejs-cli-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lirantal/nodejs-cli-apps-best-practices.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nodejs-cli-best-practices .claude/skills/nodejs-cli-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nodejs-cli-best-practices
GitHub stars
4.1k
Token cost
~2k tokens
SKILL.md length
265 words
Files
10 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
CC-BY-SA-4.0

At a glance

Guide and audit Node.js CLI application development against 41 established best practices covering UX, distribution, interoperability, accessibility, testing, error handling, development setup…

  • Scaffolding a Node.js CLI — including when someone says audit my CLI
  • SKILL.md covers Critical, Determining the mode, Audit mode and Node.js CLI best practices for…
  • Runs JavaScript scripts from its folder; calls npm and docker
  • Review my CLI code

What it does

Nodejs CLI Best Practices is an agent skill from lirantal/nodejs-cli-apps-best-practices. Guide and audit Node.js CLI application development against 41 established best practices covering UX, distribution, interoperability, accessibility, testing, error handling, development setup, analytics, versioning, and security. Use this skill when building, extending, reviewing, or scaffolding a Node.js CLI — including when someone says "audit my CLI", "review my CLI code", "I'm building a CLI tool", or asks about adding argument parsing, help output, shell completion/autocomplete, error handling, color…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including reference files (for example `EVALS.md`, `evals/README.md` and `evals/evals.json`).

It sits in Development, covering Project scaffolding, Accessibility and Error handling. It works with Node.js and npm. The repository describes itself as: The largest Node.js CLI Apps best practices list ✨. The licence is CC-BY-SA-4.0.

When your agent uses it

  • Scaffolding a Node.js CLI — including when someone says audit my CLI
  • Review my CLI code
  • Im building a CLI tool
  • Asks about adding argument parsing

Example prompts

  • “audit my CLI”
  • “review my CLI code”
  • “m building a CLI tool”
  • “/nodejs-cli-best-practices”

Requirements

  • Node.js
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit e6374e4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • npm
    • docker

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm and docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nodejs CLI Best Practices loads about 2k tokens when it runs, and up to ~6.9k if it reads all its reference files. Until then it costs about 215 tokens; SKILL.md has 265 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~215
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lirantal/nodejs-cli-apps-best-practices at commit e6374e4, republished under its CC-BY-SA-4.0 licence (© lirantal). 265 words, ~2,005 tokens.

Download SKILL.mdSave it as .claude/skills/nodejs-cli-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
nodejs-cli-best-practices
description
Guide and audit Node.js CLI application development against 41 established best practices covering UX, distribution, interoperability, accessibility, testing, error handling, development setup, analytics, versioning, and security. Use this skill when building, extending, reviewing, or scaffolding a Node.js CLI — including when someone says "audit my CLI", "review my CLI code", "I'm building a CLI tool", or asks about adding argument parsing, help output, shell completion/autocomplete, error handling, color output, STDIN, --json flags, exit codes, --version flags, or npm publishing. Applies even when best practices are not explicitly mentioned. Also trigger for "how should I implement X in my CLI" or "what's the right way to do Y in a Node.js CLI". Do NOT use for Node.js backend or API development with no CLI entry point.
metadata.version
1.0.0
metadata.category
nodejs
metadata.tags
nodejs, cli, best-practices, audit, command-line

This skill operates in two modes — audit for reviewing existing CLI code and development guide for building new features or tools.

Critical

Always read references/best-practices.md before producing any output. It contains the complete reference for all 41 practices with code examples and recommended packages. It is the source of truth for both modes — do not rely on general knowledge alone, as several practices (specific package recommendations, §X.X numbering, configuration precedence order) are specific to this guide.

Determining the mode

TriggerModeAction
User provides existing CLI code or files to reviewAuditProduce a structured audit report
User asks how to build or implement somethingDevelopment guideSurface relevant practices with examples
User says "review and help me improve"BothAudit first, then provide concrete guidance for each failing practice

Audit mode

Systematically compare the provided code against the practices in references/best-practices.md. Focus on what is verifiable from the code. Use judgment to mark practices as not applicable (➖) when there's genuinely no way to assess them from static analysis (e.g., Docker support when the project shows no distribution intent).

Prioritize by user impact — a missing exit code (§6.4) or absent --version flag (§9.1) affects every user and every CI pipeline; missing Docker image (§4.1) is low priority for most projects.

Audit report format
## Node.js CLI Best Practices Audit

### Summary
✅ N practices followed  ⚠️ N need attention  ❌ N not implemented  ➖ N not applicable

---

### 1. Command Line Experience
| # | Practice | Status | Finding |
|---|----------|--------|---------|
| 1.1 | Respect POSIX args | ✅ | Uses yargs with proper short/long aliases |
| 1.2 | Build empathic CLIs | ❌ | No interactive fallback when required args absent |
...

[Repeat for each section with applicable practices]

---

### Priority recommendations

**High priority** (user-facing or CI-breaking):
- **§6.4 Exit codes** — `process.exit()` called without a code
  ```js
  // Fix
  process.exit(1); // on error
  process.exit(0); // on success

Medium priority:

  • ...

Low priority / nice to have:

  • ...

Keep findings concise and tied to specific code patterns. Always include a concrete fix with code for each ❌.

---

## Development guide mode

When building a new CLI feature or tool, don't wait to be asked — surface relevant best practices immediately based on what the user is building.

**For a "building a CLI from scratch" request**, organize guidance by development phase:

1. **Project setup** (§7.1, §7.3, §4.4, §2.2): bin object, shebang, files field, shrinkwrap
2. **Argument design** (§1.1, §1.2, §1.7, §1.9, §3.4): POSIX compliance, empathic fallbacks, zero-config, help output, config precedence
3. **I/O and interoperability** (§3.1, §3.2, §3.5, §3.6, §3.7, §4.2): STDIN, structured output, gated interactivity, STDOUT/STDERR separation, shell completion, graceful degradation
4. **Error handling** (§6.1–§6.5): trackable codes, actionable messages, debug mode, exit codes
5. **UX polish** (§1.4, §1.5, §1.6): colors, rich interactions, hyperlinks
6. **Versioning** (§9.1–§9.7): `--version` flag, semver, changelog
7. **Security** (§10.1): argument injection

**For a targeted feature request** (e.g., "add error handling", "add a --json flag"), surface only the directly relevant practices.

### Development guidance format

Node.js CLI best practices for [feature/topic]

Checklist
  • §X.Y Practice name — one-line explanation of why it matters
Implementation

[Concrete, copy-pasteable code]

  • package-name — when and why to use it npm install package-name
Common mistakes
  • What not to do → why it breaks → what to do instead

---

## Quick reference: which section applies

| Topic | Sections |
|-------|----------|
| Argument parsing / flags | §1.1, §1.7, §1.9, §3.4 |
| Help / usage output | §1.9 |
| Shell completion / autocomplete | §3.7 |
| Prompts / interactivity | §1.2, §1.5, §3.5 |
| Colors / styling | §1.4, §4.2 |
| STDIN / piping | §3.1, §3.5, §3.6 |
| STDOUT / STDERR | §3.6 |
| JSON / structured output | §3.2, §3.6, §4.2 |
| Cross-platform issues | §3.3, §7.2 |
| Error messages | §3.6, §6.1, §6.2 |
| Exit codes | §6.4 |
| Debug / verbose mode | §3.6, §6.3 |
| `--version` flag | §9.1, §9.3 |
| package.json setup | §7.1, §7.3, §9.3 |
| npm publishing / distribution | §2.1, §2.2, §9.6 |
| Security / user input | §10.1 |
| Configuration persistence | §1.3, §2.3 |
| Node.js version targeting | §4.3 |
| Analytics / telemetry | §8.1 |

---

## Examples

### Example 1: Audit mode

**User says:** "Audit my Node.js CLI against best practices. Here's my entry file and package.json."

**Actions:**
1. Read `references/best-practices.md`
2. Examine the provided files against each applicable practice
3. Produce the structured audit report with per-section table and priority recommendations

---

### Example 2: Development guide mode (new CLI from scratch)

**User says:** "I'm building a Node.js CLI that parses log files and outputs a summary table. It needs to work cross-platform and I want to publish it on npm."

**Actions:**
1. Read `references/best-practices.md`
2. Identify all practices relevant to this CLI type (cross-platform, npm-published, table output)
3. Organize guidance by development phase (project setup → argument design → I/O → errors → UX → versioning → security)

---

### Example 3: Development guide mode (targeted feature)

**User says:** "My CLI is crashing and just dumping stack traces. How do I add proper error handling?"

**Actions:**
1. Read `references/best-practices.md` sections §6.1–§6.5
2. Surface only the directly relevant practices
3. Provide a concrete, copy-pasteable error handling wrapper

---

## Common mistakes to avoid

| Mistake | Why it matters | Correct approach |
|---------|---------------|------------------|
| Marking §4.1 (Docker) as ❌ for a small personal CLI | Docker is rarely needed; not applicable is honest | Use ➖ when the practice genuinely doesn't fit the project's scope |
| Only auditing the entry file, ignoring package.json | Several high-impact violations (§7.1, §7.3, §2.1, §4.3) live in package.json | Always audit both the entry file and package.json when both are provided |
| Recommending `package-lock.json` for §2.2 | The practice specifically calls for `npm-shrinkwrap.json` for published CLIs | Reference `references/best-practices.md` for the exact requirement |
| Skipping the priority grouping in audit reports | Users need to know what to fix first, not just what's wrong | Always include High / Medium / Low priority sections with concrete fixes |
| Providing a development guide without code examples | Prose guidance alone is not actionable | Every recommended practice should include at least one copy-pasteable code block |

© lirantal, CC-BY-SA-4.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in skills/nodejs-cli-best-practices of lirantal/nodejs-cli-apps-best-practices.

  • SKILL.md
  • EVALS.md
  • evals/README.md
  • evals/evals.json
  • evals/fixtures/arg-injection.js
  • evals/fixtures/bad-cli-clean.js
  • evals/fixtures/bad-cli.js
  • evals/fixtures/bad-package.json
  • references/best-practices.md
  • tile.json

Open the folder on GitHubat commit e6374e4

Compare with similar skills

Nodejs CLI Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nodejs CLI Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nodejs CLI Best Practices this skilllirantal/nodejs-cli-apps-best-practices4.1k—~2kAutomated safety check: PassCC-BY-SA-4.0
NodeHsienW/chat-gun143—~1.6kAutomated safety check: PassCustom licence
UI Visual DebuggingNangoHQ/nango13k—~1.3kAutomated safety check: PassCustom licence
Cabloy Backend Scaffoldcabloy/cabloy982—~3.1kAutomated safety check: PassMIT
Publishing A New PackageComfy-Org/ComfyUI_frontend2.1k—~1.8kAutomated safety check: PassGPL-3.0
Cabloy Frontend Scaffoldcabloy/cabloy982—~4.1kAutomated safety check: PassMIT

Similar skills

  • Node

    HsienW/chat-gun

    Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging…

    143 GitHub stars~1.6k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • UI Visual Debugging

    NangoHQ/nango

    A skill your agent uses when modifying or visually debugging Nango frontend UI, including packages/webapp, packages/connect-ui, browser interactions, screenshots, and visual regressions.

    13k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed
  • This skill should be used when the user needs the Vona backend scaffold/extend path in this Cabloy repo, especially to choose the right npm run vona generator or CRUD command and the required…

    982 GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Publishing A New Package

    Comfy-Org/ComfyUI_frontend

    Publishes a new package from this monorepo to npm under @comfyorg and proves it is consumable from another repo.

    2.1k GitHub stars~1.8k tokensUpdated today
    DevelopmentAuto-check passed
  • A skill your agent uses whenever the user wants the Zova frontend path in this Cabloy repo: create or extend pages, components, api or model beans, route/query/params work, metadata refresh…

    982 GitHub stars~4.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Static Code Analysis Typescript

    jaktestowac/awesome-copilot-for-testers

    Creates, reviews, and modernizes static code analysis setups for Node.js and TypeScript repositories, covering ESLint flat config, typescript-eslint, tsconfig, Prettier, import sorting, Husky…

    116 GitHub stars~4.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

Works with

Questions about Nodejs CLI Best Practices

What does Nodejs CLI Best Practices do?

Guide and audit Node.js CLI application development against 41 established best practices covering UX, distribution, interoperability, accessibility, testing, error handling, development setup…. Nodejs CLI Best Practices is an agent skill from lirantal/nodejs-cli-apps-best-practices.js CLI application development against 41 established best practices covering UX, distribution, interoperability, accessibility, testing, error handling, development setup, analytics, versioning, and security.

When should I use Nodejs CLI Best Practices?

Nodejs CLI Best Practices fits situations like: scaffolding a Node.js CLI — including when someone says audit my CLI; review my CLI code; im building a CLI tool; asks about adding argument parsing.

How do I install Nodejs CLI Best Practices in Claude Code?

Run `npx skills add lirantal/nodejs-cli-apps-best-practices --skill nodejs-cli-best-practices -a claude-code`. Or copy the skill folder (skills/nodejs-cli-best-practices in lirantal/nodejs-cli-apps-best-practices) into .claude/skills/nodejs-cli-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Nodejs CLI Best Practices in Codex?

Run `npx skills add lirantal/nodejs-cli-apps-best-practices --skill nodejs-cli-best-practices -a codex`. Or copy the skill folder (skills/nodejs-cli-best-practices in lirantal/nodejs-cli-apps-best-practices) into .agents/skills/nodejs-cli-best-practices in your project. Codex loads it when a task matches its description.

Can I use Nodejs CLI Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lirantal/nodejs-cli-apps-best-practices --skill nodejs-cli-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nodejs-cli-best-practices, .gemini/skills/nodejs-cli-best-practices, .github/skills/nodejs-cli-best-practices and .opencode/skills/nodejs-cli-best-practices in your project.

What does Nodejs CLI Best Practices need to run?

Going by SKILL.md and its folder, Nodejs CLI Best Practices needs JavaScript for the scripts in its folder and the command-line tools its instructions call (npm and docker). Our summary lists: Node.js; Docker.

Does Nodejs CLI Best Practices access the network?

SKILL.md contains no URLs. Its commands use npm and docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Nodejs CLI Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Nodejs CLI Best Practices use?

Nodejs CLI Best Practices is published under the CC-BY-SA-4.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nodejs CLI Best Practices use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.9k tokens, read only when the agent opens those files.

What are the alternatives to Nodejs CLI Best Practices?

Skills that share tags, products or a category with Nodejs CLI Best Practices: Node (HsienW/chat-gun, 143 stars), UI Visual Debugging (NangoHQ/nango, 13k stars), Cabloy Backend Scaffold (cabloy/cabloy, 982 stars) and Publishing A New Package (Comfy-Org/ComfyUI_frontend, 2.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nodejs CLI Best Practices?

lirantal (a GitHub user) maintains it in lirantal/nodejs-cli-apps-best-practices, which has 4,133 GitHub stars. The repository was last updated on July 8, 2026.

Source: lirantal/nodejs-cli-apps-best-practices on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.