best-of-n
Skill này làm gì
Skill này để AI tạo một vài phương án ứng viên cho một tác vụ quan trọng, chấm điểm chúng theo cùng tiêu chí, và dùng phương án tốt nhất sau khi kiểm chứng. Skill dành cho các quyết định hệ trọng hoặc mơ hồ, nơi so sánh các lựa chọn đáng để làm thêm.
Khi nào nên dùng
- ✓Khi một thiết kế hoặc triển khai có nhiều cách tiếp cận hợp lý cần so sánh.
- ✓Khi một tác vụ gỡ lỗi hoặc giải thích đủ rủi ro để đáng kiểm tra nhiều câu trả lời.
- ✓Khi bạn muốn áp dụng một bộ tiêu chí chấm điểm rõ ràng trước khi chọn cách tiếp cận.
Liên kết skill
https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/best-of-n/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thử ba cách thiết kế khác nhau cho lớp cache này, chấm điểm chúng, và chỉ áp dụng phương án tốt nhất sau khi nó vượt qua bài kiểm tra.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI khởi động nhiều ứng viên độc lập với cùng tác vụ và tiêu chí, thu thập kết quả, đánh giá chúng, và chỉ áp dụng phương án thắng sau khi xác minh đạt.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Best of N
Use this skill when a consequential design, implementation, explanation, or debugging task has several plausible solutions and comparison is worth the extra model work. In Operate mode this is the preferred ensemble pattern for high-stakes or ambiguous approaches. Do not use it for a tiny change or when the user has already chosen the approach.
Set The Tournament
- Define one task, one evidence packet, and one explicit scoring rubric before launching candidates. Include correctness, fit to the request, simplicity, risk, and verification.
- Choose
Nfrom 2 to 4 for a quick comparison (default 3). For an explicit experimental search, use the Workflow search option: 2–16 live candidates, with larger validated populations queued at the Workflow host's 16-worker concurrency gate rather than launched at once. - Give every candidate the same task and rubric. Add only a candidate number; do not steer candidates toward different conclusions unless diversity is an explicit part of the request.
- Prefer a session goal (
create_goalor active/goal) when the tournament spans more than one parent turn.
Generate Independently
Start the candidates as parallel background agent workers and return agent_ids
immediately so the parent stays free. For proposals, reviews, or research, keep
them read-only:
{
"action": "start",
"name": "candidate_1",
"prompt": "Produce candidate 1 for the task below. Return the proposal, evidence, risks, and rubric self-score. Do not edit files.\n\n<TASK AND RUBRIC>",
"type": "worker",
"model_strength": "same",
"write_authority": "read_only"
}
Launch the remaining candidates with the same contract, then use agent wait
or completion events to collect every result. Do not show one candidate another
candidate's answer before generation finishes.
When candidates must implement code, give each one:
type: "builder"worktree: truewrite_authority: "worktree_write"- the same bounded
write_rootsorexact_files
Never run parallel writers in the parent checkout. Each builder must return the structured candidate contract (candidate id, hypothesis, paths, commands, self-verdict, risks, and artifact references). A self-verdict is evidence to inspect, not a hard-gate result.
Optional diversity: pin different model / Fleet fleet_profile values when
the project has multiple capable routes; otherwise keep model strength same.
Judge Once
Use one read-only reviewer worker, or the parent when the result is small, to score all candidates against the original rubric. The judge must:
- cite evidence from each candidate rather than vote by style;
- reject candidates that violate authority, scope, or verification gates;
- treat candidate-reported commands and PASS claims as untrusted until replay;
- name the winner and the decisive reasons;
- identify useful pieces worth combining, if any;
- say when the candidates are tied or all fail.
Do not ask candidates to vote for themselves. Do not silently merge incompatible approaches into a new unreviewed solution.
Integrate Only After PASS
For proposal-only work, return the winning answer with a compact score summary. For code work:
- Freeze the baseline, evaluator, hard gates, score rule, and authority before a larger search admits candidates. Any evaluator change starts a revision.
- After a worker loses write authority, apply its patch to a clean baseline and let the runtime—not that worker—run hard gates and scoring.
- Inspect the winning worktree diff and independently replay it on the clean baseline. A different read-only model may look for gaming, but deterministic tests remain the authority.
- Present the verified winner for review. Applying or merging is a separate,
explicit user action;
NONEis valid when every candidate fails. - Preserve losing and failed candidate receipts as useful negative results.
The checked-in operate_best_of_n.workflow.js recipe supports
strategy: "search" for structured 2–16 candidate generation and review. It
does not yet turn prompt-listed commands into hidden runtime gates. Do not
advertise those gates until a runtime evaluator host consumes a frozen search
spec.
Stop early when one candidate reveals a hard constraint that invalidates the tournament. Report the negative result rather than spending the remaining budget to manufacture variety.
Câu hỏi thường gặp
Có bao nhiêu ứng viên được dùng?
Mặc định là ba, và skill cho phép từ hai đến bốn ứng viên để so sánh nhanh.
Có lãng phí với thay đổi nhỏ không?
Skill nói không nên dùng cho thay đổi rất nhỏ hoặc khi cách tiếp cận đã được chọn.
Các ứng viên có thể thay đổi tệp không?
Đề xuất, đánh giá và nghiên cứu vẫn ở chế độ chỉ đọc, còn các ứng viên triển khai làm việc trong worktree riêng.
Chi tiết
Mô tả gốc của tác giả
Generate a small set of independent candidate solutions in worktrees, judge them against one explicit rubric, and apply the winner only after PASS verification.
repo: codewhale-hq/Codewhale
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6520
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
dataviz
41kGiúp agent của bạn chọn biểu đồ hoặc bảng điều khiển phù hợp với dữ liệu, có nhãn rõ ràng, ghi chú nguồn và kiểm tra trục cùng giá trị bị thiếu.
debug
41kGiúp agent của bạn tìm nguyên nhân thật của một lỗi bằng cách tái hiện, thu hẹp phạm vi, và chỉ sửa khi bạn đồng ý, thay vì đoán mò.
delegate
41kDạy agent của bạn chia một tác vụ lớn thành các trợ lý song song có trọng tâm, đồng thời giữ việc lập kế hoạch, tích hợp và kiểm tra cuối trong tay mình.
dependency-update
41kGiúp agent của bạn cập nhật một nhóm phần mềm phụ thuộc đã nêu, đọc ghi chú phát hành, sửa thay đổi gây lỗi và chạy các bước kiểm tra của dự án.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.