agentsop-metric-design
Decomposed, multi-criteria metric design for LLM pipelines. The metric IS the model — change the metric and the optimizer changes behavior. Decompose by default; bool during compile, float during eval; calibrate against human; mitigate judge bias. Search keywords: LLM-as-judge, llm as judge, eval metric, evaluation score, scoring function, rubric, RAGAS, G-Eval, judge bias, verbosity bias, how to evaluate LLM output.
npx skills add agentsope/SkillAlchemy --skill agentsop-metric-design --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Produces a metric function (and a calibration receipt) that other skills consume to guide optimization in LLM pipelines. It emphasizes decomposing evaluation into orthogonal sub-judges, with a bool return during compile and a float return during evaluation. It prescribes calibrating the metric against human judgments and mitigating judge biases.
How it works
- Activate when optimization runs, RAG evaluation, agent benchmarks, prompt tuning with quantitative metrics, or production regression tests.
- Decompose into 3–6 orthogonal sub-judges (e.g., factuality, on-topic, non-hedging, length considerations, and source-citation if needed). For each criterion, create a sub-judge using a dedicated predictor call and define an aggregation rule (AND for hard gates; weighted sum for soft scores).
- Define a single metric function that returns a bool when trace is not None (compile mode) and a float otherwise (eval mode). The bool return enforces hard constraints; the float return provides a gradient-friendly score.
- Implement a deterministic length penalty separate from the sub-judges (explicit length_score), and multiply it into the final float to counteract length bias.
- Include a bias test (length, self-preference, position, rubric-order) on a dev set before calibration.
- Calibrate with human spot-checks (≥20, ideally 30) and require per-sub-judge and aggregate agreement ≥80% before shipping.
- Ship the metric function and a calibration receipt documenting spot checks, bias probes, judge/model IDs, and dates; pair with an optimizer like GEPA or MIPROv2 depending on whether textual feedback is used.
When to use it
- Use when an optimization/benchmarking pipeline consumes metric(example, pred) -> bool|float and where the metric will gate downstream decisions (chunking, retrievers, prompting, etc.).
- Activate before production changes that rely on a quantified evaluation signal to avoid bias-driven artifacts.
What it can touch
- Tools and concepts named exactly in the skill: the metric function, sub-judges via dspy.Predict(Assess), and the compile/eval modes (trace not None vs None) to switch bool/float semantics.
- It references outputs like a calibration receipt, a JSON artifact next to the compiled artifact, and potential optimizers such as
dspy.GEPAorMIPROv2.
Caveats
- The metric is the optimizer’s objective; a wrong metric leads to biased or undesired downstream behavior.
- Requires careful calibration (≥80% agreement) before compilation; otherwise, compilation is refused.
- Length penalties are deterministic and must not be delegated to the LLM judge.
- Bias probes and cross-family judge strategies are recommended to reduce self-preference and length biases.
# metric-design — Decomposed, Multi-Criteria Metrics for LLM Pipelines > "It's unproductive to launch optimization runs using a poorly designed program or a bad metric." > — DSPy core team [dspy.ai/learn/optimization/overview/] > "LLM judges exhibit self-preference, recency, rubric-order, score-ID, and length biases." > — Synthesized from [arxiv.org/pdf/2506.02592, arxiv.org/pdf/2509.26072] This is a **tool skill**. It produces a metric function (and a calibration receipt) that other skills consume — DSPy compilers (MIPROv2 / GEPA / BootstrapFewShot), LlamaIndex `FaithfulnessEvaluator`/`RelevancyEvaluator`/`RetrieverEvaluator`, LangGraph eval judges, RAGAS, TruLens. The metric is the optimization target. Get it wrong and every downstream optimizer is theatre. --- ## 1. 何时激活 (When to Activate) Activate when **any** of these is true: - **Optimization runs**: a DSPy / OpenAI-Evals / RAGAS / TruLens job is about to consume a `metric(example, pred) -> bool|float`. The metric drives gradient-free search; bias propagates into the artifact. - **RAG evaluation**: deciding chunk size, reranker, hybrid alpha, retriever-k. A bad metric here picks the wrong chunking strategy and you ship it. -
- 1. 何时激活 (When to Activate)
- 2. 核心心智模型 (Core Mental Model)
- "The metric IS the model. Change the metric, change the behavior."
- Why holistic judges fail (the catalog)
- 3. SOP (Standard Operating Procedure)
- Stage 1 — Decompose
- Stage 2 — Bool vs Float Choice (per criterion)
- Stage 3 — Write the Judge
- Stage 4 — Bias Test
- Stage 5 — Human Calibration
- Stage 6 — Ship
- 4. 操作模型 (Operations)
- OP-M01 — DecomposeMultiCriteria
- OP-M02 — BoolDuringCompileFloatDuringEval
What does the agentsop-metric-design skill do?
Decomposed, multi-criteria metric design for LLM pipelines. The metric IS the model — change the metric and the optimizer changes behavior. Decompose by default; bool during compile, float during eval; calibrate against human; mitigate judge bias. Search keywords: LLM-as-judge, llm as judge, eval metric, evaluation score, scoring function, rubric, RAGAS, G-Eval, judge bias, verbosity bias, how to evaluate LLM output.
How do I install it?
Run `npx skills add agentsope/SkillAlchemy --skill agentsop-metric-design --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From agentsope/SkillAlchemy, a repository with 255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
