Logo Clack

Clack

Cộng đồng
tuanductran
clack

Repository guidance for @clack/prompts usage in packages/hr-skills/src/cli/* and packages/hr-skills-build/src/server/build/*. Covers the intro/spinner/note/outro/log CLI-output pattern this repo actually uses — not clack's interactive text/select/confirm prompts, which this repo does not use.

Add to TypingMind

Tổng quan

Nhà phát hànhtuanductran
Kho mãhr-skills
Tên kỹ năngclack
Sao
78
Bản fork
20
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được tuanductran công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Clack trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/tuanductran/hr-skills/tree/main/.agents/skills/clack
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tuanductran/hr-skills.git /tmp/hr-skills
mkdir -p .claude/skills
cp -r /tmp/hr-skills/.agents/skills/clack .claude/skills/clack
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Clack trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Clack ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Clack với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

clack

Repository guidance for @clack/prompts (^1.7.0, see package.json) as used across packages/hr-skills/src/cli/*.ts and packages/hr-skills-build/src/server/build/sync.ts.

This repo's clack usage is narrow and deliberate. Every CLI here (discover, recommend, execute-plan, generate-plan, run-evaluation, sync, validate) is a single-shot, non-interactive script driven by process.argv — none of them collect input via clack's interactive prompts. Full upstream docs: Getting Started, Prompts, Best Practices.

What this repo actually uses

Only five clack APIs appear anywhere in this codebase — confirmed by grepping packages/hr-skills-build/src/server:

APIPurposeUsed in
p.intro(title)Announce the CLI at startEvery cli/*.ts entry point, plus server/build/sync.ts and server/validation/validate.ts
p.outro(message)Announce completion at end — including every failure path, or the box is left unterminatedSame as p.intro
p.spinner() / .start() / .stop()Show progress during buildRegistry(), validation, plan generation, and so onCreated via cliSpinner() in discover.ts, execute-plan.ts, generate-plan.ts, recommend.ts, run-evaluation.ts, server/validation/validate.ts
p.note(message, title?)Print a multi-line info block (search results, recommendations, usage)discover.ts, recommend.ts, execute-plan.ts, generate-plan.ts, run-evaluation.ts, cli-bootstrap.ts
p.log.{info,error,warn,success,message}Single-line status/error outputAll cli/*.ts, routed through cli/cli-bootstrap.ts

p.note titles are SCREAMING CASE at every call site (RESULTS FOR …, EXECUTION PLAN, USAGE). Keep it that way.

What this repo does NOT use — do not introduce it

  • No text(), select(), confirm(), multiselect(), password(), or any other interactive prompt. These CLIs must stay scriptable (CI, bunx, piped output); blocking on stdin input would break that. If a task genuinely needs a human choice, that belongs in .claude/commands/*.md (Claude Code slash commands), not in packages/hr-skills-build's CLIs.
  • No isCancel(). It only matters when interactive prompts are in play — irrelevant here. Don't add it "for safety"; it signals dead code review comments.
  • No @clack/core low-level primitives (TextPrompt, custom Prompt subclasses). @clack/prompts alone covers everything this repo needs.

If a future CLI genuinely needs interactive input, that's a deliberate scope change — flag it explicitly rather than silently adding text()/select() to keep the "always scriptable" invariant intact.

Repository pattern

Every CLI entry point in src/cli/*.ts follows this shape (see cli/cli-bootstrap.ts):

typescript
import * as p from '@clack/prompts';
import { type CliUsage, cliSpinner, printUsageAndExit, runCli } from './cli-bootstrap.js';

const USAGE: CliUsage = {
  title: 'My Command',
  usage: 'bun run my-command "<argument>"',
  example: 'bun run my-command "example"',
};

async function main() {
  const intent = process.argv[2];

  // Reject a bare flag in the positional slot too, not just an empty one.
  if (!intent || intent.startsWith('--')) {
    printUsageAndExit(USAGE);
  }

  p.intro(USAGE.title);

  const spinner = cliSpinner();
  spinner.start('Building Skill Registry...');
  const registry = await buildRegistry();
  spinner.stop(`Registry ready (${registry.skillCount} skills)`);

  // ... do the work, p.note(...) for structured output ...

  p.outro('Done');
}

runCli(main, USAGE);
  • One CliUsage per command, shared by printUsageAndExit, runCli, and p.intro(USAGE.title), so the --help screen and the bad-invocation error can't drift apart.
  • Pass USAGE to runCli. That is what implements --help/-h: it prints usage and exits 0 before main() runs. Omit it and the command treats --help as a positional argument — which is how bun run evaluate --help once ran the whole evaluation suite and bun run plan --help generated a plan for the literal intent "--help".
  • Use cliSpinner(), never p.spinner() directly. A running spinner repaints every 80ms by erasing the lines beneath it, and clack's exit handler then stamps "Canceled" over the area — so an error thrown mid-spin is invisible. cliSpinner() registers the spinner so runCli can stop it with the real message.
  • printUsageAndExit / runCli standardize the bad-invocation and uncaught-error paths — see cli-bootstrap. Don't hand-roll p.log.error(...); process.exit(1); again; that duplication is exactly what cli-bootstrap.ts was extracted to remove (see dry-refactoring). Prefer letting a typed error propagate to runCli over catching it locally.
  • p.intro/p.outro bookend the whole run — call each exactly once, on success and failure alike. p.log.* output renders with clack's │ gutter but no ┌ above and no └ below, so an exit(1) with no outro leaves a visibly broken box.
  • Validate flag values, not just presence: --limit 0 and --limit abc used to reach the search layer as 0/NaN and produce "no results", blaming the query for a bad flag. Reject unknown flags too, rather than ignoring them.
  • spinner.stop(message) should report a concrete result (count, duration), not just "Done" — matches the existing Registry ready (${registry.skillCount} skills) style.
  • A CLI module that anything else imports (validation/validate.ts is imported by its own test) keeps its if (import.meta.main) guard around runCli, and parses process.argv inside it — otherwise a plain import runs the command or parses the host process's flags.

Key prompts

Adding a new CLI

  • "Scaffold a new src/cli/*.ts entry point following this repo's clack pattern."
  • "Wire this new CLI through cli-bootstrap.ts's runCli/printUsageAndExit."

Reviewing clack usage

  • "Check whether this CLI change introduces an interactive prompt that would break scriptability."
  • "Review this p.spinner() usage for a concrete stop message."
  • "Is this p.log.* call redundant with what cli-bootstrap.ts already provides?"

Tips

  • Keep p.intro/p.outro messages short — they're a visual bookend, not a status report.
  • Prefer p.note() over multiple p.log.message() calls when printing a related block (search results, a plan summary) — it groups visually.
  • Never gate a cli/*.ts script on user input; that's the one hard rule this skill exists to protect.

Câu hỏi thường gặp

Kỹ năng AI Clack làm được gì?

Repository guidance for @clack/prompts usage in packages/hr-skills/src/cli/* and packages/hr-skills-build/src/server/build/*. Covers the intro/spinner/note/outro/log CLI-output pattern this repo actually uses — not clack's interactive text/select/confirm prompts, which this repo does not use.

Vì sao nên dùng Clack trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Clack là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Clack trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/tuanductran/hr-skills/tree/main/.agents/skills/clack. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Clack?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Clack với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Clack với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Clack có miễn phí không?

Có. Kỹ năng này được tuanductran phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇