What problem does it solve? LLM agent inference costs grow quickly in production, but cutting prompts or switching to cheaper models risks silently regressing quality. This Skill provides a gated, measurement-driven workflow for reducing cost per query without moving the needle on known failure modes. ## Core Features & Use Cases - Backlog gate: Refuses to optimize while any failure mode in evals/backlog.md lacks a validated metrics record, so cost changes are never confounded with pre-existing regressions. - Five ordered techniques: Prompt refinement, few-shot calibration, task decomposition, KV-cache-friendly prompt ordering, and model cascades tuned by scripts/cascade_threshold.py against labeled confidence triples. - CI-overlap verification: Accepts an optimization only when the new run's bootstrap confidence interval overlaps the baseline CI for every touched failure mode, rejecting point-estimate comparisons. - Use Case: An agent serving 100k queries/day is too expensive. Run this Skill to trim redundant prompt content, reorder static content first for prefix caching, and tune a cheap-to-expensive model cascade threshold within a user-specified accuracy-loss tolerance. ## Quick Start Ask the agent to run the cost optimization pass on the current agent, starting by checking that the evals backlog has no open failure modes.