clack
Original:🇺🇸 English
Translated
5 scriptsChecked / no sensitive code detected
Build and maintain interactive Node.js/Bun CLIs with Clack (`@clack/prompts` and `@clack/core`). Use when an AI agent needs to design prompt flows, implement cancellation-safe input handling, add spinners/log/note UX, apply Clack best practices, or generate runnable examples aligned with official Clack docs.
12installs
Sourcealexeira/skills
Added on
NPX Install
npx skill4agent add alexeira/skills clackTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Clack CLI Skill
Implement robust, user-friendly CLI flows with Clack.
Follow This Workflow
- Identify the implementation target.
- Use for most interactive CLI flows.
@clack/prompts - Use for low-level/custom prompt rendering and lifecycle control.
@clack/core
- Load only the relevant references.
- Prompt-centric workflows:
references/prompts-api.md - Low-level/core extension work:
references/core-api.md - UX and reliability review:
references/best-practices.md - Pattern selection and scaffolding:
references/examples.md - Source links and freshness checks:
references/sources.md - If user asks for a starter file quickly, run .
scripts/scaffold-clack.sh
- Build a minimal runnable skeleton first.
- Include imports, , flow logic, and
intro().outro() - Add install/run commands for the user's runtime.
- Add prompts with explicit validation and cancellation paths.
- Validate every user-facing field that can fail constraints.
- Handle cancellation after each prompt result with and
isCancel(...).cancel(...)
- Add UX support functions intentionally.
- Use for structured feedback.
log.* - Use for long-running single operations.
spinner() - Use for summaries and next actions.
note()
- For asynchronous multi-step work, use task-oriented patterns.
- Prefer clear status updates and concise task titles.
- Keep success/error messages short and actionable.
- Finalize with a production-ready answer.
- Return complete runnable code (not fragments) unless user asks otherwise.
- Include quick verification steps.
Bundled Resources
-
scripts/scaffold-clack.sh -
Generate a starter CLI from curated templates in JS or TS.
-
Usage:
bash scripts/scaffold-clack.sh <target-dir> [basic|spinner] [js|ts] [auto|npm|pnpm|yarn|bun] -
assets/templates/basic-cli.mjs -
Baseline prompt flow with validation, cancellation handling, and summary note.
-
assets/templates/spinner-cli.mjs -
Prompt flow plus spinner-driven execution pattern for longer operations.
-
assets/templates/basic-cli.ts -
TypeScript variant of the baseline prompt flow.
-
assets/templates/spinner-cli.ts -
TypeScript variant of the spinner flow.
Non-Negotiable Rules
- Always include a cancellation-safe path.
- Never assume valid input; validate and explain fixups in-place.
- Use consistent tone in status and error messages.
- Keep prompt trees shallow; split complex flows into grouped steps.
- Prefer sensible defaults to reduce user typing and errors.
Freshness Policy
- Treat Clack APIs as evolving.
- Use as the source-of-truth link map.
references/sources.md - If the user asks for the latest behavior or version-specific details, re-check the official docs before finalizing.
- If no web access is available, state that constraint explicitly and stick to documented APIs in this skill.