ds-best-of-n — Claude Code skill: what it does, how to install
The ds-best-of-n Claude Code skill creates several independent versions of a task and combines the strongest result with selected parts from the others. It runs for substantial work where a single attempt may take the wrong direction.
MIT 539 installs ★ 320 updated 2026-10-28
npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a claude-codeWhat ds-best-of-n does
The skill generates multiple versions of one artifact, tests them, then builds a final result from the strongest candidate. It sets a shared prompt and private scoring criteria first. Attempts run at the same time in separate locations; if subagents are unavailable, the skill runs them one after another in fresh contexts.
Each candidate gets a build, tests, or a quick execution check. The skill drops failures, picks a base by overall structure, then transfers specific good ideas from other candidates without merging entire files. It runs the full checks again and reports the result.
The default is 3 attempts; use 5 when there are many possible directions. If none passes after a rerun with a clarified prompt, the agent reports the failure.
What it helps with
- compare several solutions to one task
- discard candidates that fail checks
- move strong details into a chosen base
- rerun checks on the assembled result
Example prompts for the agent
- Run
/ds-best-of-non this task and combine the strongest results. - Create three versions, test them, and assemble the best parts.
- Compare several implementations and merge selected improvements into one.
How to install ds-best-of-n
1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a claude-code2Manually: put the files in place
~/.claude/skills/ds-best-of-n/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ds-best-of-n/
1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a codex2Manually: put the files in place
.agents/skills/ds-best-of-n/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a cursor2Manually: put the files in place
.cursor/skills/ds-best-of-n/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aicodeking/deepseek-stack skills/ds-best-of-n2Manually: put the files in place
.github/skills/ds-best-of-n/SKILL.md1Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a gemini-cli2Platform CLI
gemini skills install https://github.com/aicodeking/deepseek-stack --path skills/ds-best-of-nManually: put the files in place
.devin/skills/ds-best-of-n/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ds-best-of-n
How do I install ds-best-of-n in Claude Code?
Run npx skills add aicodeking/deepseek-stack --skill ds-best-of-n -a claude-code. The skill file is at ~/.claude/skills/ds-best-of-n/SKILL.md.
What does ds-best-of-n do?
It produces multiple versions of a task, checks them, and transfers selected strengths into the best-structured candidate. Then it reruns the checks.
How many attempts does ds-best-of-n make?
It uses 3 by default and 5 when the task has a wider design space.
Source text
SKILL.md · MIT
--- name: ds-best-of-n description: "Run N independent attempts at the same task in parallel, pick the strongest as the base, and graft the best parts of the others into it. Use when one attempt at a non-trivial artifact could land on the wrong shape, or for /ds-best-of-n, 'try a few versions', 'best of 3'." --- # ds-best-of-n One attempt is a sample, not an answer. DeepSeek is cheap enough that three to five attempts usually cost less than one round of fixing a bad first try. ## Steps 1. Frame the task. Write one prompt that every attempt gets unchanged. Write a private rubric of 3 to 6 concrete, checkable criteria. Attempts never see the rubric. 2. Pick N. Use 3 by default and 5 when the design space is wide. Give each attempt its own output location, such as a git worktree or a separate temp folder. 3. Spawn N subagents at once with the prompt, the shared context and their output path. Ask each for the artifact plus a short note on alternatives it rejected. If a harness cannot run subagents, run the attempts one after another in fresh contexts. 4. Check each attempt. Run its build, tests or a quick probe. Record pass or fail with output. Discard attempts that do not run. 5. Score the survivors against the rubric. Pick the one with the best overall structure as the base. Structure beats polish. 6. List the specific strong parts of the other attempts: a test, an edge case, a cleaner function. Graft only those into the base. Do not merge whole files. 7. Re-run the full checks on the grafted result and show the output. ## Stop when - The grafted result passes every check and you have reported base, grafts and scores. - Or no attempt passes after one re-run with a clarified prompt. Report what failed. ## Rules - Never pick by reading the attempt's own summary. Pick by running it. - Do not let one attempt see another before scoring. - Keep the losing attempts until the final checks pass.
© aicodeking · MIT · aicodeking/deepseek-stack