nodejs-cli-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 hand
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 4128
- Лиценз
- CC-BY-SA-4.0
- Последна проверка на записа
- 21.09.2026 г.
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add lirantal/nodejs-cli-apps-best-practicesСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от SKILL.md
Началото на файла на автора, без превод.
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
| Trigger | Mode | Action |
|---|---|---|
| User provides existing CLI code or files to review | Audit | Produce a structured audit report |
| User asks how to build or implement something | Development guide | Surface relevant practices with examples |
| User says "review and help me improve" | Both | Audit 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