Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计异常

horse-race赛马

Agent Skill

horse-race 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

371

周安装

15

GitHub Stars

2

下载量

116
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:horse-race(赛马)
来源仓库:https://github.com/qiao/horse-race-skill
仓库路径:skills/horse-race
安装命令:
npx skills add https://github.com/qiao/horse-race-skill --skill horse-race
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/qiao/horse-race-skill --skill horse-race

简介

用于处理 GitHub 仓库、Issue、Pull Request 等协作信息。

  • 适合围绕代码变更、项目状态或团队协作进行整理和操作。
  • 通过 npx skills add 命令从指定仓库安装。
  • 支持 Codex、Claude、Cursor、Gemini CLI,安装方式为 github。
  • horse-race 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Horse Race: Competitive Multi-Agent Problem Solving

You are orchestrating a "horse race" — multiple independent agents competing to produce the best solution to a programming task. Agents can be Claude Code subagents or OpenAI Codex CLI agents (when available). The process has three phases: independent implementation, cross-pollination improvement rounds, and Borda count consensus voting by independent judges.

Overview

Phase 0: Detect Codex CLI
  `which codex` → found?
  Yes → 2 Claude Code + 2 Codex CLI agents (4 total)
  No  → 3 Claude Code agents

Phase 1: Independent Implementation
  Agent A (Claude) ──► Solution A
  Agent B (Claude) ──► Solution B    (all in parallel, isolated worktrees)
  Agent C (Codex)  ──► Solution C
  Agent D (Codex)  ──► Solution D

Phase 2: Improvement Rounds (repeat N times)
  Each agent receives ALL other agents' diffs
  Agent A sees B+C+D diffs ──► Improved A'
  Agent B sees A+C+D diffs ──► Improved B'   (all in parallel)
  Agent C sees A+B+D diffs ──► Improved C'
  Agent D sees A+B+C diffs ──► Improved D'

Phase 3: Borda Count Voting by Independent Judges
  3 fresh judge agents rank all solutions
  Points tallied, highest Borda score wins
  Ties broken by a 4th independent judge
  Winning diff applied to current branch

Defaults

  • Implementation agents: 4 if Codex CLI available (2 Claude Code + 2 Codex), otherwise 3 (all Claude Code)
  • Improvement rounds: 1
  • Voting judges: 3
  • Voting method: Borda count, ties broken by independent tiebreak judge

The user can override these, e.g., "horse race this with 5 agents and 3 rounds".

Execution

Step 0: Preparation

Before spawning agents:

  1. Confirm you're in a git repository with a clean working tree (no uncommitted changes). If dirty, ask the user to commit or stash first.
  2. Extract the task description from the user's message.
  3. Parse any overrides for agent count or round count.
  4. Note the current branch name and HEAD commit.
  5. Detect Codex CLI by running which codex. If the command is found, set codex_available = true and plan for 2 Claude Code agents + 2 Codex CLI agents (4 total). If not found, set codex_available = false and use 3 Claude Code agents. Tell the user which configuration was detected.

Step 1: Independent Implementation (Phase 1)

Spawn all agents in a single message so they run in parallel.

Claude Code Agents

For each Claude Code agent (numbered 1 through N_claude), use the Agent tool with isolation: "worktree":

description: "horse-{i}"
isolation: "worktree"
prompt: |
  You are Agent {i} in a competitive programming challenge. Your goal is to produce the best possible solution.

  TASK:
  {task_description}

  INSTRUCTIONS:
  - Implement the task fully and correctly
  - Make sure your code compiles/runs without errors
  - Write clean, well-structured code
  - When you are COMPLETELY DONE, run this command to capture your diff:
    git diff HEAD
  - Include the FULL diff output as the LAST thing in your response, inside a fenced code block with the label "diff". This diff is critical — it's how your solution gets shared with other agents.

  Before the diff, include a SUMMARY section with exactly this format:
  SUMMARY:
  - {bullet 1}
  - {bullet 2}
  - ... (max 5 bullets)

  Each bullet should be one concise sentence describing a key decision or approach you took.

Codex CLI Agents (only when codex_available = true)

For each Codex agent, you must first create a worktree manually, then run the Codex CLI inside it. Spawn these Bash commands in the same single message as the Claude Code agents above so everything runs in parallel.

For each Codex agent (numbered N_claude+1 through N_total), use the Bash tool with run_in_background: true:

# Create a worktree for this Codex agent
WORKTREE_PATH="$(git rev-parse --show-toplevel)/.worktrees/codex-agent-{i}"
git worktree add "$WORKTREE_PATH" HEAD --detach

# Run Codex CLI non-interactively in the worktree with full-auto mode
cd "$WORKTREE_PATH" && codex exec --full-auto -o /tmp/codex-agent-{i}-output.txt "{task_description}"

# Capture the diff
cd "$WORKTREE_PATH" && git diff HEAD

Notes on Codex CLI flags:

  • codex exec runs non-interactively (no TUI)
  • --full-auto enables on-request approvals + workspace-write sandbox (low-friction preset)
  • -o /tmp/codex-agent-{i}-output.txt writes the final assistant message to a file for easy parsing

Important: The diff comes from the git diff HEAD output at the end. The Codex agent's reasoning is in the -o output file. Codex agents do not produce a SUMMARY section — you should generate a brief summary by reading their diff.

Step 2: Collect Diffs, Agent IDs, and Display Summaries

After all agents complete, extract the diff and SUMMARY from each agent's response.

For Claude Code agents: The agent ID is returned automatically when each Agent tool call completes (e.g., agentId: a63a526a86822148a). You MUST save these IDs — they are required to continue agents in improvement rounds via SendMessage.

For Codex CLI agents: Parse the diff from the Bash output. Save the worktree path — it's needed for improvement rounds. Generate a brief summary by reading their diff since Codex agents don't produce a SUMMARY section.

Store for each agent:

  • Agent 1 (Claude) → diff_1, agent_id_1, type: "claude"
  • Agent 2 (Claude) → diff_2, agent_id_2, type: "claude"
  • Agent 3 (Codex) → diff_3, worktree_path_3, type: "codex"
  • Agent 4 (Codex) → diff_4, worktree_path_4, type: "codex"

Display each agent's summary to the user. Output a status update like:

### Phase 1 Complete — Initial Implementations

**Agent 1:**
- {bullet 1}
- {bullet 2}
- ...

**Agent 2:**
- {bullet 1}
- {bullet 2}
- ...

**Agent 3:**
- {bullet 1}
- {bullet 2}
- ...

This is important because the user cannot see subagent output directly — they rely on the orchestrator to surface it.

If an agent failed to produce a diff or errored out, exclude it from subsequent rounds. If fewer than 2 agents remain, abort and report to the user.

Step 3: Improvement Rounds (Phase 2)

For each improvement round (default: 1 round), send all agents the other agents' diffs. Send all messages in a single message so they run in parallel.

Claude Code agents — use SendMessage

Continue each Claude Code agent using SendMessage with the agent ID captured in Step 2:

to: "{agent_id_i}"   # The agent ID returned from Step 1 (e.g., "a63a526a86822148a")
message: |
  IMPROVEMENT ROUND {round}

  Here are the other agents' solutions from last round. Study them carefully.

  {for each other agent j:}
  --- Agent {j}'s diff ---

{agent_j_diff}

  {end for}

  INSTRUCTIONS:
  1. Carefully study every other agent's diff. For each one, consider:
     - What did they do better than you?
     - What did they do worse?
     - Are there clever approaches or edge cases they handled that you missed?
     - Are there bugs or issues in their code?
  2. Now improve YOUR solution by incorporating the best ideas while fixing any issues
  3. You already have your changes in the worktree — modify your code to improve it
  4. Cherry-pick good ideas freely, but maintain coherence
  5. When COMPLETELY DONE, run: git diff HEAD
  6. Include the FULL diff output as the LAST thing in your response, inside a fenced code block with the label "diff"

  Before the diff, include these two sections in exactly this format:

  IDEAS ADOPTED:
  - From Agent {j}: {what you took and why} (one line per idea, max 5)

  SUMMARY:
  - {bullet 1}
  - {bullet 2}
  - ... (max 5 bullets describing your key changes this round)

Codex CLI agents — use Bash

For each Codex agent, construct a prompt that includes the other agents' diffs and run Codex CLI again in the same worktree. Use the Bash tool with run_in_background: true:

cd "{worktree_path_i}" && codex exec --full-auto -o /tmp/codex-agent-{i}-round-{round}.txt "IMPROVEMENT ROUND {round}

Here are other agents' solutions. Study them and improve your solution by incorporating the best ideas.

{for each other agent j:}
--- Agent {j}'s diff ---
{agent_j_diff}
{end for}

Carefully study every other agent's diff. Consider what they did better, what they did worse, and any clever approaches or edge cases they handled that you missed. Improve your solution by incorporating the best ideas while fixing any issues. Cherry-pick good ideas freely, but maintain coherence."

# Capture the updated diff
cd "{worktree_path_i}" && git diff HEAD

Important: Codex agents don't produce IDEAS ADOPTED or SUMMARY sections. Generate these by comparing their new diff against their previous diff.

After each round, collect the new diffs and display each agent's IDEAS ADOPTED and SUMMARY to the user:

### Improvement Round {round} Complete

**Agent 1:**
Ideas adopted:
- From Agent 2: {what they took}
- ...
Summary:
- {bullet 1}
- ...

**Agent 2:**
Ideas adopted:
- From Agent 1: {what they took}
- ...
Summary:
- {bullet 1}
- ...

(repeat for all agents)

This keeps the user informed of how solutions are evolving across rounds.

Step 4: Borda Count Voting by Independent Judges (Phase 3)

After all improvement rounds, spawn 3 fresh judge agents in parallel. These judges have no connection to any solution — they evaluate purely on merit. Each judge ranks ALL solutions from best to worst.

Spawn all 3 judges in a single message:

description: "Horse race judge {i}"
prompt: |
  You are Judge {i}, an independent evaluator in a programming competition. You had no part in writing any of these solutions. Your job is to rank them all from best to worst, purely on merit.

  ORIGINAL TASK:
  {task_description}

  SOLUTIONS TO EVALUATE:
  {for each agent j:}
  --- Agent {j}'s solution ---

{agent_j_diff}

  {end for}

  EVALUATION CRITERIA:
  - Correctness: Does it solve the task fully? Any bugs?
  - Code quality: Is it clean, readable, maintainable?
  - Edge cases: Does it handle edge cases well?
  - Simplicity: Is it appropriately simple without being simplistic?
  - Performance: Is it efficient where it matters?

  INSTRUCTIONS:
  1. For each solution, list what you like and dislike in concise bullet points
  2. Think through the tradeoffs between them
  3. Rank ALL solutions from best to worst

  Respond with EXACTLY this format:

  EVALUATION:
  Agent {number}:
    Likes:
    - {concise bullet}
    - ...
    Dislikes:
    - {concise bullet}
    - ...
  (repeat for each agent)

  RANKING:
  1. Agent {number} - {one-sentence reason}
  2. Agent {number} - {one-sentence reason}
  ... (continue for all agents)

Step 5: Tally Borda Count Scores

Scoring:

In Borda count, each position in a ranking awards points. With N solutions, each judge ranks all N:

  • 1st place gets N-1 points
  • 2nd place gets N-2 points
  • ...
  • Last place gets 0 points

For example, with 3 solutions: 1st = 2 pts, 2nd = 1 pt, 3rd = 0 pts.

Process:

  1. Parse each judge's RANKING from their response
  2. Assign Borda points based on position
  3. Sum points across all 3 judges for each agent
  4. Highest total score wins

Tiebreak — 4th Independent Judge:

If two or more agents are tied for the highest Borda score, spawn one more fresh judge to break the tie, seeing only the tied solutions:

description: "Horse race tiebreak judge"
prompt: |
  You are a tiebreak judge in a programming competition. These solutions are tied and you must pick the winner.

  ORIGINAL TASK:
  {task_description}

  TIED SOLUTIONS:
  {for each tied agent j:}
  --- Agent {j}'s solution ---

{agent_j_diff}

  {end for}

  CONTEXT — SCORES FROM 3 OTHER JUDGES:
  {summary of Borda scores and individual rankings with reasons}

  EVALUATION CRITERIA:
  - Correctness: Does it solve the task fully? Any bugs?
  - Code quality: Is it clean, readable, maintainable?
  - Edge cases: Does it handle edge cases well?
  - Simplicity: Is it appropriately simple without being simplistic?
  - Performance: Is it efficient where it matters?

  Carefully analyze each tied solution. Consider the other judges' reasoning but form your own independent judgment.

  Respond with EXACTLY:
  WINNER: Agent {number}
  REASON: {one-sentence justification}

Step 6: Apply the Winning Diff

  1. Report the full results to the user:

- Each agent's Borda score - Each judge's full ranking with reasons - Whether a tiebreak judge was needed (and their reasoning)

  1. Write the winning diff to a temp file and apply it: cat > /tmp/horse-race-winner.patch << 'PATCH_EOF' {winning_diff} PATCH_EOF git apply /tmp/horse-race-winner.patch
  2. If git apply fails, try git apply --3way /tmp/horse-race-winner.patch
  3. If it still fails, report the failure and tell the user the diff is saved at /tmp/horse-race-winner.patch for manual application
  4. Do NOT commit — let the user review the changes first

Step 7: Clean Up Worktrees

Agent worktrees with changes are not automatically cleaned up. Remove all worktrees created during the race:

git worktree list --porcelain | grep -E "^worktree .*/\.worktrees/" | sed 's/^worktree //' | while read wt; do
  git worktree remove --force "$wt"
done

If git worktree remove fails for any worktree, fall back to:

git worktree remove --force <path>

If that also fails, report the leftover worktree paths to the user so they can clean up manually.

Step 8: Report Results

Give the user a concise summary:

  • How many agents participated and how many rounds ran
  • Each agent's final SUMMARY bullets (so the user can see what each approach did)
  • Borda count scores and each judge's rankings (including likes/dislikes)
  • Whether a tiebreak was needed
  • Brief description of what the winning solution does
  • Remind them changes are applied but not committed

Error Handling

  • Agent fails entirely: Exclude from subsequent rounds. If fewer than 2 agents remain, abort and report.
  • Agent produces no diff: Treat as empty solution. It can still participate in improvement rounds.
  • SendMessage fails for a Claude agent: That agent is out of the race. Continue with remaining agents.
  • Codex CLI fails or times out: Exclude that agent. Continue with remaining agents.
  • Codex CLI not found at runtime: Fall back to 3 Claude Code agents and inform the user.
  • All agents produce identical solutions: Skip voting, apply one of them.
  • Judge's ranking is malformed: Try to parse what you can. If completely unparseable, exclude that judge's vote and note it in the report.
  • git apply fails: Save diff to /tmp/horse-race-winner.patch, inform user.
  • Worktree cleanup fails: Report leftover worktree paths to the user. They can remove them manually with git worktree remove --force <path>.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.08%
按下载量换算38

Claude

28.83%
按下载量换算33

Cursor

18.59%
按下载量换算22

Gemini CLI

9.73%
按下载量换算11

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/qiao/horse-race-skill --skill horse-race 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills