Logo Write Case

Write Case

Cộng đồng
jameskomo
write-case

Author or fix an eval case (prompt.md, graders/*.md, case.yaml) for a Claude Code plugin, skill, or hook in the official `claude plugin eval` format. Use when the user says "write an eval for", "add a test case for this skill/hook", "my grader is wrong", or "how do I assert the hook fired". Do not use to run the suite or explain a red result (that is run), or to fix the setup after a regression (that is repair).

Tổng quan

Nhà phát hànhjameskomo
Kho mãconfig-drift-checker
Tên kỹ năngwrite-case
Sao
33
Bản fork
1
Tệp đi kèm
Chỉ có hướng dẫn
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 là Markdown thuần túy, không phải 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ộ.

  • Đầy đủ trong hướng dẫn

    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 jameskomo công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Write Case 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 thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/jameskomo/config-drift-checker/tree/main/config-drift-checker/skills/write-case
  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/jameskomo/config-drift-checker.git /tmp/config-drift-checker
mkdir -p .claude/skills
cp -r /tmp/config-drift-checker/config-drift-checker/skills/write-case .claude/skills/write-case
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 Write Case 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ự tải Write Case 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 Write Case không bị giới hạn ở mô hình mà kỹ năng này được viết cho. 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 kỹ năng chưa dùng không tốn chi phí.

  • Đổ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.

config-drift-checker: write-case

Layout: <plugin>/evals/<case-dir>/prompt.md, graders/<name>.md, optional case.yaml.

prompt.md frontmatter: name, description (one sentence a reviewer would read in the report: what this case proves and which part of the setup it exercises), tags: [..], a covers.yaml sidecar next to prompt.md (the rule ids this case exercises; node ${CLAUDE_PLUGIN_ROOT}/tools/config-coverage.mjs <plugin> --list prints them; a negative-trigger case covers nothing, that is correct). Target ids the --list output marks · (uncovered) before adding a second case for a ✓ one. Every new case should move the coverage %, which the Action reports and can enforce with coverage-min. runs (3), max_turns, timeout_seconds, allowed_tools: [Bash] (only what the case needs), model. Body = the user prompt, written the way a real user would write it (do not mention the skill or hook by name).

graders/*.md frontmatter type:

  • regex: pattern, flags, match: contains|not_contains|count:N, target
  • tool_used: tool, input_match, min, max
  • file_exists: path (glob), exists
  • llm: focus (never target: the official runner rejects it on llm graders); the file body is the criteria (one paragraph; "score 1 only if all hold")
  • any grader: weight, and arm: with-only or arm: both (the only two values the official runner accepts)

What target (regex) and focus (llm) can point at, exactly as claude plugin eval defines it: last_message (default), trace, files (the list of paths Claude created, not their contents), or { source: file, path: <path> } (the contents of one workspace file after the run). To grade code, either ask the agent to print it ("Print the complete Java source in your reply") and grade last_message, or grade the file it must write with { source: file, path: ... }. Body = one sentence a reviewer would understand.

case.yaml (schema_version: "1.1", and name equal to the case's directory name so --case globs match the folder under both runners): context.scaffold_script names a script file in the case directory (scaffold.sh), never an inline script: it gives the agent a state to act on (a git repo, a file, a branch). The official runner runs it with no EVAL_* variables, so a script that needs the plugin's files locates itself: ROOT="${EVAL_PLUGIN_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}". context.add_dirs lists read-only fixture directories.

Rules that came from real failures

  1. not_contains graders must match code position (^\s*@Autowired, flag m), never a word that can appear in prose, because the model will say "I avoided X".
  2. A negative-trigger case (tool_used: Skill, max: 0, arm: both) for every skill.
  3. Hook cases: choose a command the model will attempt in a scratch repo (git reset --hard HEAD, git clean -fd), not one it refuses on its own (git push --force origin main). Assert three things: attempted (tool_used Bash), reported blocked (regex), not succeeded (regex not_contains on success phrases like "HEAD is now at|ran successfully").
  4. tool_used: Skill graders are indicators under ablation, not score. That is correct; add arm: both only when the assertion must hold without the plugin too.
  5. Keep prompts short and realistic; put setup in scaffold_script, not in the prompt.
  6. Regex over Java/TS: never rely on name\([^)]*\) to find a method; parameter annotations contain parentheses. Anchor on something unique and flat (the mapping annotation string, the record name) and use a bounded lazy window [\s\S]{0,900}?.
  7. Test every regex against a hand-written snippet of the expected code with node -e before spending an agent run; a grader that fails a correct answer costs more trust than it saves.
  8. Safety (learned the hard way): the without-arm has no guard, and workspaces do not sandbox Docker, the network, or the host. A hook case's command must be harmless when it succeeds: scratch git repo, or a stub binary created by scaffold_script in .eval-bin/ (printf '#!/usr/bin/env bash\necho stub $*\n' > .eval-bin/docker-compose; chmod +x …). The runner's safety net blocks compose down -v / prune / force-push / rm -rf outside the workspace unless the binary is stubbed. Check for name:/container_name: in compose files and for real remotes before writing the prompt.
  9. Turn budgets: real-code cases need max_turns: 30 (read → edit 2–4 files → test); single-file or prose cases 12; hook cases 6. Runs that hit the cap are scored as-is and flagged TRUNCATED; a signal to raise the budget, not a failure of the setup.

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

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

Author or fix an eval case (prompt.md, graders/*.md, case.yaml) for a Claude Code plugin, skill, or hook in the official `claude plugin eval` format. Use when the user says "write an eval for", "add a test case for this skill/hook", "my grader is wrong", or "how do I assert the hook fired". Do not use to run the suite or explain a red result (that is run), or to fix the setup after a regression (that is repair).

Vì sao nên dùng Write Case 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. Write Case 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 Write Case trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/jameskomo/config-drift-checker/tree/main/config-drift-checker/skills/write-case. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà 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 Write Case?

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.

Bạn có thể dùng Write Case 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 Write Case 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 Write Case có miễn phí không?

Kỹ năng này được jameskomo phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. 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 cho mô hình các công cụ mới để gọi — mã đượ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à tiêu chí của đầu ra tốt. 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 👇