Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add RoyZhao1991/LingShu --skill best-of-ngit clone --depth 1 https://github.com/RoyZhao1991/LingShuWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/royzhao1991/lingshu/best-of-n)<a href="https://agentmods.dev/skills/royzhao1991/lingshu/best-of-n"><img src="https://agentmods.dev/badge/skills/royzhao1991/lingshu/best-of-n/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/royzhao1991/lingshu/best-of-n"><img src="https://agentmods.dev/badge/skills/royzhao1991/lingshu/best-of-n.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00062 | $0.00785 |
| Opus 5 | $0.00031 | $0.00392 |
| Sonnet 5 | $0.00012 | $0.00157 |
| Haiku 4.5 | $0.00006 | $0.00078 |
Grade A, and why
best-of-n scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- best-of-n — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/best-of-n -- Parallel Implementation Tournament
Implement a task multiple different ways in parallel, evaluate all candidates, and apply the best one.
Usage
/best-of-n [N] <task>
- If the first token is a number 2-10, it sets the candidate count; the rest is the task.
- If omitted, N defaults to 3.
Examples:
/best-of-n implement the login page(3 candidates)/best-of-n 5 refactor the auth module(5 candidates)
Steps
-
Parse the user's message to extract N (candidate count, default 3) and the task description.
-
Spawn N subagents in a single message (parallel tool calls). Use the
tasktool for each with:subagent_type:"general-purpose"isolation:"worktree"run_in_background:truedescription:"Candidate <number>"prompt: the task description, plus"You are candidate <number> of <N> independent implementations. Implement the task fully. When done, summarize your approach and the changes you made."
-
Wait for all candidates to complete using
get_task_outputwithblock: trueorwait_taskswithmode: "wait_all". -
Evaluate and pick the winner using the criteria below.
-
Apply the winner's changes from its worktree to the main workspace. Review the changes in context and fix any remaining issues.
-
End your response with
WINNER: <number>(1-N).
Evaluation Criteria
Evaluate each candidate on these axes, in order of importance:
-
Correctness -- Does the candidate actually solve the task? Does it handle the requirements completely, or does it miss important aspects? Are there logic errors, type errors, or broken imports?
-
Code Quality -- Is the code clean, readable, and well-structured? Does it follow the patterns and conventions of the surrounding codebase? Does it avoid unnecessary complexity?
-
Safety -- Does the candidate avoid introducing bugs, security issues, or breaking changes to existing functionality?
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 94 lines · 62 tokens per session scan A e0e1849ead8d
best-of-n is a skill published in the GitHub repository RoyZhao1991/LingShu (12 stars, last pushed 23d ago), licensed Apache-2.0. It adds 62 tokens to every session and 785 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
massgen-log-analyzer
Run MassGen experiments and analyze logs using automation mode, logfire tracing, and SQL queries. Use this skill for performance analysis, debugging agent behavior, evaluating coordination patterns, and improving the logging structure, or whenever an ANALYSISREPORT.md is needed in a log directory.
backend-integrator
Complete guide for integrating a new LLM backend into MassGen. Use when adding a new provider (e.g., Codex, Mistral, DeepSeek) or when auditing an existing backend for missing integration points. Covers all 15 files that need touching.
massgen-develops-massgen
Guide for using MassGen to develop and improve itself. This skill should be used when agents need to run MassGen experiments programmatically (using automation mode) OR analyze terminal UI/UX quality (using visual evaluation tools). These are mutually exclusive workflows for different improvement goals.
release-prep
Prepare release documentation including CHANGELOG entry, announcement text, and validation. Run before tagging a new release.
model-registry-maintainer
Guide for maintaining the MassGen model and backend registry. This skill should be used when adding new models, updating model information (release dates, pricing, context windows), or ensuring the registry stays current with provider releases. Covers both the capabilities registry and the pricing/token manager.
serena
This skill provides symbol-level code understanding and navigation using Language Server Protocol (LSP). Enables IDE-like capabilities for finding symbols, tracking references, and making precise code edits at the symbol level.