clack
SKILL.md
Clack CLI Skill
Implement robust, user-friendly CLI flows with Clack.
Follow This Workflow
- Identify the implementation target.
- Use
@clack/promptsfor most interactive CLI flows. - Use
@clack/corefor low-level/custom prompt rendering and lifecycle control.
- 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,
intro(), flow logic, andoutro(). - 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
isCancel(...)andcancel(...).
- Add UX support functions intentionally.
- Use
log.*for structured feedback. - Use
spinner()for long-running single operations. - Use
note()for summaries and next actions.
- 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
references/sources.mdas the source-of-truth link map. - 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.
Weekly Installs
10
Repository
alexeira/skillsFirst Seen
Feb 19, 2026
Security Audits
Installed on
codex10
opencode9
gemini-cli9
github-copilot9
kimi-cli9
amp9