Automated summary
This skill provides generic patterns to improve a Node.js CLI's user experience: interactive prompts with @clack/prompts, update notifications, and richer Commander.js help text.
Strengths
- Covers three concrete areas: interactive prompts, update-notifier, and Commander.js help text
- Encourages correct TTY/CI handling and cancellation via p.isCancel()
- Copy-pasteable code samples, including conditional colored help output
- Generic patterns reusable across any Node.js CLI
Limitations
- Assumes a Node.js stack with Commander.js and pnpm; not directly portable elsewhere
- Does not cover testing interactive flows or error handling beyond cancellation
- update-notifier and picocolors are shown without comparison to alternatives
When you want to quickly add interactive prompts, version notifications, and clearer help output to an existing Node.js CLI.
If your CLI does not use Commander.js, or you need a fuller interaction architecture than a few isolated patterns.
Security analysis
SafeThe skill contains only documentation and benign code examples for improving CLI UX. It does not instruct destructive commands, secret exfiltration, obfuscated payload execution, or disabling safety mechanisms.
No concerns found
How this analysis is madeExamples
Add a @clack/prompts confirmation prompt to my CLI's apply command, with proper TTY detection and Ctrl+C cancellation handling.Wire up update-notifier in my Node.js CLI entry point so users are notified of new versions without blocking startup.Add usage examples and a documentation epilog to my Commander.js commands, and bold the section headings when stdout is a TTY.name: cli-ux-polish description: Polish CLI user experience with @clack/prompts for interactive flows, update-notifier for version awareness, and enhanced Commander.js help text with examples and colors. Generic patterns for any Node.js CLI.
CLI UX Polish
Goal
Improve the interactive experience with polished prompts, update notifications, and better help text.
1. Interactive Prompts with @clack/prompts
Install
pnpm add @clack/prompts
Confirmation Flow
import * as p from '@clack/prompts'
async function promptConfirmation(message: string): Promise<boolean> {
const result = await p.confirm({ message })
if (p.isCancel(result)) {
p.cancel('Operation cancelled.')
process.exit(130)
}
return result
}
Selection Flow
async function promptSelect<T extends string>(
message: string,
options: Array<{ value: T; label: string }>,
): Promise<T> {
const result = await p.select({ message, options })
if (p.isCancel(result)) {
p.cancel('Operation cancelled.')
process.exit(130)
}
return result as T
}
Spinner
const s = p.spinner()
s.start('Processing...')
await doWork()
s.stop('Done')
Important
- Only use @clack/prompts when
process.stdout.isTTYis true (interactive terminal) - In non-TTY / CI modes, skip prompts and auto-approve or fail with a clear message
- Always handle
p.isCancel()— it returns a symbol when user presses Ctrl+C
2. Update Notifications
Install
pnpm add update-notifier
Usage
Add to the CLI entry point (before command parsing):
import updateNotifier from 'update-notifier'
const pkg = { name: 'your-package-name', version: currentVersion }
updateNotifier({ pkg }).notify()
This:
- Checks npm registry in the background (non-blocking)
- Caches the result for 24h
- Shows notification only when a new version exists
- Automatically respects
NO_UPDATE_NOTIFIER=1and CI environments
3. Enhanced Help Text
Add Examples to Commands
program
.command('apply')
.description('Apply changes')
.addHelpText(
'after',
`
Examples:
$ mycli apply --env staging
$ mycli apply --env production --approve
$ mycli apply --env dev --json`,
)
Global Help Epilog
program.addHelpText(
'after',
`
Documentation: https://github.com/YOUR_ORG/YOUR_REPO
Report bugs: https://github.com/YOUR_ORG/YOUR_REPO/issues`,
)
Colored Help (Optional)
import pc from 'picocolors'
program.configureHelp({
formatHelp: (cmd, helper) => {
const defaultHelp = helper.formatHelp(cmd, helper)
if (process.stdout.isTTY) {
return defaultHelp
.replace(/^Usage:/m, pc.bold('Usage:'))
.replace(/^Commands:/m, pc.bold('Commands:'))
.replace(/^Options:/m, pc.bold('Options:'))
}
return defaultHelp
},
})
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/cli-ux-polish-with-interactive-prompts-mt3wm0n2/download' --output '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md.part' && mv '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md.part' '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md' && test -s '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/cli-ux-polish' && cp -R '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2' '.claude/skills/cli-ux-polish'Cursor
test -f '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md' && test -s '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/cli-ux-polish' && cp -R '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2' '.cursor/skills/cli-ux-polish'Codex
test -f '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md' && test -s '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/cli-ux-polish' && cp -R '.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2' '.agents/skills/cli-ux-polish'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2'openskills read 'cli-ux-polish-with-interactive-prompts-mt3wm0n2'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/cli-ux-polish-with-interactive-prompts-mt3wm0n2/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.