MCPcopy
hub / github.com/wshobson/agents / compare

Function compare

plugins/plugin-eval/src/plugin_eval/cli.py:151–182  ·  view source on GitHub ↗

Head-to-head comparison of two skills.

(
    skill_a: Path = typer.Argument(..., help="First skill directory"),  # noqa: B008
    skill_b: Path = typer.Argument(..., help="Second skill directory"),  # noqa: B008
    depth: Depth = typer.Option(Depth.QUICK, help="Evaluation depth"),  # noqa: B008
    output: str = typer.Option("markdown", help="Output format"),  # noqa: B008
)

Source from the content-addressed store, hash-verified

149
150@app.command()
151def compare(
152 skill_a: Path = typer.Argument(..., help="First skill directory"), # noqa: B008
153 skill_b: Path = typer.Argument(..., help="Second skill directory"), # noqa: B008
154 depth: Depth = typer.Option(Depth.QUICK, help="Evaluation depth"), # noqa: B008
155 output: str = typer.Option("markdown", help="Output format"), # noqa: B008
156) -> None:
157 """Head-to-head comparison of two skills."""
158 for p in (skill_a, skill_b):
159 if not p.exists():
160 console.print(f"[red]Error: Path does not exist: {p}[/red]")
161 raise typer.Exit(code=2)
162 config = EvalConfig(depth=depth, output_format=output)
163 engine = EvalEngine(config)
164 result_a = engine.evaluate_skill(skill_a)
165 result_b = engine.evaluate_skill(skill_b)
166 score_a = result_a.composite.score if result_a.composite else 0
167 score_b = result_b.composite.score if result_b.composite else 0
168 lines = [
169 f"# Head-to-Head: {skill_a.name} vs {skill_b.name}",
170 "",
171 f"| | {skill_a.name} | {skill_b.name} | Winner |",
172 "|---|---|---|---|",
173 f"| **Overall** | {score_a:.0f}/100 | {score_b:.0f}/100 | {'A' if score_a > score_b else 'B' if score_b > score_a else 'Tie'} |",
174 ]
175 if result_a.composite and result_b.composite:
176 for da, db in zip(
177 result_a.composite.dimensions, result_b.composite.dimensions, strict=False
178 ):
179 winner = "A" if da.score > db.score else "B" if db.score > da.score else "Tie"
180 name = da.name.replace("_", " ").title()
181 lines.append(f"| {name} | {da.score:.2f} | {db.score:.2f} | {winner} |")
182 console.print("\n".join(lines))

Callers

nothing calls this directly

Calls 3

evaluate_skillMethod · 0.95
EvalConfigClass · 0.90
EvalEngineClass · 0.90

Tested by

no test coverage detected