본문으로 건너뛰기
Skillpedia
에이전트41k · #6520

best-of-n

하는 일

이 스킬은 AI가 중요한 작업에 대해 몇 가지 후보 해결책을 만들고, 같은 기준으로 점수를 매긴 뒤, 검증을 거쳐 가장 좋은 것을 사용하게 합니다. 비교할 가치가 있는 고위험 또는 모호한 결정을 위한 스킬입니다.

사용하는 경우

  • ✓설계나 구현에 그럴듯한 접근법이 여러 개 있어 비교가 필요할 때.
  • ✓디버깅이나 설명 작업이 위험해서 여러 답을 확인할 가치가 있을 때.
  • ✓접근법을 고르기 전에 명확한 채점 기준을 적용하고 싶을 때.

스킬 링크

https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/best-of-n/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/codewhale-hq/Codewhale/blob/main/crates/skills/assets/skills/best-of-n/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 캐싱 계층을 설계하는 방법을 세 가지로 시도해서 점수를 매기고, 테스트를 통과한 최고의 방법 하나만 적용해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 같은 작업과 기준으로 여러 독립 후보를 시작하고, 결과를 모아 평가한 뒤, 검증을 통과한 우승자만 적용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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

  1. Define one task, one evidence packet, and one explicit scoring rubric before launching candidates. Include correctness, fit to the request, simplicity, risk, and verification.
  2. Choose N from 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.
  3. 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.
  4. Prefer a session goal (create_goal or 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: true
  • write_authority: "worktree_write"
  • the same bounded write_roots or exact_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:

  1. Freeze the baseline, evaluator, hard gates, score rule, and authority before a larger search admits candidates. Any evaluator change starts a revision.
  2. 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.
  3. 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.
  4. Present the verified winner for review. Applying or merging is a separate, explicit user action; NONE is valid when every candidate fails.
  5. 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.

자주 묻는 질문

후보는 몇 개를 사용하나요?

기본은 세 개이며, 빠른 비교를 위해 두 개에서 네 개까지 허용합니다.

작은 변경에도 낭비인가요?

네. 스킬은 아주 작은 변경이거나 이미 접근법이 정해진 경우에는 사용하지 말라고 합니다.

후보가 파일을 바꿀 수 있나요?

제안, 검토, 조사는 읽기 전용으로 유지되며, 구현 후보는 별도의 worktree에서 작업합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6520
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬