Skip to content
cccskills
FreePublished on GitHub

best-of-n

Generate several separate solutions, compare them against criteria fixed in advance, and verify the selected result through executable checks or an independent reviewer. Keep a proof log documenting candidates, evidence, failures, and remaining limits.

OriginalShow the original description

Generate bounded independent candidates, score them against a frozen rubric, and verify the selected result with a proof log.

See how to install

Good for

  • Comparing implementation options before choosing one
  • Verifying a solution when a wrong choice would be costly
  • Keeping evaluation evidence for delivery or audit

Files included (1)

  • SKILL.md4.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Best-of-N selection and proof

Use this skill when a task has several plausible solutions, a wrong choice is costly, and a deterministic check or independent reviewer can evaluate the selected result. Do not use it for mechanical work with one clear implementation and a direct acceptance test.

Read the full method at Best-of-N: Generate, Select, and Verify before running the protocol.

Inputs to collect before generation

  • Task scope, exclusions, repository revision, environment, permissions, and budget.
  • Acceptance criteria, mandatory failure conditions, and executable checks.
  • A rubric with weights, observable anchors, passing threshold, tie-breaker, candidate count or predeclared batch schedule, and stop rule.
  • The selected TESTING.md path. Start from the portable proof-log template.

If any item is missing, return needs_contract and list the missing fields. Do not generate candidates first and invent the rubric afterward.

Procedure

  1. Freeze the contract in the proof log. Default to three candidates. Use five only when the expected improvement justifies the additional generation, scoring, and verification cost. If work runs in batches, declare every batch and the between-batch stop condition before generation.
  2. Generate each candidate from the same frozen contract. Do not reveal candidate text, scores, or private reasoning across generators. Assign an opaque identifier to every generated candidate.
  3. Preserve each candidate as a separate artifact. For code, use isolated diffs or worktrees from the same base revision. Add one proof-log line for every generated candidate, including every candidate in Best-of-5 and rejected candidates.
  4. Blind provenance and presentation order for scoring when practical. Apply the fixed rubric to every candidate in the declared N, or to every candidate in the completed predeclared batch. Record criterion-level evidence and disqualify mandatory failures.
  5. Select the highest passing candidate using the declared tie-breaker. Treat any combination of candidate fragments as a new synthesized candidate with its own ID, score, and verification.
  6. Run the declared executable checks in the recorded environment. Capture commands, output location, exit status, artifact hash or revision, and uncovered scope.
  7. If executable verification cannot decide the requirement, request a reviewer who did not generate the candidate and who receives a fresh task packet. Record shared model, context, tools, and repository access as correlation risks.
  8. Finish the proof log with PASS, FAIL, or UNKNOWN. UNKNOWN blocks a claim that the requirement was verified.

Guardrails

  • Candidate generation is not selection. Selection is not synthesis. Majority vote is not evidence of correctness.
  • Never use a self-grading generator as the only acceptance gate.
  • Generate and score all candidates in the declared N before selection. A batched run may stop only after the complete predeclared batch is evaluated and its predeclared stop condition is met. Do not keep sampling until an answer feels persuasive.
  • Do not claim candidates are independent solely because they came from different calls. State the isolation controls and remaining shared context.
  • Preserve failed candidates and failed checks in the proof log. They bound what was actually tested.

Required output

Return this concise record and write the full details to TESTING.md:

BEST-OF-N RESULT
Task: <scope>
Contract: <rubric version, N or batch schedule, stop rule>
Candidates: <every generated candidate ID>
Selected: <candidate ID or none>
Verification: PASS | FAIL | UNKNOWN
Evidence: <proof-log path and artifact links>
Remaining limits: <uncovered scope or none>

Connections

Use Dynamic Workflows for durable parallel stages and schemas. Pair this skill with TDD with Claude Code, Agent Evaluation, Code Review, and AI traceability when the result will be delivered or audited.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Evaluate Claude Code agents, skills, and commands with weighted quality criteria. Get scores, readiness grades, template comparisons, and practical improvement suggestions in Markdown or JSON reports to guide reviews before release.

  • Review skills before release
  • Compare agent definitions with reference templates
  • Quickly check critical quality criteria
FlorianBruniaux/claude-code-ultimate-guide6.2KUpdated Oct 23, 2026

audit-codebase

FreeSummary

Assess a codebase across seven areas, including exposed credentials, security, dependencies, structure, and tests. Receive category scores, findings tied to file locations, and a prioritized improvement plan with smaller tasks that can be completed quickly.

  • Assessing the overall health of an inherited project
  • Reviewing exposed credentials and security risks
  • Identifying dependency and test coverage gaps
FlorianBruniaux/claude-code-ultimate-guide6.2KUpdated Oct 23, 2026

autoresearch

FreeSummary

Measure code patterns such as casts to any or disabled lint rules, then run repeated, targeted edits. Keep changes that improve the chosen metric, revert unsuccessful changes, and track results for each improvement loop.

  • Finding code patterns to prioritize for cleanup
  • Preparing measurement files for an improvement loop
  • Repeating targeted edits to reduce casts to any
FlorianBruniaux/claude-code-ultimate-guide6.2KUpdated Oct 23, 2026

canary

FreeSummary

Monitor a live application after deployment and compare it with a saved baseline, a record of its earlier state. Check page responses, loading times, and new errors, flag persistent changes, and produce a per-page health report.

  • Recording a healthy baseline before deployment
  • Monitoring production immediately after deployment
  • Checking key pages for slower responses or failures
FlorianBruniaux/claude-code-ultimate-guide6.2KUpdated Oct 23, 2026

catchup

FreeSummary

Rebuild project context after clearing a conversation or returning to work. Review recent Git history, uncommitted changes, and TODO markers to get a structured summary of project status and suggested next steps.

  • Restoring project context after /clear
  • Reviewing recent changes after a long break
  • Checking unfinished work before choosing the next task
FlorianBruniaux/claude-code-ultimate-guide6.2KUpdated Oct 23, 2026

ccboard

FreeSummary

Launch a terminal or web dashboard to inspect Claude Code activity across projects. Browse sessions, search messages, track token usage and estimated costs, and check MCP servers that connect external tools to the agent.

  • Checking daily usage and estimated costs
  • Searching past conversations across projects
  • Investigating MCP server status
FlorianBruniaux/claude-code-ultimate-guide6.2KUpdated Oct 23, 2026

See all skills by FlorianBruniaux

Report a problem with this skill